orogen_transports::TypelibMarshallerBase Class Reference

#include <TypelibMarshallerBase.hpp>

Inheritance diagram for orogen_transports::TypelibMarshallerBase:
Inheritance graph
[legend]

List of all members.

Classes

struct  Handle

Public Member Functions

HandlecreateHandle ()
virtual HandlecreateSample ()=0
virtual
RTT::base::ChannelElementBase::shared_ptr 
createStream (RTT::base::PortInterface *port, const RTT::ConnPolicy &policy, bool is_sender) const
void deleteHandle (Handle *data)
virtual void deleteOrocosSample (Handle *data)=0
virtual void deleteTypelibSample (Handle *data)=0
virtual
RTT::base::DataSourceBase::shared_ptr 
getDataSource (Handle *handle)=0
size_t getMarshallingSize (Handle const *sample) const
char const * getMarshallingType () const
uint8_t * getTypelibSample (Handle *sample)
bool isPlainTypelibType () const
int marshal (void *buffer, int buffer_size, Handle *sample)
void marshal (std::vector< uint8_t > &buffer, Handle *sample)
void marshal (std::ostream &stream, Handle *sample)
void marshal (int fd, Handle *sample)
virtual bool readDataSource (RTT::base::DataSourceBase &source, Handle *handle)=0
virtual void refreshOrocosSample (Handle *data)=0
virtual void refreshTypelibSample (Handle *handle)=0
virtual uint8_t * releaseOrocosSample (Handle *sample)=0
virtual void setOrocosSample (Handle *data, void *sample, bool refresh_typelib=true)=0
virtual void setTypelibSample (Handle *data, uint8_t *typelib_data, bool refresh_orocos=true)=0
void setTypelibSample (Handle *data, Typelib::Value typelib_data, bool refresh_orocos=true)
 TypelibMarshallerBase (bool plain_type, std::string const &typelib_typename, std::string const &orocos_typename, Typelib::Registry const &registry)
virtual void unmarshal (void const *buffer, int buffer_size, Handle *sample)
virtual void unmarshal (std::vector< uint8_t > &buffer, Handle *sample)
virtual void writeDataSource (RTT::base::DataSourceBase &source, Handle const *handle)=0

Private Attributes

Typelib::MemoryLayout layout
bool m_plain
std::string m_typename_orocos
std::string m_typename_typelib
Typelib::Type const * type_def

Detailed Description

Definition at line 13 of file TypelibMarshallerBase.hpp.


Constructor & Destructor Documentation

TypelibMarshallerBase::TypelibMarshallerBase ( bool  plain_type,
std::string const &  typelib_typename,
std::string const &  orocos_typename,
Typelib::Registry const &  registry 
)

Definition at line 10 of file TypelibMarshallerBase.cpp.


Member Function Documentation

Handle * TypelibMarshallerBase::createHandle (  ) 

Creates a sample handler, which is an opaque type used to read/write/marshal data. Unlike createSample(), the handle returned by this method does not contain any preallocated data sample. Using it in readPort will cause memory allocation.

Definition at line 28 of file TypelibMarshallerBase.cpp.

virtual Handle* orogen_transports::TypelibMarshallerBase::createSample (  )  [pure virtual]

Creates a sample handler, which is an opaque type used to read/write/marshal data. Unlike createHandle(), the handle returned by this method already contains a preallocated data sample. It can therefore be used as-is for readPort.

Implemented in orogen_transports::OpaqueTypelibMarshaller< TypelibType, OpaqueType, 0 >, orogen_transports::OpaqueTypelibMarshaller< TypelibType, OpaqueType, 1 >, and orogen_transports::TypelibMarshaller< T >.

virtual RTT::base::ChannelElementBase::shared_ptr orogen_transports::TypelibMarshallerBase::createStream ( RTT::base::PortInterface *  port,
const RTT::ConnPolicy &  policy,
bool  is_sender 
) const [inline, virtual]

Definition at line 161 of file TypelibMarshallerBase.hpp.

void TypelibMarshallerBase::deleteHandle ( Handle data  ) 

Destroys the sample handle and the data it owns.

What is actually deleted depends on how the handle has been used. For instance, if setTypelibSample has been used, then the sample will not be deleted.

Definition at line 29 of file TypelibMarshallerBase.cpp.

virtual void orogen_transports::TypelibMarshallerBase::deleteOrocosSample ( Handle data  )  [pure virtual]

Destroys the orocos-related data sample that is stored in data.

For non-opaque types, this is the same than destroyOrocosSample and destroyData. It is different only for opaque types.

Implemented in orogen_transports::OpaqueTypelibMarshallerBase< TypelibType, OpaqueType >, and orogen_transports::TypelibMarshaller< T >.

virtual void orogen_transports::TypelibMarshallerBase::deleteTypelibSample ( Handle data  )  [pure virtual]

Destroys the typelib-related data sample that is stored in data.

For non-opaque types, this is the same than destroyTypelibSample and destroyData. It is different only for opaque types.

Implemented in orogen_transports::OpaqueTypelibMarshallerBase< TypelibType, OpaqueType >, and orogen_transports::TypelibMarshaller< T >.

virtual RTT::base::DataSourceBase::shared_ptr orogen_transports::TypelibMarshallerBase::getDataSource ( Handle handle  )  [pure virtual]

Returns a data source that can be used to modify the Orocos sample stored in this handle

Implemented in orogen_transports::OpaqueTypelibMarshallerBase< TypelibType, OpaqueType >, and orogen_transports::TypelibMarshaller< T >.

size_t TypelibMarshallerBase::getMarshallingSize ( Handle const *  sample  )  const

Returns the marshalled size for the given data sample

Definition at line 36 of file TypelibMarshallerBase.cpp.

char const * TypelibMarshallerBase::getMarshallingType (  )  const

Returns the Typelib-friendly type name for this marshaller. I.e. the type name for the pointer returned by getTypelibData.

I.e. if the type is opaque, it is the name of the intermediate type. Otherwise, it is the type name itself.

Definition at line 34 of file TypelibMarshallerBase.cpp.

uint8_t * TypelibMarshallerBase::getTypelibSample ( Handle sample  ) 

Returns a type-pruned pointer to an object that Typelib understands. This object is of the type returned by getMarshallingType

Definition at line 30 of file TypelibMarshallerBase.cpp.

bool TypelibMarshallerBase::isPlainTypelibType (  )  const

Returns true if the underlying orocos type can be manipulated by typelib directly and false otherwise

Definition at line 25 of file TypelibMarshallerBase.cpp.

int TypelibMarshallerBase::marshal ( void *  buffer,
int  buffer_size,
Handle sample 
)

Marshals the given sample into a memory buffer

Definition at line 44 of file TypelibMarshallerBase.cpp.

void TypelibMarshallerBase::marshal ( std::vector< uint8_t > &  buffer,
Handle sample 
)

Marshals the given sample into a memory buffer

Definition at line 42 of file TypelibMarshallerBase.cpp.

void TypelibMarshallerBase::marshal ( std::ostream &  stream,
Handle sample 
)

Marshals the given sample directly on to a C++ stream

Definition at line 40 of file TypelibMarshallerBase.cpp.

void TypelibMarshallerBase::marshal ( int  fd,
Handle sample 
)

Marshals the given sample directly on to a file

Definition at line 38 of file TypelibMarshallerBase.cpp.

virtual bool orogen_transports::TypelibMarshallerBase::readDataSource ( RTT::base::DataSourceBase &  source,
Handle handle 
) [pure virtual]
virtual void orogen_transports::TypelibMarshallerBase::refreshOrocosSample ( Handle data  )  [pure virtual]
virtual void orogen_transports::TypelibMarshallerBase::refreshTypelibSample ( Handle handle  )  [pure virtual]
virtual uint8_t* orogen_transports::TypelibMarshallerBase::releaseOrocosSample ( Handle sample  )  [pure virtual]

Returns a type-pruned pointer to the C++ object, and passes ownership along

Implemented in orogen_transports::OpaqueTypelibMarshallerBase< TypelibType, OpaqueType >, and orogen_transports::TypelibMarshaller< T >.

virtual void orogen_transports::TypelibMarshallerBase::setOrocosSample ( Handle data,
void *  sample,
bool  refresh_typelib = true 
) [pure virtual]

Updates the sample handler by using a data sample that Typelib understands. +typelib_data+ must be pointing to an object whose type is the one returned by getMarshallingType.

The handle will then point directly to the given data sample, i.e. calls to read might modify that sample directly.

The ownership of typelib_data is retained by the caller. I.e. it has to delete it.

Implemented in orogen_transports::OpaqueTypelibMarshallerBase< TypelibType, OpaqueType >, and orogen_transports::TypelibMarshaller< T >.

virtual void orogen_transports::TypelibMarshallerBase::setTypelibSample ( Handle data,
uint8_t *  typelib_data,
bool  refresh_orocos = true 
) [pure virtual]

Updates the sample handler by using a data sample that Typelib understands. +typelib_data+ must be pointing to an object whose type is the one returned by getMarshallingType.

The handle will then point directly to the given data sample, i.e. calls to read might modify that sample directly.

The ownership of typelib_data is retained by the caller. I.e. it has to delete it.

Implemented in orogen_transports::OpaqueTypelibMarshaller< TypelibType, OpaqueType, 0 >, orogen_transports::OpaqueTypelibMarshaller< TypelibType, OpaqueType, 1 >, and orogen_transports::TypelibMarshaller< T >.

void TypelibMarshallerBase::setTypelibSample ( Handle data,
Typelib::Value  typelib_data,
bool  refresh_orocos = true 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 56 of file TypelibMarshallerBase.cpp.

void TypelibMarshallerBase::unmarshal ( void const *  buffer,
int  buffer_size,
Handle sample 
) [virtual]

Update the sample in +sample+ from the marshalled data in +buffer+

Reimplemented in orogen_transports::OpaqueTypelibMarshallerBase< TypelibType, OpaqueType >.

Definition at line 46 of file TypelibMarshallerBase.cpp.

void TypelibMarshallerBase::unmarshal ( std::vector< uint8_t > &  buffer,
Handle sample 
) [virtual]

Update the sample in +sample+ from the marshalled data in +buffer+

Reimplemented in orogen_transports::OpaqueTypelibMarshallerBase< TypelibType, OpaqueType >.

Definition at line 51 of file TypelibMarshallerBase.cpp.

virtual void orogen_transports::TypelibMarshallerBase::writeDataSource ( RTT::base::DataSourceBase &  source,
Handle const *  handle 
) [pure virtual]

Writes the data from from the handle into the data source

Implemented in orogen_transports::OpaqueTypelibMarshallerBase< TypelibType, OpaqueType >, and orogen_transports::TypelibMarshaller< T >.


Member Data Documentation

Typelib::MemoryLayout orogen_transports::TypelibMarshallerBase::layout [private]

Definition at line 17 of file TypelibMarshallerBase.hpp.

Definition at line 15 of file TypelibMarshallerBase.hpp.

Definition at line 19 of file TypelibMarshallerBase.hpp.

Definition at line 18 of file TypelibMarshallerBase.hpp.

Definition at line 16 of file TypelibMarshallerBase.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs


rtt_typelib
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Fri Jan 11 10:07:20 2013