38 #ifndef CORELIB_DATASOURCE_HPP 39 #define CORELIB_DATASOURCE_HPP 44 #include "../rtt-config.h" 45 #include <boost/call_traits.hpp> 46 #include <boost/static_assert.hpp> 47 #include <boost/type_traits/add_reference.hpp> 48 #include <boost/type_traits/add_const.hpp> 50 #include "../base/DataSourceBase.hpp" 65 virtual const char* what()
const throw();
73 {
static const int value = 0; };
76 {
static const int value = 1; };
80 {
typedef typename boost::add_reference<typename boost::add_const<X>::type>
::type type; };
115 typedef typename boost::intrusive_ptr<DataSource<T> >
shared_ptr;
117 typedef typename boost::intrusive_ptr<const DataSource<T> >
const_ptr;
122 virtual result_t
get()
const = 0;
129 virtual result_t value()
const = 0;
137 virtual const_reference_t rvalue()
const = 0;
143 virtual bool evaluate()
const;
147 virtual DataSource<T>* copy( std::map<const base::DataSourceBase*, base::DataSourceBase*>& alreadyCloned )
const = 0;
149 virtual std::string getType()
const;
154 static std::string GetType();
167 static std::string GetTypeName();
169 virtual std::string getTypeName()
const;
192 typedef typename boost::call_traits<value_t>::param_type
param_t;
193 typedef typename boost::call_traits<value_t>::reference
reference_t;
198 typedef boost::intrusive_ptr<AssignableDataSource<T> >
shared_ptr;
199 typedef typename boost::intrusive_ptr<const AssignableDataSource<T> >
const_ptr;
204 virtual void set( param_t t ) = 0;
210 virtual reference_t
set() = 0;
224 virtual AssignableDataSource<T>* copy( std::map<const base::DataSourceBase*, base::DataSourceBase*>& alreadyCloned )
const = 0;
236 #ifndef ORO_CORELIB_DATASOURCES_HPP DataSource is a base class representing a generic way to read data of type T.
virtual bool isAssignable() const
Returns true if this object can be cast to an AssignableDataSource.
boost::intrusive_ptr< const AssignableDataSource< T > > const_ptr
The base class for all internal data representations.
boost::call_traits< value_t >::reference reference_t
void * getRawPointer()
Generic implementation of getRawPointer() based on set()
T value_t
The bare type of T is extracted into value_t.
This exception is thrown if the target and source type of an assignment of a DataSource with a base::...
Based on the software pattern 'command', this interface allows execution of action objects...
A class for representing a user type, and which can build instances of that type. ...
boost::intrusive_ptr< DataSource< T > > shared_ptr
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
Use this type to store a pointer to an AssignableDataSource.
A DataSource which has set() methods.
boost::add_reference< typename boost::add_const< X >::type >::type type
boost::intrusive_ptr< const DataSource< T > > const_ptr
DataSource< T >::value_t value_t
DataSource< T >::const_reference_t const_reference_t
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
void const * getRawConstPointer()
Generic implementation of getRawConstPointer() based on rvalue()
details::GetConstRef< T >::type const_reference_t
boost::call_traits< value_t >::param_type param_t