Orocos Real-Time Toolkit
2.8.3
|
A DataSource that collects the result of an asynchronous method which store its results in other data sources. More...
#include <rtt/internal/FusedFunctorDataSource.hpp>
Public Types | |
typedef SendStatus | result_type |
typedef result_type | value_t |
typedef DataSource< SendStatus >::const_reference_t | const_reference_t |
typedef CollectType< Signature >::type | CollectSignature |
typedef boost::function_types::parameter_types< CollectSignature >::type | arg_types |
typedef mpl::push_front< arg_types, SendHandle< Signature > & >::type | handle_and_arg_types |
typedef create_sequence< handle_and_arg_types > | SequenceFactory |
typedef SequenceFactory::type | DataSourceSequence |
typedef boost::intrusive_ptr< FusedMCollectDataSource< Signature > > | shared_ptr |
typedef SendStatus | result_t |
typedef boost::intrusive_ptr< const DataSource< SendStatus > > | const_ptr |
Public Member Functions | |
FusedMCollectDataSource (const DataSourceSequence &s, DataSource< bool >::shared_ptr blocking) | |
void | setArguments (const DataSourceSequence &a1) |
value_t | value () const |
Return the result of the last evaluate() function. More... | |
const_reference_t | rvalue () const |
Get a const reference to the value of this DataSource. More... | |
value_t | get () const |
Return the data as type T. More... | |
virtual FusedMCollectDataSource< Signature > * | clone () const |
Return a shallow clone of this DataSource. More... | |
virtual FusedMCollectDataSource< Signature > * | copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const |
Create a deep copy of this internal::DataSource, unless it is already cloned. More... | |
BOOST_STATIC_ASSERT (!details::HasConst< SendStatus >::value) | |
If you get a compile error here, it means T has const or reference qualifiers, which is not allowed for DataSource<T> More... | |
void const * | getRawConstPointer () |
Generic implementation of getRawConstPointer() based on rvalue() More... | |
virtual bool | evaluate () const |
Force an evaluation of the DataSourceBase. More... | |
virtual std::string | getType () const |
Return useful type info in a human readable format. More... | |
virtual const types::TypeInfo * | getTypeInfo () const |
Return the Orocos type info object. More... | |
virtual std::string | getTypeName () const |
Return the Orocos type name, without const, pointer or reference qualifiers. More... | |
void | ref () const |
Increase the reference count by one. More... | |
void | deref () const |
Decrease the reference count by one and delete this on zero. More... | |
virtual void | reset () |
Reset the data to initial values. More... | |
virtual bool | isAssignable () const |
Returns true if this object can be cast to an AssignableDataSource. More... | |
virtual void | updated () |
In case the internal::DataSource returns a 'reference' type, call this method to notify it that the data was updated in the course of an invocation of get(). More... | |
virtual bool | update (DataSourceBase *other) |
Update the value of this internal::DataSource with the value of an other DataSource. More... | |
virtual ActionInterface * | updateAction (DataSourceBase *other) |
Generate a ActionInterface object which will update this internal::DataSource with the value of another internal::DataSource when execute()'ed. More... | |
virtual shared_ptr | getMember (const std::string &member_name) |
Get a (const) reference data source to a member of the structure of this data source. More... | |
virtual shared_ptr | getMember (DataSourceBase::shared_ptr member_id, DataSourceBase::shared_ptr offset) |
Same as above, but with run-time lookup of the member to use. More... | |
virtual std::vector< std::string > | getMemberNames () const |
Returns the names of all members of the structure contained in this data source, or an empty list if none. More... | |
virtual shared_ptr | getParent () |
Returns the top level data source that contains the full data structure this data source refers to. More... | |
std::ostream & | write (std::ostream &os) |
Stream the contents of this object. More... | |
std::string | toString () |
Get the contents of this object as a string. More... | |
virtual void * | getRawPointer () |
Returns a pointer to the sample contained in this data source, if there is any, and if it is an lvalue. More... | |
Static Public Member Functions | |
static std::string | GetType () |
Return usefull type info in a human readable format. More... | |
static const types::TypeInfo * | GetTypeInfo () |
Return the Orocos type info. More... | |
static std::string | GetTypeName () |
Return the Orocos type name, without const, pointer or reference qualifiers. More... | |
static DataSource< SendStatus > * | narrow (base::DataSourceBase *db) |
This method narrows a base::DataSourceBase to a typeded DataSource, possibly returning a new object. More... | |
static shared_ptr | stack_shared_ptr (DataSourceBase *dsb) |
Returns a shared ptr to a DataSourceBase living on the stack. More... | |
static const_ptr | stack_const_ptr (const DataSourceBase *dsb) |
Returns a const shared_ptr to a DataSourceBase living on the stack. More... | |
Public Attributes | |
DataSourceSequence | args |
DataSource< bool >::shared_ptr | isblocking |
SendStatus | ss |
Protected Attributes | |
os::AtomicInt | refcount |
We keep the refcount ourselves. More... | |
A DataSource that collects the result of an asynchronous method which store its results in other data sources.
The result type of this data source is a SendStatus.
Signature | is the signature of the collect function, not of the original send function. |
Definition at line 399 of file FusedFunctorDataSource.hpp.
typedef boost::function_types::parameter_types<CollectSignature>::type RTT::internal::FusedMCollectDataSource< Signature >::arg_types |
Definition at line 407 of file FusedFunctorDataSource.hpp.
typedef CollectType<Signature>::type RTT::internal::FusedMCollectDataSource< Signature >::CollectSignature |
Definition at line 406 of file FusedFunctorDataSource.hpp.
|
inherited |
Definition at line 117 of file DataSource.hpp.
typedef DataSource<SendStatus>::const_reference_t RTT::internal::FusedMCollectDataSource< Signature >::const_reference_t |
Definition at line 404 of file FusedFunctorDataSource.hpp.
typedef SequenceFactory::type RTT::internal::FusedMCollectDataSource< Signature >::DataSourceSequence |
Definition at line 411 of file FusedFunctorDataSource.hpp.
typedef mpl::push_front<arg_types, SendHandle<Signature>& >::type RTT::internal::FusedMCollectDataSource< Signature >::handle_and_arg_types |
Definition at line 408 of file FusedFunctorDataSource.hpp.
|
inherited |
Definition at line 106 of file DataSource.hpp.
typedef SendStatus RTT::internal::FusedMCollectDataSource< Signature >::result_type |
Definition at line 402 of file FusedFunctorDataSource.hpp.
typedef create_sequence< handle_and_arg_types > RTT::internal::FusedMCollectDataSource< Signature >::SequenceFactory |
Definition at line 410 of file FusedFunctorDataSource.hpp.
typedef boost::intrusive_ptr<FusedMCollectDataSource<Signature> > RTT::internal::FusedMCollectDataSource< Signature >::shared_ptr |
Definition at line 417 of file FusedFunctorDataSource.hpp.
typedef result_type RTT::internal::FusedMCollectDataSource< Signature >::value_t |
Definition at line 403 of file FusedFunctorDataSource.hpp.
|
inline |
Definition at line 419 of file FusedFunctorDataSource.hpp.
|
inherited |
If you get a compile error here, it means T has const or reference qualifiers, which is not allowed for DataSource<T>
|
inlinevirtual |
Return a shallow clone of this DataSource.
This method returns a duplicate of this instance which re-uses the DataSources this internal::DataSource holds reference to. The clone() function is thus a non-deep copy.
Implements RTT::internal::DataSource< SendStatus >.
Definition at line 451 of file FusedFunctorDataSource.hpp.
References RTT::internal::FusedFunctorDataSource< Signature, Enable >::args.
|
inlinevirtual |
Create a deep copy of this internal::DataSource, unless it is already cloned.
Places the association (parent, clone) in alreadyCloned. If the internal::DataSource is non-copyable (for example it represents the Property of a Task ), this may be returned.
Implements RTT::internal::DataSource< SendStatus >.
Definition at line 455 of file FusedFunctorDataSource.hpp.
References RTT::internal::create_sequence_impl< List, mpl::size< List >::value >::copy().
|
inherited |
Decrease the reference count by one and delete this on zero.
Definition at line 81 of file DataSource.cpp.
References RTT::os::AtomicInt::dec_and_test(), and RTT::base::DataSourceBase::refcount.
Referenced by RTT::base::intrusive_ptr_release().
|
virtualinherited |
Force an evaluation of the DataSourceBase.
Implements RTT::base::DataSourceBase.
|
inlinevirtual |
Return the data as type T.
Implements RTT::internal::DataSource< SendStatus >.
Definition at line 440 of file FusedFunctorDataSource.hpp.
References RTT::internal::create_sequence_impl< List, mpl::size< List >::value >::data(), RTT::internal::DataSource< T >::get(), and RTT::internal::create_sequence_impl< List, mpl::size< List >::value >::update().
|
virtualinherited |
Get a (const) reference data source to a member of the structure of this data source.
You must call getMember() in turn on the returned member to access sub-members.
member_name | The name of the member to get access to. |
Definition at line 124 of file DataSource.cpp.
References RTT::types::TypeInfo::getMember(), and RTT::base::DataSourceBase::getTypeInfo().
|
virtualinherited |
Same as above, but with run-time lookup of the member to use.
Also takes an optional offset argument which can be used to offset the member in memory. This is necessary when using sequences of sequences. DataSources which are a sequence/offset member themselves must override this function to let the returned member take the offset into account.
Definition at line 130 of file DataSource.cpp.
References RTT::types::TypeInfo::getMember(), and RTT::base::DataSourceBase::getTypeInfo().
|
virtualinherited |
Returns the names of all members of the structure contained in this data source, or an empty list if none.
If this data source is a sequence, it will not return the allowed index numbers.
Definition at line 134 of file DataSource.cpp.
References RTT::types::TypeInfo::getMemberNames(), and RTT::base::DataSourceBase::getTypeInfo().
|
virtualinherited |
Returns the top level data source that contains the full data structure this data source refers to.
Defaults to returning this.
Definition at line 138 of file DataSource.cpp.
|
inlinevirtualinherited |
Generic implementation of getRawConstPointer() based on rvalue()
Reimplemented from RTT::base::DataSourceBase.
Definition at line 141 of file DataSource.hpp.
|
virtualinherited |
Returns a pointer to the sample contained in this data source, if there is any, and if it is an lvalue.
Returns 0 otherwise
Reimplemented in RTT::internal::AssignableDataSource< T >, RTT::internal::AssignableDataSource< DataSourceType >, RTT::internal::AssignableDataSource< types::carray< T > >, RTT::internal::AssignableDataSource< remove_cr< boost::function_traits< Signature >::result_type >::type >, RTT::internal::AssignableDataSource< ds_type >, RTT::internal::AssignableDataSource< RTT::scripting::ProgramInterface * >, RTT::internal::AssignableDataSource< value_t >, and RTT::internal::AssignableDataSource< bool >.
Definition at line 115 of file DataSource.cpp.
|
virtualinherited |
Return useful type info in a human readable format.
Implements RTT::base::DataSourceBase.
|
staticinherited |
Return usefull type info in a human readable format.
|
virtualinherited |
Return the Orocos type info object.
Implements RTT::base::DataSourceBase.
|
staticinherited |
Return the Orocos type info.
|
staticinherited |
Return the Orocos type name, without const, pointer or reference qualifiers.
|
virtualinherited |
Return the Orocos type name, without const, pointer or reference qualifiers.
Implements RTT::base::DataSourceBase.
|
virtualinherited |
Returns true if this object can be cast to an AssignableDataSource.
When this method returns true, all update functions below will return as well when valid input is given.
Reimplemented in RTT::internal::AssignableDataSource< T >, RTT::internal::AssignableDataSource< DataSourceType >, RTT::internal::AssignableDataSource< types::carray< T > >, RTT::internal::AssignableDataSource< remove_cr< boost::function_traits< Signature >::result_type >::type >, RTT::internal::AssignableDataSource< ds_type >, RTT::internal::AssignableDataSource< RTT::scripting::ProgramInterface * >, RTT::internal::AssignableDataSource< value_t >, and RTT::internal::AssignableDataSource< bool >.
Definition at line 104 of file DataSource.cpp.
|
staticinherited |
This method narrows a base::DataSourceBase to a typeded DataSource, possibly returning a new object.
|
inherited |
Increase the reference count by one.
Definition at line 80 of file DataSource.cpp.
References RTT::os::AtomicInt::inc(), and RTT::base::DataSourceBase::refcount.
Referenced by RTT::base::PropertyBase::compose(), RTT::types::BoostArrayTypeInfo< T, has_ostream >::composeType(), RTT::types::CArrayTypeInfo< T, has_ostream >::composeType(), RTT::types::StructTypeInfo< T, has_ostream >::composeTypeImpl(), RTT::corba::DataSourceProxy< T >::get(), RTT::corba::ValueDataSourceProxy< T >::get(), RTT::base::intrusive_ptr_add_ref(), RTT::corba::RemoteChannelElement< T >::read(), RTT::corba::ValueDataSourceProxy< T >::set(), RTT::internal::ReferenceDataSource< ds_type >::setReference(), RTT::base::DataSourceBase::stack_const_ptr(), RTT::base::DataSourceBase::stack_shared_ptr(), and RTT::corba::RemoteChannelElement< T >::write().
|
virtualinherited |
Reset the data to initial values.
Reimplemented in RTT::internal::NArityDataSource< function >, RTT::internal::UnaryDataSource< function >, RTT::internal::BinaryDataSource< function >, RTT::internal::ActionAliasAssignableDataSource< T >, RTT::internal::ActionAliasDataSource< T >, RTT::internal::AliasDataSource< T >, RTT::internal::InputPortSource< T >, RTT::scripting::DataSourceTime, RTT::internal::DataSourceCommand, RTT::scripting::DataSourceCondition, and RTT::internal::DataObjectDataSource< T >.
Definition at line 87 of file DataSource.cpp.
Referenced by RTT::scripting::StatementProcessor::D::doPrint(), RTT::scripting::ConditionBoolDataSource::reset(), RTT::scripting::CommandDataSourceBool::reset(), RTT::scripting::EvalCommand::reset(), RTT::internal::AliasDataSource< T >::reset(), RTT::internal::ActionAliasDataSource< T >::reset(), RTT::internal::ActionAliasAssignableDataSource< T >::reset(), RTT::internal::BinaryDataSource< function >::reset(), RTT::internal::UnaryDataSource< function >::reset(), and RTT::internal::NArityDataSource< function >::reset().
|
inlinevirtual |
Get a const reference to the value of this DataSource.
You must call evaluate() prior to calling this function in order to get the most recent value of this attribute.
Implements RTT::internal::DataSource< SendStatus >.
Definition at line 435 of file FusedFunctorDataSource.hpp.
|
inline |
Definition at line 425 of file FusedFunctorDataSource.hpp.
|
staticinherited |
Returns a const shared_ptr to a DataSourceBase living on the stack.
Make sure that the const_ptr does not outlive the stacked element.
Definition at line 74 of file DataSource.cpp.
References RTT::base::DataSourceBase::ref().
|
staticinherited |
Returns a shared ptr to a DataSourceBase living on the stack.
Make sure that the shared_ptr does not outlive the stacked element.
Definition at line 69 of file DataSource.cpp.
References RTT::base::DataSourceBase::ref().
|
inherited |
Get the contents of this object as a string.
Definition at line 98 of file DataSource.cpp.
|
virtualinherited |
Update the value of this internal::DataSource with the value of an other DataSource.
Update does a full update of the value, adding extra information if necessary.
Reimplemented in RTT::internal::AssignableDataSource< T >, RTT::internal::AssignableDataSource< DataSourceType >, RTT::internal::AssignableDataSource< types::carray< T > >, RTT::internal::AssignableDataSource< remove_cr< boost::function_traits< Signature >::result_type >::type >, RTT::internal::AssignableDataSource< ds_type >, RTT::internal::AssignableDataSource< RTT::scripting::ProgramInterface * >, RTT::internal::AssignableDataSource< value_t >, and RTT::internal::AssignableDataSource< bool >.
Definition at line 108 of file DataSource.cpp.
|
virtualinherited |
Generate a ActionInterface object which will update this internal::DataSource with the value of another internal::DataSource when execute()'ed.
Reimplemented in RTT::internal::AssignableDataSource< T >, RTT::internal::AssignableDataSource< DataSourceType >, RTT::internal::AssignableDataSource< types::carray< T > >, RTT::internal::AssignableDataSource< remove_cr< boost::function_traits< Signature >::result_type >::type >, RTT::internal::AssignableDataSource< ds_type >, RTT::internal::AssignableDataSource< RTT::scripting::ProgramInterface * >, RTT::internal::AssignableDataSource< value_t >, and RTT::internal::AssignableDataSource< bool >.
Definition at line 120 of file DataSource.cpp.
|
virtualinherited |
In case the internal::DataSource returns a 'reference' type, call this method to notify it that the data was updated in the course of an invocation of get().
Reimplemented in RTT::corba::ValueDataSourceProxy< T >, RTT::internal::PartDataSource< types::carray< T > >, RTT::internal::ArrayPartDataSource< T >, and RTT::internal::PartDataSource< T >.
Definition at line 112 of file DataSource.cpp.
Referenced by RTT::types::TemplateCompositionFactory< bool >::composeType(), RTT::types::SequenceTypeInfoBase< std::vector< double > >::composeType(), RTT::types::BoolTypeInfo::read(), RTT::types::PrimitiveTypeInfo< std::vector< T >, use_ostream >::read(), RTT::types::SequenceTypeInfoBase< std::vector< double > >::resize(), and RTT::corba::CorbaTemplateProtocol< T >::updateFromAny().
|
inlinevirtual |
Return the result of the last evaluate() function.
You must call evaluate() prior to calling this function in order to get the most recent value of this attribute.
Implements RTT::internal::DataSource< SendStatus >.
Definition at line 430 of file FusedFunctorDataSource.hpp.
|
inherited |
Stream the contents of this object.
Definition at line 91 of file DataSource.cpp.
DataSourceSequence RTT::internal::FusedMCollectDataSource< Signature >::args |
Definition at line 412 of file FusedFunctorDataSource.hpp.
DataSource<bool>::shared_ptr RTT::internal::FusedMCollectDataSource< Signature >::isblocking |
Definition at line 413 of file FusedFunctorDataSource.hpp.
|
mutableprotectedinherited |
We keep the refcount ourselves.
We aren't using boost::shared_ptr, because boost::intrusive_ptr is better, exactly because it can be used with refcounts that are stored in the class itself. Advantages are that the shared_ptr's for derived classes use the same refcount, which is of course very much desired, and that refcounting happens in an efficient way, which is also nice :)
Definition at line 88 of file DataSourceBase.hpp.
Referenced by RTT::base::DataSourceBase::deref(), and RTT::base::DataSourceBase::ref().
|
mutable |
Definition at line 414 of file FusedFunctorDataSource.hpp.