TT CORE SDK  0.1
TT CORE SDK documentation
tt_core_sdk::OrderHandle Class Reference

Represents the current state of the order. More...

#include <orders.hpp>

Inheritance diagram for tt_core_sdk::OrderHandle:
Collaboration diagram for tt_core_sdk::OrderHandle:

Public Member Functions

 OrderHandle (OrderManager &manager, const order_profile &profile)
 OrderHandle ctor. More...
 
 OrderHandle (std::unique_ptr< OrderHandleImpl > &&)
 OrderHandle ctor (Internal use only) More...
 
 ~OrderHandle (void) noexcept
 OrderHandle dtor. More...
 
const std::string & GetOrderId (void) const noexcept
 TT Order Id. More...
 
double GetPrice (void) const noexcept
 Order price (NAN if not available) More...
 
int32_t GetOrderQuantity (void) const noexcept
 Order quantity (0 if not available) More...
 
int32_t GetWorkingQuantity (void) const noexcept
 Quantity working in the market (0 if not available) More...
 
void ChangeOrder (change_request &request)
 Change the order. More...
 
void ChangePrice (double price, uint32_t request_id=0)
 Change the order price. More...
 
void ChangeQuantity (int32_t quantity, uint32_t request_id=0)
 Change the order quantity. More...
 
void ChangePriceQuantity (double price, int32_t quantity, uint32_t request_id=0)
 Change the order price and quantity. More...
 
void DeleteOrder (uint32_t request_id=0)
 Delete the order from the market. More...
 
 OrderHandle (const OrderHandle &)=delete
 Copy/Move disabled. More...
 
OrderHandleoperator= (const OrderHandle &)=delete
 
 OrderHandle (OrderHandle &&)=delete
 
OrderHandleoperator= (OrderHandle &&)=delete
 

Friends

class OrderManager
 
class OrderManagerImpl
 
class SharedOrderManagerImpl
 

Detailed Description

Represents the current state of the order.

Order handles provide an interface with how to interact with the order. CoreSDK maintains an internal cache of the working orders, therefore requiring an OrderHandle be encapsulated in a std::shared_ptr.

Definition at line 65 of file orders.hpp.

Constructor & Destructor Documentation

◆ OrderHandle() [1/4]

tt_core_sdk::OrderHandle::OrderHandle ( OrderManager manager,
const order_profile profile 
)
explicit

OrderHandle ctor.

Constructs the object using the definition provided by the order_profile Struct. The order is NOT submitted upon construction, that is done via the OrderManager. Once the order is working, methods to change/delete the order will become active.

Parameters
[in]managerOrderManager responsible for submission
[in]profileProfile defining the order
Exceptions
std::runtime_errorOrderHandle failed to be constructed

◆ OrderHandle() [2/4]

tt_core_sdk::OrderHandle::OrderHandle ( std::unique_ptr< OrderHandleImpl > &&  )
explicit

OrderHandle ctor (Internal use only)

◆ ~OrderHandle()

tt_core_sdk::OrderHandle::~OrderHandle ( void  )
noexcept

OrderHandle dtor.

◆ OrderHandle() [3/4]

tt_core_sdk::OrderHandle::OrderHandle ( const OrderHandle )
delete

Copy/Move disabled.

◆ OrderHandle() [4/4]

tt_core_sdk::OrderHandle::OrderHandle ( OrderHandle &&  )
delete

Member Function Documentation

◆ ChangeOrder()

void tt_core_sdk::OrderHandle::ChangeOrder ( change_request request)

Change the order.

Change is performed in accordance to the values in the provided request. CoreSDK will populate the request_time field.

Parameters
[in]requestChange request profile

◆ ChangePrice()

void tt_core_sdk::OrderHandle::ChangePrice ( double  price,
uint32_t  request_id = 0 
)

Change the order price.

Parameters
[in]priceChange price
[in]request_idId echoed back on acknowledgement

◆ ChangePriceQuantity()

void tt_core_sdk::OrderHandle::ChangePriceQuantity ( double  price,
int32_t  quantity,
uint32_t  request_id = 0 
)

Change the order price and quantity.

Parameters
[in]priceChange price
[in]quantityChange quantity
[in]request_idId echoed back on acknowledgement

◆ ChangeQuantity()

void tt_core_sdk::OrderHandle::ChangeQuantity ( int32_t  quantity,
uint32_t  request_id = 0 
)

Change the order quantity.

Parameters
[in]quantityChange quantity
[in]request_idId echoed back on acknowledgement

◆ DeleteOrder()

void tt_core_sdk::OrderHandle::DeleteOrder ( uint32_t  request_id = 0)

Delete the order from the market.

Parameters
[in]request_idId echoed back on acknowledgement

◆ GetOrderId()

const std::string& tt_core_sdk::OrderHandle::GetOrderId ( void  ) const
noexcept

TT Order Id.

Note
Id is generated on construction, and will be populated prior to submission

◆ GetOrderQuantity()

int32_t tt_core_sdk::OrderHandle::GetOrderQuantity ( void  ) const
noexcept

Order quantity (0 if not available)

◆ GetPrice()

double tt_core_sdk::OrderHandle::GetPrice ( void  ) const
noexcept

Order price (NAN if not available)

◆ GetWorkingQuantity()

int32_t tt_core_sdk::OrderHandle::GetWorkingQuantity ( void  ) const
noexcept

Quantity working in the market (0 if not available)

◆ operator=() [1/2]

OrderHandle& tt_core_sdk::OrderHandle::operator= ( const OrderHandle )
delete

◆ operator=() [2/2]

OrderHandle& tt_core_sdk::OrderHandle::operator= ( OrderHandle &&  )
delete

Friends And Related Function Documentation

◆ OrderManager

friend class OrderManager
friend

Definition at line 131 of file orders.hpp.

◆ OrderManagerImpl

friend class OrderManagerImpl
friend

Definition at line 132 of file orders.hpp.

◆ SharedOrderManagerImpl

friend class SharedOrderManagerImpl
friend

Definition at line 133 of file orders.hpp.


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