Fix server build after upgrading externals
This commit is contained in:
1 parent
ea8bad4ece
commit
2ef66bc91f
13 files changed
+42
-28
No files matched your search
@@ -590,7 +590,7 @@ struct MDRelayServer : bts::co2::AuthenticatedMarketDataRelayBase {
|
||||
#ifndef _WIN32
|
||||
auto elapsed = (TimeStamp::now() - start);
|
||||
_time->observe(elapsed.milliseconds());
|
||||
_size->observe(preply->ByteSize());
|
||||
_size->observe(preply->ByteSizeLong());
|
||||
#endif
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#define OSTREAM_FMT_IMPL(T) \
|
||||
template <> \
|
||||
struct fmt::formatter<T> { \
|
||||
constexpr auto parse(fmt::format_parse_context &ctx) { \
|
||||
return ctx.end(); \
|
||||
} \
|
||||
\
|
||||
template <typename FormatContext> \
|
||||
auto format(const T &t, FormatContext &ctx) { \
|
||||
return fmt::format_to(ctx.out(), "{}", t); \
|
||||
} \
|
||||
}
|
||||
@@ -23,7 +23,7 @@ TEST_CASE("AuthToken", "[security]") {
|
||||
SECTION("round trip admin") {
|
||||
auto token = api::auth::generate_token(admin_user);
|
||||
// We use 1 byte for api header size
|
||||
REQUIRE(token.ByteSize() <= 240);
|
||||
REQUIRE(token.ByteSizeLong() <= 240);
|
||||
api::user::TokenPayload payload;
|
||||
api::auth::clear_all_sessions();
|
||||
REQUIRE(!api::auth::requires_auth_session(admin_user));
|
||||
@@ -35,7 +35,7 @@ TEST_CASE("AuthToken", "[security]") {
|
||||
SECTION("round trip trader") {
|
||||
auto token = api::auth::generate_token(trader_user);
|
||||
// We use 1 byte for api header size
|
||||
REQUIRE(token.ByteSize() <= 240);
|
||||
REQUIRE(token.ByteSizeLong() <= 240);
|
||||
api::user::TokenPayload payload;
|
||||
api::auth::clear_all_sessions();
|
||||
REQUIRE(api::auth::decode_token(token, &payload));
|
||||
@@ -63,4 +63,4 @@ TEST_CASE("AuthToken", "[security]") {
|
||||
|
||||
} // namespace test
|
||||
} // namespace bts
|
||||
#endif
|
||||
#endif
|
||||
@@ -21,9 +21,6 @@ target_include_directories( sparkd PUBLIC
|
||||
${emumba-deribit-connector-library_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set_source_files_properties(exchange_sim/ExchangeSim.cpp PROPERTIES COMPILE_FLAGS --std=c++14)
|
||||
set_source_files_properties(exchange_sim/ExchangeSimApplication.cpp PROPERTIES COMPILE_FLAGS --std=c++14)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(emumba-deribit-connector-library REQUIRED emumba-deribit-connector)
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <mutex>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <google/btree/btree_set.h>
|
||||
#include <btree/set.h>
|
||||
#include <set>
|
||||
#include <unordered_set>
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace bts::cmds {
|
||||
// // update.set_quantity(2);
|
||||
|
||||
// // std::string buffer;
|
||||
// // buffer.resize(update.ByteSize());
|
||||
// // buffer.resize(update.ByteSizeLong());
|
||||
|
||||
// // bts_assert(update.SerializeToArray(&buffer[0], buffer.size()));
|
||||
// // for (auto _ : state) {
|
||||
@@ -692,7 +692,7 @@ BENCHMARK(boost_spsc);
|
||||
// // }
|
||||
// // }
|
||||
// // void set_btreeset_insert(::benchmark::State &state) {
|
||||
// // btree::btree_set<uintptr_t> s;
|
||||
// // btree::set<uintptr_t> s;
|
||||
// // size_t x = 0;
|
||||
// // for (auto _ : state) {
|
||||
// // x = std::rand();
|
||||
@@ -723,7 +723,7 @@ BENCHMARK(boost_spsc);
|
||||
// // }
|
||||
// // }
|
||||
// // void set_btreeset_iterate(::benchmark::State &state) {
|
||||
// // btree::btree_set<uintptr_t> s;
|
||||
// // btree::set<uintptr_t> s;
|
||||
// // size_t x = 0;
|
||||
// // for (auto _ : state) {
|
||||
// // x = std::rand();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "lib/utils/OSTREAM_FMT_IMPL.h"
|
||||
#include <fmt/format.h>
|
||||
#include <string>
|
||||
|
||||
namespace bts::spartan {
|
||||
@@ -57,3 +59,5 @@ class SpartanError {
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, SpartanError const &gw);
|
||||
} // namespace bts::spartan
|
||||
|
||||
OSTREAM_FMT_IMPL(bts::spartan::SpartanError);
|
||||
@@ -7,9 +7,6 @@ constexpr BookMark::BookMark() : _level(0), _offset(0) {}
|
||||
constexpr BookMark::BookMark(std::uint16_t level, mdp3::Quantity offset)
|
||||
: _level(level), _offset(offset) {}
|
||||
|
||||
constexpr BookMark::BookMark(const BookMark &other)
|
||||
: _level(other.level()), _offset(other.offset()) {}
|
||||
|
||||
constexpr std::uint16_t BookMark::level() const { return _level; }
|
||||
|
||||
constexpr mdp3::Quantity BookMark::offset() const { return _offset; }
|
||||
|
||||
@@ -14,7 +14,10 @@ class BookMark {
|
||||
public:
|
||||
constexpr BookMark();
|
||||
constexpr BookMark(std::uint16_t level, mdp3::Quantity offset);
|
||||
constexpr BookMark(const BookMark &);
|
||||
constexpr BookMark(const BookMark &) noexcept = default;
|
||||
BookMark(BookMark &&) noexcept = default;
|
||||
BookMark &operator=(const BookMark &) noexcept = default;
|
||||
BookMark &operator=(BookMark &&) noexcept = default;
|
||||
|
||||
constexpr std::uint16_t level() const;
|
||||
constexpr mdp3::Quantity offset() const;
|
||||
|
||||
@@ -9,9 +9,6 @@ SyntheticBook_Leg::SyntheticBook_Leg(
|
||||
LegDefinition def, const mdp3::BookSide *book)
|
||||
: _def(def), _book(book) {}
|
||||
|
||||
SyntheticBook_Leg::SyntheticBook_Leg(const SyntheticBook_Leg &other)
|
||||
: _def(other._def), _book(other._book) { }
|
||||
|
||||
const LegDefinition &SyntheticBook_Leg::def() const { return _def; }
|
||||
const mdp3::BookSide &SyntheticBook_Leg::book() const { return *_book; }
|
||||
void SyntheticBook_Leg::on_update(const MBPUpdate &) {
|
||||
|
||||
@@ -16,7 +16,10 @@ class SyntheticBook_Leg {
|
||||
public:
|
||||
SyntheticBook_Leg();
|
||||
SyntheticBook_Leg(LegDefinition, const mdp3::BookSide *);
|
||||
SyntheticBook_Leg(const SyntheticBook_Leg &);
|
||||
SyntheticBook_Leg(const SyntheticBook_Leg &) noexcept = default;
|
||||
SyntheticBook_Leg(SyntheticBook_Leg &&) noexcept = default;
|
||||
SyntheticBook_Leg &operator=(const SyntheticBook_Leg &) noexcept = default;
|
||||
SyntheticBook_Leg &operator=(SyntheticBook_Leg &&) noexcept = default;
|
||||
|
||||
const LegDefinition &def() const;
|
||||
const mdp3::BookSide &book() const;
|
||||
|
||||
@@ -160,16 +160,16 @@ void ExchangeSimApplication::onLogon(const FIX::SessionID &) {}
|
||||
void ExchangeSimApplication::onLogout(const FIX::SessionID &) {}
|
||||
void ExchangeSimApplication::toAdmin(FIX::Message &, const FIX::SessionID &) {}
|
||||
void ExchangeSimApplication::toApp(
|
||||
FIX::Message &, const FIX::SessionID &) throw(FIX::DoNotSend) {}
|
||||
FIX::Message &, const FIX::SessionID &) EXCEPT(FIX::DoNotSend) {}
|
||||
void ExchangeSimApplication::
|
||||
fromAdmin(const FIX::Message &, const FIX::SessionID &) throw(
|
||||
fromAdmin(const FIX::Message &, const FIX::SessionID &) EXCEPT(
|
||||
FIX::FieldNotFound,
|
||||
FIX::IncorrectDataFormat,
|
||||
FIX::IncorrectTagValue,
|
||||
FIX::RejectLogon) {}
|
||||
|
||||
void ExchangeSimApplication::
|
||||
fromApp(const FIX::Message &message, const FIX::SessionID &sessionID) throw(
|
||||
fromApp(const FIX::Message &message, const FIX::SessionID &sessionID) EXCEPT(
|
||||
FIX::FieldNotFound,
|
||||
FIX::IncorrectDataFormat,
|
||||
FIX::IncorrectTagValue,
|
||||
|
||||
@@ -69,15 +69,14 @@ class ExchangeSimApplication : public sim::IMDPlayerObserver,
|
||||
void onLogon(const FIX::SessionID &sessionID) override;
|
||||
void onLogout(const FIX::SessionID &sessionID) override;
|
||||
void toAdmin(FIX::Message &, const FIX::SessionID &) override;
|
||||
void
|
||||
toApp(FIX::Message &, const FIX::SessionID &) throw(FIX::DoNotSend) override;
|
||||
void fromAdmin(const FIX::Message &, const FIX::SessionID &) throw(
|
||||
void toApp(FIX::Message &, const FIX::SessionID &) EXCEPT(FIX::DoNotSend) override;
|
||||
void fromAdmin(const FIX::Message &, const FIX::SessionID &) EXCEPT(
|
||||
FIX::FieldNotFound,
|
||||
FIX::IncorrectDataFormat,
|
||||
FIX::IncorrectTagValue,
|
||||
FIX::RejectLogon) override;
|
||||
void
|
||||
fromApp(const FIX::Message &message, const FIX::SessionID &sessionID) throw(
|
||||
fromApp(const FIX::Message &message, const FIX::SessionID &sessionID) EXCEPT(
|
||||
FIX::FieldNotFound,
|
||||
FIX::IncorrectDataFormat,
|
||||
FIX::IncorrectTagValue,
|
||||
|
||||
@@ -106,7 +106,7 @@ struct ApiGatewayImpl {
|
||||
api_header.set_method(header.method());
|
||||
api_header.set_request_id(header.request_id());
|
||||
api_header.mutable_token()->CopyFrom(header.token());
|
||||
int header_size = 1 + api_header.ByteSize();
|
||||
int header_size = 1 + api_header.ByteSizeLong();
|
||||
bts_assert(header_size < 128);
|
||||
std::string buffer;
|
||||
buffer.reserve(header_size + body.size());
|
||||
@@ -269,4 +269,4 @@ std::string get_server_info(const api::ServiceContext &ctx) {
|
||||
}
|
||||
|
||||
} // namespace http
|
||||
} // namespace bts
|
||||
} // namespace bts
|
||||
Reference in new issue
Block a user