RSB  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::converter::Converter< WireType > Class Template Referenceabstract

#include <Converter.h>

Inheritance diagram for rsb::converter::Converter< WireType >:
Inheritance graph
Collaboration diagram for rsb::converter::Converter< WireType >:
Collaboration graph

Public Types

typedef boost::shared_ptr
< Converter< WireType > > 
Ptr
 

Public Member Functions

virtual ~Converter ()
 
virtual std::string serialize (const AnnotatedData &data, WireType &wire)=0
 Serialized the given domain object to the wire. More...
 
virtual AnnotatedData deserialize (const std::string &wireSchema, const WireType &wire)=0
 Deserializes a domain object from a wire type. More...
 
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...
 

Protected Member Functions

 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...
 
template<typename DataType >
 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...
 

Private Member Functions

std::string getClassName () const
 
void printContents (std::ostream &stream) const
 

Private Attributes

std::string dataType
 
std::string wireSchema
 

Detailed Description

template<class WireType>
class rsb::converter::Converter< WireType >

Author
swrede
jwienke
Template Parameters
WireTypeis the serialization format, uchar, string, binary, ...

Definition at line 53 of file Converter.h.

Member Typedef Documentation

template<class WireType>
typedef boost::shared_ptr<Converter<WireType> > rsb::converter::Converter< WireType >::Ptr

Definition at line 101 of file Converter.h.

Constructor & Destructor Documentation

template<class WireType>
virtual rsb::converter::Converter< WireType >::~Converter ( )
inlinevirtual

Definition at line 56 of file Converter.h.

template<class WireType>
rsb::converter::Converter< WireType >::Converter ( const std::string &  dataType,
const std::string &  wireSchema,
bool  dummy = true 
)
inlineprotected

Creates a new instance of this class with automatic handling for types.

Parameters
dataTypedata type this converter can serialize
wireSchemawire schema this converter can deserialize
dummyThis parameter is used to disambiguate constructor signatures when WireType is std::string .

Definition at line 113 of file Converter.h.

template<class WireType>
template<typename DataType >
rsb::converter::Converter< WireType >::Converter ( const std::string &  wireSchema,
const DataType *  = 0 
)
inlineprotected

Creates a new instance of this class with a data type string that is inferred based on the template parameter DataType.

Template Parameters
DataTypetype of the objects that the converter (de)serializes. Use the RSB_TYPE_TAG macro with this.
Parameters
wireSchemawire schema from/to this converter can (de)serialize.

Definition at line 129 of file Converter.h.

Member Function Documentation

template<class WireType>
virtual AnnotatedData rsb::converter::Converter< WireType >::deserialize ( const std::string &  wireSchema,
const WireType &  wire 
)
pure virtual
template<class WireType>
std::string rsb::converter::Converter< WireType >::getClassName ( ) const
inlineprivate

Definition at line 138 of file Converter.h.

template<class WireType>
virtual std::string rsb::converter::Converter< WireType >::getDataType ( ) const
inlinevirtual

Returns the name of the data type this converter is applicable for.

Returns
name of the data type this converter can be used for

Definition at line 86 of file Converter.h.

Referenced by rsb::converter::Converter< std::string >::printContents().

Here is the caller graph for this function:

template<class WireType>
virtual std::string rsb::converter::Converter< WireType >::getWireSchema ( ) const
inlinevirtual

Returns the name of the wire schema this converter can (de)serialize from/to.

Returns
name of the wire schema from/to this converter can (de)serialize

Reimplemented in rsb::converter::EventsByScopeMapConverter, and rsb::converter::EventIdConverter.

Definition at line 97 of file Converter.h.

Referenced by rsb::converter::EventIdConverter::getWireSchema(), rsb::converter::EventsByScopeMapConverter::getWireSchema(), and rsb::converter::Converter< std::string >::printContents().

Here is the caller graph for this function:

template<class WireType>
void rsb::converter::Converter< WireType >::printContents ( std::ostream &  stream) const
inlineprivate

Definition at line 142 of file Converter.h.

template<class WireType>
virtual std::string rsb::converter::Converter< WireType >::serialize ( const AnnotatedData data,
WireType &  wire 
)
pure virtual

Member Data Documentation

template<class WireType>
std::string rsb::converter::Converter< WireType >::dataType
private

Definition at line 135 of file Converter.h.

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

template<class WireType>
std::string rsb::converter::Converter< WireType >::wireSchema
private

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