gepetto::viewer::corba::Server Class Reference

Implementation of Hpp module Corba server. More...

#include <gepetto/viewer/corba/server.hh>

Public Member Functions

 Server (WindowsManagerPtr_t windowsManager, int argc, const char *argv[], bool multiThread=false, bool useNameService=false)
 Constructor. More...
 
 ~Server ()
 Shutdown CORBA server. More...
 
void startCorbaServer ()
 Initialize CORBA server to process requests from clients. More...
 
int processRequest (bool loop)
 If ORB work is pending, process it. More...
 
void shutdown (bool wait)
 Stop processing requests. More...
 
WindowsManagerPtr_t windowsManager () const
 
void qparent (QObject *parent)
 

Detailed Description

Implementation of Hpp module Corba server.

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

  • hpp::Robot: to build a model::Device and to insert it in a core::ProblemSolver object,
  • hpp::Obstacle: to build obstacles and insert them in a core::ProblemSolver object,
  • hpp::Problem: to define a path planning problem and solve it. To use this object, call the constructor
    int argc=1;
    char *argv[1] = {"program"};
    core::ProblemSolverPtr_t problemSolver = new core::ProblemSolver;
    Server server(problemSolver, argc, argv, isMultiThread);
    where isMultiThread specifies whether the server should process requests using multi-thread policy of not. After starting a name server and configuring your Corba implementation, start the servers.
    server.startCorbaServer();
    Then, enter in the loop that handle the Corba requests
    server.processRequest(true);
    You can then send request to the servers.

Constructor & Destructor Documentation

gepetto::viewer::corba::Server::Server ( WindowsManagerPtr_t  windowsManager,
int  argc,
const char *  argv[],
bool  multiThread = false,
bool  useNameService = false 
)

Constructor.

Parameters
theobject that handles 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.
gepetto::viewer::corba::Server::~Server ( )

Shutdown CORBA server.

Member Function Documentation

int gepetto::viewer::corba::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 gepetto::viewer::corba::Server::qparent ( QObject parent)

Referenced by windowsManager().

void gepetto::viewer::corba::Server::shutdown ( bool  wait)

Stop processing requests.

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 gepetto::viewer::corba::Server::startCorbaServer ( )

Initialize CORBA server to process requests from clients.

Returns
0 if success, -1 if failure.
WindowsManagerPtr_t gepetto::viewer::corba::Server::windowsManager ( ) const
inline

References qparent().