CBOE Emulator  1.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
OrderEntry::Connection Class Reference

A TCP connection to a client device for providing direct market access. More...

#include <connection.hpp>

Inheritance diagram for OrderEntry::Connection:

Public Types

typedef std::shared_ptr< ConnectionPointer
 a shared pointer type for this connection object
 

Public Member Functions

tcp::socket & get_socket ()
 Return the socket this connection is using. More...
 
bool is_logged_in () const
 Return true if the connection is authorized, false otherwise. More...
 
uint32_t get_output_buffer_size () const
 Return the size of the output buffer (number of queued messages). More...
 
SequenceNumber get_sequence () const
 Return the sequence number at this sender. More...
 
void start ()
 Start the connection.
 
void trade (OrderID order_id, Price price, Quantity size, Quantity leaves_size, Side side)
 Send a trade message to the client. More...
 

Static Public Member Functions

static Pointer create (asio::io_context &context, Authorizer< Connection > &authorizer, LOB::LimitOrderBook &book)
 Create a shared pointer to a new connection. More...
 

Detailed Description

A TCP connection to a client device for providing direct market access.

Member Function Documentation

◆ create()

static Pointer OrderEntry::Connection::create ( asio::io_context &  context,
Authorizer< Connection > &  authorizer,
LOB::LimitOrderBook book 
)
inlinestatic

Create a shared pointer to a new connection.

Parameters
contextthe IO context to create the connection with
authorizerthe authorizer for credential / account management
bookthe limit order book for the instrument
Returns
a shared pointer to the new connection

◆ get_output_buffer_size()

uint32_t OrderEntry::Connection::get_output_buffer_size ( ) const
inline

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

Returns
the number of messages in the outbound queue

◆ get_sequence()

SequenceNumber OrderEntry::Connection::get_sequence ( ) const
inline

Return the sequence number at this sender.

Returns
the sequence number of the next message to send

◆ get_socket()

tcp::socket& OrderEntry::Connection::get_socket ( )
inline

Return the socket this connection is using.

Returns
the socket this connection is using

◆ is_logged_in()

bool OrderEntry::Connection::is_logged_in ( ) const
inline

Return true if the connection is authorized, false otherwise.

Returns
true if the connection has been authorized (logged in)

◆ trade()

void OrderEntry::Connection::trade ( OrderID  order_id,
Price  price,
Quantity  size,
Quantity  leaves_size,
Side  side 
)
inline

Send a trade message to the client.

Parameters
order_idthe ID of the trade that occurred
pricethe price the trade occurred at
sizethe size of the trade the occurred
leaves_sizethe size left on the order after the trade
sidethe side of the book the trade is for

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