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

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

Inheritance diagram for slick::trader::Level2Streams< Client >:
Collaboration diagram for slick::trader::Level2Streams< Client >:

Public Types

using Clients = std::unordered_set<Client*>

Public Member Functions

const Clients & apply (const Level2UpdateEvent &event)
const Clients & trade (const TradeEvent &event)
const LastTrade * last_trade (std::string_view instrument) const
const Level2Book * subscribe (Client *client, std::string_view instrument)
bool unsubscribe (Client *client, std::string_view instrument)
template<typename F>
void remove (Client *client, F &&unwatched)
void remove (Client *client)
size_t watchers (std::string_view instrument) const
void release (std::string_view instrument)
void renew (std::string_view instrument)
size_t size () const noexcept

Static Public Attributes

static constexpr size_t MAX_STREAMS_PER_CLIENT = 1024

Detailed Description

template<typename Client>
class slick::trader::Level2Streams< Client >

Definition at line 234 of file level2_book.hpp.

Member Typedef Documentation

◆ Clients

template<typename Client>
using slick::trader::Level2Streams< Client >::Clients = std::unordered_set<Client*>

Definition at line 236 of file level2_book.hpp.

Member Function Documentation

◆ apply()

template<typename Client>
const Clients & slick::trader::Level2Streams< Client >::apply ( const Level2UpdateEvent & event)
inline

◆ last_trade()

template<typename Client>
const LastTrade * slick::trader::Level2Streams< Client >::last_trade ( std::string_view instrument) const
inline

Definition at line 264 of file level2_book.hpp.

References slick::trader::LastTrade::qty.

◆ release()

template<typename Client>
void slick::trader::Level2Streams< Client >::release ( std::string_view instrument)
inline

Definition at line 335 of file level2_book.hpp.

◆ remove() [1/2]

template<typename Client>
void slick::trader::Level2Streams< Client >::remove ( Client * client)
inline

Definition at line 320 of file level2_book.hpp.

References remove().

◆ remove() [2/2]

template<typename Client>
template<typename F>
void slick::trader::Level2Streams< Client >::remove ( Client * client,
F && unwatched )
inline

Definition at line 306 of file level2_book.hpp.

Referenced by remove().

◆ renew()

template<typename Client>
void slick::trader::Level2Streams< Client >::renew ( std::string_view instrument)
inline

Definition at line 341 of file level2_book.hpp.

◆ size()

template<typename Client>
size_t slick::trader::Level2Streams< Client >::size ( ) const
inlinenoexcept

Definition at line 355 of file level2_book.hpp.

◆ subscribe()

template<typename Client>
const Level2Book * slick::trader::Level2Streams< Client >::subscribe ( Client * client,
std::string_view instrument )
inline

◆ trade()

template<typename Client>
const Clients & slick::trader::Level2Streams< Client >::trade ( const TradeEvent & event)
inline

Definition at line 253 of file level2_book.hpp.

References slick::trader::Event::instrument.

◆ unsubscribe()

template<typename Client>
bool slick::trader::Level2Streams< Client >::unsubscribe ( Client * client,
std::string_view instrument )
inline

Definition at line 293 of file level2_book.hpp.

◆ watchers()

template<typename Client>
size_t slick::trader::Level2Streams< Client >::watchers ( std::string_view instrument) const
inline

Definition at line 325 of file level2_book.hpp.

Member Data Documentation

◆ MAX_STREAMS_PER_CLIENT

template<typename Client>
size_t slick::trader::Level2Streams< Client >::MAX_STREAMS_PER_CLIENT = 1024
staticconstexpr

Definition at line 239 of file level2_book.hpp.

Referenced by subscribe().


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