CBOE Emulator  1.0
Public Member Functions | List of all members
OrderEntry::Client Class Reference

A client for interacting with the direct market access server. More...

#include <client.hpp>

Public Member Functions

 Client (asio::io_context &context, std::string host, std::string port)
 Create a new order entry client. More...
 
bool is_logged_in () const
 Return true if the client is authorized, false otherwise. More...
 
const OrderIDSetget_active_orders () const
 Return the set of active orders for this client connection. More...
 
bool has_active_order () const
 Return true if the client has an active order. More...
 
void set_shares (ClientShares shares_)
 Set the client shares to a new value. More...
 
ClientShares get_shares () const
 Return the number of shares the client currently has. More...
 
void set_capital (ClientCapital capital_)
 Set the client capital to a new value. More...
 
ClientCapital get_capital () const
 Return the amount of capital the client currently has. More...
 
template<class T , typename ... Args>
void send (Args &&...args)
 Write a message asynchronously (non-blocking). More...
 
template<class T , typename ... Args>
void send_sync (Args &&...args)
 Write a message synchronously (blocking). More...
 

Detailed Description

A client for interacting with the direct market access server.

Constructor & Destructor Documentation

◆ Client()

OrderEntry::Client::Client ( asio::io_context &  context,
std::string  host,
std::string  port 
)
inline

Create a new order entry client.

Parameters
contextthe IO context to run the client on
hostthe host address of the order entry server
portthe port number the order entry server runs at

Member Function Documentation

◆ get_active_orders()

const OrderIDSet& OrderEntry::Client::get_active_orders ( ) const
inline

Return the set of active orders for this client connection.

Returns
a constant set of order IDs representing active orders

◆ get_capital()

ClientCapital OrderEntry::Client::get_capital ( ) const
inline

Return the amount of capital the client currently has.

Returns
the amount of capital in the client's local account

◆ get_shares()

ClientShares OrderEntry::Client::get_shares ( ) const
inline

Return the number of shares the client currently has.

Returns
the number of shares in the client's local account

◆ has_active_order()

bool OrderEntry::Client::has_active_order ( ) const
inline

Return true if the client has an active order.

Returns
true if there is an active limit order for the account

◆ is_logged_in()

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

Return true if the client is authorized, false otherwise.

Returns
true if the client is authorized to send messages

◆ send()

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

Write a message asynchronously (non-blocking).

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

◆ send_sync()

template<class T , typename ... Args>
void OrderEntry::Client::send_sync ( Args &&...  args)
inline

Write a message synchronously (blocking).

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

◆ set_capital()

void OrderEntry::Client::set_capital ( ClientCapital  capital_)
inline

Set the client capital to a new value.

Parameters
capital_the new amount of capital for the client

◆ set_shares()

void OrderEntry::Client::set_shares ( ClientShares  shares_)
inline

Set the client shares to a new value.

Parameters
shares_the new amount of shares for the client

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