RTT::CommandC Class Reference

A user friendly Command to a TaskContext. More...

#include <rtt/CommandC.hpp>

List of all members.

Public Member Functions

 CommandC ()
 The default constructor Make a copy from another CommandC object in order to make it usable.
 CommandC (const CommandFactory *gcf, const std::string &name)
 The constructor.
 CommandC (const CommandC &other)
 A CommandC is copyable by value.
 CommandC (DispatchInterface *di)
 Create a CommandC object from a dispatch command.
 CommandC (DispatchInterface::shared_ptr di)
 Create a CommandC object from a dispatch command.
CommandCoperator= (const CommandC &other)
 A CommandC is assignable.
CommandCarg (DataSourceBase::shared_ptr a)
 Add a datasource argument to the Command.
template<class ArgT >
CommandCargC (const ArgT a)
 Add a constant argument to the Command.
template<class ArgT >
CommandCarg (ArgT &a)
 Add an argument by reference to the Command.
bool ready () const
 Returns true if all correct arguments were provided and the command is ready for execution.
bool execute ()
 Send the contained command to the Command Processor and report Status.
bool sent () const
 Returns true if the command was sent to the CommandProcessor.
bool accepted () const
 Check if the Command was accepted by the receiving task.
bool executed () const
 Check if the Command was executed by the receiving task.
bool valid () const
 Check the return value of the Command when it is executed.
bool done () const
 Evaluate if the command is done.
void reset ()
 Reset the command.

Detailed Description

A user friendly Command to a TaskContext.

Definition at line 55 of file CommandC.hpp.


Constructor & Destructor Documentation

RTT::CommandC::CommandC ( const CommandFactory gcf,
const std::string &  name 
)

The constructor.

See also:
CommandRepository
RTT::CommandC::CommandC ( DispatchInterface di  ) 

Create a CommandC object from a dispatch command.

Parameters:
di The command, the CommandC takes ownership.
RTT::CommandC::CommandC ( DispatchInterface::shared_ptr  di  ) 

Create a CommandC object from a dispatch command.

Parameters:
di The command shares ownership of di.

Member Function Documentation

bool RTT::CommandC::accepted (  )  const

Check if the Command was accepted by the receiving task.

Return values:
true if accepted by the command processor.
false otherwise.
template<class ArgT >
CommandC & RTT::CommandC::arg ( ArgT &  a  )  [inline]

Add an argument by reference to the Command.

Parameters:
a A value of which the reference is used and re-read each time the command is executed. Thus if the contents of the source of a changes, execute() will use the new contents.

Definition at line 199 of file CommandC.hpp.

References arg().

CommandC& RTT::CommandC::arg ( DataSourceBase::shared_ptr  a  ) 

Add a datasource argument to the Command.

Parameters:
a A DataSource which contents are consulted each time when execute() is called.

Referenced by arg(), and argC().

template<class ArgT >
CommandC & RTT::CommandC::argC ( const ArgT  a  )  [inline]

Add a constant argument to the Command.

Parameters:
a A value of which a copy is made and this value is used each time in execute().

Definition at line 193 of file CommandC.hpp.

References arg().

bool RTT::CommandC::done (  )  const

Evaluate if the command is done.

Return values:
true if accepted(), valid() was true and the completion condition was true as well.
false otherwise.
bool RTT::CommandC::execute (  ) 

Send the contained command to the Command Processor and report Status.

Multiple invocations of execute will send the command only once, and will return the 'status' of the Command. From the moment an error is detected (for example, rejection by the Command Processor or invalid Command), this method will return false. Use reset() to restart this cycle.

Referenced by RTT::detail::RemoteCommandImpl< CommandT >::invoke().

bool RTT::CommandC::executed (  )  const

Check if the Command was executed by the receiving task.

Return values:
true if accepted and executed by the Command Processor.
false otherwise.
void RTT::CommandC::reset (  ) 

Reset the command.

Required before invoking execute() a second time.

bool RTT::CommandC::sent (  )  const

Returns true if the command was sent to the CommandProcessor.

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

bool RTT::CommandC::valid (  )  const

Check the return value of the Command when it is executed.

Return values:
true if accepted() and the command returned true, indicating that it is valid.
false otherwise.

The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:22:40 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3