Go to the documentation of this file.
22 namespace serialization
85 const CSerializable* o, std::vector<uint8_t>& out_vector);
102 #define DEFINE_SERIALIZABLE(class_name) \
103 DEFINE_MRPT_OBJECT(class_name) \
107 uint8_t serializeGetVersion() const override; \
108 void serializeTo(mrpt::serialization::CArchive& out) const override; \
109 void serializeFrom( \
110 mrpt::serialization::CArchive& in, uint8_t serial_version) override; \
114 #define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace) \
115 IMPLEMENTS_MRPT_OBJECT(class_name, base, NameSpace)
119 #define DEFINE_VIRTUAL_SERIALIZABLE(class_name) \
120 DEFINE_VIRTUAL_MRPT_OBJECT(class_name)
125 #define IMPLEMENTS_VIRTUAL_SERIALIZABLE( \
126 class_name, base_class_name, NameSpace) \
127 IMPLEMENTS_VIRTUAL_MRPT_OBJECT(class_name, base_class_name, NameSpace)
131 #define DECLARE_MEX_CONVERSION \
135 mxArray* writeToMatlab() const override; \
140 #define DECLARE_MEXPLUS_FROM(complete_type) \
143 template <typename T> \
144 mxArray* from(const T& value); \
146 mxArray* from(const complete_type& value); \
149 #define IMPLEMENTS_MEXPLUS_FROM(complete_type) \
153 mxArray* from(const complete_type& var) \
155 return var.writeToMatlab(); \
virtual void serializeTo(CArchive &out) const =0
Pure virtual method for writing (serializing) to an abstract archive.
#define DEFINE_VIRTUAL_MRPT_OBJECT(class_name)
This declaration must be inserted in virtual CObject classes definition:
std::shared_ptr< CSerializable > Ptr
GLsizei GLsizei GLuint * obj
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
The virtual base class of all MRPT classes with a unified RTTI system.
The virtual base class which provides a unified interface for all persistent objects in MRPT.
virtual void serializeFrom(CArchive &in, uint8_t serial_version)=0
Pure virtual method for reading (deserializing) from an abstract archive.
void OctetVectorToObject(const std::vector< uint8_t > &in_data, CSerializable::Ptr &obj)
Converts back (de-serializes) a sequence of binary data into a MRPT object, without prior information...
virtual uint8_t serializeGetVersion() const =0
Must return the current versioning number of the object.
void ObjectToOctetVector(const CSerializable *o, std::vector< uint8_t > &out_vector)
Converts (serializes) an MRPT object into an array of bytes.
virtual mxArray * writeToMatlab() const
Introduces a pure virtual method responsible for writing to a mxArray Matlab object,...
struct mxArray_tag mxArray
Forward declaration for mxArray (avoid #including as much as possible to speed up compiling)
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |