40 #include "../FactoryExceptions.hpp" 42 #include "../Service.hpp" 43 #include "../Logger.hpp" 50 using namespace detail;
90 if (ms && autocollect) {
94 }
catch (std::exception&) {
115 std::vector<DataSourceBase::shared_ptr>
args;
124 if ( sz == args.size() ) {
126 args.insert( args.begin(), msh );
131 log(
Error) <<
"Failed to produce collector for "<< mname <<
" with " << sz <<
" arguments." << endlog();
140 this->args.push_back( na );
141 this->checkAndCreate();
145 : mofp(ofp), mname(name), s(), msh(sh), blocking( new
ValueDataSource<bool>(false) )
147 this->checkAndCreate();
151 : mofp(other.mofp), mname(other.mname),
152 args( other.args ), s( other.s ), msh(other.msh), blocking(new
ValueDataSource<bool>(false))
163 : d(0), e( new
E(0) )
168 : d( ofp ? new
D( sh, ofp, name ) : 0 ), e( new
E(op) )
181 : d( other.d ? new
D(*other.d) : 0 ), e( new
E(*other.e) )
187 if ( &other ==
this )
190 d = ( other.d ?
new D(*other.d) : 0 );
base::DataSourceBase::shared_ptr mop
Stores the operation in order to avoid its premature destruction.
internal::DataSource< SendStatus >::shared_ptr s
This data source will do a collect/collectIfDone when being evaluated().
DataSource is a base class representing a generic way to read data of type T.
SendHandleC()
The default constructor.
E(base::DataSourceBase::shared_ptr op)
D(base::DataSourceBase::shared_ptr sh, OperationInterfacePart *ofp, const std::string &name)
std::vector< DataSourceBase::shared_ptr > args
OperationInterfacePart * getOrp()
Get the contained OperationInterfacePart for SendHandle.
OperationInterfacePart * orp
Stores the OperationInterfacePart pointer contained in this SendHandle.
SendHandleC & operator=(const SendHandleC &other)
A SendHandleC is assignable.
DataSource< SendStatus >::shared_ptr s
virtual void set(param_t t)=0
Set this DataSource with a value.
static std::ostream & nl(std::ostream &__os)
Insert a newline ' ' in the ostream.
When Orocos is compiled without exceptions (define ORO_EMBEDDED), the functions which would throw an ...
AssignableDataSource< bool >::shared_ptr blocking
This is a custom deleter that blocks on an asynchronous operation.
void setAutoCollect(bool on_off)
When set to 'on', the destruction of this SendHandleC will cause a call to collect() before all data ...
SendStatus collect()
Collect the contained method.
Exception thrown when a factory is requested to create an object with an invalid SendHandle.
SendStatus
Returns the status of a send() or collect() invocation.
DataSourceBase::shared_ptr msh
OperationInterfacePart * mofp
SendHandleC & arg(base::DataSourceBase::shared_ptr a)
Add a datasource argument to the SendHandle.
A template-less SendHandle manager.
base::DataSourceBase::shared_ptr getSendHandleDataSource()
Get the contained data source for send handle.
Returned when the result of the send() could not be collected.
AssignableDataSource< bool >::shared_ptr mb
static std::ostream & endl(std::ostream &__os)
SendStatus collectIfDone()
Collect the contained method.
internal::AssignableDataSource< bool >::shared_ptr b
Stores the blocking/non blocking flag for collect/collectIfDone.
bool ready() const
Returns true if this handle is ready for execution.
This class defines the interface for creating operation objects without using C++ templates...
void newarg(DataSourceBase::shared_ptr na)
boost::intrusive_ptr< DataSource< T > > shared_ptr
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
Use this type to store a pointer to an AssignableDataSource.
virtual base::DataSourceBase::shared_ptr produceCollect(const std::vector< base::DataSourceBase::shared_ptr > &args, internal::DataSource< bool >::shared_ptr blocking) const =0
Create a DataSource for collecting the results of a Send.
DataSource< SendStatus >::shared_ptr ms
A DataSource which has set() methods.
virtual unsigned int collectArity() const =0
Returns the number of collectable arguments of this operation's function.
Notify the Logger in which 'module' the message occured.
static Logger & log()
As Instance(), but more userfriendly.
void check()
Checks if this handle is ready for collecting, will throw if not so.
virtual result_t value() const =0
Return the result of the last evaluate() function.
boost::shared_ptr< OperationKeeper > mopkeeper
boost::intrusive_ptr< DataSourceBase > shared_ptr
Use this type to store a pointer to a DataSourceBase.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
virtual bool evaluate() const
Force an evaluation of the DataSourceBase.
A simple, yet very useful DataSource, which keeps a value, and returns it in its get() method...
OperationKeeper(DataSource< SendStatus >::shared_ptr s, AssignableDataSource< bool >::shared_ptr b)