$search
#include <TypeMarshaller.hpp>
Public Member Functions | |
virtual void * | createCookie () const |
virtual void | deleteCookie (void *cookie) const |
virtual std::pair< void const *, int > | fillBlob (base::DataSourceBase::shared_ptr source, void *blob, int size, void *cookie=0) const =0 |
virtual unsigned int | getSampleSize (base::DataSourceBase::shared_ptr sample, void *cookie=0) const =0 |
virtual bool | updateFromBlob (const void *blob, int size, base::DataSourceBase::shared_ptr target, void *cookie=0) const =0 |
Objects implementing this interface have the capability to convert data sources to and from a binary representation.
Definition at line 61 of file TypeMarshaller.hpp.
virtual void* RTT::types::TypeMarshaller::createCookie | ( | ) | const [inline, virtual] |
Overload in subclasses for marshallers that need to allocate some internal data. The protocol will call deleteCookie(void*) accordingly
Definition at line 68 of file TypeMarshaller.hpp.
virtual void RTT::types::TypeMarshaller::deleteCookie | ( | void * | cookie | ) | const [inline, virtual] |
Called to delete a cookie created with createCookie
Definition at line 70 of file TypeMarshaller.hpp.
virtual std::pair<void const*,int> RTT::types::TypeMarshaller::fillBlob | ( | base::DataSourceBase::shared_ptr | source, | |
void * | blob, | |||
int | size, | |||
void * | cookie = 0 | |||
) | const [pure virtual] |
Create an transportable object for a protocol which contains the value of source. This must be a real-time function which does not allocate memory
source | The data to be read | |
blob | Suggested target memory area to write to. In case the type marshaller does not need this, it will return an alternative as a first element in the returned std::pair. | |
size | The size of the memory area pointed by blob |
size
Implemented in RTT::mqueue::MQSerializationProtocol< T >, and RTT::mqueue::MQTemplateProtocol< T >.
virtual unsigned int RTT::types::TypeMarshaller::getSampleSize | ( | base::DataSourceBase::shared_ptr | sample, | |
void * | cookie = 0 | |||
) | const [pure virtual] |
Returns the size in bytes of a marshalled data element.
Implemented in RTT::mqueue::MQSerializationProtocol< T >, and RTT::mqueue::MQTemplateProtocol< T >.
virtual bool RTT::types::TypeMarshaller::updateFromBlob | ( | const void * | blob, | |
int | size, | |||
base::DataSourceBase::shared_ptr | target, | |||
void * | cookie = 0 | |||
) | const [pure virtual] |
Update target with the contents of blob which is an object of a protocol. The given data source is guaranteed to be an AssignableDataSource
Implemented in RTT::mqueue::MQSerializationProtocol< T >, and RTT::mqueue::MQTemplateProtocol< T >.