Main MRPT website > C++ reference for MRPT 1.9.9
Modules | Functions
Non-CStream serialization functions (in

Detailed Description

#include <mrpt/serializatin/CSerializable.h>)

Collaboration diagram for Non-CStream serialization functions (in:

Modules

 Serialization functions for ZMQ (v3
 

Functions

void mrpt::serialization::ObjectToOctetVector (const CSerializable *o, std::vector< uint8_t > &out_vector)
 Converts (serializes) an MRPT object into an array of bytes. More...
 
void mrpt::serialization::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 about the object's class. More...
 

Function Documentation

◆ ObjectToOctetVector()

void mrpt::serialization::ObjectToOctetVector ( const CSerializable o,
std::vector< uint8_t > &  out_vector 
)

Converts (serializes) an MRPT object into an array of bytes.

Parameters
oThe object to be serialized.
out_vectorThe vector which at return will contain the data. Size will be set automatically.
See also
OctetVectorToObject, ObjectToString

Definition at line 21 of file CSerializable.cpp.

References mrpt::serialization::archiveFrom().

Referenced by mrpt::hmtslam::CHierarchicalMHMap::dumpAsXMLfile(), and TEST().

◆ OctetVectorToObject()

void mrpt::serialization::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 about the object's class.

Parameters
in_dataThe serialized input data representing the object.
objThe newly created object will be stored in this smart pointer.
Exceptions
NoneOn any internal exception, this function returns a nullptr pointer.
See also
ObjectToOctetVector, StringToObject

Definition at line 29 of file CSerializable.cpp.

References mrpt::serialization::archiveFrom().

Referenced by TEST().




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