RSB  0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::converter::ByteArrayConverter Class Reference

"Converts" arbitrary payloads into a std::string which should be interpreted as an array of bytes. More...

#include <ByteArrayConverter.h>

Inheritance diagram for rsb::converter::ByteArrayConverter:
Inheritance graph
Collaboration diagram for rsb::converter::ByteArrayConverter:
Collaboration graph

Public Member Functions

 ByteArrayConverter ()
virtual ~ByteArrayConverter ()
std::string serialize (const AnnotatedData &data, std::string &wire)
 Serialized the given domain object to the wire.
AnnotatedData deserialize (const std::string &wireSchema, const std::string &wire)
 Deserializes a domain object from a wire type.
- Public Member Functions inherited from rsb::converter::Converter< std::string >
virtual ~Converter ()
virtual std::string getDataType () const
 Returns the name of the data type this converter is applicable for.
virtual std::string getWireSchema () const
 Returns the name of the wire schema this converter can (de)serialize from/to.

Static Private Attributes

static const std::string WIRE_SCHEMA = ".*"

Additional Inherited Members

- Public Types inherited from rsb::converter::Converter< std::string >
typedef boost::shared_ptr
< Converter< std::string > > 
Ptr
- Protected Member Functions inherited from rsb::converter::Converter< std::string >
 Converter (const std::string &dataType, const std::string &wireSchema, bool dummy=true)
 Creates a new instance of this class with automatic handling for types.
 Converter (const std::string &wireSchema, const DataType *=0)
 Creates a new instance of this class with a data type string that is inferred based on the template parameter DataType.

Detailed Description

"Converts" arbitrary payloads into a std::string which should be interpreted as an array of bytes.

Author
jmoringe

Definition at line 45 of file ByteArrayConverter.h.

Constructor & Destructor Documentation

rsb::converter::ByteArrayConverter::ByteArrayConverter ( )

Definition at line 38 of file ByteArrayConverter.cpp.

rsb::converter::ByteArrayConverter::~ByteArrayConverter ( )
virtual

Definition at line 42 of file ByteArrayConverter.cpp.

Member Function Documentation

AnnotatedData rsb::converter::ByteArrayConverter::deserialize ( const std::string &  wireSchema,
const std::string &  wire 
)
virtual

Deserializes a domain object from a wire type.

Parameters
wireSchematype of the wire message
wirethe wire containing the data
Returns
the deserialized domain object annotated with its data type name
Exceptions
SerializationExceptionif deserializing the message fails

Implements rsb::converter::Converter< std::string >.

Definition at line 49 of file ByteArrayConverter.cpp.

References rsb::converter::Converter< std::string >::getDataType().

Here is the call graph for this function:

string rsb::converter::ByteArrayConverter::serialize ( const AnnotatedData data,
std::string &  wire 
)
virtual

Serialized the given domain object to the wire.

Parameters
datadata to serialize
wirethe wire to serialize on
Returns
the wire schema the data is encoded with
Exceptions
SerializationExceptionif the serialization failed

Implements rsb::converter::Converter< std::string >.

Definition at line 45 of file ByteArrayConverter.cpp.

Member Data Documentation

const string rsb::converter::ByteArrayConverter::WIRE_SCHEMA = ".*"
staticprivate

Definition at line 56 of file ByteArrayConverter.h.


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