Classes | Public Member Functions | Private Attributes
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 * getOrocosSample (Handle *sample)
Typelib::Registry const & getRegistry () const
uint8_t * getTypelibSample (Handle *sample)
bool isPlainTypelibType () const
void marshal (int fd, Handle *sample)
void marshal (std::ostream &stream, Handle *sample)
void marshal (std::vector< uint8_t > &buffer, Handle *sample)
int marshal (void *buffer, int buffer_size, 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
void setTypelibSample (Handle *data, Typelib::Value typelib_data, bool refresh_orocos=true)
virtual void setTypelibSample (Handle *data, uint8_t *typelib_data, bool refresh_orocos=true)=0
 TypelibMarshallerBase (bool plain_type, std::string const &typelib_typename, std::string const &orocos_typename, Typelib::Registry const &registry)
virtual void unmarshal (std::vector< uint8_t > &buffer, Handle *sample)
virtual void unmarshal (void const *buffer, int buffer_size, 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::Registry const * registry
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

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 32 of file TypelibMarshallerBase.cpp.

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, 1 >, orogen_transports::OpaqueTypelibMarshaller< TypelibType, OpaqueType, 0 >, and orogen_transports::TypelibMarshaller< T >.

Implements RTT::types::TypeTransporter.

Definition at line 181 of file TypelibMarshallerBase.hpp.

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 33 of file TypelibMarshallerBase.cpp.

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 >.

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 >.

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

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

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

Returns the marshalled size for the given data sample

Definition at line 44 of file TypelibMarshallerBase.cpp.

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 42 of file TypelibMarshallerBase.cpp.

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

If this handle has ownership of the sample, it is kept (i.e. not passed along). Note that the sample would need to have been either explicitly set or explicitly refreshed for this value to be non-NULL.

Definition at line 38 of file TypelibMarshallerBase.cpp.

Returns the typelib registry that defines this type

Definition at line 26 of file TypelibMarshallerBase.cpp.

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

If this handle has ownership of the sample, it is kept (i.e. not passed along). Note that the sample would need to have been either explicitly set or explicitly refreshed for this value to be non-NULL.

Definition at line 34 of file TypelibMarshallerBase.cpp.

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

Definition at line 29 of file TypelibMarshallerBase.cpp.

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

Marshals the given sample directly on to a file

Definition at line 46 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 48 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 50 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 52 of file TypelibMarshallerBase.cpp.

virtual bool orogen_transports::TypelibMarshallerBase::readDataSource ( RTT::base::DataSourceBase source,
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::TypelibMarshaller< T >, and orogen_transports::OpaqueTypelibMarshallerBase< TypelibType, OpaqueType >.

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 >.

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 64 of file TypelibMarshallerBase.cpp.

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, 1 >, orogen_transports::OpaqueTypelibMarshaller< TypelibType, OpaqueType, 0 >, and orogen_transports::TypelibMarshaller< T >.

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 59 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 54 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

Definition at line 18 of file TypelibMarshallerBase.hpp.

Definition at line 15 of file TypelibMarshallerBase.hpp.

Definition at line 20 of file TypelibMarshallerBase.hpp.

Definition at line 19 of file TypelibMarshallerBase.hpp.

Definition at line 16 of file TypelibMarshallerBase.hpp.

Definition at line 17 of file TypelibMarshallerBase.hpp.


The documentation for this class was generated from the following files:


rtt_typelib
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Sat Jun 8 2019 18:49:39