83 const CSerializable* o, std::vector<uint8_t>& out_vector);
100 #define DEFINE_SERIALIZABLE(class_name) \ 101 DEFINE_MRPT_OBJECT(class_name) \ 105 uint8_t serializeGetVersion() const override; \ 106 void serializeTo(mrpt::serialization::CArchive& out) const override; \ 107 void serializeFrom( \ 108 mrpt::serialization::CArchive& in, uint8_t serial_version) override; \ 112 #define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace) \ 113 IMPLEMENTS_MRPT_OBJECT(class_name, base, NameSpace) 117 #define DEFINE_VIRTUAL_SERIALIZABLE(class_name) \ 118 DEFINE_VIRTUAL_MRPT_OBJECT(class_name) 123 #define IMPLEMENTS_VIRTUAL_SERIALIZABLE( \ 124 class_name, base_class_name, NameSpace) \ 125 IMPLEMENTS_VIRTUAL_MRPT_OBJECT(class_name, base_class_name, NameSpace) 129 #define DECLARE_MEX_CONVERSION \ 133 mxArray* writeToMatlab() const override; \ 138 #define DECLARE_MEXPLUS_FROM(complete_type) \ 141 template <typename T> \ 142 mxArray* from(const T& value); \ 144 mxArray* from(const complete_type& value); \ 147 #define IMPLEMENTS_MEXPLUS_FROM(complete_type) \ 151 mxArray* from(const complete_type& var) \ 153 return var.writeToMatlab(); \ virtual void serializeTo(CArchive &out) const =0
Pure virtual method for writing (serializing) to an abstract archive.
virtual void serializeFrom(CArchive &in, uint8_t serial_version)=0
Pure virtual method for reading (deserializing) from an abstract archive.
std::shared_ptr< CSerializable > Ptr
void ObjectToOctetVector(const CSerializable *o, std::vector< uint8_t > &out_vector)
Converts (serializes) an MRPT object into an array of bytes.
#define DEFINE_VIRTUAL_MRPT_OBJECT(class_name)
This declaration must be inserted in virtual CObject classes definition:
The virtual base class of all MRPT classes with a unified RTTI system.
GLsizei GLsizei GLuint * obj
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...
struct mxArray_tag mxArray
Forward declaration for mxArray (avoid #including as much as possible to speed up compiling) ...
Virtual base class for "archives": classes abstracting I/O streams.
virtual mxArray * writeToMatlab() const
Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
virtual uint8_t serializeGetVersion() const =0
Must return the current versioning number of the object.