39 #ifndef CONDITION_CACHE_HPP 40 #define CONDITION_CACHE_HPP 43 #include "../internal/DataSources.hpp" 46 {
namespace scripting {
57 boost::shared_ptr<ConditionInterface> mc;
71 result->
set( mc->evaluate() );
72 return result->
value();
81 virtual ConditionInterface*
copy( std::map<const base::DataSourceBase*, base::DataSourceBase*>& alreadyCloned )
const A conditional that evaluates and caches another Condition.
This interface represents the concept of a condition which can be evaluated and return true or false...
virtual void set(param_t t)=0
Set this DataSource with a value.
virtual bool evaluate()
Evaluate the Condition and return the outcome.
#define RTT_SCRIPTING_API
ConditionCache(ConditionInterface *c, internal::AssignableDataSource< bool >::shared_ptr ds=internal::AssignableDataSource< bool >::shared_ptr())
virtual void reset()
Some conditions need to be reset at some points.
virtual 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 ~ConditionCache()
boost::intrusive_ptr< DataSource< T > > shared_ptr
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
Use this type to store a pointer to an AssignableDataSource.
internal::DataSource< bool >::shared_ptr getResult()
virtual result_t value() const =0
Return the result of the last evaluate() function.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
A simple, yet very useful DataSource, which keeps a value, and returns it in its get() method...
virtual ConditionInterface * clone() const
A clone will cache the same condition.
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.