TEC
A lightweight C++ library enabling safe, efficient execution in multithreaded and concurrent systems.
Loading...
Searching...
No Matches
tec::Serializable Struct Referenceabstract

Base interface for objects that support binary serialization. More...

#include <tec_serialize.hpp>

Inheritance diagram for tec::Serializable:
tec::NdRoot

Public Member Functions

virtual NetDatastore (NetData &s) const =0
 Serialize this object into a binary stream.
 
virtual NetDataload (NetData &s)=0
 Deserialize this object from a binary stream.
 

Detailed Description

Base interface for objects that support binary serialization.

This is a pure abstract interface. Derived classes must implement all pure virtual methods to be instantiable.

Note
All types that can be binary serialized must inherit from this class.

Member Function Documentation

◆ load()

virtual NetData & tec::Serializable::load ( NetData s)
pure virtual

Deserialize this object from a binary stream.

Implementations must read exactly the data that was previously written by store(). The stream is expected to contain valid data produced by a compatible version of store().

Parameters
sThe input stream to read from (guaranteed to be non-const)
Returns
Reference to the modified stream (for chaining)

◆ store()

virtual NetData & tec::Serializable::store ( NetData s) const
pure virtual

Serialize this object into a binary stream.

Implementations should write all necessary member data into the provided NetData object in a deterministic order. The stream must remain valid and writable for the duration of the call.

Parameters
sThe output stream to write into (guaranteed to be non-const)
Returns
Reference to the modified stream (for chaining)

The documentation for this struct was generated from the following file: