Slick Trader 0.11.0
Multi-broker algorithmic trading engine with plugin strategies and a live web dashboard
Loading...
Searching...
No Matches
slick::trader::detail::SlotFile Class Reference

#include <slick-trader/brokers/common/slot_store.hpp>

Collaboration diagram for slick::trader::detail::SlotFile:

Public Member Functions

 SlotFile (const std::string &path, const SlotStoreFormat &format, const std::array< char, IDENTITY_SIZE > &identity, std::string_view identity_text, size_t slot_size, size_t max_slots, const void *fresh_state, size_t state_size)
uint8_t * state () noexcept
uint8_t * slot (uint32_t index) noexcept
const uint8_t * slot (uint32_t index) const noexcept
uint32_t capacity () const noexcept
bool created () const noexcept
const std::string & path () const noexcept
const char * name () const noexcept

Static Public Attributes

static constexpr size_t HEADER_SIZE = 128
static constexpr size_t IDENTITY_SIZE = 16
static constexpr size_t STATE_OFFSET = 32
static constexpr size_t STATE_SIZE = HEADER_SIZE - STATE_OFFSET

Detailed Description

Definition at line 30 of file slot_store.hpp.

Constructor & Destructor Documentation

◆ SlotFile()

slick::trader::detail::SlotFile::SlotFile ( const std::string & path,
const SlotStoreFormat & format,
const std::array< char, IDENTITY_SIZE > & identity,
std::string_view identity_text,
size_t slot_size,
size_t max_slots,
const void * fresh_state,
size_t state_size )

Member Function Documentation

◆ capacity()

uint32_t slick::trader::detail::SlotFile::capacity ( ) const
inlinenodiscardnoexcept

Definition at line 50 of file slot_store.hpp.

◆ created()

bool slick::trader::detail::SlotFile::created ( ) const
inlinenodiscardnoexcept

Definition at line 51 of file slot_store.hpp.

◆ name()

const char * slick::trader::detail::SlotFile::name ( ) const
inlinenodiscardnoexcept

Definition at line 53 of file slot_store.hpp.

Referenced by SlotFile().

◆ path()

const std::string & slick::trader::detail::SlotFile::path ( ) const
inlinenodiscardnoexcept

Definition at line 52 of file slot_store.hpp.

Referenced by SlotFile().

◆ slot() [1/2]

const uint8_t * slick::trader::detail::SlotFile::slot ( uint32_t index) const
inlinenodiscardnoexcept

Definition at line 47 of file slot_store.hpp.

References HEADER_SIZE.

◆ slot() [2/2]

uint8_t * slick::trader::detail::SlotFile::slot ( uint32_t index)
inlinenodiscardnoexcept

Definition at line 44 of file slot_store.hpp.

References HEADER_SIZE.

◆ state()

uint8_t * slick::trader::detail::SlotFile::state ( )
inlinenodiscardnoexcept

Definition at line 43 of file slot_store.hpp.

References STATE_OFFSET.

Member Data Documentation

◆ HEADER_SIZE

size_t slick::trader::detail::SlotFile::HEADER_SIZE = 128
staticconstexpr

Definition at line 32 of file slot_store.hpp.

Referenced by SlotFile(), slot(), and slot().

◆ IDENTITY_SIZE

size_t slick::trader::detail::SlotFile::IDENTITY_SIZE = 16
staticconstexpr

Definition at line 33 of file slot_store.hpp.

Referenced by SlotFile().

◆ STATE_OFFSET

size_t slick::trader::detail::SlotFile::STATE_OFFSET = 32
staticconstexpr

Definition at line 34 of file slot_store.hpp.

Referenced by state().

◆ STATE_SIZE

size_t slick::trader::detail::SlotFile::STATE_SIZE = HEADER_SIZE - STATE_OFFSET
staticconstexpr

Definition at line 35 of file slot_store.hpp.


The documentation for this class was generated from the following files: