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 64 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 ControlTaskServerCreate (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 ActivityInterfaceorbrunner = 0

Friends

class OrbRunner
class ControlTaskProxy

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 252 of file ControlTaskServer.cpp.

References ControlTaskServer::DoShutdownOrb().

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 280 of file ControlTaskServer.cpp.

References ApplicationServer::orb.

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 324 of file ControlTaskServer.cpp.

References ApplicationServer::orb, 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 369 of file ControlTaskServer.cpp.

References ControlTaskServer::ControlTaskServer(), TaskContext::getName(), and ApplicationServer::orb.

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

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 384 of file ControlTaskServer.cpp.

References ControlTaskServer::ControlTaskServer(), TaskContext::getName(), ApplicationServer::orb, and ControlTaskServer::server().

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 406 of file ControlTaskServer.cpp.

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


The documentation for this class was generated from the following files:

Generated on Mon Jan 19 16:53:59 2009 for OrocosReal-TimeToolkit by  doxygen 1.5.6