Skip to content

Advanced Serialization

Andrew Gresyk edited this page Mar 31, 2022 · 3 revisions

Serialization

  1. FSM instance can be stored to char buffer and restored from it.

  2. Serialization can be used for saving FSM to file or network replication.

Tests

  1. Enable serialization support

    #define FFSM2_ENABLE_SERIALIZATION
    #include <ffsm2/machine.hpp>
void Instance::save(SerialBuffer& buffer) const; Store instance state
void Instance::load(const SerialBuffer& buffer); Restore instance state

SerialBuffer

void SerialBuffer::clear(); Clear buffer

const
Data&
Data&
SerialBuffer::data();
SerialBuffer::data()

const;
Data access