Nymph  v1.5.2
Flow-Based Data Processing Framework
KTApplication.hh
Go to the documentation of this file.
1 
9 #ifndef KTAPPLICATION_HH_
10 #define KTAPPLICATION_HH_
11 
12 #include "KTCommandLineHandler.hh"
13 #include "KTConfigurable.hh"
14 #include "KTConfigurator.hh"
15 
16 #include "param.hh"
17 
18 #include <set>
19 #include <string>
20 
21 namespace Nymph
22 {
23  class KTEventLoop;
24  //class scarab::param_node;
25 
57  {
58  public:
59  KTApplication();
61  KTApplication(int argC, char** argV, bool requireArgs=true, const scarab::param_node& defaultConfig=scarab::param_node());
62  virtual ~KTApplication();
63 
64  private:
65  void AddConfigOptionsToCLHandler(const scarab::param& param, const std::string& rootName);
66 
67  public:
68  virtual bool Configure(const scarab::param_node& node);
69 
70  public:
72  const KTConfigurator* GetConfigurator() const;
73 
74  const std::string& GetConfigFilename() const;
75 
76  void AddEventLoop(KTEventLoop* loop);
77  void RemoveEventLoop(KTEventLoop* loop);
78 
79  protected:
82 
83  std::string fConfigFilename;
84 
85  std::set< KTEventLoop* > fEventLoops;
86 
87  };
88 
90  {
91  return fCLHandler;
92  }
93 
95  {
96  return fConfigurator;
97  }
98 
99  inline const std::string& KTApplication::GetConfigFilename() const
100  {
101  return fConfigFilename;
102  }
103 
104 } /* namespace Nymph */
105 #endif /* KTAPPLICATION_HH_ */
Interface for the command-line handler and the configurator.
Abstract base class for event loops.
Definition: KTEventLoop.hh:22
void RemoveEventLoop(KTEventLoop *loop)
Adds loop to the set of event loops overseen by KTApplication. Does NOT assume ownership of an event ...
Parses and stores command-line options.
virtual bool Configure(const scarab::param_node &node)
Should perform parameter store and command-line configurations.
Contains KTCommandLineHandler.
std::string fConfigFilename
KTCommandLineHandler * fCLHandler
Removes loop from the set of event loops overseen by KTApplication. Does not stop the loop...
std::set< KTEventLoop *> fEventLoops
KTConfigurator * fConfigurator
const std::string & GetConfigFilename() const
const KTConfigurator * GetConfigurator() const
void AddConfigOptionsToCLHandler(const scarab::param &param, const std::string &rootName)
void AddEventLoop(KTEventLoop *loop)
KTCommandLineHandler * GetCommandLineHandler() const