This class manages the creation of TaskContext Corba Servers and a Corba Object Request Broker (Orb) which executes the servers. More...
#include <rtt/corba/ControlTaskServer.hpp>
Public Member Functions | |
ControlTask_ptr | server () const |
Get the Corba Object of this ControlTask. | |
Static Public Member Functions | |
static void | ShutdownOrb (bool wait_for_completion=true) |
Invoke this method once to shutdown the Orb which is running the task servers in RunOrb(). | |
static void | CleanupServers () |
Destroys all ControlTaskServer objects. | |
static void | RunOrb () |
Invoke this method to run the orb and accept client requests. | |
static void | ThreadOrb () |
Invoke this method to run the orb in a separate thread and accept client requests from that thread. | |
static void | DestroyOrb () |
Invoke this method once to cleanup the orb. | |
static ControlTaskServer * | Create (TaskContext *tc, bool use_naming=true, bool require_name_service=false) |
Factory method: create a CORBA server for an existing TaskContext. | |
static ControlTask_ptr | CreateServer (TaskContext *tc, bool use_naming=true, bool require_name_service=false) |
Factory method: create a CORBA server for an existing TaskContext. | |
static void | CleanupServer (TaskContext *tc) |
Deletes a ControlTask server for a given taskcontext. | |
static bool RTT_CORBA_API | InitOrb (int argc, char *argv[], Seconds orb_timeout=0) |
Invoke this method once to initialise the Orb which will run the task servers. | |
Static Public Attributes | |
static CORBA::ORB_var | orb |
The orb of this process. | |
static PortableServer::POA_var | rootPOA |
The root POA of this process. | |
Protected Types | |
typedef std::map< TaskContext *, ControlTaskServer * > | ServerMap |
Protected Member Functions | |
ControlTaskServer (TaskContext *taskcontext, bool use_naming, bool require_name_service) | |
Private constructor which creates a new servant. | |
~ControlTaskServer () | |
When a ControlTaskServer is destroyed, the object reference is removed from the Naming Service and the servant is deleted. | |
Static Protected Member Functions | |
static void | DoShutdownOrb (bool wait_for_completion=true) |
Internal shutdown function, used by both thread and ShutdownOrb. | |
Protected Attributes | |
Corba::ControlTask_var | mtask |
TaskContext * | mtaskcontext |
bool | muse_naming |
Static Protected Attributes | |
static ServerMap | servers |
static ActivityInterface * | orbrunner |
static bool | is_shutdown |
Friends | |
class | OrbRunner |
class | ControlTaskProxy |
This class manages the creation of TaskContext Corba Servers and a Corba Object Request Broker (Orb) which executes the servers.
The Orb may be run from the main thread or in its own thread.
Definition at line 70 of file ControlTaskServer.hpp.
static void RTT::Corba::ControlTaskServer::CleanupServer | ( | TaskContext * | tc | ) | [static] |
Deletes a ControlTask server for a given taskcontext.
If no such server exists, this method silently does nothing.
static ControlTaskServer* RTT::Corba::ControlTaskServer::Create | ( | TaskContext * | tc, | |
bool | use_naming = true , |
|||
bool | require_name_service = false | |||
) | [static] |
Factory method: create a CORBA server for an existing TaskContext.
tc | The TaskContext to serve. | |
use_naming | Set to false in order not to use the Corba Naming Service. | |
require_naming | Set to true to require that the Corba Naming Service be found. |
0 | if the ORB is not initialised, or if require_name_service==true and the name service was not found |
static ControlTask_ptr RTT::Corba::ControlTaskServer::CreateServer | ( | TaskContext * | tc, | |
bool | use_naming = true , |
|||
bool | require_name_service = false | |||
) | [static] |
Factory method: create a CORBA server for an existing TaskContext.
Same as above, but immediately return the Corba object. Also checks if tc is ControlTaskProxy and returns the server of the proxy if so.
tc | The TaskContext to serve. | |
use_naming | Set to false in order not to use the Corba Naming Service. | |
require_naming | Set to true to require that the Corba Naming Service be found. |
0 | if the ORB is not initialised, or if require_name_service==true and the name service was not found |
static bool RTT_CORBA_API RTT::Corba::ApplicationServer::InitOrb | ( | int | argc, | |
char * | argv[], | |||
Seconds | orb_timeout = 0 | |||
) | [static, inherited] |
Invoke this method once to initialise the Orb which will run the task servers.
orb_timeout | timeout value for each remote call, expressed in seconds. The resolution is up to 100 nano seconds. Anything smaller will be interpreted as a zero. |
static void RTT::Corba::ControlTaskServer::RunOrb | ( | ) | [static] |
Invoke this method to run the orb and accept client requests.
Use ShutdownOrb() to break out of this method.
ControlTask_ptr RTT::Corba::ControlTaskServer::server | ( | ) | const |
Get the Corba Object of this ControlTask.
This object universally identifies the remote ControlTaskServer and can be used to tell other (remote) objects where to find it.
static void RTT::Corba::ControlTaskServer::ShutdownOrb | ( | bool | wait_for_completion = true |
) | [static] |
Invoke this method once to shutdown the Orb which is running the task servers in RunOrb().
When this function returns, no CORBA invocations are in progress, unless wait_for_completion is false.
static void RTT::Corba::ControlTaskServer::ThreadOrb | ( | ) | [static] |
Invoke this method to run the orb in a separate thread and accept client requests from that thread.
Use ShutdownOrb() to break out of this method.