39 #ifndef ORO_ARRAYPARTDATASOURCE_HPP_ 40 #define ORO_ARRAYPARTDATASOURCE_HPP_ 72 typedef boost::intrusive_ptr<ArrayPartDataSource<T> >
shared_ptr;
84 : mref(&ref), mindex(index), mparent(parent), mmax(max)
90 unsigned int i = mindex->
get();
98 unsigned int i = mindex->
get();
106 unsigned int i = mindex->
get();
115 unsigned int i = mindex->
get();
123 unsigned int i = mindex->
get();
130 if (mparent) mparent->updated();
139 if ( replace[
this] != 0 ) {
145 assert( mparent->getRawPointer() != 0 &&
"Can't copy part of rvalue datasource.");
146 if ( mparent->getRawPointer() == 0 )
147 throw std::runtime_error(
"PartDataSource.hpp: Can't copy part of rvalue datasource.");
150 int offset =
reinterpret_cast<unsigned char*
>( mref ) - reinterpret_cast<unsigned char*>(mparent->getRawPointer());
DataSource is a base class representing a generic way to read data of type T.
virtual result_t get() const =0
Return the data as type T.
ArrayPartDataSource(typename AssignableDataSource< T >::reference_t ref, DataSource< unsigned int >::shared_ptr index, base::DataSourceBase::shared_ptr parent, unsigned int max)
The part is constructed from a reference to an existing array of elements and an index for accessing ...
boost::call_traits< value_t >::reference reference_t
void updated()
In case the internal::DataSource returns a 'reference' type, call this method to notify it that the d...
AssignableDataSource< T >::const_reference_t rvalue() const
Get a const reference to the value of this DataSource.
boost::intrusive_ptr< ArrayPartDataSource< T > > shared_ptr
DataSource< T >::result_t value() const
Return the result of the last evaluate() function.
A DataSource which is used to manipulate a reference to a part of a data source holding a C-style arr...
virtual DataSource< 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.
virtual ArrayPartDataSource< T > * copy(std::map< const base::DataSourceBase *, base::DataSourceBase * > &replace) const
Create a deep copy of this internal::DataSource, unless it is already cloned.
virtual ArrayPartDataSource< T > * clone() const
Return a shallow clone of this DataSource.
This class is used to return a 'default' value when no value is available ('Not Available').
A DataSource which has set() methods.
DataSource< T >::value_t value_t
DataSource< T >::const_reference_t const_reference_t
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.
void ref() const
Increase the reference count by one.
boost::call_traits< value_t >::param_type param_t