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);
154 void clearServantsMap ();
162 void parseArguments (
int argc,
const char* argv[]);
166 corba::Server<Tools>* tools_;
168 std::string ORBendPoint;
169 std::string mainContextId_;
171 bool multiThread_, nameService_;
182 typedef shared_ptr<ServerPlugin> ServerPluginPtr_t;
183 typedef std::map<std::string, ServerPluginPtr_t> ServerPluginMap_t;
185 ServerPluginPtr_t main;
186 ServerPluginMap_t plugins;
188 std::map<std::string, Context> contexts_;
190 Context& getContext (
const std::string& name);
192 typedef std::map <ServantKey, PortableServer::Servant> ServantKeyToServantMap_t;
193 typedef std::map <PortableServer::Servant, ServantKey> ServantToServantKeyMap_t;
194 ServantKeyToServantMap_t servantKeyToServantMap_;
195 ServantToServantKeyMap_t servantToServantKeyMap_;