Based on the software patterns 'command' and 'decorator', this interface represents a wrapper around a given command, which decorates that command as an asynchronous command. More...
#include <rtt/AsynchCommandDecorator.hpp>
Public Types | |
|
typedef boost::shared_ptr < ActionInterface > | shared_ptr |
| Use this type for shared pointer storage of an ActionInterface object. | |
Public Member Functions | |
| AsynchCommandDecorator (CommandInterface *cmd) | |
| Construct a new decorator with given command. | |
| AsynchCommandDecorator (const AsynchCommandDecorator &orig) | |
| void | readArguments () |
| This is invoked some time before execute() at a time when the action may read its function arguments. | |
| virtual bool | execute () |
| Execute the functionality of the corresponding command. | |
| virtual void | reset () |
| Reset this action. | |
| const CommandInterface * | getCommand () const |
| virtual CommandInterface * | clone () const |
| The Clone Software Pattern. | |
| virtual CommandInterface * | copy (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. | |
| virtual bool | valid () const |
| Inspect if this action was executed and valid. | |
Based on the software patterns 'command' and 'decorator', this interface represents a wrapper around a given command, which decorates that command as an asynchronous command.
The command will be executed once, until reset() and the result of this invocation will be returned.
If the command fails when executed, no more attempts will be done to execute it again, and execute() will return false until the AsynchCommandDecorator is reset().
Definition at line 64 of file AsynchCommandDecorator.hpp.
| RTT::AsynchCommandDecorator::AsynchCommandDecorator | ( | CommandInterface * | cmd | ) |
Construct a new decorator with given command.
| cmd | The command to be decorated |
| virtual CommandInterface* RTT::AsynchCommandDecorator::copy | ( | std::map< const DataSourceBase *, DataSourceBase * > & | alreadyCloned | ) | const [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::ActionInterface.
| virtual void RTT::AsynchCommandDecorator::reset | ( | ) | [virtual] |
| virtual bool RTT::ActionInterface::valid | ( | ) | const [virtual, inherited] |
Inspect if this action was executed and valid.
This method may not be called before execute(). The default implementation returns always true, i.e. after execute(), it was executed. Override this method if it has more complex state semantics.
Reimplemented in RTT::CommandComposite, RTT::CommandDispatch, RTT::CommandExecFunction, RTT::Corba::CommandProxy, RTT::detail::DataSourceArgsCommand< CommandT, CommandF >, RTT::DispatchAction, RTT::DispatchInterface, and RTT::TryCommand.
1.6.1