RTT::Corba::CommandProxy Class Reference

This class manages the access of remote Command Corba Servers. More...

#include <rtt/corba/CommandProxy.hpp>

Inheritance diagram for RTT::Corba::CommandProxy:
RTT::DispatchInterface RTT::ActionInterface

List of all members.

Public Types

enum  Status {
  NotReady, Ready, Sent, NotAccepted,
  Accepted, Executed, NotValid, Valid,
  Done
}
 

The status progressions of a Dispatchable Command.

More...
typedef boost::shared_ptr
< DispatchInterface
shared_ptr
 If you want to share ownership of DispatchInterface instances, use this shared_ptr type.

Public Member Functions

Corba::Command_ptr server () const
 Get the Corba Object reference of the Command.
virtual void readArguments ()
 This is invoked some time before execute() at a time when the action may read its function arguments.
virtual bool ready () const
 The command's effect is done.
virtual bool dispatch ()
 Dispatch a command.
virtual bool execute ()
 Execute the functionality of this action.
virtual void reset ()
 After reset(), another attempt to dispatch the command will be made upon execute().
virtual bool sent () const
 Returns true if the command was sent to the CommandProcessor.
virtual bool accepted () const
 Returns true if the command was accepted when sent to the CommandProcessor.
virtual bool executed () const
 Returns true if the command was executed by the CommandProcessor.
virtual bool valid () const
 Returns true if the command was valid, i.e.
virtual bool done () const
 Returns true if the command is done.
virtual ConditionInterfacecreateCondition () const
virtual CommandProxyclone () const
 The Clone Software Pattern.
virtual CommandProxycopy (std::map< const DataSourceBase *, DataSourceBase * > &alreadyCloned) const
 When copying an Orocos program, we want identical DataSource's to be mapped to identical DataSources, in order for the program to work correctly.

Static Public Member Functions

static CommandProxyCreate (::RTT::Corba::Command_ptr act)
 Factory method: create a CORBA connection to an existing Command Object.

Protected Member Functions

 CommandProxy (::RTT::Corba::Command_ptr t)
 Private constructor which creates a new connection to a corba object.

Protected Attributes

Corba::Command_var mdata

Detailed Description

This class manages the access of remote Command Corba Servers.

Definition at line 52 of file CommandProxy.hpp.


Member Enumeration Documentation

The status progressions of a Dispatchable Command.

The order of these enums is important and should not be altered.

Enumerator:
Ready 

The command is not yet initialised.

Sent 

The command is ready for execution.

NotAccepted 

The command has been sent/dispatched to the CommandProcessor.

Accepted 

The command was not accepted by the CommandProcessor.

Executed 

The command was accepted by the CommandProcessor.

NotValid 

The command was executed by the CommandProcessor.

Valid 

The command's arguments were found to be invalid.

Done 

The command's arguments were valid.

Definition at line 65 of file DispatchInterface.hpp.


Member Function Documentation

virtual bool RTT::Corba::CommandProxy::accepted (  )  const [inline, virtual]

Returns true if the command was accepted when sent to the CommandProcessor.

A Command is accepted when the CommandProcessor was running and its queue was not full.

Implements RTT::DispatchInterface.

Definition at line 103 of file CommandProxy.hpp.

virtual CommandProxy* RTT::Corba::CommandProxy::copy ( std::map< const DataSourceBase *, DataSourceBase * > &  alreadyCloned  )  const [inline, virtual]

When copying an Orocos program, we want identical DataSource's to be mapped to identical DataSources, in order for the program to work correctly.

This is different from the clone function, where we simply want a new Action that can replace the old one directly.

This function takes a map that maps the old DataSource's onto their new replacements. This way, it is possible to check before cloning a DataSource, whether it has already been copied, and if so, reuse the existing copy.

To keep old source working, the standard implementation of this function simply calls the clone function. If your ActionInterface uses a DataSource, it is important that you reimplement this function correctly though.

Reimplemented from RTT::DispatchInterface.

Definition at line 125 of file CommandProxy.hpp.

static CommandProxy* RTT::Corba::CommandProxy::Create ( ::RTT::Corba::Command_ptr  act  )  [static]

Factory method: create a CORBA connection to an existing Command Object.

Parameters:
act The Object to connect to.
Returns:
A new or previously created CORBA proxy for act.
virtual bool RTT::Corba::CommandProxy::dispatch (  )  [inline, virtual]

Dispatch a command.

If it is not accepted, fail, if it is accepted, return true

Implements RTT::DispatchInterface.

Definition at line 87 of file CommandProxy.hpp.

virtual bool RTT::Corba::CommandProxy::execute (  )  [inline, virtual]

Execute the functionality of this action.

Returns:
true if the action was accepted, false otherwise

Implements RTT::ActionInterface.

Definition at line 91 of file CommandProxy.hpp.

virtual bool RTT::Corba::CommandProxy::executed (  )  const [inline, virtual]

Returns true if the command was executed by the CommandProcessor.

When executed() is true, you can check if it was found valid().

Implements RTT::DispatchInterface.

Definition at line 107 of file CommandProxy.hpp.

virtual bool RTT::Corba::CommandProxy::ready (  )  const [inline, virtual]

The command's effect is done.

Returns true if the command is ready for dispatch. If ready() returns true, dispatch() can be safely called, otherwise, dispatch() will fail.

Implements RTT::DispatchInterface.

Definition at line 83 of file CommandProxy.hpp.

virtual bool RTT::Corba::CommandProxy::sent (  )  const [inline, virtual]

Returns true if the command was sent to the CommandProcessor.

You can use this flag to check whether execute() was invoked.

Implements RTT::DispatchInterface.

Definition at line 99 of file CommandProxy.hpp.

Corba::Command_ptr RTT::Corba::CommandProxy::server (  )  const

Get the Corba Object reference of the Command.

This object universally identifies the remote Command Object and can be used to tell other (remote) objects where to find it.

virtual bool RTT::Corba::CommandProxy::valid (  )  const [inline, virtual]

Returns true if the command was valid, i.e.

the command itself was executed and returned true.

Implements RTT::DispatchInterface.

Definition at line 111 of file CommandProxy.hpp.


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

Generated on Tue Jul 13 11:03:25 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.1