A simple marshaller which flattens your property bag into simple types. More...
#include <rtt/marsh/SimpleMarshaller.hpp>
Public Member Functions | |
SimpleMarshaller (output_stream &os) | |
virtual void | flush () |
Flush all buffers, write footers. | |
virtual void | serialize (PropertyBase *p) |
Serialize a property. | |
virtual void | serialize (const PropertyBag &v) |
Serialize the contents of a property bag with headers and footers. | |
Protected Member Functions | |
template<class T > | |
void | introspect (Property< T > &v) |
Unknown types must decompose theirselves into the primitives. | |
void | introspect_T (PropertyBase *t) |
The default handler to execute when an unknown type is being decomposed. |
A simple marshaller which flattens your property bag into simple types.
The representation has the following structure:
typecode, name length, name, ':', value length, value, ';'
For example, to declare a string with contents "value":
Sktest:lvalue;
Except that the k and l would be replaced by byte values four and five.
The typecodes are:
The name length is a single byte and thus limits the length of names to 255 characters. (Zero means zero length.)
The name is an ASCII string representing the name of the property.
The value length is a single byte and thus limits the length of names to 255 characters. (Zero means zero length.)
Definition at line 83 of file SimpleMarshaller.hpp.
virtual void RTT::SimpleMarshaller< o_stream >::flush | ( | ) | [inline, virtual] |
Flush all buffers, write footers.
Instructs the Marshaller to flush any remaining buffered data and write a footer to indicate that serialization is done. A marshaller may choose to write nothing until this function is called, or print a summary, or anything else.
Implements RTT::Marshaller.
Definition at line 154 of file SimpleMarshaller.hpp.
void RTT::PropertyIntrospection::introspect | ( | Property< T > & | v | ) | [inline, inherited] |
Unknown types must decompose theirselves into the primitives.
Definition at line 49 of file PropertyIntrospection.inl.
References RTT::PropertyIntrospection::introspect_T().
virtual void RTT::SimpleMarshaller< o_stream >::serialize | ( | const PropertyBag & | v | ) | [inline, virtual] |
Serialize the contents of a property bag with headers and footers.
Use this method on your 'root' PropertyBag, such that headers and footers are written.
v | The property bag to be serialized. |
Implements RTT::Marshaller.
Definition at line 162 of file SimpleMarshaller.hpp.
References RTT::PropertyBag::identify().
virtual void RTT::SimpleMarshaller< o_stream >::serialize | ( | PropertyBase * | v | ) | [inline, virtual] |
Serialize a property.
v | The property to be serialized. |
Implements RTT::Marshaller.
Definition at line 157 of file SimpleMarshaller.hpp.
References RTT::PropertyBase::identify().