dxFeed Graal CXX API v4.2.0
Loading...
Searching...
No Matches
MarketDepthModelListener< O > Struct Template Referencefinal

Invoked when the order book is changed. More...

#include <MarketDepthModelListener.hpp>

+ Inheritance diagram for MarketDepthModelListener< O >:

Public Types

using Signature
 The listener's callback (and handler) signature.
 
- Public Types inherited from SharedEntity
using Ptr = std::shared_ptr<SharedEntity>
 The alias to a type of shared pointer to the SharedEntity object.
 

Public Member Functions

SimpleHandler< Signature > & getHandler ()
 
- Public Member Functions inherited from SharedEntity
template<typename T>
bool is () const noexcept
 Checks that pointer to the current type could be converted to type T* In other words: whether type T belongs to the type hierarchy in which the current type resides.
 
template<typename T>
std::shared_ptr< T > sharedAs () noexcept
 Returns a pointer to the current object wrapped in a smart pointer to type T.
 
template<typename T>
std::shared_ptr< T > sharedAs () const noexcept
 Returns a pointer to the current object wrapped in a smart pointer to type T.
 
virtual std::string toString () const
 Returns a string representation of the current object.
 
- Public Member Functions inherited from Entity
virtual ~Entity () noexcept=default
 The default virtual d-tor.
 

Static Public Member Functions

static std::shared_ptr< MarketDepthModelListenercreate (std::function< Signature > onEventsReceived)
 Constructs the new listener from the callback.
 
- Static Public Member Functions inherited from RequireMakeShared< MarketDepthModelListener< O > >
static auto createShared (Args &&...args)
 Creates smart pointer to object.
 

Detailed Description

template<Derived< OrderBase > O>
struct MarketDepthModelListener< O >

Invoked when the order book is changed.

The MarketDepthModelListener is used to handle notifications of changes to the market depth, including updates to the buy and sell orders. Use the MarketDepthModelListener::create() method, passing it a lambda, function, or function object to create an instance of the listener to process or react to changes in the market order book.

Template Parameters
OThe type of order derived from OrderBase.

Member Function Documentation

◆ create()

template<Derived< OrderBase > O>
static std::shared_ptr< MarketDepthModelListener > MarketDepthModelListener< O >::create ( std::function< Signature > onEventsReceived)
inlinestatic

Constructs the new listener from the callback.

Parameters
onEventsReceivedThe callback (a lambda, a function or a functional object) with signature void(const std::vector<std::shared_ptr<O>> buyOrders, const std::vector<std::shared_ptr<O>> buyOrders)
Returns
the new listener.

◆ getHandler()

template<Derived< OrderBase > O>
SimpleHandler< Signature > & MarketDepthModelListener< O >::getHandler ( )
inline
Returns
A handler of the listener.