Class Backup

Class Documentation

class Backup

Backup data for a Phase or Event. The state is represented by a nlohmann::json data structure. The meaning and format of the json structure is up to the phase or event implementation to decide.

Each Backup is tagged with a sequence number. As the phase or event makes progress, it can issue new Backups with higher sequence numbers. Only the Backup with the highest sequence number will be kept.

Public Functions

uint64_t sequence() const

Get the sequence number.

const nlohmann::json &state() const

Get the YAML representation of the backed up state.

Public Static Functions

static Backup make(uint64_t seq, nlohmann::json state)

Make a backup of the phase

Parameters:
  • seq[in] Sequence number. The Backup from this phase with the highest sequence number will be held onto until a Backup with a higher sequence number is issued.

  • state[in] A serialization of the phase’s state. This will be used by Phase::Activator when restoring a Task.