39 #ifndef ORO_MQ_TEMPATE_PROTOCOL_HPP 40 #define ORO_MQ_TEMPATE_PROTOCOL_HPP 43 #include "../../types/TypeMarshaller.hpp" 47 #include <boost/type_traits/has_virtual_destructor.hpp> 48 #include <boost/static_assert.hpp> 78 if (
sizeof(T) <= (
unsigned int)size)
79 return std::make_pair(source->getRawConstPointer(), int(
sizeof(T)));
80 return std::make_pair((
void const*)0,
int(0));
86 assert( size ==
sizeof(T) );
88 ad->
set( *(T*)(blob) );
For each transportable type T, specify the conversion functions.
virtual void set(param_t t)=0
Set this DataSource with a value.
virtual unsigned int getSampleSize(base::DataSourceBase::shared_ptr ignored, void *cookie) const
Returns the size in bytes of a marshalled data element.
For each transportable type T, specify the conversion functions.
T UserType
The given T parameter is the type for reading DataSources.
virtual std::pair< void const *, int > fillBlob(base::DataSourceBase::shared_ptr source, void *blob, int size, void *cookie) const
Create an transportable object for a protocol which contains the value of source. ...
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
Use this type to store a pointer to an AssignableDataSource.
static AssignableDataSource< T > * narrow(base::DataSourceBase *db)
This method narrows a base::DataSourceBase to a typeded AssignableDataSource, possibly returning a ne...
BOOST_STATIC_ASSERT(!boost::has_virtual_destructor< T >::value)
We don't support types with virtual functions ! TODO: use this type trait to make the necessary adjus...
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 updateFromBlob(const void *blob, int size, base::DataSourceBase::shared_ptr target, void *cookie) const
Update target with the contents of blob which is an object of a protocol.