41 #include "../internal/DataSources.hpp" 46 using namespace detail;
59 if (_result->
get() ==
false)
64 _result->
set(
false );
79 return _result->
get() ==
false || c->
valid();
86 _result->
set(
false );
107 _result->
copy(alreadyCloned));
112 :c(ec), _invert(invert) {}
120 return _invert != c->
get();
163 _cache->
copy(alreadyCloned) );
DataSource is a base class representing a generic way to read data of type T.
ConditionInterface * clone() const
The Clone Software Pattern.
virtual result_t get() const =0
Return the data as type T.
base::ActionInterface * theCommand() const
EvalCommand(internal::DataSource< bool >::shared_ptr ds, internal::AssignableDataSource< bool >::shared_ptr cache=0)
virtual void reset()
Reset this action.
bool execute()
Execute the functionality of this action.
EvalCommandResult(internal::DataSource< bool >::shared_ptr ec)
This interface represents the concept of a condition which can be evaluated and return true or false...
ConditionInterface * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
When copying an Orocos program, we want identical internal::DataSource's to be mapped to identical Da...
virtual void set(param_t t)=0
Set this DataSource with a value.
virtual void readArguments()=0
This is invoked some time before execute() at a time when the action may read its function arguments...
virtual bool valid() const
Inspect if this action was executed and valid.
void readArguments()
This is invoked some time before execute() at a time when the action may read its function arguments...
TryCommandResult(internal::DataSource< bool >::shared_ptr ec, bool invert)
Pass TryCommand::result() to the first parameter of the command you want to check.
void reset()
Reset this action.
bool evaluate()
Evaluate the Condition and return the outcome.
TryCommand * clone() const
The Clone Software Pattern.
virtual void reset()
Reset the data to initial values.
base::ActionInterface * clone() const
The Clone Software Pattern.
bool evaluate()
Evaluate the Condition and return the outcome.
A command which tries another command and stores the result in a internal::DataSource<bool>.
bool execute()
Execute the functionality of this action.
virtual DataSource< T > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const =0
Create a deep copy of this internal::DataSource, unless it is already cloned.
virtual ActionInterface * clone() const =0
The Clone Software Pattern.
void readArguments()
This is invoked some time before execute() at a time when the action may read its function arguments...
virtual bool execute()=0
Execute the functionality of this action.
Based on the software pattern 'command', this interface allows execution of action objects...
ConditionInterface * clone() const
The Clone Software Pattern.
internal::AssignableDataSource< bool >::shared_ptr result()
TryCommand(base::ActionInterface *command, internal::AssignableDataSource< bool >::shared_ptr storage=0)
Try a command.
bool valid() const
Inspect if this action was executed and valid.
A special DataSource only to be used for if you understand the copy()/clone() semantics very well...
internal::AssignableDataSource< bool >::shared_ptr cache()
A DataSource which has set() methods.
void reset()
Reset this action.
base::ActionInterface * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
When copying an Orocos program, we want identical internal::DataSource's to be mapped to identical Da...
virtual result_t value() const =0
Return the result of the last evaluate() function.
TryCommand * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
When copying an Orocos program, we want identical internal::DataSource's to be mapped to identical Da...
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
virtual bool evaluate() const
Force an evaluation of the DataSourceBase.
ConditionInterface * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
When copying an Orocos program, we want identical internal::DataSource's to be mapped to identical Da...
A simple, yet very useful DataSource, which keeps a value, and returns it in its get() method...
virtual AssignableDataSource< T > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const =0
Create a deep copy of this internal::DataSource, unless it is already cloned.
virtual ActionInterface * copy(std::map< const DataSourceBase *, DataSourceBase * > &alreadyCloned) const
When copying an Orocos program, we want identical internal::DataSource's to be mapped to identical Da...