Slick Trader 0.11.0
Multi-broker algorithmic trading engine with plugin strategies and a live web dashboard
Loading...
Searching...
No Matches
slick::trader::SlotStore< State, Record > Class Template Reference

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

Collaboration diagram for slick::trader::SlotStore< State, Record >:

Public Types

using Identity = std::array<char, detail::SlotFile::IDENTITY_SIZE>

Public Member Functions

 SlotStore (const std::string &path, const SlotStoreFormat &format, const Identity &identity, std::string_view identity_text, size_t max_records=DEFAULT_MAX_RECORDS)
State & state () noexcept
template<typename F>
void for_each (F &&f) const
uint32_t save (uint32_t index, const Record &record)
void release (uint32_t index) noexcept
size_t capacity () const noexcept
size_t size () const noexcept
const std::string & path () const noexcept
bool created () const noexcept

Static Public Attributes

static constexpr uint32_t NO_SLOT = UINT32_MAX
static constexpr size_t DEFAULT_MAX_RECORDS = 4096

Detailed Description

template<typename State, typename Record>
class slick::trader::SlotStore< State, Record >

Definition at line 80 of file slot_store.hpp.

Member Typedef Documentation

◆ Identity

template<typename State, typename Record>
using slick::trader::SlotStore< State, Record >::Identity = std::array<char, detail::SlotFile::IDENTITY_SIZE>

Definition at line 88 of file slot_store.hpp.

Constructor & Destructor Documentation

◆ SlotStore()

template<typename State, typename Record>
slick::trader::SlotStore< State, Record >::SlotStore ( const std::string & path,
const SlotStoreFormat & format,
const Identity & identity,
std::string_view identity_text,
size_t max_records = DEFAULT_MAX_RECORDS )
inline

Definition at line 90 of file slot_store.hpp.

References DEFAULT_MAX_RECORDS, and path().

Member Function Documentation

◆ capacity()

template<typename State, typename Record>
size_t slick::trader::SlotStore< State, Record >::capacity ( ) const
inlinenodiscardnoexcept

Definition at line 148 of file slot_store.hpp.

◆ created()

template<typename State, typename Record>
bool slick::trader::SlotStore< State, Record >::created ( ) const
inlinenodiscardnoexcept

Definition at line 152 of file slot_store.hpp.

◆ for_each()

template<typename State, typename Record>
template<typename F>
void slick::trader::SlotStore< State, Record >::for_each ( F && f) const
inline

Definition at line 109 of file slot_store.hpp.

◆ path()

template<typename State, typename Record>
const std::string & slick::trader::SlotStore< State, Record >::path ( ) const
inlinenodiscardnoexcept

Definition at line 150 of file slot_store.hpp.

Referenced by SlotStore().

◆ release()

template<typename State, typename Record>
void slick::trader::SlotStore< State, Record >::release ( uint32_t index)
inlinenoexcept

Definition at line 141 of file slot_store.hpp.

References state().

◆ save()

template<typename State, typename Record>
uint32_t slick::trader::SlotStore< State, Record >::save ( uint32_t index,
const Record & record )
inline

Definition at line 120 of file slot_store.hpp.

References NO_SLOT.

◆ size()

template<typename State, typename Record>
size_t slick::trader::SlotStore< State, Record >::size ( ) const
inlinenodiscardnoexcept

Definition at line 149 of file slot_store.hpp.

◆ state()

template<typename State, typename Record>
State & slick::trader::SlotStore< State, Record >::state ( )
inlinenodiscardnoexcept

Definition at line 105 of file slot_store.hpp.

Referenced by release().

Member Data Documentation

◆ DEFAULT_MAX_RECORDS

template<typename State, typename Record>
size_t slick::trader::SlotStore< State, Record >::DEFAULT_MAX_RECORDS = 4096
staticconstexpr

Definition at line 87 of file slot_store.hpp.

Referenced by SlotStore().

◆ NO_SLOT

template<typename State, typename Record>
uint32_t slick::trader::SlotStore< State, Record >::NO_SLOT = UINT32_MAX
staticconstexpr

Definition at line 86 of file slot_store.hpp.

Referenced by save().


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