Nymph  v1.5.2
Flow-Based Data Processing Framework
KTConfigurable.hh
Go to the documentation of this file.
1 /*
2  * KTConfigurable.hh
3  *
4  * Created on: Aug 21, 2012
5  * Author: nsoblath
6  */
7 
8 #ifndef KTCONFIGURABLE_HH_
9 #define KTCONFIGURABLE_HH_
10 
11 #include "param.hh"
12 
13 #include <string>
14 
15 namespace Nymph
16 {
17  class KTCommandLineHandler;
18 
19 
20  //******************
21  // KTConfigurable
22  //******************
23 
25  {
26  public:
27  KTConfigurable(const std::string& name="default-name");
28  virtual ~KTConfigurable();
29 
31  virtual bool Configure(const scarab::param_node& node) = 0;
33  //virtual bool Configure();
35  bool Configure(const std::string& config);
36 
37  protected:
39 
40  public:
41  const std::string& GetConfigName() const;
42  void SetConfigName(const std::string& name);
43 
44  protected:
45  std::string fConfigName;
46 
47  };
48 /*
49  inline bool KTConfigurable::Configure()
50  {
51  return Configure(NULL);
52  }
53 */
54  inline const std::string& KTConfigurable::GetConfigName() const
55  {
56  return fConfigName;
57  }
58 
59  inline void KTConfigurable::SetConfigName(const std::string& name)
60  {
61  fConfigName = name;
62  }
63 
64 
65  //**********************
66  // KTSelfConfigurable
67  //**********************
68 
70  {
71  public:
72  KTSelfConfigurable(const std::string& name="default-self-name");
73  virtual ~KTSelfConfigurable();
74 
76  virtual bool Configure(const scarab::param_node& node) = 0;
78  virtual bool Configure();
79 
81  virtual bool IsReady() const = 0;
82 
83  bool GetIsConfigured();
84 
85  private:
87 
88  };
89 
91  {
92  return fIsConfigured;
93  }
94 
95 } /* namespace Nymph */
96 #endif /* KTCONFIGURABLE_HH_ */
virtual bool Configure(const scarab::param_node &node)=0
Should perform parameter store and command-line configurations.
Parses and stores command-line options.
KTConfigurable(const std::string &name="default-name")
KTCommandLineHandler * fCLHandler
const std::string & GetConfigName() const
void SetConfigName(const std::string &name)