35 #ifndef HPP_CORBASERVER_SERVER_HH 36 #define HPP_CORBASERVER_SERVER_HH 38 #include <omniORB4/CORBA.h> 40 #include <hpp/corba/template/server.hh> 47 namespace corbaServer {
91 Server(core::ProblemSolverPtr_t problemSolver,
int argc,
const char* argv[],
92 bool multiThread =
false);
98 Server(core::ProblemSolverPtr_t problemSolver,
bool multiThread =
false);
104 bool parseArguments(
int argc,
const char* argv[]);
114 PortableServer::POA_var
poa() {
return tools_->main_poa(); }
116 CORBA::ORB_var
orb() {
return tools_->orb(); }
120 void startCorbaServer();
133 int processRequest(
bool loop);
139 void requestShutdown(
bool wait);
141 bool createContext(
const std::string& contextName);
143 std::vector<std::string> getContexts()
const;
145 bool deleteContext(
const std::string& contextName);
147 CORBA::Object_ptr getServer(
const std::string& contextName,
148 const std::string& pluginName,
149 const std::string& objectName);
154 bool loadPlugin(
const std::string& contextName,
155 const std::string& libFilename);
159 core::ProblemSolverPtr_t problemSolver();
163 PortableServer::Servant getServant(
ServantKey servantKey)
const;
165 void addServantKeyAndServant(
ServantKey servantKey,
166 PortableServer::Servant servant);
168 void removeServant(PortableServer::Servant servant);
170 void clearServantsMap();
172 std::vector<std::string> getAllObjectIds();
175 corba::Server<Tools>* tools_;
177 std::string ORBendPoint;
178 std::string mainContextId_;
180 bool multiThread_, nameService_;
191 typedef shared_ptr<ServerPlugin> ServerPluginPtr_t;
192 typedef std::map<std::string, ServerPluginPtr_t> ServerPluginMap_t;
194 ServerPluginPtr_t main;
195 ServerPluginMap_t plugins;
197 std::map<std::string, Context> contexts_;
199 Context& getContext(
const std::string& name);
201 typedef std::map<ServantKey, PortableServer::Servant>
202 ServantKeyToServantMap_t;
203 typedef std::map<PortableServer::Servant, ServantKey>
204 ServantToServantKeyMap_t;
205 ServantKeyToServantMap_t servantKeyToServantMap_;
206 ServantToServantKeyMap_t servantToServantKeyMap_;
shared_ptr< ProblemSolverMap > ProblemSolverMapPtr_t
Definition: fwd.hh:57
Implement CORBA interface `‘Obstacle’'.
Definition: client.hh:46
CORBA::ORB_var orb()
Definition: server.hh:116
Definition: read-write-lock.hh:17
PortableServer::POA_var poa()
Definition: server.hh:114
#define HPP_CORBASERVER_DLLAPI
Definition: config.hh:88
const std::string & mainContextId() const
Get main context ID.
Definition: server.hh:123
Implementation of Hpp module Corba server.
Definition: server.hh:78
const bool & multiThread() const
Definition: server.hh:125
void * ServantKey
Definition: server.hh:161
const bool & nameService() const
Definition: server.hh:127