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

#include <slick-trader/web/sim_control.hpp>

Collaboration diagram for slick::trader::SimControl:

Classes

struct  ReplayAnswer

Public Member Functions

 SimControl (ByteTransport &transport)
void on_connected (uint64_t now_ns)
size_t on_data (const uint8_t *data, size_t size, uint64_t now_ns)
void on_timer (uint64_t now_ns)
void on_disconnected ()
bool ready_to_connect (uint64_t) const noexcept
bool held () const noexcept
void on_lost ()
bool connected () const noexcept
const std::string & version () const noexcept
std::string_view environment () const noexcept
const SimFeedList & list () const noexcept
const std::vector< SimFeed > & feeds () const noexcept
std::string start_blocked () const
bool start_replay (uint64_t now_ns)
bool take_changed () noexcept
std::optional< ReplayAnswer > take_replay_answer ()
nlohmann::json to_json () const

Static Public Attributes

static constexpr uint64_t POLL_NS = 1'000'000'000
static constexpr uint64_t REPLY_TIMEOUT_NS = 5'000'000'000
static constexpr uint64_t STARTING_NS = 5'000'000'000

Detailed Description

Definition at line 94 of file sim_control.hpp.

Constructor & Destructor Documentation

◆ SimControl()

slick::trader::SimControl::SimControl ( ByteTransport & transport)
inlineexplicit

Definition at line 107 of file sim_control.hpp.

Member Function Documentation

◆ connected()

bool slick::trader::SimControl::connected ( ) const
inlinenoexcept

Definition at line 124 of file sim_control.hpp.

◆ environment()

std::string_view slick::trader::SimControl::environment ( ) const
inlinenoexcept

◆ feeds()

const std::vector< SimFeed > & slick::trader::SimControl::feeds ( ) const
inlinenoexcept

Definition at line 135 of file sim_control.hpp.

Referenced by to_json().

◆ held()

bool slick::trader::SimControl::held ( ) const
inlinenoexcept

Definition at line 118 of file sim_control.hpp.

◆ list()

const SimFeedList & slick::trader::SimControl::list ( ) const
inlinenoexcept

Definition at line 133 of file sim_control.hpp.

◆ on_connected()

void slick::trader::SimControl::on_connected ( uint64_t now_ns)

Definition at line 172 of file sim_control.cpp.

References slick::trader::sim_cli::GET_VERSION.

◆ on_data()

◆ on_disconnected()

void slick::trader::SimControl::on_disconnected ( )

Definition at line 233 of file sim_control.cpp.

References on_lost().

◆ on_lost()

void slick::trader::SimControl::on_lost ( )

Definition at line 252 of file sim_control.cpp.

Referenced by on_disconnected().

◆ on_timer()

void slick::trader::SimControl::on_timer ( uint64_t now_ns)

Definition at line 218 of file sim_control.cpp.

References STARTING_NS.

◆ ready_to_connect()

bool slick::trader::SimControl::ready_to_connect ( uint64_t ) const
inlinenoexcept

Definition at line 114 of file sim_control.hpp.

◆ start_blocked()

std::string slick::trader::SimControl::start_blocked ( ) const

◆ start_replay()

bool slick::trader::SimControl::start_replay ( uint64_t now_ns)

Definition at line 361 of file sim_control.cpp.

References start_blocked(), and slick::trader::sim_cli::START_REPLAY.

◆ take_changed()

bool slick::trader::SimControl::take_changed ( )
inlinenoexcept

Definition at line 144 of file sim_control.hpp.

◆ take_replay_answer()

std::optional< ReplayAnswer > slick::trader::SimControl::take_replay_answer ( )
inline

Definition at line 146 of file sim_control.hpp.

◆ to_json()

nlohmann::json slick::trader::SimControl::to_json ( ) const

Definition at line 371 of file sim_control.cpp.

References feeds(), start_blocked(), and slick::trader::to_string().

◆ version()

const std::string & slick::trader::SimControl::version ( ) const
inlinenoexcept

Definition at line 127 of file sim_control.hpp.

Referenced by on_data().

Member Data Documentation

◆ POLL_NS

uint64_t slick::trader::SimControl::POLL_NS = 1'000'000'000
staticconstexpr

Definition at line 96 of file sim_control.hpp.

◆ REPLY_TIMEOUT_NS

uint64_t slick::trader::SimControl::REPLY_TIMEOUT_NS = 5'000'000'000
staticconstexpr

Definition at line 98 of file sim_control.hpp.

◆ STARTING_NS

uint64_t slick::trader::SimControl::STARTING_NS = 5'000'000'000
staticconstexpr

Definition at line 100 of file sim_control.hpp.

Referenced by on_timer().


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