hpp::corba::Server< T > Class Template Reference

Template CORBA server. More...

#include <hpp/corba/template/server.hh>

Public Member Functions

 Server (int argc, const char *argv[], bool multiThread=false, const std::string &poaName="child")
 Constructor. More...
 
 ~Server ()
 Shutdown CORBA server. More...
 
int startCorbaServer (const std::string &contextId, const std::string &contextKind, const std::string &objectId, const std::string &objectKind)
 Initialize CORBA server to process requests from clients. More...
 
int processRequest (bool loop)
 If ORB work is pending, process it. More...
 
T & implementation ()
 Return a reference to the implementation. More...
 

Detailed Description

template<class T>
class hpp::corba::Server< T >

Template CORBA server.

For information on how to use see the How to section of the main documentation page

Constructor & Destructor Documentation

template<class T >
hpp::corba::Server< T >::Server ( int  argc,
const char *  argv[],
bool  multiThread = false,
const std::string &  poaName = "child" 
)

Constructor.

Parameters
argc,argvparameter to feed ORB initialization.
inMultiThreadwhether the server may process request using multithread policy.
Note
It is recommended to configure your Corba implementation through environment variables and to set argc to 1 and argv to any string.
template<class T >
hpp::corba::Server< T >::~Server ( )

Shutdown CORBA server.

Member Function Documentation

template<class T >
T & hpp::corba::Server< T >::implementation ( )

Return a reference to the implementation.

References HPP_CORBA_CATCH.

template<class T >
int hpp::corba::Server< T >::processRequest ( bool  loop)

If ORB work is pending, process it.

If CORBA requests are pending, process them.

Parameters
loopif true, the function never returns; if false, the function processes pending requests and returns.

References HPP_CORBA_CATCH.

template<class T >
int hpp::corba::Server< T >::startCorbaServer ( const std::string &  contextId,
const std::string &  contextKind,
const std::string &  objectId,
const std::string &  objectKind 
)

Initialize CORBA server to process requests from clients.

Parameters
contextIdfirst part of context name
contextKindsecond part of context name
objectIdfirst part of CORBA server name
objectKindsecond part of CORBA server name
Returns
0 if success, -1 if failure.

The CORBA server is referenced in the name server by context and name: contextId.contextKind/objectId.objectKind. The context can be seen as a directory and the object as a filename.

References HPP_CORBA_CATCH.