39 #ifndef ORO_CORELIB_DATASOURCES_HPP 40 #define ORO_CORELIB_DATASOURCES_HPP 72 typedef boost::intrusive_ptr<ValueDataSource<T> >
shared_ptr;
102 virtual ValueDataSource<T>*
copy( std::map<const base::DataSourceBase*, base::DataSourceBase*>& replace )
const;
118 typename boost::add_const<typename DataSource<T>::value_t>::type
mdata;
126 typedef boost::intrusive_ptr< ConstantDataSource<T> >
shared_ptr;
147 virtual ConstantDataSource<T>*
copy( std::map<const base::DataSourceBase*, base::DataSourceBase*>& alreadyCloned )
const;
167 typedef boost::intrusive_ptr<ConstReferenceDataSource<T> >
shared_ptr;
209 typedef boost::intrusive_ptr<ReferenceDataSource<T> >
shared_ptr;
215 mptr =
static_cast<T*
>(
ref);
268 typedef boost::intrusive_ptr<AliasDataSource<T> >
shared_ptr;
287 return alias->
value();
325 typedef boost::intrusive_ptr<ArrayDataSource<T> >
shared_ptr;
347 void newArray( std::size_t size );
373 virtual ArrayDataSource<T>*
copy( std::map<const base::DataSourceBase*, base::DataSourceBase*>& replace )
const;
392 typedef boost::intrusive_ptr<LateReferenceDataSource<T> >
shared_ptr;
459 typedef boost::intrusive_ptr<LateConstReferenceDataSource<T> >
shared_ptr;
510 typedef boost::intrusive_ptr<ActionAliasDataSource<T> >
shared_ptr;
513 : action(act), alias(ds)
537 return alias->
value();
568 typedef boost::intrusive_ptr<ActionAliasDataSource<T> >
shared_ptr;
571 : action(act), alias(ds)
595 return alias->
value();
636 template<
typename BoundType>
641 typedef typename BoundType::result_t
T;
642 typedef boost::intrusive_ptr< UnboundDataSource<BoundType> >
shared_ptr;
652 return BoundType::clone();
670 template<
typename function>
672 :
public DataSource< typename remove_cr<typename function::result_type>::type >
682 typedef boost::intrusive_ptr<BinaryDataSource<function> >
shared_ptr;
691 : mdsa( a ), mdsb( b ), fun( f )
695 virtual value_t
get()
const 697 first_arg_t a = mdsa->
get();
698 second_arg_t b = mdsb->
get();
699 return mdata = fun( a, b );
733 template <
typename function>
735 :
public DataSource<typename remove_cr<typename function::result_type>::type>
743 typedef boost::intrusive_ptr<UnaryDataSource<function> >
shared_ptr;
750 : mdsa( a ), fun( f )
754 virtual value_t
get()
const 756 return mdata = fun( mdsa->
get() );
792 template<
typename function>
794 :
public DataSource<typename remove_cr<typename function::result_type>::type>
799 std::vector<typename DataSource<arg_t>::shared_ptr >
mdsargs;
803 typedef boost::intrusive_ptr<NArityDataSource<function> >
shared_ptr;
819 : margs( dsargs.size() ), mdsargs(dsargs), fun( f )
824 mdsargs.push_back(ds);
825 margs.push_back( ds->
value() );
828 virtual value_t
get()
const 830 assert( mdsargs.size() == margs.size() );
831 for(
unsigned int i=0; i !=mdsargs.size(); ++i)
832 margs[i] = mdsargs[i]->
get();
833 return mdata = fun( margs );
848 for(
unsigned int i=0; i !=mdsargs.size(); ++i)
858 std::vector<typename DataSource<arg_t>::shared_ptr > newargs( mdsargs.size() );
859 for(
unsigned int i=0; i !=mdsargs.size(); ++i)
860 newargs[i] = mdsargs[i]->
copy(alreadyCloned);
867 #include "DataSources.inl" void setPointer(typename AssignableDataSource< T >::value_t *ptr)
DataSource< T >::result_t value() const
BinaryDataSource(typename DataSource< first_arg_t >::shared_ptr a, typename DataSource< second_arg_t >::shared_ptr b, function f)
NArityDataSource(function f=function())
virtual LateReferenceDataSource< T > * clone() const
DataSource< T >::value_t mdata
DataSource< T >::result_t value() const
DataSource< T >::result_t value() const
virtual result_t get() const =0
LateReferenceDataSource(typename AssignableDataSource< T >::value_t *ptr=0)
boost::intrusive_ptr< ActionAliasDataSource< T > > shared_ptr
virtual NArityDataSource< function > * clone() const
boost::intrusive_ptr< UnboundDataSource< BoundType > > shared_ptr
virtual LateReferenceDataSource< T > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &) const
virtual UnaryDataSource< function > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
boost::intrusive_ptr< UnaryDataSource< function > > shared_ptr
boost::call_traits< value_t >::reference reference_t
DataSource< T >::result_t value() const
boost::intrusive_ptr< ArrayDataSource< T > > shared_ptr
void setReference(void *ref)
boost::intrusive_ptr< LateConstReferenceDataSource< T > > shared_ptr
virtual void set(param_t t)=0
boost::intrusive_ptr< ConstantDataSource< T > > shared_ptr
virtual value_t value() const
virtual void readArguments()=0
void add(typename DataSource< arg_t >::shared_ptr ds)
bool setReference(base::DataSourceBase::shared_ptr dsb)
AliasDataSource(DataSource< T > *ds)
boost::intrusive_ptr< ConstReferenceDataSource< T > > shared_ptr
DataSource< T >::result_t value() const
std::vector< typename DataSource< arg_t >::shared_ptr > mdsargs
DataSource< T >::const_reference_t rvalue() const
const DataSource< T >::value_t * mptr
remove_cr< typename function::result_type >::type value_t
void const * getRawDataConst()
NArityDataSource(function f, const std::vector< typename DataSource< arg_t >::shared_ptr > &dsargs)
UnaryDataSource(typename DataSource< arg_t >::shared_ptr a, function f)
base::ActionInterface * action
boost::intrusive_ptr< NArityDataSource< function > > shared_ptr
DataSource< arg_t >::shared_ptr mdsa
virtual DataSource< T > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const =0
DataSource< second_arg_t >::shared_ptr mdsb
DataSource< T >::result_t value() const
AssignableDataSource< T >::const_reference_t rvalue() const
remove_cr< typename function::first_argument_type >::type first_arg_t
AssignableDataSource< T >::const_reference_t rvalue() const
remove_cr< typename function::argument_type >::type arg_t
AssignableDataSource< T >::const_reference_t rvalue() const
DataSource< T >::result_t value() const
virtual NArityDataSource< function > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
virtual value_t value() const
base::ActionInterface * action
virtual BoundType * clone() const
DataSource< T >::const_reference_t rvalue() const
virtual const_reference_t rvalue() const =0
boost::intrusive_ptr< LateReferenceDataSource< T > > shared_ptr
boost::intrusive_ptr< AliasDataSource< T > > shared_ptr
remove_cr< typename function::result_type >::type value_t
virtual ValueDataSource< T > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &replace) const
Based on the software pattern 'command', this interface allows execution of action objects...
DataSource< value_t >::const_reference_t rvalue() const
ActionAliasAssignableDataSource(base::ActionInterface *act, AssignableDataSource< T > *ds)
DataSource< T >::shared_ptr alias
std::vector< arg_t > margs
~ActionAliasAssignableDataSource()
DataSource< T >::shared_ptr alias
virtual value_t value() const
virtual AliasDataSource< T > * clone() const
virtual BinaryDataSource< function > * clone() const
LateConstReferenceDataSource(const typename DataSource< T >::value_t *ptr=0)
virtual LateConstReferenceDataSource< T > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &) const
boost::intrusive_ptr< DataSource< T > > shared_ptr
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
remove_cr< typename function::second_argument_type >::type second_arg_t
DataSource< T >::result_t value() const
virtual BinaryDataSource< function > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
DataSource< T >::result_t value() const
DataSource< T >::const_reference_t rvalue() const
virtual AliasDataSource< T > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
AssignableDataSource< T >::shared_ptr alias
ActionAliasDataSource(base::ActionInterface *act, DataSource< T > *ds)
virtual ActionAliasDataSource< T > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
DataSource< T >::const_reference_t rvalue() const
virtual ActionAliasDataSource< T > * clone() const
boost::intrusive_ptr< ReferenceDataSource< T > > shared_ptr
void const * getRawDataConst()
void setPointer(const typename AssignableDataSource< T >::value_t *ptr)
DataSource< value_t >::const_reference_t rvalue() const
boost::remove_const< typename boost::remove_reference< T >::type >::type type
virtual result_t value() const =0
DataSource< T >::value_t value_t
DataSource< first_arg_t >::shared_ptr mdsa
DataSource< T >::const_reference_t const_reference_t
DataSource< T >::const_reference_t rvalue() const
boost::intrusive_ptr< DataSourceBase > shared_ptr
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
AssignableDataSource< T >::const_reference_t rvalue() const
virtual LateConstReferenceDataSource< T > * clone() const
virtual ValueDataSource< T > * clone() const
AssignableDataSource< T >::const_reference_t rvalue() const
AssignableDataSource< T >::value_t * mptr
DataSource< T >::const_reference_t mref
remove_cr< typename function::result_type >::type value_t
boost::add_const< typename DataSource< T >::value_t >::type mdata
details::GetConstRef< T >::type const_reference_t
remove_cr< typename function::argument_type >::type arg_t
virtual ActionAliasAssignableDataSource< T > * clone() const
virtual ActionAliasAssignableDataSource< T > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
DataSource< value_t >::const_reference_t rvalue() const
boost::intrusive_ptr< ValueDataSource< T > > shared_ptr
DataSource< T >::result_t value() const
virtual UnaryDataSource< function > * clone() const
boost::intrusive_ptr< ActionAliasDataSource< T > > shared_ptr
boost::intrusive_ptr< BinaryDataSource< function > > shared_ptr
virtual AssignableDataSource< T > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const =0
virtual bool evaluate() const
boost::call_traits< value_t >::param_type param_t
virtual ActionInterface * copy(std::map< const DataSourceBase *, DataSourceBase * > &alreadyCloned) const