Main MRPT website > C++ reference
MRPT logo
Classes | Namespaces | Macros
CSerializable.h File Reference
#include <mrpt/utils/CObject.h>
#include <mrpt/utils/CStream.h>
#include <mrpt/utils/safe_pointers.h>
#include <mrpt/utils/TTypeName.h>
Include dependency graph for CSerializable.h:

Go to the source code of this file.

Classes

struct  mrpt::utils::CSerializablePtr
 
class  mrpt::utils::CSerializable
 The virtual base class which provides a unified interface for all persistent objects in MRPT. More...
 

Namespaces

 mrpt
 This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
 
 mrpt::utils
 Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
 

Macros

#define DEFINE_SERIALIZABLE_CUSTOM_LINKAGE(class_name, _VOID_LINKAGE_, _STATIC_LINKAGE_, _VIRTUAL_LINKAGE_)
 Like DEFINE_SERIALIZABLE, but for template classes that need the DLL imp/exp keyword in Windows. More...
 
#define DEFINE_SERIALIZABLE(class_name)   DEFINE_SERIALIZABLE_CUSTOM_LINKAGE(class_name, void /*no extra linkage keyword*/, static /*none*/,virtual /*none*/ )
 This declaration must be inserted in all CSerializable classes definition, within the class declaration. More...
 
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_LINKAGE(class_name, _LINKAGE_)
 This declaration must be inserted in all CSerializable classes definition, before the class declaration. More...
 
#define DEFINE_SERIALIZABLE_PRE(class_name)
 This declaration must be inserted in all CSerializable classes definition, before the class declaration. More...
 
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
 This declaration must be inserted in all CSerializable classes definition, before the class declaration. More...
 
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE(class_name, base_name)
 This declaration must be inserted in all CSerializable classes definition, before the class declaration. More...
 
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
 This must be inserted in all CSerializable classes implementation files: More...
 
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)   DEFINE_VIRTUAL_MRPT_OBJECT(class_name)
 This declaration must be inserted in virtual CSerializable classes definition: More...
 
#define IMPLEMENTS_VIRTUAL_SERIALIZABLE(class_name, base_class_name, NameSpace)
 This must be inserted as implementation of some required members for virtual CSerializable classes: More...
 

Functions

Non-streaming serialization functions
std::string BASE_IMPEXP mrpt::utils::ObjectToString (const CSerializable *o)
 Used to pass MRPT objects into a CORBA-like object (strings). More...
 
void BASE_IMPEXP mrpt::utils::StringToObject (const std::string &str, CSerializablePtr &obj)
 Used to pass CORBA-like objects (strings) into a MRPT object. More...
 
void BASE_IMPEXP mrpt::utils::ObjectToOctetVector (const CSerializable *o, vector_byte &out_vector)
 Converts (serializes) an MRPT object into an array of bytes. More...
 
void BASE_IMPEXP mrpt::utils::OctetVectorToObject (const vector_byte &in_data, CSerializablePtr &obj)
 Converts back (de-serializes) a sequence of binary data into a MRPT object, without prior information about the object's class. More...
 
void BASE_IMPEXP mrpt::utils::ObjectToRawString (const CSerializable *o, std::string &out_str)
 Converts (serializes) an MRPT object into an array of bytes within a std::string, without codifying to avoid NULL characters. More...
 
void BASE_IMPEXP mrpt::utils::RawStringToObject (const std::string &in_str, CSerializablePtr &obj)
 Converts back (de-serializes) a sequence of binary data within a std::string into a MRPT object, without prior information about the object's class. More...
 

Macro Definition Documentation

◆ DEFINE_SERIALIZABLE

#define DEFINE_SERIALIZABLE (   class_name)    DEFINE_SERIALIZABLE_CUSTOM_LINKAGE(class_name, void /*no extra linkage keyword*/, static /*none*/,virtual /*none*/ )

This declaration must be inserted in all CSerializable classes definition, within the class declaration.

Definition at line 129 of file CSerializable.h.

◆ DEFINE_SERIALIZABLE_CUSTOM_LINKAGE

#define DEFINE_SERIALIZABLE_CUSTOM_LINKAGE (   class_name,
  _VOID_LINKAGE_,
  _STATIC_LINKAGE_,
  _VIRTUAL_LINKAGE_ 
)
Value:
DEFINE_MRPT_OBJECT_CUSTOM_LINKAGE(class_name, _STATIC_LINKAGE_, _VIRTUAL_LINKAGE_ ) \
protected: \
/*! @name CSerializable virtual methods */ \
/*! @{ */ \
_VOID_LINKAGE_ writeToStream(mrpt::utils::CStream &out, int *getVersion) const;\
_VOID_LINKAGE_ readFromStream(mrpt::utils::CStream &in, int version); \
/*! @} */
#define DEFINE_MRPT_OBJECT_CUSTOM_LINKAGE(class_name, _STATIC_LINKAGE_, _VIRTUAL_LINKAGE_)
Just like DEFINE_MRPT_OBJECT but with DLL export/import linkage keywords.
Definition: CObject.h:143
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:36

Like DEFINE_SERIALIZABLE, but for template classes that need the DLL imp/exp keyword in Windows.

Definition at line 119 of file CSerializable.h.

◆ DEFINE_SERIALIZABLE_PRE

#define DEFINE_SERIALIZABLE_PRE (   class_name)
Value:
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(class_name, base_name, class_name_LINKAGE_)
This declaration must be inserted in all CObject classes definition, before the class declaration...
Definition: CObject.h:176
class BASE_IMPEXP CStream
Definition: math_frwds.h:28
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:36
class BASE_IMPEXP CSerializable
Definition: CStream.h:21
BASE_IMPEXP ::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CMatrixPtr &pObj)

This declaration must be inserted in all CSerializable classes definition, before the class declaration.

Definition at line 141 of file CSerializable.h.

◆ DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE

#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE (   class_name,
  base_name 
)
Value:
class BASE_IMPEXP CStream
Definition: math_frwds.h:28
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:36
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
Definition: CObject.h:167
BASE_IMPEXP ::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CMatrixPtr &pObj)

This declaration must be inserted in all CSerializable classes definition, before the class declaration.

Definition at line 154 of file CSerializable.h.

◆ DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE

#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE (   class_name,
  base_name,
  _LINKAGE_ 
)
Value:
DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(class_name, base_name, _LINKAGE_ class_name) \
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(class_name, base_name, class_name_LINKAGE_)
This declaration must be inserted in all CObject classes definition, before the class declaration...
Definition: CObject.h:176
class BASE_IMPEXP CStream
Definition: math_frwds.h:28
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:36
BASE_IMPEXP ::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CMatrixPtr &pObj)

This declaration must be inserted in all CSerializable classes definition, before the class declaration.

Definition at line 147 of file CSerializable.h.

◆ DEFINE_SERIALIZABLE_PRE_CUSTOM_LINKAGE

#define DEFINE_SERIALIZABLE_PRE_CUSTOM_LINKAGE (   class_name,
  _LINKAGE_ 
)
Value:
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(class_name, base_name, class_name_LINKAGE_)
This declaration must be inserted in all CObject classes definition, before the class declaration...
Definition: CObject.h:176
class BASE_IMPEXP CStream
Definition: math_frwds.h:28
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:36
class BASE_IMPEXP CSerializable
Definition: CStream.h:21
BASE_IMPEXP ::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CMatrixPtr &pObj)

This declaration must be inserted in all CSerializable classes definition, before the class declaration.

Definition at line 134 of file CSerializable.h.

◆ DEFINE_VIRTUAL_SERIALIZABLE

#define DEFINE_VIRTUAL_SERIALIZABLE (   class_name)    DEFINE_VIRTUAL_MRPT_OBJECT(class_name)

This declaration must be inserted in virtual CSerializable classes definition:

Definition at line 167 of file CSerializable.h.

◆ IMPLEMENTS_SERIALIZABLE

#define IMPLEMENTS_SERIALIZABLE (   class_name,
  base,
  NameSpace 
)
Value:
IMPLEMENTS_MRPT_OBJECT(class_name, base,NameSpace) \
mrpt::utils::CStream& NameSpace::operator>>(mrpt::utils::CStream& in, NameSpace::class_name##Ptr &pObj) \
{ pObj = NameSpace::class_name##Ptr( in.ReadObject() ); return in; }
#define IMPLEMENTS_MRPT_OBJECT(class_name, base, NameSpace)
This must be inserted in all CObject classes implementation files.
Definition: CObject.h:239
class BASE_IMPEXP CStream
Definition: math_frwds.h:28
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:36
BASE_IMPEXP ::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CMatrixPtr &pObj)

This must be inserted in all CSerializable classes implementation files:

Definition at line 160 of file CSerializable.h.

◆ IMPLEMENTS_VIRTUAL_SERIALIZABLE

#define IMPLEMENTS_VIRTUAL_SERIALIZABLE (   class_name,
  base_class_name,
  NameSpace 
)
Value:
IMPLEMENTS_VIRTUAL_MRPT_OBJECT(class_name, base_class_name,NameSpace) \
{ pObj = class_name##Ptr( in.ReadObject() ); return in; }
#define IMPLEMENTS_VIRTUAL_MRPT_OBJECT(class_name, base_class_name, NameSpace)
This must be inserted as implementation of some required members for virtual CSerializable classes: ...
Definition: CObject.h:272
class BASE_IMPEXP CStream
Definition: math_frwds.h:28
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:36
BASE_IMPEXP ::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CMatrixPtr &pObj)

This must be inserted as implementation of some required members for virtual CSerializable classes:

Definition at line 173 of file CSerializable.h.




Page generated by Doxygen 1.8.14 for MRPT 1.1.0 SVN: at lun oct 28 00:54:49 CET 2019 Hosted on:
SourceForge.net Logo