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

Represents a completed trade, containing information about the bid and ask sides. More...

#include <Trade.hpp>

Public Member Functions

 Trade (const TradeInfo &bidTrade, const TradeInfo &askTrade)
 Constructs a Trade object with specified bid and ask trade details. More...
 
const TradeInfogetBidTrade () const
 Retrieves the bid-side trade information of this Trade. More...
 
const TradeInfogetAskTrade () const
 Retrieves the ask-side trade information of this Trade. More...
 

Detailed Description

Represents a completed trade, containing information about the bid and ask sides.

A Trade object contains bid and ask details, encapsulated in TradeInfo objects. It provides methods to access these details, facilitating the retrieval of trade information in a trading system.

Constructor & Destructor Documentation

◆ Trade()

Trade::Trade ( const TradeInfo bidTrade,
const TradeInfo askTrade 
)
inline

Constructs a Trade object with specified bid and ask trade details.

Parameters
bidTradeThe TradeInfo for the bid side of the trade.
askTradeThe TradeInfo for the ask side of the trade.

Member Function Documentation

◆ getAskTrade()

const TradeInfo & Trade::getAskTrade ( ) const

Retrieves the ask-side trade information of this Trade.

The TradeInfo returned contains details about the ask side of the trade, including order ID, price, and quantity.

Returns
A constant reference to the TradeInfo associated with the ask side of the trade.

◆ getBidTrade()

const TradeInfo & Trade::getBidTrade ( ) const

Retrieves the bid-side trade information of this Trade.

The TradeInfo returned contains details about the bid side of the trade, including order ID, price, and quantity.

Returns
A constant reference to the TradeInfo associated with the bid side of the trade.

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