ControlTaskServer Class Reference
[Component IDL and Corba Setup]

#include <rtt/corba/ControlTaskServer.hpp>

Inheritance diagram for ControlTaskServer:

ApplicationServer

List of all members.


Detailed Description

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 63 of file ControlTaskServer.hpp.


Public Member Functions

ControlTask_ptr server () const
 Get the Corba Object of this ControlTask.

Static Public Member Functions

static bool InitOrb (int argc, char *argv[])
 Invoke this method once to initialise the Orb which will run the task servers.
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)
 Factory method: create a CORBA server for an existing TaskContext.
static ControlTask_ptr CreateServer (TaskContext *tc, bool use_naming=true)
 Factory method: create a CORBA server for an existing TaskContext.

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)
 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
TaskContextmtaskcontext
bool muse_naming

Static Protected Attributes

static ServerMap servers
static
ActivityInterface
orbrunner = 0

Friends

class OrbRunner

Member Function Documentation

void 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.

Definition at line 253 of file ControlTaskServer.cpp.

References ControlTaskServer::DoShutdownOrb().

Referenced by RTT_Corba_ServiceInterface_i::requestShutdown().

void RunOrb (  )  [static]

Invoke this method to run the orb and accept client requests.

Use ShutdownOrb() to break out of this method.

Definition at line 281 of file ControlTaskServer.cpp.

References RTT::Error, RTT::Info, and ApplicationServer::orb.

Referenced by OrbRunner::loop().

void 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.

Definition at line 325 of file ControlTaskServer.cpp.

References RTT::Error, RTT::Info, ApplicationServer::orb, ControlTaskServer::OrbRunner, ControlTaskServer::orbrunner, and ActivityInterface::start().

ControlTaskServer * Create ( TaskContext tc,
bool  use_naming = true 
) [static]

Factory method: create a CORBA server for an existing TaskContext.

Parameters:
tc The TaskContext to serve.
use_naming Set to false in order not to use the Corba Naming Service.
Return values:
0 if the ORB is not initialised
Returns:
A new or previously created CORBA server for tc.

Definition at line 370 of file ControlTaskServer.cpp.

References ControlTaskServer::ControlTaskServer(), RTT::Debug, TaskContext::getName(), RTT::Info, ApplicationServer::orb, and ControlTaskServer::servers.

Referenced by ControlTaskProxy::addPeer(), and ControlTaskProxy::connectPeers().

ControlTask_ptr CreateServer ( TaskContext tc,
bool  use_naming = true 
) [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.

Parameters:
tc The TaskContext to serve.
use_naming Set to false in order not to use the Corba Naming Service.
Return values:
0 if the ORB is not initialised
Returns:
A new or previously created CORBA server for tc.

Definition at line 385 of file ControlTaskServer.cpp.

References ControlTaskServer::ControlTaskServer(), RTT::Debug, TaskContext::getName(), RTT::Info, ApplicationServer::orb, ControlTaskProxy::proxies, ControlTaskServer::server(), and ControlTaskServer::servers.

Corba::ControlTask_ptr 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.

Definition at line 407 of file ControlTaskServer.cpp.

References ControlTaskServer::mtask.

Referenced by ControlTaskProxy::addPeer(), ControlTaskProxy::connectPeers(), and ControlTaskServer::CreateServer().


The documentation for this class was generated from the following files:
Generated on Tue Mar 25 17:41:58 2008 for OrocosReal-TimeToolkit by  doxygen 1.5.3