9 #ifndef CSERIALIZABLE_H 10 #define CSERIALIZABLE_H 159 #define DEFINE_SERIALIZABLE(class_name) \ 160 DEFINE_MRPT_OBJECT(class_name) \ 164 void writeToStream(mrpt::utils::CStream& out, int* getVersion) const override;\ 165 void readFromStream(mrpt::utils::CStream& in, int version) override; \ 169 #define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace) \ 170 IMPLEMENTS_MRPT_OBJECT(class_name, base, NameSpace) 174 #define DEFINE_VIRTUAL_SERIALIZABLE(class_name) \ 175 DEFINE_VIRTUAL_MRPT_OBJECT(class_name) 180 #define IMPLEMENTS_VIRTUAL_SERIALIZABLE( \ 181 class_name, base_class_name, NameSpace) \ 182 IMPLEMENTS_VIRTUAL_MRPT_OBJECT(class_name, base_class_name, NameSpace) 187 #define DECLARE_MEX_CONVERSION \ 191 virtual mxArray* writeToMatlab() const; \ 194 #define DECLARE_MEX_CONVERSION // Empty 200 #define DECLARE_MEXPLUS_FROM(complete_type) \ 203 template <typename T> \ 204 mxArray* from(const T& value); \ 206 mxArray* from(const complete_type& value); \ 209 #define IMPLEMENTS_MEXPLUS_FROM(complete_type) \ 213 mxArray* from(const complete_type& var) \ 215 return var.writeToMatlab(); \ 219 #define DECLARE_MEXPLUS_FROM(complete_type) // Empty 220 #define IMPLEMENTS_MEXPLUS_FROM(complete_type) // Empty
std::vector< uint8_t > vector_byte
The virtual base class which provides a unified interface for all persistent objects in MRPT...
void StringToObject(const std::string &str, CSerializable::Ptr &obj)
Used to pass CORBA-like objects (strings) into a MRPT object.
virtual void writeToStream(mrpt::utils::CStream &out, int *getVersion) const =0
Introduces a pure virtual method responsible for writing to a CStream.
#define DEFINE_VIRTUAL_MRPT_OBJECT(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
GLsizei GLsizei GLuint * obj
void 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...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
void ObjectToOctetVector(const CSerializable *o, vector_byte &out_vector)
Converts (serializes) an MRPT object into an array of bytes.
GLsizei const GLchar ** string
std::shared_ptr< CSerializable > Ptr
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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.
void 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...
void ObjectToRawString(const CSerializable *o, std::string &out_str)
Converts (serializes) an MRPT object into an array of bytes within a std::string, without codifying t...
std::string ObjectToString(const CSerializable *o)
Used to pass MRPT objects into a CORBA-like object (strings).
The virtual base class of all MRPT classes with a unified RTTI system.
virtual void readFromStream(mrpt::utils::CStream &in, int version)=0
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
struct mxArray_tag mxArray
Forward declaration for mxArray (avoid #including as much as possible to speed up compiling) ...