BetaTrader
A HFT Eco-System
Loading...
Searching...
No Matches
NewOrder.h
Go to the documentation of this file.
1//
2// Created by sujal on 21-10-2025.
3//
4
5#pragma once
6#include "Command.h"
7#include "common/Order.h"
8#include <memory>
9
10namespace trading_core {
19 class NewOrder : public Command {
20 public:
28 explicit NewOrder(const common::ClientID& clientId,
29 const common::Timestamp timestamp,
30 std::unique_ptr<common::Order> order)
31 : Command(CommandType::NewOrder, clientId, timestamp),
32 mOrder(std::move(order)) {};
33
38 [[nodiscard]] common::Order* getOrder() const { return mOrder.get(); }
39
44 [[nodiscard]] std::unique_ptr<common::Order> releaseOrder()
45 {
46 return std::move(mOrder);
47 }
48
49 private:
50 std::unique_ptr<common::Order>
52 };
53} // namespace trading_core
Represents a single trading order in the system.
Definition Order.h:19
An internal representation of a request, converted from an FIX message into this object for faster pr...
Definition Command.h:22
A command to submit a new order to the trading engine.
Definition NewOrder.h:19
common::Order * getOrder() const
Gets the order associated with this command.
Definition NewOrder.h:38
NewOrder(const common::ClientID &clientId, const common::Timestamp timestamp, std::unique_ptr< common::Order > order)
Constructs a new NewOrder command.
Definition NewOrder.h:28
std::unique_ptr< common::Order > mOrder
A unique pointer to the new order.
Definition NewOrder.h:51
std::unique_ptr< common::Order > releaseOrder()
Releases ownership of the order.
Definition NewOrder.h:44
std::chrono::system_clock::time_point Timestamp
A type alias for std::chrono::system_clock::time_point.
Definition Time.h:15
std::string ClientID
A type alias for client identifiers.
Definition Types.h:140
Definition CancelOrder.h:10
CommandType
Represents the different types of commands that can be processed by the trading engine.
Definition CommandType.h:13