| 84 | #endif |
| 85 | |
| 86 | struct Order |
| 87 | { |
| 88 | int32_t id; |
| 89 | std::string symbol; |
| 90 | ::proto::OrderSide side; |
| 91 | ::proto::OrderType type; |
| 92 | double price; |
| 93 | double volume; |
| 94 | |
| 95 | size_t fbe_type() const noexcept { return 1; } |
| 96 | |
| 97 | Order(); |
| 98 | Order(int32_t arg_id, const std::string& arg_symbol, const ::proto::OrderSide& arg_side, const ::proto::OrderType& arg_type, double arg_price, double arg_volume); |
| 99 | Order(const Order& other) = default; |
| 100 | Order(Order&& other) = default; |
| 101 | ~Order() = default; |
| 102 | |
| 103 | Order& operator=(const Order& other) = default; |
| 104 | Order& operator=(Order&& other) = default; |
| 105 | |
| 106 | bool operator==(const Order& other) const noexcept; |
| 107 | bool operator!=(const Order& other) const noexcept { return !operator==(other); } |
| 108 | bool operator<(const Order& other) const noexcept; |
| 109 | bool operator<=(const Order& other) const noexcept { return operator<(other) || operator==(other); } |
| 110 | bool operator>(const Order& other) const noexcept { return !operator<=(other); } |
| 111 | bool operator>=(const Order& other) const noexcept { return !operator<(other); } |
| 112 | |
| 113 | std::string string() const { std::stringstream ss; ss << *this; return ss.str(); } |
| 114 | |
| 115 | friend std::ostream& operator<<(std::ostream& stream, const Order& value); |
| 116 | |
| 117 | void swap(Order& other) noexcept; |
| 118 | friend void swap(Order& value1, Order& value2) noexcept { value1.swap(value2); } |
| 119 | }; |
| 120 | |
| 121 | } // namespace proto |
| 122 |
no outgoing calls