CBOE Emulator  1.0
Public Member Functions | List of all members
DataFeed::Sender Class Reference

A class for multi-casting depth of book messages from a LOB::LimitOrderBook. More...

#include <sender.hpp>

Public Member Functions

 Sender (asio::io_context &context, const asio::ip::address &group, uint16_t port)
 Initialize a new data feed multi-cast server. More...
 
void set_ttl (uint32_t ttl)
 Set the TTL hops for messages rendered by the sender. More...
 
void enable_loopback ()
 Enable loop-back for the sender.
 
void set_outbound_interface (const asio::ip::address_v4 &interface)
 Set the outbound interface for the sender. More...
 
SequenceNumber get_sequence () const
 Return the sequence number at this sender. More...
 
asio::ip::address group () const
 Return the group that this sender is sending to. More...
 
uint16_t port () const
 Return the port this sender is running at. More...
 
uint32_t get_output_buffer_size () const
 Return the current size of the output buffer (number of messages). More...
 
template<class T , typename ... Args>
void send (Args &&...args)
 Send a message. More...
 

Detailed Description

A class for multi-casting depth of book messages from a LOB::LimitOrderBook.

Constructor & Destructor Documentation

◆ Sender()

DataFeed::Sender::Sender ( asio::io_context &  context,
const asio::ip::address &  group,
uint16_t  port 
)
inline

Initialize a new data feed multi-cast server.

Parameters
contextthe IO context to run the server on
groupthe multi-cast group address in the range [224.0.0.0, 239.255.255.255]
portthe port to send the packets to

Member Function Documentation

◆ get_output_buffer_size()

uint32_t DataFeed::Sender::get_output_buffer_size ( ) const
inline

Return the current size of the output buffer (number of messages).

Returns
the number of message currently in the output buffer

◆ get_sequence()

SequenceNumber DataFeed::Sender::get_sequence ( ) const
inline

Return the sequence number at this sender.

Returns
the sequence number of the next message to send

◆ group()

asio::ip::address DataFeed::Sender::group ( ) const
inline

Return the group that this sender is sending to.

Returns
the UDP multi-cast group that this sender sends to

◆ port()

uint16_t DataFeed::Sender::port ( ) const
inline

Return the port this sender is running at.

Returns
the UDP port this service is running at

◆ send()

template<class T , typename ... Args>
void DataFeed::Sender::send ( Args &&...  args)
inline

Send a message.

Template Parameters
Tthe class of the message to send
Parameters
...argsthe initialization parameters for the object

◆ set_outbound_interface()

void DataFeed::Sender::set_outbound_interface ( const asio::ip::address_v4 &  interface)
inline

Set the outbound interface for the sender.

Parameters
interfacethe IPv4 address of the interface to bind to

◆ set_ttl()

void DataFeed::Sender::set_ttl ( uint32_t  ttl)
inline

Set the TTL hops for messages rendered by the sender.

Parameters
ttlthe number of hops to limit the multi-cast packets to

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