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
MatchedOrderDetail Class Reference

Stores details of a matched order, including price, quantity, and time. More...

#include <MatchedOrderDetails.hpp>

Public Member Functions

 MatchedOrderDetail (Price price, Quantity qty)
 Constructs a MatchedOrderDetail with specified price and quantity. More...
 
Price getPrice () const
 Retrieves the price of the matched order. More...
 
Quantity getQuantity () const
 Retrieves the quantity of the matched order. More...
 
std::string getTime () const
 Retrieves the timestamp of when the order was matched as a formatted string. More...
 

Detailed Description

Stores details of a matched order, including price, quantity, and time.

The MatchedOrderDetail class represents an individual matched order in a trading system. It contains the order's price, quantity, and timestamp, and provides accessors for retrieving each of these details.

Constructor & Destructor Documentation

◆ MatchedOrderDetail()

MatchedOrderDetail::MatchedOrderDetail ( Price  price,
Quantity  qty 
)
inline

Constructs a MatchedOrderDetail with specified price and quantity.

Initializes the matched order with the given price and quantity, and sets the timestamp to the current system time.

Parameters
priceThe price at which the order was matched.
qtyThe quantity of the matched order.

Member Function Documentation

◆ getPrice()

Price MatchedOrderDetail::getPrice ( ) const
inline

Retrieves the price of the matched order.

Returns
The price at which the order was matched.

◆ getQuantity()

Quantity MatchedOrderDetail::getQuantity ( ) const
inline

Retrieves the quantity of the matched order.

Returns
The quantity of the matched order.

◆ getTime()

std::string MatchedOrderDetail::getTime ( ) const
inline

Retrieves the timestamp of when the order was matched as a formatted string.

Converts the internal timestamp to a string in the format "YYYY-MM-DD HH:MM:SS".

Returns
A string representation of the timestamp in local time.

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