RSB  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::converter::ProtocolBufferConverter< ProtocolBuffer > Class Template Reference

A generic converter for data types based on Protocol Buffer messages. More...

#include <ProtocolBufferConverter.h>

Inheritance diagram for rsb::converter::ProtocolBufferConverter< ProtocolBuffer >:
Inheritance graph
Collaboration diagram for rsb::converter::ProtocolBufferConverter< ProtocolBuffer >:
Collaboration graph

Public Member Functions

 ProtocolBufferConverter ()
 
virtual ~ProtocolBufferConverter ()
 
std::string serialize (const AnnotatedData &data, std::string &wire)
 Serialized the given domain object to the wire. More...
 
AnnotatedData deserialize (const std::string &wireType, const std::string &wire)
 Deserializes a domain object from a wire type. More...
 
- 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. More...
 
virtual std::string getWireSchema () const
 Returns the name of the wire schema this converter can (de)serialize from/to. More...
 

Private Member Functions

std::string typeNameToProtoName (const std::string &type_name)
 
std::string typeNameToWireSchema (const std::string &type_name)
 

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

Detailed Description

template<typename ProtocolBuffer>
class rsb::converter::ProtocolBufferConverter< ProtocolBuffer >

A generic converter for data types based on Protocol Buffer messages.

Author
jmoringe
Template Parameters
ProtocolBuffertype of the protobuf message to be converted

Definition at line 48 of file ProtocolBufferConverter.h.

Constructor & Destructor Documentation

template<typename ProtocolBuffer >
rsb::converter::ProtocolBufferConverter< ProtocolBuffer >::ProtocolBufferConverter ( )

Definition at line 98 of file ProtocolBufferConverter.h.

template<typename ProtocolBuffer >
rsb::converter::ProtocolBufferConverter< ProtocolBuffer >::~ProtocolBufferConverter ( )
virtual

Definition at line 105 of file ProtocolBufferConverter.h.

Member Function Documentation

template<typename ProtocolBuffer >
AnnotatedData rsb::converter::ProtocolBufferConverter< ProtocolBuffer >::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 120 of file ProtocolBufferConverter.h.

template<typename ProtocolBuffer >
std::string rsb::converter::ProtocolBufferConverter< ProtocolBuffer >::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 109 of file ProtocolBufferConverter.h.

template<typename ProtocolBuffer >
std::string rsb::converter::ProtocolBufferConverter< ProtocolBuffer >::typeNameToProtoName ( const std::string &  type_name)
inlineprivate

Definition at line 62 of file ProtocolBufferConverter.h.

Referenced by rsb::converter::ProtocolBufferConverter< ProtocolBuffer >::typeNameToWireSchema().

Here is the caller graph for this function:

template<typename ProtocolBuffer >
std::string rsb::converter::ProtocolBufferConverter< ProtocolBuffer >::typeNameToWireSchema ( const std::string &  type_name)
inlineprivate

Definition at line 89 of file ProtocolBufferConverter.h.

References rsb::converter::ProtocolBufferConverter< ProtocolBuffer >::typeNameToProtoName().

Here is the call graph for this function:


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