Main MRPT website > C++ reference for MRPT 1.5.7
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>
Include dependency graph for CSerializable.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_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_POST_CUSTOM_LINKAGE(class_name, _LINKAGE_)   DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, mrpt::utils::CSerializable, _LINKAGE_ class_name)
 
#define DEFINE_SERIALIZABLE_PRE(class_name)
 This declaration must be inserted in all CSerializable classes definition, before the class declaration. More...
 
#define DEFINE_SERIALIZABLE_POST(class_name)   DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, mrpt::utils::CSerializable, BASE_IMPEXP class_name)
 
#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_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)   DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, base_name, _LINKAGE_ class_name)
 
#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 DEFINE_SERIALIZABLE_POST_CUSTOM_BASE(class_name, base_name)   DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, BASE_IMPEXP ) \
 
#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...
 
#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 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 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:17

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

Definition at line 206 of file CSerializable.h.

#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: glew.h:1756
struct mxArray_tag mxArray
Forward declaration for mxArray (avoid #including as much as possible to speed up compiling) ...
Definition: CSerializable.h:17

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

Definition at line 218 of file CSerializable.h.

Referenced by mrpt::utils::TCamera::k3(), mrpt::obs::CObservationImage::setSensorPose(), and mrpt::obs::CObservationStereoImages::setSensorPose().

#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 148 of file CSerializable.h.

#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 MRPT_OVERRIDE;\
_VOID_LINKAGE_ readFromStream(mrpt::utils::CStream &in, int version) MRPT_OVERRIDE; \
/*! @} */
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
#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:151
GLuint in
Definition: glew.h:7146
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
int version
Definition: mrpt_jpeglib.h:898

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

Definition at line 138 of file CSerializable.h.

#define DEFINE_SERIALIZABLE_POST (   class_name)    DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, mrpt::utils::CSerializable, BASE_IMPEXP class_name)
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE (   class_name,
  base_name 
)    DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, BASE_IMPEXP ) \
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE (   class_name,
  base_name,
  _LINKAGE_ 
)    DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, base_name, _LINKAGE_ class_name)

Definition at line 175 of file CSerializable.h.

Referenced by mrpt::opengl::CMesh::adjustGridToImageAR(), mrpt::opengl::CRenderizable::clone(), mrpt::opengl::CSetOfTexturedTriangles::CSetOfTexturedTriangles(), mrpt::detectors::CDetectable2D::distanceTo(), mrpt::opengl::CSetOfObjects::empty(), mrpt::obs::CObservationRange::end(), mrpt::obs::CRawlog::erase(), mrpt::obs::CActionCollection::getActionByClass(), mrpt::hmtslam::CHMHMapNode::getArcs(), mrpt::maps::CMetricMap::getAsSimplePointsMap(), mrpt::nav::CHolonomicLogFileRecord::getDirectionScores(), mrpt::nav::CLogFileRecord_FullEval::getDirectionScores(), mrpt::opengl::CText::getFont(), mrpt::obs::CObservationRFID::getNtags(), mrpt::opengl::CTexturedPlane::getPlaneCorners(), mrpt::hmtslam::THypothesisIDSet::has(), mrpt::opengl::COpenGLScene::internal_visitAllObjects(), mrpt::maps::COctoMap::isEmpty(), mrpt::opengl::CPointCloudColoured::PLY_export_get_face_count(), mrpt::opengl::CCylinder::reachesHeight(), mrpt::opengl::CRenderizableDisplayList::setColor_u8(), mrpt::kinematics::CKinematicChain::setConfiguration(), mrpt::detectors::CDetectableObject::setObservation(), mrpt::opengl::CMesh3D::setPointSize(), mrpt::obs::CObservationComment::setSensorPose(), mrpt::obs::CObservationReflectivity::setSensorPose(), mrpt::obs::CObservationOdometry::setSensorPose(), mrpt::obs::CObservationVisualLandmarks::setSensorPose(), mrpt::obs::CObservationImage::setSensorPose(), mrpt::obs::CObservationRawDAQ::setSensorPose(), mrpt::obs::CObservationCANBusJ1939::setSensorPose(), mrpt::obs::CObservationSkeleton::setSensorPose(), mrpt::obs::CObservationBearingRange::setSensorPose(), mrpt::obs::CObservationRGBD360::setSensorPose(), mrpt::obs::CObservationStereoImagesFeatures::setSensorPose(), mrpt::obs::CObservationIMU::setSensorPose(), mrpt::obs::CObservationStereoImages::setSensorPose(), mrpt::obs::CObservation2DRangeScan::setSensorPose(), mrpt::obs::CObservationVelodyneScan::setSensorPose(), mrpt::nav::CHolonomicVFF::setTargetApproachSlowDownDistance(), mrpt::opengl::CText3D::setTextKerning(), mrpt::opengl::CAngularObservationMesh::trace1DSetOfRays(), mrpt::obs::CObservation::unload(), mrpt::opengl::CArrow::~CArrow(), mrpt::opengl::CAxis::~CAxis(), mrpt::opengl::CBox::~CBox(), mrpt::opengl::CCamera::~CCamera(), mrpt::opengl::CDisk::~CDisk(), mrpt::opengl::CEllipsoid::~CEllipsoid(), mrpt::opengl::CEllipsoidInverseDepth2D::~CEllipsoidInverseDepth2D(), mrpt::opengl::CEllipsoidInverseDepth3D::~CEllipsoidInverseDepth3D(), mrpt::opengl::CEllipsoidRangeBearing2D::~CEllipsoidRangeBearing2D(), mrpt::vision::CFeature::~CFeature(), mrpt::opengl::CFrustum::~CFrustum(), mrpt::opengl::CGeneralizedCylinder::~CGeneralizedCylinder(), mrpt::opengl::CGridPlaneXY::~CGridPlaneXY(), mrpt::opengl::CGridPlaneXZ::~CGridPlaneXZ(), mrpt::opengl::CMeshFast::~CMeshFast(), mrpt::opengl::COctoMapVoxels::~COctoMapVoxels(), mrpt::opengl::COpenGLStandardObject::~COpenGLStandardObject(), mrpt::opengl::CPlanarLaserScan::~CPlanarLaserScan(), mrpt::opengl::CSetOfLines::~CSetOfLines(), mrpt::opengl::CSetOfTriangles::~CSetOfTriangles(), mrpt::opengl::CSimpleLine::~CSimpleLine(), mrpt::opengl::CSphere::~CSphere(), mrpt::opengl::CVectorField2D::~CVectorField2D(), and mrpt::opengl::CVectorField3D::~CVectorField3D().

#define DEFINE_SERIALIZABLE_POST_CUSTOM_LINKAGE (   class_name,
  _LINKAGE_ 
)    DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, mrpt::utils::CSerializable, _LINKAGE_ class_name)

Definition at line 157 of file CSerializable.h.

#define DEFINE_SERIALIZABLE_PRE (   class_name)
Value:
BASE_IMPEXP ::mrpt::utils::CStream& operator>>(mrpt::utils::CStream& in, class_name##Ptr &pObj);
#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:184
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:39
GLuint in
Definition: glew.h:7146
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
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 162 of file CSerializable.h.

#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE (   class_name,
  base_name 
)
Value:
BASE_IMPEXP ::mrpt::utils::CStream& operator>>(mrpt::utils::CStream& in, class_name##Ptr &pObj);
GLuint in
Definition: glew.h:7146
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
Definition: CObject.h:176
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 179 of file CSerializable.h.

#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) \
_LINKAGE_ ::mrpt::utils::CStream& operator>>(mrpt::utils::CStream& in, class_name##Ptr &pObj);
#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:184
GLuint in
Definition: glew.h:7146
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
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 171 of file CSerializable.h.

Referenced by mrpt::detectors::CDetectable2D::distanceTo(), and mrpt::detectors::CDetectableObject::setObservation().

#define DEFINE_SERIALIZABLE_PRE_CUSTOM_LINKAGE (   class_name,
  _LINKAGE_ 
)
Value:
_LINKAGE_ ::mrpt::utils::CStream& operator>>(mrpt::utils::CStream& in, class_name##Ptr &pObj);
#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:184
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:39
GLuint in
Definition: glew.h:7146
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
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 153 of file CSerializable.h.

Referenced by mrpt::maps::TMatchingRatioParams::TMatchingRatioParams().

#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 193 of file CSerializable.h.

#define IMPLEMENTS_MEXPLUS_FROM (   complete_type)
Value:
namespace mexplus \
{ \
template <> \
mxArray* from(const complete_type& var) \
{ \
return var.writeToMatlab(); \
} \
}
struct mxArray_tag mxArray
Forward declaration for mxArray (avoid #including as much as possible to speed up compiling) ...
Definition: CSerializable.h:17

Definition at line 227 of file CSerializable.h.

Referenced by mrpt::maps::CPointsMap::load2Dor3D_from_text_file(), mrpt::poses::operator<<(), mrpt::utils::TCamera::readFromStream(), mrpt::obs::CObservationImage::readFromStream(), mrpt::obs::CObservationStereoImages::readFromStream(), mrpt::obs::CObservation2DRangeScan::readFromStream(), and mrpt::utils::CImage::readFromStream().

#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:256
GLuint in
Definition: glew.h:7146
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
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 187 of file CSerializable.h.

Referenced by mrpt::maps::COctoMap::internal_CreateFromMapDefinition(), mrpt::maps::CColouredOctoMap::internal_CreateFromMapDefinition(), mrpt::maps::CWirelessPowerGridMap2D::internal_CreateFromMapDefinition(), mrpt::maps::CHeightGridMap2D_MRF::internal_CreateFromMapDefinition(), mrpt::maps::CReflectivityGridMap2D::internal_CreateFromMapDefinition(), mrpt::maps::CSimplePointsMap::internal_CreateFromMapDefinition(), mrpt::maps::CWeightedPointsMap::internal_CreateFromMapDefinition(), mrpt::maps::CHeightGridMap2D::internal_CreateFromMapDefinition(), mrpt::maps::CGasConcentrationGridMap2D::internal_CreateFromMapDefinition(), mrpt::maps::CBeaconMap::internal_CreateFromMapDefinition(), mrpt::maps::CColouredPointsMap::internal_CreateFromMapDefinition(), mrpt::maps::CLandmarksMap::internal_CreateFromMapDefinition(), and mrpt::maps::COccupancyGridMap2D::internal_CreateFromMapDefinition().

#define IMPLEMENTS_VIRTUAL_SERIALIZABLE (   class_name,
  base_class_name,
  NameSpace 
)
Value:
IMPLEMENTS_VIRTUAL_MRPT_OBJECT(class_name, base_class_name,NameSpace) \
mrpt::utils::CStream& NameSpace::operator>>(mrpt::utils::CStream& in, class_name##Ptr &pObj) \
{ 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:291
GLuint in
Definition: glew.h:7146
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
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 199 of file CSerializable.h.

Typedef Documentation

typedef struct mxArray_tag mxArray

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

Definition at line 17 of file CSerializable.h.




Page generated by Doxygen 1.8.11 for MRPT 1.5.7 Git: 2190203 Tue May 15 02:01:15 2018 +0200 at miƩ may 16 12:40:16 CEST 2018