Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
RTT::corba::TaskContextProxy Class Reference

#include <TaskContextProxy.hpp>

Inheritance diagram for RTT::corba::TaskContextProxy:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::map
< TaskContextProxy
*, corba::CTaskContext_ptr > 
PMap

Public Member Functions

virtual bool activate ()
virtual bool addPeer (TaskContext *peer, std::string alias="")
virtual bool cleanup ()
virtual bool configure ()
virtual bool connectPeers (TaskContext *peer)
virtual bool connectPorts (TaskContext *peer)
virtual bool connectServices (TaskContext *peer)
virtual void disconnectPeers (const std::string &name)
virtual TaskContextgetPeer (const std::string &peer_name) const
virtual PeerList getPeerList () const
virtual TaskState getTaskState () const
virtual bool hasPeer (const std::string &peer_name) const
virtual bool inFatalError () const
virtual bool inRunTimeError () const
virtual bool isActive () const
virtual bool isConfigured () const
virtual bool isRunning () const
virtual bool ready ()
virtual void removePeer (const std::string &name)
virtual void removePeer (TaskContext *peer)
corba::CTaskContext_ptr server () const
virtual void setName (const std::string &n)
virtual bool start ()
virtual bool stop ()
 ~TaskContextProxy ()

Static Public Member Functions

static TaskContextProxyCreate (std::string name, bool is_ior=false)
static TaskContextCreate (::RTT::corba::CTaskContext_ptr task, bool force_remote=false)
static TaskContextProxyCreateFromFile (std::string filename)
static void DestroyOrb ()
static PortableServer::POA_ptr ProxyPOA ()

Static Public Attributes

static PMap proxies

Protected Member Functions

void fetchPorts (Service::shared_ptr parent, CDataFlowInterface_ptr serv)
void fetchRequesters (ServiceRequester::shared_ptr parent, CServiceRequester_ptr csrq)
void fetchServices (Service::shared_ptr parent, CService_ptr mtask)
void initFromURIOrTaskname (std::string location, bool is_ior)
void synchronize ()
 TaskContextProxy (std::string location, bool is_ior)
 TaskContextProxy ()
 TaskContextProxy (::RTT::corba::CTaskContext_ptr t)

Protected Attributes

corba::CTaskContext_var mtask
std::list< base::PortInterface * > port_proxies

Static Protected Attributes

static PortableServer::POA_var proxy_poa

Detailed Description

This class manages the access of remote TaskContext Corba Servers and a Corba Object Request Broker (Orb) which connects to these servers.

Definition at line 82 of file TaskContextProxy.hpp.


Member Typedef Documentation

typedef std::map<TaskContextProxy*, corba::CTaskContext_ptr> RTT::corba::TaskContextProxy::PMap

Definition at line 87 of file TaskContextProxy.hpp.


Constructor & Destructor Documentation

RTT::corba::TaskContextProxy::TaskContextProxy ( std::string  location,
bool  is_ior 
) [protected]

Private constructor which creates a new connection to a stringified ior or taskname in NameServer.

Definition at line 94 of file TaskContextProxy.cpp.

A Private constructor which does nothing

Definition at line 100 of file TaskContextProxy.cpp.

RTT::corba::TaskContextProxy::TaskContextProxy ( ::RTT::corba::CTaskContext_ptr  t) [protected]

Private constructor which creates a new connection to a corba object

Definition at line 172 of file TaskContextProxy.cpp.

Definition at line 82 of file TaskContextProxy.cpp.


Member Function Documentation

bool RTT::corba::TaskContextProxy::activate ( void  ) [virtual]

This method starts the ExecutionEngine of this component in case it was not running. Normally, it is always running. There is no way to deactivate it from the public interface.

Returns:
true if the ExecutionEngine is running (again) and false if it could not be started.

Reimplemented from RTT::base::TaskCore.

Definition at line 498 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::addPeer ( TaskContext peer,
std::string  alias = "" 
) [virtual]

Add a one-way connection from this task to a peer task.

Parameters:
peerThe peer to add.
aliasAn optional alias (another name) for the peer. defaults to peer->getName()

Reimplemented from RTT::TaskContext.

Definition at line 599 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::cleanup ( void  ) [virtual]

This method instructs a stopped component to enter the pre-operational state again. It calls cleanupHook().

Returns:
true if the component was in the Stopped state.

Reimplemented from RTT::base::TaskCore.

Definition at line 542 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::configure ( void  ) [virtual]

This method instructs the component to (re-)read configuration data and try to enter the Stopped state. This can only succeed if the component is not running and configureHook() returns true.

Reimplemented from RTT::base::TaskCore.

Definition at line 530 of file TaskContextProxy.cpp.

Add a two-way connection from this task to a peer task.

Reimplemented from RTT::TaskContext.

Definition at line 654 of file TaskContextProxy.cpp.

Add a data flow connection from this task's ports to a peer's ports.

Reimplemented from RTT::TaskContext.

Definition at line 723 of file TaskContextProxy.cpp.

Connects all requires/provides services of this component to these of a peer.

Reimplemented from RTT::TaskContext.

Definition at line 738 of file TaskContextProxy.cpp.

TaskContextProxy * RTT::corba::TaskContextProxy::Create ( std::string  name,
bool  is_ior = false 
) [static]

Factory method: create a CORBA Proxy for an existing TaskContextServer.

Parameters:
nameThe name of the TaskContextServer to connect to or the Object Reference of the object to connect to
is_iorset to true if name is an IOR. Defaults to false.
Return values:
0if the ORB is not initialised
Returns:
A new or previously created CORBA proxy for name.

Definition at line 396 of file TaskContextProxy.cpp.

TaskContext * RTT::corba::TaskContextProxy::Create ( ::RTT::corba::CTaskContext_ptr  task,
bool  force_remote = false 
) [static]

Factory method: create a CORBA Proxy for an existing TaskContextServer. This method may in fact return the real TaskContext in case the servant of task is in the same process.

Parameters:
taskThe Object to create a proxy for.
Return values:
0if the ORB is not initialised
Returns:
A new or previously created CORBA proxy for task, or the TaskContext itself.

Definition at line 433 of file TaskContextProxy.cpp.

TaskContextProxy * RTT::corba::TaskContextProxy::CreateFromFile ( std::string  filename) [static]

Factory method: create a CORBA Proxy for an existing TaskContextServer.

Parameters:
filenameA file containing an IOR which refers to the existing TaskContextServer.
Return values:
0if the ORB is not initialised
Returns:
A new or previously created CORBA proxy for filename.

Definition at line 416 of file TaskContextProxy.cpp.

Invoke this method once to cleanup the orb.

Definition at line 378 of file TaskContextProxy.cpp.

void RTT::corba::TaskContextProxy::disconnectPeers ( const std::string &  name) [virtual]

Remove a two-way connection from this task to a peer task.

Reimplemented from RTT::TaskContext.

Definition at line 669 of file TaskContextProxy.cpp.

void RTT::corba::TaskContextProxy::fetchPorts ( Service::shared_ptr  parent,
CDataFlowInterface_ptr  serv 
) [protected]

Definition at line 345 of file TaskContextProxy.cpp.

void RTT::corba::TaskContextProxy::fetchRequesters ( ServiceRequester::shared_ptr  parent,
CServiceRequester_ptr  csrq 
) [protected]

Definition at line 210 of file TaskContextProxy.cpp.

void RTT::corba::TaskContextProxy::fetchServices ( Service::shared_ptr  parent,
CService_ptr  mtask 
) [protected]

Definition at line 237 of file TaskContextProxy.cpp.

TaskContext * RTT::corba::TaskContextProxy::getPeer ( const std::string &  peer_name) const [virtual]

Get a pointer to a peer of this task.

Returns:
null if no such peer.

Reimplemented from RTT::TaskContext.

Definition at line 708 of file TaskContextProxy.cpp.

Return a standard container which contains all the Peer names of this TaskContext.

Reimplemented from RTT::TaskContext.

Definition at line 681 of file TaskContextProxy.cpp.

Returns the current state of the TaskCore. For example, before start(), this function returns Stopped. During startHook() it returns Stopped, and after start() it returns Running.

See also:
getTargetState()

Reimplemented from RTT::base::TaskCore.

Definition at line 584 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::hasPeer ( const std::string &  peer_name) const [virtual]

Return true if it knows a peer by that name.

Reimplemented from RTT::TaskContext.

Definition at line 697 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::inFatalError ( void  ) const [virtual]

Inspect if the component is in the FatalError state. There is no possibility to recover from this state. You need to destroy and recreate your component.

Reimplemented from RTT::base::TaskCore.

Definition at line 564 of file TaskContextProxy.cpp.

void RTT::corba::TaskContextProxy::initFromURIOrTaskname ( std::string  location,
bool  is_ior 
) [protected]

initializes the class from a stringified ior or taskname in NameServer.

Definition at line 105 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::inRunTimeError ( void  ) const [virtual]

Inspect if the component is in the RunTimeError state.

Reimplemented from RTT::base::TaskCore.

Definition at line 574 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::isActive ( void  ) const [virtual]

Inspect if the component's ExecutionEngine is processing requests. Normally this is always the case, but user code could stop the ExecutionEngine manually.

Reimplemented from RTT::base::TaskCore.

Definition at line 510 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::isConfigured ( void  ) const [virtual]

Inspect if the component is configured, i.e. in the Stopped, Active or Running state.

Reimplemented from RTT::base::TaskCore.

Definition at line 554 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::isRunning ( void  ) const [virtual]

Inspect if the component is in the Running or RunTimeError state. As RunTimeError is a substate of Running, this method also returns true when the component is in one of these states. See inRunTimeError() or testing the run-time error state.

Reimplemented from RTT::base::TaskCore.

Definition at line 520 of file TaskContextProxy.cpp.

PortableServer::POA_ptr RTT::corba::TaskContextProxy::ProxyPOA ( ) [static]

Returns the default POA for all proxies.

Definition at line 776 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::ready ( void  ) [virtual]

Checks the validity of this TaskContext. When this method returns false, the TaskContext should not be used and various methods may throw exceptions. Use this in case the TaskContext could be a remote object. Will always return true when this TaskContext is local.

Reimplemented from RTT::TaskContext.

Definition at line 753 of file TaskContextProxy.cpp.

void RTT::corba::TaskContextProxy::removePeer ( const std::string &  name) [virtual]

Remove a one-way connection from this task to a peer task.

Reimplemented from RTT::TaskContext.

Definition at line 628 of file TaskContextProxy.cpp.

Remove a one-way connection from this task to a peer task.

Reimplemented from RTT::TaskContext.

Definition at line 641 of file TaskContextProxy.cpp.

corba::CTaskContext_ptr RTT::corba::TaskContextProxy::server ( ) const

Get the Corba Object of the CTaskContext. You need to duplicate this object reference in case you wish to keep a reference to it. This object universally identifies the remote TaskContextServer and can be used to tell other (remote) objects where to find it.

Definition at line 770 of file TaskContextProxy.cpp.

void RTT::corba::TaskContextProxy::setName ( const std::string &  n) [virtual]

Definition at line 594 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::start ( void  ) [virtual]

This method starts the execution of the updateHook() with each trigger or period. This function calls the user function startHook(), which must return true in order to allow this component to run.

Return values:
false
  • if startHook() returned false
  • if the component was not Stopped
trueif the Running state was entered.

Reimplemented from RTT::TaskContext.

Definition at line 474 of file TaskContextProxy.cpp.

bool RTT::corba::TaskContextProxy::stop ( void  ) [virtual]

This method stops the execution of updateHook() of this component. You can override this method to do something else or in addition. This function calls stopHook() as well.

Returns:
false if the component was not Running or not Active.

Reimplemented from RTT::TaskContext.

Definition at line 486 of file TaskContextProxy.cpp.

Definition at line 195 of file TaskContextProxy.cpp.


Member Data Documentation

corba::CTaskContext_var RTT::corba::TaskContextProxy::mtask [mutable, protected]

Definition at line 123 of file TaskContextProxy.hpp.

CDataFlowInterface does not delete ports automatically, because they can then be defined as members of the TaskContext classes.

We must therefore delete in the proxy destructor the ones we are adding through synchronization

Definition at line 114 of file TaskContextProxy.hpp.

std::map< TaskContextProxy *, corba::CTaskContext_ptr > RTT::corba::TaskContextProxy::proxies [static]

Definition at line 88 of file TaskContextProxy.hpp.

PortableServer::POA_var RTT::corba::TaskContextProxy::proxy_poa [static, protected]

For now one POA handles all proxies.

Definition at line 128 of file TaskContextProxy.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Sat Jun 8 2019 18:46:38