exchange
Low-latency exchange in C++
Loading...
Searching...
No Matches
order_id.hpp
Go to the documentation of this file.
1#pragma once
3#include <boost/uuid/uuid.hpp>
4
5#include <functional>
6
7namespace exchange::server
8{
9struct OrderId
10{
11 boost::uuids::uuid uuid;
12 OrderId() = default;
13 explicit OrderId(const boost::uuids::uuid uuid) : uuid(uuid)
14 {
15 }
16
17 bool operator==(const OrderId &other) const
18 {
19 return uuid == other.uuid;
20 }
21};
22} // namespace exchange::server
23
24template <> struct std::hash<exchange::server::OrderId>
25{
26 std::size_t operator()(const exchange::server::OrderId &id) const noexcept
27 {
28 return std::hash<boost::uuids::uuid>{}(id.uuid);
29 }
30};
Definition main.hpp:4
Definition cli_parsing.hpp:10
Definition order_id.hpp:10
boost::uuids::uuid uuid
Definition order_id.hpp:11
bool operator==(const OrderId &other) const
Definition order_id.hpp:17
OrderId(const boost::uuids::uuid uuid)
Definition order_id.hpp:13
std::size_t operator()(const exchange::server::OrderId &id) const noexcept
Definition order_id.hpp:26