diff --git a/src/server/sparkd/cmds/spartan/domain/book/BookLevel.cc b/src/server/sparkd/cmds/spartan/domain/book/BookLevel.cc new file mode 100644 index 000000000..418ebbeb8 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/domain/book/BookLevel.cc @@ -0,0 +1,14 @@ +#include "BookLevel.h" + +namespace bts::spartan::mdp3 { + +constexpr bool BookLevel::operator==(const BookLevel &other) const { + return price == other.price && quantity == other.quantity && + n_orders == other.n_orders; +} + +constexpr bool BookLevel::operator!=(const BookLevel &other) const { + return !(*this == other); +} + +} // namespace bts::spartan::mdp3 diff --git a/src/server/sparkd/cmds/spartan/domain/book/BookLevel.h b/src/server/sparkd/cmds/spartan/domain/book/BookLevel.h index 7dacf5c1f..9f6d76dd6 100644 --- a/src/server/sparkd/cmds/spartan/domain/book/BookLevel.h +++ b/src/server/sparkd/cmds/spartan/domain/book/BookLevel.h @@ -1,8 +1,6 @@ #pragma once - -#include -#include "server/sparkd/cmds/spartan/domain/Quantity.h" #include "server/sparkd/cmds/spartan/domain/Price.h" +#include "server/sparkd/cmds/spartan/domain/Quantity.h" namespace bts::spartan::mdp3 { @@ -11,11 +9,11 @@ class BookLevel { Price price; Quantity quantity = Quantity{0}; int32_t n_orders = 0; - bool operator==(BookLevel const &other) const { - return price == other.price && - quantity.value() == other.quantity.value() && - n_orders == other.n_orders; - } + + constexpr bool operator==(const BookLevel &) const; + constexpr bool operator!=(const BookLevel &) const; }; -} +} // namespace bts::spartan::mdp3 + +#include "BookLevel.cc"