FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
fastmm::StrategyStateMsg Struct Reference

Journal only: what a replay or a backtest over the journal can start from. More...

#include <fastmm/core/messages.hpp>

Public Types

enum class  Kind : std::uint8_t { Restored = 0 , Snapshot = 1 }
 

Public Member Functions

const std::byte * data () const noexcept
 

Static Public Member Functions

static constexpr std::uint32_t size_for (std::uint32_t n) noexcept
 

Public Attributes

EventHeader hdr
 
std::uint64_t id
 
std::uint32_t total
 bytes of the part
 
std::uint32_t offset
 of this record's bytes in the part
 
std::uint32_t bytes
 after the head
 
Kind kind
 
std::uint8_t part
 
std::uint8_t flags
 
std::uint8_t pad_ [37]
 

Static Public Attributes

static constexpr std::uint8_t kStatePart = 0
 
static constexpr std::uint8_t kPositionsPart = 1
 
static constexpr std::uint8_t kAccepted = 1U << 0
 
static constexpr std::uint32_t kChunkBytes = 16384
 

Detailed Description

Journal only: what a replay or a backtest over the journal can start from.

The bytes the strategy was handed to restore() at the start (Kind::Restored, flagged kAccepted when it took them), and every [strategy] state_snapshot_interval_s its state() with the engine's positions (Kind::Snapshot). One state is written as records of at most kChunkBytes each: id numbers the states of the session, part says what the bytes are (kStatePart: the strategy's state; kPositionsPart: StatePosition entries), and offset / total place them in it. A record is the 128-byte head and its bytes padded to 64. Never dispatched.

Member Enumeration Documentation

◆ Kind

enum class fastmm::StrategyStateMsg::Kind : std::uint8_t
strong
Enumerator
Restored 
Snapshot 

Member Function Documentation

◆ size_for()

static constexpr std::uint32_t fastmm::StrategyStateMsg::size_for ( std::uint32_t  n)
inlinestaticconstexprnoexcept

◆ data()

const std::byte * fastmm::StrategyStateMsg::data ( ) const
inlinenoexcept

Member Data Documentation

◆ kStatePart

constexpr std::uint8_t fastmm::StrategyStateMsg::kStatePart = 0
staticconstexpr

◆ kPositionsPart

constexpr std::uint8_t fastmm::StrategyStateMsg::kPositionsPart = 1
staticconstexpr

◆ kAccepted

constexpr std::uint8_t fastmm::StrategyStateMsg::kAccepted = 1U << 0
staticconstexpr

◆ kChunkBytes

constexpr std::uint32_t fastmm::StrategyStateMsg::kChunkBytes = 16384
staticconstexpr

◆ hdr

EventHeader fastmm::StrategyStateMsg::hdr

◆ id

std::uint64_t fastmm::StrategyStateMsg::id

◆ total

std::uint32_t fastmm::StrategyStateMsg::total

bytes of the part

◆ offset

std::uint32_t fastmm::StrategyStateMsg::offset

of this record's bytes in the part

◆ bytes

std::uint32_t fastmm::StrategyStateMsg::bytes

after the head

◆ kind

Kind fastmm::StrategyStateMsg::kind

◆ part

std::uint8_t fastmm::StrategyStateMsg::part

◆ flags

std::uint8_t fastmm::StrategyStateMsg::flags

◆ pad_

std::uint8_t fastmm::StrategyStateMsg::pad_[37]