CARMA C++
ConfigureImr.h
Go to the documentation of this file.
1 
11 #ifndef CARMA_UTIL_CONFIGUREIMR_H
12 #define CARMA_UTIL_CONFIGUREIMR_H
13 
14 #include "carma/util/ImrClient.h"
16 
17 namespace carma {
18 namespace util {
19 
25 class ConfigureImr {
26 public:
27 
35  std::string imrHost,
37 
41  virtual ~ConfigureImr();
42 
47  void addOads();
48 
55  void addServers( const std::string &oad,
56  const std::string prioritySpec = "0-9",
57  unsigned long SleepyTimeMs = 0 );
58 
74  void startServers( const std::string &oad,
75  const std::string prioritySpec = "0-9",
76  unsigned int waitForRunningMs = 0,
77  unsigned long sleepyTimeMs = 0,
78  bool waitForEachPriorityStage = false,
79  unsigned long waitAfterEachStageMs = 0,
80  bool verbose = true );
81 
96  void stopServers( const std::string &oad,
97  const std::string prioritySpec = "9-0",
98  unsigned int waitForStoppedMs = 0,
99  bool waitForEachPriorityStage = false );
100 
105  void resetServers(const std::string &oad);
106 
112  void clean(const std::string &oad);
113 
114 protected:
115 
116  // Nothing here
117 
118 private:
119 
120  void waitForServers( const std::string & oad,
121  ImrClient::ServerStatus state, // State to wait for.
122  const std::pair<int, int> & inPriorityRange,
123  long waitMaxMs );
124 
125  std::vector<OADConfig>::iterator findOAD(const std::string &oad);
126 
127  // Reference to IMR Client
128  carma::util::ImrClient imr_;
129  std::string imrHost_;
130  domainType domain_;
131 
132 }; // End class ConfigureImr
133 }} // End namespace carma::util;
134 #endif
ConfigureImr(carma::corba::Client &client, std::string imrHost, carma::util::domainType domain)
Constructor.
void startServers(const std::string &oad, const std::string prioritySpec="0-9", unsigned int waitForRunningMs=0, unsigned long sleepyTimeMs=0, bool waitForEachPriorityStage=false, unsigned long waitAfterEachStageMs=0, bool verbose=true)
Start servers Start all servers associated with input OAD.
void addOads()
Add OADs Take all oads input to this class and add them to the IMR.
Domain structure - holds it all.
Class to encapsulate CORBA client functionality in CARMA.
Definition: Client.h:26
void addServers(const std::string &oad, const std::string prioritySpec="0-9", unsigned long SleepyTimeMs=0)
Add Servers Take all servers specific to the input OAD and add them to the IMR.
virtual ~ConfigureImr()
Destructor.
void resetServers(const std::string &oad)
Reset servers Reset all servers associated with input OAD.
This class is responsible for taking server information retrieved from the ImrConfigHandlers class (w...
Definition: ConfigureImr.h:25
void stopServers(const std::string &oad, const std::string prioritySpec="9-0", unsigned int waitForStoppedMs=0, bool waitForEachPriorityStage=false)
Stop servers Stop all servers associated with input OAD.
void clean(const std::string &oad)
Clean IMR of currently registered servers and non-running oads This routine stops all currently runni...
SAX Handlers for parsing IMR configuration files.