9 #ifndef CSERIALIZABLE_H
10 #define CSERIALIZABLE_H
19 typedef struct mxArray_tag
mxArray;
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
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)
220 #define IMPLEMENTS_MEXPLUS_FROM(complete_type)
#define DEFINE_VIRTUAL_MRPT_OBJECT(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
struct mxArray_tag mxArray
Forward declaration for mxArray (avoid #including as much as possible to speed up compiling)
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 writeToStream(mrpt::utils::CStream &out, int *getVersion) const =0
Introduces a pure virtual method responsible for writing to a CStream.
std::shared_ptr< CSerializable > Ptr
virtual mxArray * writeToMatlab() const
Introduces a pure virtual method responsible for writing to a mxArray Matlab object,...
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...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
GLsizei GLsizei GLuint * obj
GLsizei const GLchar ** string
std::vector< uint8_t > vector_byte
std::string ObjectToString(const CSerializable *o)
Used to pass MRPT objects into a CORBA-like object (strings).
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...
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...
void StringToObject(const std::string &str, CSerializable::Ptr &obj)
Used to pass CORBA-like objects (strings) into a MRPT object.
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 ObjectToOctetVector(const CSerializable *o, vector_byte &out_vector)
Converts (serializes) an MRPT object into an array of bytes.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.