|
BetaTrader
A HFT Eco-System
|
Manages all the orders in the system. More...
#include <OrderManager.h>

Public Member Functions | |
| OrderManager ()=default | |
| Default constructor. | |
| virtual | ~OrderManager ()=default |
| virtual bool | addOrder (std::unique_ptr< common::Order > order) |
| Adds an order to the order manager. | |
| bool | containsOrderById (const common::OrderID &id) const |
| Checks if an order exists in the order manager. | |
| virtual std::optional< common::Order * > | getOrderByClientOrderId (const std::string &clOrdId) const |
| Gets an order by its client-assigned ID. | |
| virtual std::optional< common::Order * > | getOrderById (const common::OrderID &id) const |
| Gets an order by its core ID. | |
| const std::unordered_map< common::OrderID, std::unique_ptr< common::Order > > & | getOrders () const |
| Gets a const reference to the underlying order map. | |
| virtual bool | removeOrderById (const common::OrderID &id) |
| Removes an order by its ID. | |
| size_t | size () const |
| Gets the number of orders in the order manager. | |
Private Attributes | |
| std::unordered_map< common::OrderID, std::unique_ptr< common::Order > > | mOrderMap |
| A map of order IDs to orders. | |
Manages all the orders in the system.
This class is responsible for adding, removing, and retrieving orders. It stores all orders in an unordered map, using the order ID as the key.
|
virtualdefault |
|
default |
Default constructor.
|
virtual |
Adds an order to the order manager.
| order | A unique pointer to the order to be added. |

| bool trading_core::OrderManager::containsOrderById | ( | const common::OrderID & | id | ) | const |
Checks if an order exists in the order manager.
| id | The ID of the order to check. |
|
virtual |
Gets an order by its client-assigned ID.
| clOrdId | The client order ID to search for. |
|
virtual |
Gets an order by its core ID.
| id | The ID of the order to retrieve. |

| const std::unordered_map< common::OrderID, std::unique_ptr< common::Order > > & trading_core::OrderManager::getOrders | ( | ) | const |
Gets a const reference to the underlying order map.
|
virtual |
Removes an order by its ID.
| id | The ID of the order to be removed. |

| size_t trading_core::OrderManager::size | ( | ) | const |
Gets the number of orders in the order manager.
|
private |
A map of order IDs to orders.