tobicore  7.0.0
 All Classes Functions Variables Typedefs Enumerator Friends Groups Pages
IDSerializer Class Reference

TOBI iD serializer interface. More...

#include <tobiid/IDSerializer.hpp>

+ Inheritance diagram for IDSerializer:
+ Collaboration diagram for IDSerializer:

Public Member Functions

 IDSerializer (void)
 Constructor.
 IDSerializer (IDMessage *const message)
 Constructor.
virtual ~IDSerializer (void)
 Destructor.
IDSerializerSetMessage (IDMessage *const message)
 Sets the associated IDMessage.
virtual std::string * Serialize (std::string *buffer)=0
 Serializes to std::string.
virtual std::string * Deserialize (std::string *const buffer)=0
 Deserializes from std::string.
virtual std::string SerializeCp (void)
 Serializes to std::string.
virtual void DeserializeCp (const std::string &buffer)
 Deserializes from std::string.
virtual char * SerializeCh (char *buffer, const unsigned int bsize)
 Serializes to a char array.
virtual const char * DeserializeCh (const char *buffer, const unsigned int bsize)
 Deserializes from a char array.

Public Attributes

IDMessagemessage
 Pointer to the associated IDMessage.

Detailed Description

TOBI iD serializer interface.

An IDMessage object embeds a simple data structure with very few fields (specially if compared to the ICMessage recursive data structure). In order to transmit an IDMessage from one process to another, it is then necessary to serialize its data structure to a format that might be transferred, for examples, trough a socket.

The IDSerializer interface can then be derived to implement different flavors of serialization formats. Ad today only XML is supported by the concrete IDSerializerRapid class.

Definition at line 38 of file IDSerializer.hpp.

Constructor & Destructor Documentation

IDSerializer::IDSerializer ( IDMessage *const  message)

Constructor.

  • message Pointer to the IDMessage to serialize/deserialize

Definition at line 30 of file IDSerializer.cpp.

Member Function Documentation

virtual std::string* IDSerializer::Deserialize ( std::string *const  buffer)
pure virtual

Deserializes from std::string.

  • buffer Pointer to the std::string that contains the result of a serialization and that will be used for the deserialization
    Returns
    A pointer to the buffer instance

Implemented in IDSerializerRapid.

+ Here is the caller graph for this function:

const char * IDSerializer::DeserializeCh ( const char *  buffer,
const unsigned int  bsize 
)
virtual

Deserializes from a char array.

  • buffer Pointer to a char array that contains a serialized IDMessage and that will be used for deserialization
  • bsize Size of the char array

Definition at line 68 of file IDSerializer.cpp.

+ Here is the call graph for this function:

void IDSerializer::DeserializeCp ( const std::string &  buffer)
virtual

Deserializes from std::string.

  • buffer std::string that contains the result of a serialization and that will be used for the deserialization

Definition at line 49 of file IDSerializer.cpp.

+ Here is the call graph for this function:

virtual std::string* IDSerializer::Serialize ( std::string *  buffer)
pure virtual

Serializes to std::string.

  • buffer Pointer to the std::string that will contain the result of the serialization
    Returns
    Pointer to the buffer instance

Implemented in IDSerializerRapid.

+ Here is the caller graph for this function:

char * IDSerializer::SerializeCh ( char *  buffer,
const unsigned int  bsize 
)
virtual

Serializes to a char array.

  • buffer Pointer to a char array that will contain the result of the serialization
  • bsize Size of the char array

Definition at line 54 of file IDSerializer.cpp.

+ Here is the call graph for this function:

std::string IDSerializer::SerializeCp ( void  )
virtual

Serializes to std::string.

Returns
std::string that contains the result of the serialization

Definition at line 43 of file IDSerializer.cpp.

+ Here is the call graph for this function:

IDSerializer * IDSerializer::SetMessage ( IDMessage *const  message)

Sets the associated IDMessage.

  • IDMessage to serialize/deserialize
    Returns
    Pointer to the serializer instance

Definition at line 38 of file IDSerializer.cpp.

Member Data Documentation

IDMessage* IDSerializer::message

Pointer to the associated IDMessage.

Each IDSerializer has an associated IDMessage. Once an IDMessage is associated, its content can be serialized. It is also possible to deserialize a string into the associated IDMessage.

Definition at line 113 of file IDSerializer.hpp.


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