Main MRPT website > C++ reference for MRPT 1.9.9
Classes | Namespaces | Macros | Typedefs | Functions
CSerializable.h File Reference
#include <mrpt/utils/CObject.h>
#include <mrpt/utils/TTypeName.h>
#include <mrpt/utils/types_simple.h>

Go to the source code of this file.

Classes

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(class_name)
 This declaration must be inserted in all CSerializable classes definition, within the class declaration. More...
 
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)   IMPLEMENTS_MRPT_OBJECT(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)   IMPLEMENTS_VIRTUAL_MRPT_OBJECT(class_name, base_class_name, NameSpace)
 This must be inserted as implementation of some required members for virtual CSerializable classes: More...
 
#define DECLARE_MEX_CONVERSION
 This must be inserted if a custom conversion method for MEX API is implemented in the class. More...
 
#define DECLARE_MEXPLUS_FROM(complete_type)
 This must be inserted if a custom conversion method for MEX API is implemented in the class. More...
 
#define IMPLEMENTS_MEXPLUS_FROM(complete_type)
 

Typedefs

typedef struct mxArray_tag mxArray
 Forward declaration for mxArray (avoid #including as much as possible to speed up compiling) More...
 

Functions

std::string mrpt::utils::ObjectToString (const CSerializable *o)
 Used to pass MRPT objects into a CORBA-like object (strings). More...
 
void mrpt::utils::StringToObject (const std::string &str, CSerializable::Ptr &obj)
 Used to pass CORBA-like objects (strings) into a MRPT object. More...
 
void mrpt::utils::ObjectToOctetVector (const CSerializable *o, vector_byte &out_vector)
 Converts (serializes) an MRPT object into an array of bytes. More...
 
void mrpt::utils::OctetVectorToObject (const vector_byte &in_data, CSerializable::Ptr &obj)
 Converts back (de-serializes) a sequence of binary data into a MRPT object, without prior information about the object's class. More...
 
void 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 nullptr characters. More...
 
void mrpt::utils::RawStringToObject (const std::string &in_str, CSerializable::Ptr &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

◆ DECLARE_MEX_CONVERSION

#define DECLARE_MEX_CONVERSION
Value:
/*! @name Virtual methods for MRPT-MEX conversion */ \
/*! @{ */ \
public: \
virtual mxArray* writeToMatlab() const; \
/*! @} */
struct mxArray_tag mxArray
Forward declaration for mxArray (avoid #including as much as possible to speed up compiling) ...
Definition: CSerializable.h:19

This must be inserted if a custom conversion method for MEX API is implemented in the class.

Definition at line 187 of file CSerializable.h.

◆ DECLARE_MEXPLUS_FROM

#define DECLARE_MEXPLUS_FROM (   complete_type)
Value:
namespace mexplus \
{ \
template <typename T> \
mxArray* from(const T& value); \
template <> \
mxArray* from(const complete_type& value); \
}
GLsizei const GLfloat * value
Definition: glext.h:4117

This must be inserted if a custom conversion method for MEX API is implemented in the class.

Definition at line 200 of file CSerializable.h.

◆ DEFINE_SERIALIZABLE

#define DEFINE_SERIALIZABLE (   class_name)
Value:
DEFINE_MRPT_OBJECT(class_name) \
protected: \
/*! @name CSerializable virtual methods */ \
/*! @{ */ \
void writeToStream(mrpt::utils::CStream& out, int* getVersion) const override;\
void readFromStream(mrpt::utils::CStream& in, int version) override; \
/*! @} */
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
#define DEFINE_MRPT_OBJECT(class_name)
This declaration must be inserted in all CObject classes definition, within the class declaration...
Definition: CObject.h:186
GLuint in
Definition: glext.h:7274

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

Definition at line 159 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 174 of file CSerializable.h.

◆ IMPLEMENTS_MEXPLUS_FROM

#define IMPLEMENTS_MEXPLUS_FROM (   complete_type)
Value:
namespace mexplus \
{ \
template <> \
mxArray* from(const complete_type& var) \
{ \
return var.writeToMatlab(); \
} \
}

Definition at line 209 of file CSerializable.h.

◆ IMPLEMENTS_SERIALIZABLE

#define IMPLEMENTS_SERIALIZABLE (   class_name,
  base,
  NameSpace 
)    IMPLEMENTS_MRPT_OBJECT(class_name, base, NameSpace)

This must be inserted in all CSerializable classes implementation files.

Definition at line 169 of file CSerializable.h.

◆ IMPLEMENTS_VIRTUAL_SERIALIZABLE

#define IMPLEMENTS_VIRTUAL_SERIALIZABLE (   class_name,
  base_class_name,
  NameSpace 
)    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 at line 180 of file CSerializable.h.

Typedef Documentation

◆ mxArray

typedef struct mxArray_tag mxArray

Forward declaration for mxArray (avoid #including as much as possible to speed up compiling)

Definition at line 19 of file CSerializable.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019