Orderbook Simulation
OrderbookSim is a C++ application simulating a financial market order book. It efficiently manages and matches buy and sell orders while calculating the Volume-Weighted Average Price (VWAP).
Public Member Functions | List of all members
OrderModify Class Reference

Represents a modification to an existing order. More...

#include <OrderModify.hpp>

Public Member Functions

 OrderModify (OrderId orderId, Side side, Price price, Quantity quantity)
 Constructs an OrderModify object with the specified parameters. More...
 
OrderId getOrderId () const
 Gets the order ID of the modified order. More...
 
Price getPrice () const
 Gets the price of the modified order. More...
 
Side getSide () const
 Gets the side (buy or sell) of the modified order. More...
 
Quantity getQuantity () const
 Gets the quantity of the modified order. More...
 
OrderPtr toOrderPtr (OrderType type) const
 Converts the order modification into a shared pointer to a new Order object. More...
 

Detailed Description

Represents a modification to an existing order.

The OrderModify class is used to store and apply modifications to an order. It includes details such as the modified order's ID, price, side (buy/sell), and quantity. The class also provides a method to convert these modifications into a new Order object.

Constructor & Destructor Documentation

◆ OrderModify()

OrderModify::OrderModify ( OrderId  orderId,
Side  side,
Price  price,
Quantity  quantity 
)
inline

Constructs an OrderModify object with the specified parameters.

Parameters
orderIdThe unique identifier of the order to modify.
sideThe side (buy or sell) of the order.
priceThe updated price of the order.
quantityThe updated quantity of the order.

Member Function Documentation

◆ getOrderId()

OrderId OrderModify::getOrderId ( ) const
inline

Gets the order ID of the modified order.

Returns
The OrderId of the modified order.

◆ getPrice()

Price OrderModify::getPrice ( ) const
inline

Gets the price of the modified order.

Returns
The updated Price of the modified order.

◆ getQuantity()

Quantity OrderModify::getQuantity ( ) const
inline

Gets the quantity of the modified order.

Returns
The updated Quantity of the modified order.

◆ getSide()

Side OrderModify::getSide ( ) const
inline

Gets the side (buy or sell) of the modified order.

Returns
The updated Side of the modified order.

◆ toOrderPtr()

OrderPtr OrderModify::toOrderPtr ( OrderType  type) const
inline

Converts the order modification into a shared pointer to a new Order object.

Creates a new OrderPtr from the modification details using the specified order type.

Parameters
typeThe type of the new order to create (e.g., market, limit).
Returns
A shared pointer (OrderPtr) to a newly created Order with the modification details.

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