CARMA C++
ImrClient.h
1 
14 #ifndef CARMA_UTIL_IMRCLIENT_H
15 #define CARMA_UTIL_IMRCLIENT_H
16 
17 #include <string>
18 #include <utility>
19 #include <memory>
20 
21 namespace carma {
22 
23 namespace corba {
24  class Client;
25 }
26 
27 namespace util {
28 
29  class ImrClient {
30  public:
31 
38  enum ServerStatus {
39  UNKNOWN, /*< Server state could not be determined from the IMR. */
40  FORKED, /*< Server has been spawned by IMR but not yet initialized
41  it's POAs. */
42  STARTING, /*< Server has created POAs and is proceeding to startup. */
43  RUNNING, /*< Server has activated POAs and is running normally. */
44  STOPPING, /*< Server has deactivated POAs and is shutting down. */
45  STOPPED /*< Server is not running and there are no outstanding
46  startup requests. */
47  };
48 
55  explicit ImrClient( carma::corba::Client & client,
56  const std::string & imrHost="imr" );
57 
58  virtual ~ImrClient();
59 
65  bool addOad( const std::string & oadHost );
66 
72  bool removeOad( const std::string & oadHost );
73 
86  bool addServer( const std::string & serverName,
87  const std::string & oadHost,
88  const std::string & execPath,
89  const std::string & args,
90  const std::string & optArgs,
91  const std::string & runDir );
92 
98  bool removeServer( const std::string & serverName );
99 
105  bool startServer( const std::string & serverName );
106 
112  bool stopServer( const std::string & serverName );
113 
119  bool resetServer( const std::string & serverName );
120 
129  ServerStatus getServerStatus( const std::string & serverName );
130 
131  private:
132 
133  class Pimpl;
134  std::auto_ptr<Pimpl> pimpl_; // Hide the implementation
135 
136  }; // end class ImrClient
137 } // end namespace util
138 } // end namespace carma
139 
140 #endif
Class to encapsulate CORBA client functionality in CARMA.
Definition: Client.h:26
The module has sent out a single slow monitor packet to identify itself.
Definition: Types.h:185