39 #ifndef ORO_CALL_FUNCTION_HPP 40 #define ORO_CALL_FUNCTION_HPP 42 #include "../base/ActionInterface.hpp" 43 #include "../base/DisposableInterface.hpp" 44 #include "../internal/DataSources.hpp" 46 #include "../internal/DataSource.hpp" 47 #include "../ExecutionEngine.hpp" 48 #include <boost/shared_ptr.hpp> 49 #include <boost/bind.hpp> 52 {
namespace scripting {
53 using namespace detail;
76 boost::shared_ptr<ProgramInterface> _foo;
81 return _foo->inError() || _foo->isStopped();
93 boost::shared_ptr<ProgramInterface> foo,
98 mrunner(p), mcaller(caller),
100 _foo( foo ), isqueued(false), maccept(false)
110 if (isqueued ==
false ) {
112 maccept = minit->execute() && mrunner->
runFunction( _foo.get() );
114 if ( _foo->needsStart() )
120 if ( _foo->inError() ) {
142 minit->readArguments();
148 return new CallFunction( minit->clone(), _foo, mrunner, mcaller, _v.
get() );
155 boost::shared_ptr<ProgramInterface> fcpy( _foo->copy(alreadyCloned) );
157 vcpy->set( fcpy.get() );
158 return new CallFunction( minit->copy(alreadyCloned), fcpy , mrunner, mcaller, vcpy );
base::ActionInterface * clone() const
The Clone Software Pattern.
virtual result_t get() const =0
Return the data as type T.
virtual bool removeFunction(base::ExecutableInterface *f)
Remove a running function added with runFunction.
virtual bool execute()
Execute the functionality of this action.
#define RTT_SCRIPTING_API
void waitForFunctions(const boost::function< bool(void)> &pred)
Call this if you wish to block on a function completing in the Execution Engine.
An execution engine serialises (executes one after the other) the execution of all commands...
virtual bool valid() const
Inspect if this action was executed and valid.
virtual void readArguments()
This is invoked some time before execute() at a time when the action may read its function arguments...
Based on the software pattern 'command', this interface allows execution of action objects...
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...
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
Use this type to store a pointer to an AssignableDataSource.
A special DataSource only to be used for if you understand the copy()/clone() semantics very well...
A DataSource which has set() methods.
virtual void reset()
Reset this action.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
An action which calls a FunctionFraph for execution in a ExecutionEngine.
virtual bool runFunction(base::ExecutableInterface *f)
Run a given function in step() or loop().
A Program represents a collection of instructions that can be stepwise executed.
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.
CallFunction(base::ActionInterface *init_com, boost::shared_ptr< ProgramInterface > foo, ExecutionEngine *p, ExecutionEngine *caller, internal::AssignableDataSource< ProgramInterface * > *v=0, internal::AssignableDataSource< bool > *a=0)
Create a Command to send a function to a ExecutionEngine.