hpp::corbaServer::Server Class Reference

Implementation of Hpp module Corba server. More...

#include <hpp/corbaserver/server.hh>

Public Types

typedef void * ServantKey
 

Public Member Functions

 Server (core::ProblemSolverPtr_t problemSolver, int argc, const char *argv[], bool multiThread=false)
 Constructor. More...
 
 Server (ProblemSolverMapPtr_t problemSolverMap, int argc, const char *argv[], bool multiThread=false)
 Constructor. More...
 
 ~Server ()
 Shutdown CORBA server. More...
 
PortableServer::POA_var poa ()
 
CORBA::ORB_var orb ()
 
void startCorbaServer ()
 Initialize CORBA server to process requests from clients. More...
 
const std::string & mainContextId () const
 Get main context ID. More...
 
const bool & multiThread () const
 
int processRequest (bool loop)
 If ORB work is pending, process it. More...
 
void requestShutdown (bool wait)
 Request a shutdown. More...
 
bool createContext (const std::string &contextName)
 
bool loadPlugin (const std::string &contextName, const std::string &libFilename)
 Load a plugin if not already loaded. More...
 
ProblemSolverMapPtr_t problemSolverMap ()
 
core::ProblemSolverPtr_t problemSolver ()
 
PortableServer::Servant getServant (ServantKey servantKey) const
 
void addServantKeyAndServant (ServantKey servantKey, PortableServer::Servant servant)
 
void removeServant (PortableServer::Servant servant)
 

Detailed Description

Implementation of Hpp module Corba server.

This class initializes the Corba server and starts the following Corba interface implementations.

Member Typedef Documentation

Constructor & Destructor Documentation

hpp::corbaServer::Server::Server ( core::ProblemSolverPtr_t  problemSolver,
int  argc,
const char *  argv[],
bool  multiThread = false 
)

Constructor.

Parameters
problemSolverthe object that will handle Corba requests.
argc,argvparameter to feed ORB initialization.
multiThreadwhether the server may process request using multithred policy.
Note
It is recommended to configure your Corba implementation through environment variables and to set argc to 1 and argv to any string.
It is highly recommended not to enable multi-thread policy in CORBA request processing if this library is run from an openGL based GUI, since OpenGL does not support multithreading.
hpp::corbaServer::Server::Server ( ProblemSolverMapPtr_t  problemSolverMap,
int  argc,
const char *  argv[],
bool  multiThread = false 
)

Constructor.

Parameters
problemSolverMapthe object that will handle Corba requests.
argc,argvparameter to feed ORB initialization.
multiThreadwhether the server may process request using multithred policy.
Note
It is recommended to configure your Corba implementation through environment variables and to set argc to 1 and argv to any string.
It is highly recommended not to enable multi-thread policy in CORBA request processing if this library is run from an openGL based GUI, since OpenGL does not support multithreading.
hpp::corbaServer::Server::~Server ( )

Shutdown CORBA server.

Member Function Documentation

void hpp::corbaServer::Server::addServantKeyAndServant ( ServantKey  servantKey,
PortableServer::Servant  servant 
)
bool hpp::corbaServer::Server::createContext ( const std::string &  contextName)
PortableServer::Servant hpp::corbaServer::Server::getServant ( ServantKey  servantKey) const
bool hpp::corbaServer::Server::loadPlugin ( const std::string &  contextName,
const std::string &  libFilename 
)

Load a plugin if not already loaded.

Returns
true if the plugin is correctly loaded, false otherwise (which includes the case where the plugin was already loaded).
const std::string& hpp::corbaServer::Server::mainContextId ( ) const
inline

Get main context ID.

const bool& hpp::corbaServer::Server::multiThread ( ) const
inline
CORBA::ORB_var hpp::corbaServer::Server::orb ( )
inline
core::ProblemSolverPtr_t hpp::corbaServer::Server::problemSolver ( )
ProblemSolverMapPtr_t hpp::corbaServer::Server::problemSolverMap ( )
int hpp::corbaServer::Server::processRequest ( bool  loop)

If ORB work is pending, process it.

Parameters
loopif true, the function never returns, if false, the function processes pending requests and returns.
void hpp::corbaServer::Server::removeServant ( PortableServer::Servant  servant)
void hpp::corbaServer::Server::requestShutdown ( bool  wait)

Request a shutdown.

Parameters
waitif true, the method waits for the server to be shut down.
Warning
From a servant method, set wait to false. Otherwise the application will be deadlocked.
void hpp::corbaServer::Server::startCorbaServer ( )

Initialize CORBA server to process requests from clients.

Returns
0 if success, -1 if failure.