#include <TaskContextServer.hpp>
Public Member Functions | |
CTaskContext_ptr | server () const |
~TaskContextServer () | |
Static Public Member Functions | |
static void | CleanupServer (TaskContext *tc) |
static void | CleanupServers () |
static TaskContextServer * | Create (TaskContext *tc, bool use_naming=true, bool require_name_service=false) |
static CTaskContext_ptr | CreateServer (TaskContext *tc, bool use_naming=true, bool require_name_service=false) |
static void | DestroyOrb () |
static std::string | getIOR (TaskContext *tc) |
static void | RunOrb () |
static void | ShutdownOrb (bool wait_for_completion=true) |
static void | ThreadOrb () |
static void | ThreadOrb (int scheduler, int priority=RTT::os::LowestPriority, unsigned cpu_affinity=0) |
Protected Types | |
typedef std::map< TaskContext *, std::string > | IorMap |
typedef std::map< TaskContext *, TaskContextServer * > | ServerMap |
Protected Member Functions | |
TaskContextServer (TaskContext *taskcontext, bool use_naming, bool require_name_service) | |
Static Protected Member Functions | |
static void | DoShutdownOrb (bool wait_for_completion=true) |
Protected Attributes | |
PortableServer::POA_var | mpoa |
corba::CTaskContext_var | mtask |
PortableServer::ServantBase_var | mtask_i |
TaskContext * | mtaskcontext |
bool | muse_naming |
Static Protected Attributes | |
static IorMap | iors |
static bool | is_shutdown = false |
static base::ActivityInterface * | orbrunner = 0 |
static ServerMap | servers |
Friends | |
class | OrbRunner |
class | TaskContextProxy |
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 65 of file TaskContextServer.hpp.
typedef std::map<TaskContext*, std::string> RTT::corba::TaskContextServer::IorMap [protected] |
Definition at line 79 of file TaskContextServer.hpp.
typedef std::map<TaskContext*, TaskContextServer*> RTT::corba::TaskContextServer::ServerMap [protected] |
Definition at line 72 of file TaskContextServer.hpp.
RTT::corba::TaskContextServer::TaskContextServer | ( | TaskContext * | taskcontext, |
bool | use_naming, | ||
bool | require_name_service | ||
) | [protected] |
Private constructor which creates a new servant.
Definition at line 121 of file TaskContextServer.cpp.
When a TaskContextServer is destroyed, the object reference is removed from the Naming Service and the servant is deleted.
Definition at line 77 of file TaskContextServer.cpp.
void RTT::corba::TaskContextServer::CleanupServer | ( | TaskContext * | tc | ) | [static] |
Deletes a TaskContext server for a given taskcontext. If no such server exists, this method silently does nothing.
Definition at line 261 of file TaskContextServer.cpp.
void RTT::corba::TaskContextServer::CleanupServers | ( | ) | [static] |
Destroys all TaskContextServer objects.
Definition at line 249 of file TaskContextServer.cpp.
TaskContextServer * RTT::corba::TaskContextServer::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 |
Definition at line 399 of file TaskContextServer.cpp.
CTaskContext_ptr RTT::corba::TaskContextServer::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 TaskContextProxy 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 |
Definition at line 420 of file TaskContextServer.cpp.
void RTT::corba::TaskContextServer::DestroyOrb | ( | ) | [static] |
Invoke this method once to cleanup the orb.
Definition at line 369 of file TaskContextServer.cpp.
void RTT::corba::TaskContextServer::DoShutdownOrb | ( | bool | wait_for_completion = true | ) | [static, protected] |
Internal shutdown function, used by both thread and ShutdownOrb.
Definition at line 279 of file TaskContextServer.cpp.
std::string RTT::corba::TaskContextServer::getIOR | ( | TaskContext * | tc | ) | [static] |
Get the IOR of a given TaskContext
tc | The TaskContext to find the IOR for |
Definition at line 454 of file TaskContextServer.cpp.
void RTT::corba::TaskContextServer::RunOrb | ( | ) | [static] |
Invoke this method to run the orb and accept client requests. Use ShutdownOrb() to break out of this method.
Definition at line 307 of file TaskContextServer.cpp.
corba::CTaskContext_ptr RTT::corba::TaskContextServer::server | ( | ) | const |
Get the Corba Object of this TaskContext. If you want to store this reference, you must _duplicate it. This object universally identifies the remote TaskContextServer and can be used to tell other (remote) objects where to find it.
Definition at line 448 of file TaskContextServer.cpp.
void RTT::corba::TaskContextServer::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 273 of file TaskContextServer.cpp.
void RTT::corba::TaskContextServer::ThreadOrb | ( | ) | [static] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This is kept (instead of using only default parameters in the other version) for ABI compatibility.
Definition at line 352 of file TaskContextServer.cpp.
void RTT::corba::TaskContextServer::ThreadOrb | ( | int | scheduler, |
int | priority = RTT::os::LowestPriority , |
||
unsigned | cpu_affinity = 0 |
||
) | [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 353 of file TaskContextServer.cpp.
friend class OrbRunner [friend] |
Definition at line 69 of file TaskContextServer.hpp.
friend class TaskContextProxy [friend] |
Definition at line 70 of file TaskContextServer.hpp.
std::map< TaskContext *, std::string > RTT::corba::TaskContextServer::iors [static, protected] |
Definition at line 80 of file TaskContextServer.hpp.
bool RTT::corba::TaskContextServer::is_shutdown = false [static, protected] |
Definition at line 75 of file TaskContextServer.hpp.
PortableServer::POA_var RTT::corba::TaskContextServer::mpoa [protected] |
Definition at line 77 of file TaskContextServer.hpp.
corba::CTaskContext_var RTT::corba::TaskContextServer::mtask [protected] |
Definition at line 88 of file TaskContextServer.hpp.
PortableServer::ServantBase_var RTT::corba::TaskContextServer::mtask_i [protected] |
Definition at line 87 of file TaskContextServer.hpp.
TaskContext* RTT::corba::TaskContextServer::mtaskcontext [protected] |
Definition at line 89 of file TaskContextServer.hpp.
bool RTT::corba::TaskContextServer::muse_naming [protected] |
Definition at line 90 of file TaskContextServer.hpp.
base::ActivityInterface * RTT::corba::TaskContextServer::orbrunner = 0 [static, protected] |
Definition at line 74 of file TaskContextServer.hpp.
std::map< TaskContext *, TaskContextServer * > RTT::corba::TaskContextServer::servers [static, protected] |
Definition at line 73 of file TaskContextServer.hpp.