The DistributionLibrary (DL) Command wrapper class. More...
#include <rtt/dlib/DLibCommand.hpp>
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. | |
typedef CommandInterface_ptr | _ptr_type |
typedef CommandInterface_var | _var_type |
typedef CommandInterface_out | _out_type |
Public Member Functions | |
DLibCommandImpl () | |
The defaults are reset by the constructor. | |
bool | invoke () |
Call this operator if the DLibCommand takes no arguments. | |
template<class T1 > | |
bool | invoke (T1 a1) |
template<class T1 , class T2 > | |
bool | invoke (T1 a1, T2 a2) |
template<class T1 , class T2 , class T3 > | |
bool | invoke (T1 a1, T2 a2, T3 a3) |
template<class T1 , class T2 , class T3 , class T4 > | |
bool | invoke (T1 a1, T2 a2, T3 a3, T4 a4) |
virtual CommandBase< CommandT > * | cloneI () const =0 |
virtual bool | ready () const =0 |
The command's effect is done. | |
virtual bool | dispatch ()=0 |
Dispatch a command. | |
virtual void | reset ()=0 |
After reset(), another attempt to dispatch the command will be made upon execute(). | |
virtual bool | sent () const =0 |
Returns true if the command was sent to the CommandProcessor. | |
virtual bool | accepted () const =0 |
Returns true if the command was accepted when sent to the CommandProcessor. | |
virtual bool | executed () const =0 |
Returns true if the command was executed by the CommandProcessor. | |
virtual bool | valid () const =0 |
Returns true if the command was valid, i.e. | |
virtual bool | done () const =0 |
Returns true if the command is done. | |
virtual ConditionInterface * | createCondition () const =0 |
virtual DispatchInterface * | clone () const =0 |
virtual DispatchInterface * | copy (std::map< const DataSourceBase *, DataSourceBase * > &alreadyCloned) const |
virtual ::RTT::Corba::CommandList * | getCommands (void) |
virtual ::RTT::Corba::Descriptions * | getArguments (const char *command) |
virtual char * | getResultType (const char *command) |
virtual char * | getDescription (const char *command) |
virtual ::RTT::Corba::Command_ptr | createCommand (const char *command, const ::RTT::Corba::Arguments &args) |
virtual ::RTT::Corba::Command_ptr | createCommandAny (const char *command, const ::RTT::Corba::AnyArguments &args) |
virtual ::CORBA::Boolean | _is_a (const char *type_id) |
virtual const char * | _interface_repository_id (void) const |
virtual ::CORBA::Boolean | marshal (TAO_OutputCDR &cdr) |
Static Public Member Functions | |
static CommandInterface_ptr | _duplicate (CommandInterface_ptr obj) |
static void | _tao_release (CommandInterface_ptr obj) |
static CommandInterface_ptr | _narrow (::CORBA::Object_ptr obj) |
static CommandInterface_ptr | _unchecked_narrow (::CORBA::Object_ptr obj) |
static CommandInterface_ptr | _nil (void) |
static void | _tao_any_destructor (void *) |
Protected Member Functions | |
virtual void | RTT_Corba_CommandInterface_setup_collocation (void) |
Protected Attributes | |
int | id |
ProtocolT * | protocol |
Friends | |
class | TAO::Narrow_Utils< CommandInterface > |
The DistributionLibrary (DL) Command wrapper class.
It maps the Command C++ interface to the 'C' api. The implementation dispatches a Command through the 'Distribution Library' to a remote CommandProcessor. It assumes the presense of a 'sendCommand' function which takes the same arguments as the command.
CommandT | The function signature of the command. For example, bool( int, Frame, double) |
Definition at line 74 of file DLibCommand.hpp.
enum RTT::DispatchInterface::Status [inherited] |
The status progressions of a Dispatchable Command.
The order of these enums is important and should not be altered.
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.
virtual bool RTT::DispatchInterface::accepted | ( | ) | const [pure virtual, inherited] |
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.
Implemented in RTT::CommandDispatch, RTT::CommandExecFunction, RTT::Corba::CommandProxy, and RTT::detail::DataSourceArgsCommand< CommandT, CommandF >.
virtual bool RTT::DispatchInterface::dispatch | ( | ) | [pure virtual, inherited] |
Dispatch a command.
If it is not accepted, fail, if it is accepted, return true
Implemented in RTT::CommandDispatch, RTT::CommandExecFunction, RTT::Corba::CommandProxy, and RTT::detail::DataSourceArgsCommand< CommandT, CommandF >.
virtual bool RTT::DispatchInterface::executed | ( | ) | const [pure virtual, inherited] |
Returns true if the command was executed by the CommandProcessor.
When executed() is true, you can check if it was found valid().
Implemented in RTT::CommandDispatch, RTT::CommandExecFunction, RTT::Corba::CommandProxy, and RTT::detail::DataSourceArgsCommand< CommandT, CommandF >.
bool RTT::DLib::DLibCommandImpl< CommandT, ProtocolT >::invoke | ( | ) | [inline] |
Call this operator if the DLibCommand takes no arguments.
Definition at line 94 of file DLibCommand.hpp.
References RTT::DispatchInterface::Done, and RTT::DispatchInterface::Ready.
virtual bool RTT::DispatchInterface::ready | ( | ) | const [pure virtual, inherited] |
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.
Implemented in RTT::CommandDispatch, RTT::CommandExecFunction, RTT::Corba::CommandProxy, and RTT::detail::DataSourceArgsCommand< CommandT, CommandF >.
virtual bool RTT::DispatchInterface::sent | ( | ) | const [pure virtual, inherited] |
Returns true if the command was sent to the CommandProcessor.
You can use this flag to check whether execute() was invoked.
Implemented in RTT::CommandDispatch, RTT::CommandExecFunction, RTT::Corba::CommandProxy, and RTT::detail::DataSourceArgsCommand< CommandT, CommandF >.
virtual bool RTT::DispatchInterface::valid | ( | ) | const [pure virtual, inherited] |
Returns true if the command was valid, i.e.
the command itself was executed and returned true.
Implemented in RTT::CommandDispatch, RTT::CommandExecFunction, RTT::Corba::CommandProxy, and RTT::detail::DataSourceArgsCommand< CommandT, CommandF >.