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

TOBI iC serializer interface. More...

#include <tobiic/ICSerializer.hpp>

+ Inheritance diagram for ICSerializer:
+ Collaboration diagram for ICSerializer:

Public Member Functions

 ICSerializer (void)
 Constructor.
 ICSerializer (ICMessage *const message)
 Constructor.
virtual ~ICSerializer (void)
 Destructor.
ICSerializerSetMessage (ICMessage *const message)
 Sets the associated ICMessage.
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

ICMessagemessage
 Pointer to the associated ICMessage.

Detailed Description

TOBI iC serializer interface.

An ICMessage object embeds a complex and recursive data structure. In order to transmit an ICMessage 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 ICSerializer interface can then be derived to implement different flavors of serialization formats. Ad today only XML is supported by the concrete ICSerializerRapid class.

Definition at line 37 of file ICSerializer.hpp.

Constructor & Destructor Documentation

ICSerializer::ICSerializer ( ICMessage *const  message)

Constructor.

  • message Pointer to the ICMessage to serialize/deserialize

Definition at line 30 of file ICSerializer.cpp.

Member Function Documentation

virtual std::string* ICSerializer::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 ICSerializerRapid.

+ Here is the caller graph for this function:

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

Deserializes from a char array.

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

Definition at line 68 of file ICSerializer.cpp.

void ICSerializer::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 ICSerializer.cpp.

virtual std::string* ICSerializer::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 ICSerializerRapid.

+ Here is the caller graph for this function:

char * ICSerializer::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
Examples:
icserializerrapid.cpp.

Definition at line 54 of file ICSerializer.cpp.

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

Serializes to std::string.

Returns
std::string that contains the result of the serialization
Examples:
icserializerrapid.cpp.

Definition at line 43 of file ICSerializer.cpp.

ICSerializer * ICSerializer::SetMessage ( ICMessage *const  message)

Sets the associated ICMessage.

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

Definition at line 38 of file ICSerializer.cpp.

Member Data Documentation

ICMessage* ICSerializer::message

Pointer to the associated ICMessage.

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

Definition at line 112 of file ICSerializer.hpp.


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