11 #ifndef HPP_CORBASERVER_SERVER_HH
12 # define HPP_CORBASERVER_SERVER_HH
14 # include <omniORB4/CORBA.h>
20 # include <hpp/corba/template/server.hh>
68 Server (core::ProblemSolverPtr_t problemSolver,
int argc,
69 const char* argv[],
bool multiThread =
false);
83 const char* argv[],
bool multiThread =
false);
88 PortableServer::POA_var
poa ()
90 return tools_->main_poa();
100 void startCorbaServer ();
105 return mainContextId_;
122 int processRequest (
bool loop);
128 void requestShutdown (
bool wait);
130 bool createContext (
const std::string& contextName);
132 CORBA::Object_ptr getServer (
const std::string& contextName,
133 const std::string& pluginName,
134 const std::string& objectName);
139 bool loadPlugin (
const std::string& contextName,
140 const std::string& libFilename);
144 core::ProblemSolverPtr_t problemSolver ();
148 PortableServer::Servant getServant (
ServantKey servantKey)
const;
150 void addServantKeyAndServant (
ServantKey servantKey, PortableServer::Servant servant);
152 void removeServant (PortableServer::Servant servant);
160 void parseArguments (
int argc,
const char* argv[]);
164 corba::Server<Tools>* tools_;
166 std::string ORBendPoint;
167 std::string mainContextId_;
169 bool multiThread_, nameService_;
180 typedef boost::shared_ptr<ServerPlugin> ServerPluginPtr_t;
181 typedef std::map<std::string, ServerPluginPtr_t> ServerPluginMap_t;
183 ServerPluginPtr_t main;
184 ServerPluginMap_t plugins;
186 std::map<std::string, Context> contexts_;
188 Context& getContext (
const std::string& name);
190 typedef std::map <ServantKey, PortableServer::Servant> ServantKeyToServantMap_t;
191 typedef std::map <PortableServer::Servant, ServantKey> ServantToServantKeyMap_t;
192 ServantKeyToServantMap_t servantKeyToServantMap_;
193 ServantToServantKeyMap_t servantToServantKeyMap_;