Class CSerializable

Inheritance Relationships

Base Type

  • public mrpt::rtti::CObject

Class Documentation

class CSerializable : public mrpt::rtti::CObject

The virtual base class which provides a unified interface for all persistent objects in MRPT. Many important properties of this class are inherited from mrpt::rtti::CObject. Refer to the library tutorial: mrpt_serialization_grp

See also

CArchive

CSerializable virtual methods

virtual uint8_t serializeGetVersion() const = 0

Must return the current versioning number of the object. Start in zero for new classes, and increments each time there is a change in the stored format.

virtual void serializeTo(CArchive &out) const = 0

Pure virtual method for writing (serializing) to an abstract archive. Users don’t call this method directly. Instead, use stream << object;.

Throws:

std::exception – On any I/O error

virtual void serializeFrom(CArchive &in, uint8_t serial_version) = 0

Pure virtual method for reading (deserializing) from an abstract archive. Users don’t call this method directly. Instead, use stream >> object;.

Parameters:
  • in – The input binary stream where the object data must read from.

  • version – The version of the object stored in the stream: use this version number in your code to know how to read the incoming data.

Throws:

std::exception – On any I/O error

inline virtual void serializeTo([[maybe_unused]] CSchemeArchiveBase &out) const

Virtual method for writing (serializing) to an abstract schema based archive.

inline virtual void serializeFrom([[maybe_unused]] CSchemeArchiveBase &in)

Virtual method for reading (deserializing) from an abstract schema based archive.