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

Detailed Description

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

Collaboration diagram for Non-CStream serialization functions (in:

Modules

 Serialization functions for ZMQ (v3
 or above) (in #include <mrpt/utils/serialization_zmq.h>)
 

Functions

std::string mrpt::utils::ObjectToString (const CSerializable *o)
 Used to pass MRPT objects into a CORBA-like object (strings). More...
 
void mrpt::utils::StringToObject (const std::string &str, CSerializable::Ptr &obj)
 Used to pass CORBA-like objects (strings) into a MRPT object. More...
 
void mrpt::utils::ObjectToOctetVector (const CSerializable *o, vector_byte &out_vector)
 Converts (serializes) an MRPT object into an array of bytes. More...
 
void mrpt::utils::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 about the object's class. More...
 
void mrpt::utils::ObjectToRawString (const CSerializable *o, std::string &out_str)
 Converts (serializes) an MRPT object into an array of bytes within a std::string, without codifying to avoid nullptr characters. More...
 
void mrpt::utils::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, without prior information about the object's class. More...
 

Function Documentation

◆ ObjectToOctetVector()

void mrpt::utils::ObjectToOctetVector ( const CSerializable o,
vector_byte 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 155 of file CSerializable.cpp.

References mrpt::system::os::fprintf(), mrpt::utils::CMemoryStream::getRawBufferData(), mrpt::utils::CMemoryStream::getTotalBytesCount(), mrpt::system::os::memcpy(), and mrpt::utils::CStream::WriteObject().

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ObjectToRawString()

void mrpt::utils::ObjectToRawString ( const CSerializable o,
std::string out_str 
)

Converts (serializes) an MRPT object into an array of bytes within a std::string, without codifying to avoid nullptr characters.

This is therefore more efficient than ObjectToString

Parameters
oThe object to be serialized.
out_vectorThe string which at return will contain the data. Size will be set automatically.
See also
RawStringToObject, ObjectToOctetVector

Definition at line 216 of file CSerializable.cpp.

References mrpt::system::os::fprintf(), mrpt::utils::CMemoryStream::getRawBufferData(), mrpt::utils::CMemoryStream::getTotalBytesCount(), mrpt::system::os::memcpy(), and mrpt::utils::CStream::WriteObject().

Here is the call graph for this function:

◆ ObjectToString()

std::string mrpt::utils::ObjectToString ( const CSerializable o)

Used to pass MRPT objects into a CORBA-like object (strings).

See doc about "Integration with BABEL".

Parameters
oThe object to be serialized.
Returns
The string containing the binay version of object.
See also
StringToObject, Integration with BABEL

Definition at line 28 of file CSerializable.cpp.

References mrpt::system::os::fprintf(), mrpt::utils::CMemoryStream::getRawBufferData(), mrpt::utils::CMemoryStream::getTotalBytesCount(), mrpt::system::os::memcpy(), mrpt::utils::CStream::WriteBuffer(), and mrpt::utils::CStream::WriteObject().

Referenced by mrpt::hmtslam::CHierarchicalMHMap::dumpAsXMLfile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OctetVectorToObject()

void mrpt::utils::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 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 186 of file CSerializable.cpp.

References mrpt::utils::CMemoryStream::assignMemoryNotOwn(), mrpt::system::os::fprintf(), and mrpt::utils::CStream::ReadObject().

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RawStringToObject()

void mrpt::utils::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, 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
ObjectToRawString

Definition at line 247 of file CSerializable.cpp.

References mrpt::utils::CMemoryStream::assignMemoryNotOwn(), mrpt::system::os::fprintf(), and mrpt::utils::CStream::ReadObject().

Here is the call graph for this function:

◆ StringToObject()

void mrpt::utils::StringToObject ( const std::string str,
CSerializable::Ptr obj 
)

Used to pass CORBA-like objects (strings) into a MRPT object.

Parameters
strAn string generated with ObjectToString
objA currently empty pointer, where a pointer to the newly created object will be stored.
Exceptions
NoneOn any internal exception, this function returns NULL.
See also
ObjectToString, Integration with BABEL

Definition at line 96 of file CSerializable.cpp.

References mrpt::utils::CMemoryStream::getRawBufferData(), mrpt::utils::CMemoryStream::getTotalBytesCount(), MRPT_END, MRPT_START, mrpt::utils::CStream::ReadObject(), mrpt::utils::CMemoryStream::Seek(), mrpt::utils::CStream::sFromBeginning, and mrpt::utils::CStream::WriteBuffer().

Here is the call graph for this function:



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019