RSB
0.7.0
|
#include <Converter.h>
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. | |
virtual AnnotatedData | deserialize (const std::string &wireSchema, const WireType &wire)=0 |
Deserializes a domain object from a wire type. | |
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. |
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. | |
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. |
Private Member Functions | |
std::string | getClassName () const |
void | printContents (std::ostream &stream) const |
Private Attributes | |
std::string | dataType |
std::string | wireSchema |
WireType | is the serialization format, uchar, string, binary, ... |
Definition at line 53 of file Converter.h.
typedef boost::shared_ptr<Converter<WireType> > rsb::converter::Converter< WireType >::Ptr |
Definition at line 101 of file Converter.h.
|
inlinevirtual |
Definition at line 56 of file Converter.h.
|
inlineprotected |
Creates a new instance of this class with automatic handling for types.
dataType | data type this converter can serialize |
wireSchema | wire schema this converter can deserialize |
dummy | This parameter is used to disambiguate constructor signatures when WireType is std::string . |
Definition at line 113 of file Converter.h.
|
inlineprotected |
Creates a new instance of this class with a data type string that is inferred based on the template parameter DataType.
DataType | type of the objects that the converter (de)serializes. Use the RSB_TYPE_TAG macro with this. |
wireSchema | wire schema from/to this converter can (de)serialize. |
Definition at line 129 of file Converter.h.
|
pure virtual |
Deserializes a domain object from a wire type.
wireSchema | type of the wire message |
wire | the wire containing the data |
SerializationException | if deserializing the message fails |
Implemented in rsb::converter::EventsByScopeMapConverter, rsb::converter::ProtocolBufferConverter< ProtocolBuffer >, rsb::converter::EventIdConverter, rsb::converter::RosettaConverter< Mechanism, Type >, rsb::converter::ByteArrayConverter, rsb::converter::BoolConverter, rsb::converter::SchemaAndByteArrayConverter, rsb::converter::StringConverter, rsb::converter::Uint32Converter, rsb::converter::Uint64Converter, and rsb::converter::VoidConverter.
Referenced by rsb::converter::EventIdConverter::deserialize().
|
inlineprivate |
Reimplemented in rsb::converter::EventsByScopeMapConverter, and rsb::converter::EventIdConverter.
Definition at line 138 of file Converter.h.
|
inlinevirtual |
Returns the name of the data type this converter is applicable for.
Definition at line 86 of file Converter.h.
|
inlinevirtual |
Returns the name of the wire schema this converter can (de)serialize from/to.
Reimplemented in rsb::converter::EventsByScopeMapConverter, and rsb::converter::EventIdConverter.
Definition at line 97 of file Converter.h.
Referenced by rsb::converter::EventIdConverter::getWireSchema(), and rsb::converter::EventsByScopeMapConverter::getWireSchema().
|
inlineprivate |
Definition at line 142 of file Converter.h.
|
pure virtual |
Serialized the given domain object to the wire.
data | data to serialize |
wire | the wire to serialize on |
SerializationException | if the serialization failed |
Implemented in rsb::converter::EventsByScopeMapConverter, rsb::converter::ProtocolBufferConverter< ProtocolBuffer >, rsb::converter::EventIdConverter, rsb::converter::RosettaConverter< Mechanism, Type >, rsb::converter::ByteArrayConverter, rsb::converter::BoolConverter, rsb::converter::SchemaAndByteArrayConverter, rsb::converter::StringConverter, rsb::converter::Uint32Converter, rsb::converter::Uint64Converter, and rsb::converter::VoidConverter.
Referenced by rsb::converter::EventIdConverter::serialize(), and rsb::converter::EventsByScopeMapConverter::serialize().
|
private |
Definition at line 135 of file Converter.h.
Referenced by rsb::converter::Converter< std::string >::getDataType(), and rsb::converter::Converter< std::string >::printContents().
|
private |
Definition at line 136 of file Converter.h.
Referenced by rsb::converter::Converter< std::string >::getWireSchema(), and rsb::converter::Converter< std::string >::printContents().