diff --git a/.gitignore b/.gitignore index bcd61444b..a3b1173dd 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,6 @@ trace_data/ .clangd/ /.cache/ .venv/** +install/** +.devcontainer/** +/src/Spark.Admin.WebApp/src/bin/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index fa467640e..50b5e93f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,7 @@ cmake_minimum_required(VERSION 3.5) project(spark) -if (WIN32) - set (platform "windows") -else () - set (platform "linux") -endif () - -set (EXTERNALS_ROOT "${CMAKE_SOURCE_DIR}/externals/${platform}") -set (SPARK_PYTHON "${EXTERNALS_ROOT}/python") -set (SPARK_BIN "${EXTERNALS_ROOT}/bin") -set (SPARK_INCLUDE "${EXTERNALS_ROOT}/include") -set (SPARK_LIB "${EXTERNALS_ROOT}/lib/${CMAKE_BUILD_TYPE}") +set(BUILD_SDK OFF CACHE BOOL "Build the sdk") include_directories (BEFORE SYSTEM ${SPARK_INCLUDE} ${EXTERNALS_ROOT}/include/zlib) link_directories (${SPARK_LIB}) @@ -20,10 +10,12 @@ if (WIN32) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ /MP \ /WX /wd4251 /wd4250 /wd4251 /wd4244 /wd4267 /wd4355 /wd4275 /wd4345 \ + /bigobj \ /DCURL_STATICLIB \ /D_WINSOCK_DEPRECATED_NO_WARNINGS \ /D__TBB_NO_IMPLICIT_LINKAGE \ /DBOOST_ALL_NO_LIB \ + /std:c++17 \ /D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS /D_WIN32_WINNT=0x0600") set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") @@ -32,23 +24,14 @@ if (WIN32) add_subdirectory(src/lib) else () -# so that sparkd looks for libspark.so in its directory - set (CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - set (CMAKE_INSTALL_RPATH ".") - set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install/${CMAKE_BUILD_TYPE}/sparkd") - - set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} \ - -fPIC -Wall -pedantic -Wextra -Werror \ - -Wno-missing-braces -Wno-ignored-qualifiers \ - --std=c++17 -fdiagnostics-color") - set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -DNDEBUG -O3") - set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wno-undef") + # so that sparkd looks for libspark.so in its directory add_subdirectory(src/server/sparkd) add_subdirectory(src/lib) # add_subdirectory(src/web) add_subdirectory(doc/user) - add_subdirectory(src/sdk) + if(BUILD_SDK) + add_subdirectory(src/sdk) + endif() add_subdirectory(src/data_files) add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/server diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 000000000..eb2e12bad --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,129 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "sparkd", + "hidden": true, + "description": "Sparkd common config", + "binaryDir": "${sourceDir}/build/${presetName}", + "generator": "Ninja", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + }, + "cacheVariables": { + "CMAKE_BUILD_WITH_INSTALL_RPATH": { + "type": "BOOL", + "value": true + }, + "CMAKE_CXX_STANDARD": "17", + "CMAKE_EXE_LINKER_FLAGS": "-Wno-undef", + "CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}", + "CMAKE_INSTALL_RPATH": ".", + "EXTERNALS_ROOT": "${sourceDir}/externals/linux", + "SPARK_BIN": "${sourceDir}/externals/linux/bin", + "SPARK_INCLUDE": "${sourceDir}/externals/linux/include" + } + }, + { + "name": "sparkd-debug-clang", + "displayName": "Debug (clang)", + "description": "Debug build compiled w/ clang", + "inherits": "sparkd", + "binaryDir": "${sourceDir}/build/clang/debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_C_COMPILER": "clang", + "CMAKE_CXX_COMPILER": "clang++", + "CMAKE_CXX_FLAGS_DEBUG": "-g -fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers -Wno-deprecated-copy -Wno-unused-but-set-variable -Wno-c++17-extensions --std=c++17 -fdiagnostics-color -DDEBUG", + "CMAKE_EXPORT_COMPILE_COMMANDS": { + "type": "BOOL", + "value": true + }, + "SPARK_LIB": "${sourceDir}/externals/linux/lib/Debug" + } + }, + { + "name": "sparkd-release-clang", + "displayName": "Release (clang)", + "description": "Release build compiled w/ clang", + "binaryDir": "${sourceDir}/build/clang/release", + "inherits": "sparkd", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_C_COMPILER": "clang", + "CMAKE_CXX_COMPILER": "clang++", + "CMAKE_CXX_FLAGS_RELEASE": "-fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers -Wno-deprecated-copy -Wno-c++17-extensions --std=c++17 -fdiagnostics-color -fno-omit-frame-pointer -DNDEBUG -O3", + "SPARK_LIB": "${sourceDir}/externals/linux/lib/Release" + } + }, + { + "name": "sparkd-debug-gcc", + "displayName": "Debug (gcc)", + "description": "Debug build compiled w/ gcc", + "inherits": "sparkd", + "binaryDir": "${sourceDir}/build/gcc/debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_C_COMPILER": "gcc", + "CMAKE_CXX_COMPILER": "g++", + "CMAKE_CXX_FLAGS_DEBUG": "-g -fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers -Wno-deprecated-copy -Wno-catch-value --std=c++17 -fdiagnostics-color -DDEBUG", + "CMAKE_EXPORT_COMPILE_COMMANDS": { + "type": "BOOL", + "value": true + }, + "SPARK_LIB": "${sourceDir}/externals/linux/lib/Debug" + } + }, + { + "name": "sparkd-release-gcc", + "displayName": "Release (gcc)", + "description": "Release build compiled w/ gcc", + "inherits": "sparkd", + "binaryDir": "${sourceDir}/build/gcc/release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_C_COMPILER": "/usr/local/bin/gcc", + "CMAKE_CXX_COMPILER": "/usr/local/bin/g++", + "CMAKE_CXX_FLAGS_RELEASE": "-fPIC -Wall -pedantic -Wextra -Werror -Wno-missing-braces -Wno-ignored-qualifiers -Wno-deprecated-copy -Wno-catch-value --std=c++17 -fdiagnostics-color -fno-omit-frame-pointer -DNDEBUG -O3", + "SPARK_LIB": "${sourceDir}/externals/linux/lib/Release" + } + } + ], + "buildPresets": [ + { + "name": "sparkd", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + }, + "hidden": true + }, + { + "name": "sparkd-debug-clang", + "configurePreset": "sparkd-debug-clang", + "displayName": "Debug (clang)", + "inherits": "sparkd" + }, + { + "name": "sparkd-debug-gcc", + "configurePreset": "sparkd-debug-gcc", + "displayName": "Debug (gcc)", + "inherits": "sparkd" + }, + { + "name": "sparkd-release-clang", + "configurePreset": "sparkd-release-clang", + "displayName": "Release (clang)", + "inherits": "sparkd" + }, + { + "name": "sparkd-release-gcc", + "configurePreset": "sparkd-release-gcc", + "displayName": "Release (gcc)", + "inherits": "sparkd" + } + ] +} diff --git a/externals b/externals index 60a2edab6..e9120dabf 160000 --- a/externals +++ b/externals @@ -1 +1 @@ -Subproject commit 60a2edab6936ac7eb03d077055dd8039267e347d +Subproject commit e9120dabfeb709e5a5ed3dbc21c539ad8fb621cc diff --git a/requirements.txt b/requirements.txt index 96d1ced48..51c22aa07 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,6 @@ pycodestyle==2.7.0 pycparser==2.20 pylint==2.10.2 PyMeta3==0.5.1 -termcolor==1.1.0 toml==0.10.2 wrapt==1.12.1 yapf==0.31.0 diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 3d0a366db..6a10903c9 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -18,6 +18,7 @@ if (WIN32) domain_model/*.cpp expression/*.cpp logging/*.cpp + io/*.cpp md/*.cpp os/*.cpp quickbus/*.cpp @@ -107,7 +108,11 @@ if (WIN32) libboost_date_time libboost_atomic libprotobuf - ) + libprotoc + libssl + libcrypto + crypt32 + ) else () target_link_libraries( libspark protobuf @@ -143,5 +148,3 @@ endif() if (WIN32) include(${CMAKE_SOURCE_DIR}/tools/vs_filters.cmake) endif() - - diff --git a/src/lib/api/core/ApiClientInterop.cpp b/src/lib/api/core/ApiClientInterop.cpp index 6c29be4b7..3c43d27b5 100644 --- a/src/lib/api/core/ApiClientInterop.cpp +++ b/src/lib/api/core/ApiClientInterop.cpp @@ -13,7 +13,7 @@ #include "lib/config/protos/system.pb.h" #include "lib/config/protos/Ports.pb.h" -#ifdef WIN32 +#ifdef _WIN32 #include #endif @@ -60,8 +60,8 @@ CAPI Quickbus* api_create_quickbus(const char* qbconfig, long length) { return new Quickbus(temp_conf); } -CAPI void api_destroy_quickbus(Quickbus* qbus) { - #ifndef WIN32 +CAPI void api_destroy_quickbus(Quickbus *qbus) { +#ifndef _WIN32 if (qbus != nullptr) { delete qbus; } diff --git a/src/lib/api/public/ApiServer.h b/src/lib/api/public/ApiServer.h index d4200f93e..64e95f3f1 100644 --- a/src/lib/api/public/ApiServer.h +++ b/src/lib/api/public/ApiServer.h @@ -36,8 +36,8 @@ protected: ResponseHeader header; header.set_code(ApiError::SUCCESS); header.set_request_id(request_id); - int header_size = header.ByteSize() + 1; - int body_size = response.ByteSize(); + int header_size = header.ByteSizeLong() + 1; + int body_size = response.ByteSizeLong(); int total_size = header_size + body_size; if (total_size <= 1024) { uint8_t buffer[1024]; diff --git a/src/lib/api/public/ClientChannel.h b/src/lib/api/public/ClientChannel.h index fb5fd31c7..bd0ac6144 100644 --- a/src/lib/api/public/ClientChannel.h +++ b/src/lib/api/public/ClientChannel.h @@ -40,11 +40,11 @@ public: header.set_request_id(++_id); auto ptoken = _context.token(); if (ptoken) header.mutable_token()->CopyFrom(*ptoken); - int header_size = header.ByteSize()+1; + int header_size = header.ByteSizeLong()+1; assert(header_size < 128); std::string request_buffer; - request_buffer.reserve(header_size + request.ByteSize()); + request_buffer.reserve(header_size + request.ByteSizeLong()); request_buffer += (char)(header_size); bool success = header.AppendToString(&request_buffer); success = success && request.AppendToString(&request_buffer); @@ -77,8 +77,8 @@ public: template - rxcpp::observable>> subscribe(int method_id, const char* method, const std::string& qualifier) { - return rxcpp::observable<>::create>>([=](rxcpp::subscriber>> observer) { + rxcpp::observable>> subscribe(int method_id, const char* method, const std::string& qualifier) { + return rxcpp::observable<>::create>>([=](rxcpp::subscriber>> observer) { StreamAccessRequest request; request.set_qualifier(qualifier); send(method_id, request, [=](const Result& response) { @@ -95,11 +95,12 @@ public: bool first_update = true; auto cb = [observer, first_update, qualifier](EventType event_type, const StreamUpdate* changes, int change_count) mutable { if (event_type == EventType::TABLE_UPDATED) { - std::vector> added_items, changed_items; + std::vector> added_items, changed_items; std::vector added_keys, changed_keys, removed_keys; - for (size_t x = 0; x < change_count; ++x) { + for (std::size_t x = 0; + x < static_cast(change_count); ++x) { const StreamUpdate& change = changes[x]; switch(change.type) { case StreamUpdate::REMOVE: @@ -115,11 +116,11 @@ public: break; } } - observer.on_next(RawUpdate>(added_items, added_keys, changed_items, changed_keys, removed_keys)); + observer.on_next(RawUpdate>(added_items, added_keys, changed_items, changed_keys, removed_keys)); } else if (event_type == EventType::TABLE_CREATED) { if (!first_update) { - observer.on_next(RawUpdate>::Reset()); + observer.on_next(RawUpdate>::Reset()); } first_update = false; } diff --git a/src/lib/api/public/Update.h b/src/lib/api/public/Update.h index 3d18c5d6d..e90d409cb 100644 --- a/src/lib/api/public/Update.h +++ b/src/lib/api/public/Update.h @@ -1,112 +1,121 @@ #pragma once #include "RawUpdate.h" -#include #include -#include +#include #include +#include namespace bts { namespace api { - template - class Change { - T _old, _new; - public: - Change(const T& old_value, const T& new_value) : _old(old_value), _new(new_value) { } - const T& previous() const { return _old; } - const T& current() const { return _new; } - }; +template class Change { + T _old, _new; - template - struct Update { - Update(std::vector& all, std::vector& added, std::vector> changed, std::vector& removed) : - _all_items(std::move(all)), - _added_items(std::move(added)), + public: + Change(const T &old_value, const T &new_value) + : _old(old_value), _new(new_value) {} + const T &previous() const { return _old; } + const T ¤t() const { return _new; } +}; + +template struct Update { + Update( + std::vector &all, + std::vector &added, + std::vector> changed, + std::vector &removed) + : _all_items(std::move(all)), _added_items(std::move(added)), _changed_items(std::move(changed)), - _removed_items(std::move(removed)) - {} + _removed_items(std::move(removed)) {} - Update(const Update& other) : _all_items(other._all_items), - _added_items(other._added_items), - _changed_items(other._changed_items), - _removed_items(other._removed_items) - {} - - Update(Update&& other) : - _all_items(std::move(other._all_items)), + Update(const Update &other) + : _all_items(other._all_items), _added_items(other._added_items), + _changed_items(other._changed_items), + _removed_items(other._removed_items) {} + + Update(Update &&other) + : _all_items(std::move(other._all_items)), _added_items(std::move(other._added_items)), _changed_items(std::move(other._changed_items)), - _removed_items(std::move(other._removed_items)) - {} + _removed_items(std::move(other._removed_items)) {} - TKey key(const T& t) const { return ServiceType::key(t); } - const std::vector& all() const { return _all_items; } - const std::vector& added() const { return _added_items; } - const std::vector>& changed() const { return _changed_items; } - const std::vector& removed() const { return _removed_items; } + TKey key(const T &t) const { return ServiceType::key(t); } + const std::vector &all() const { return _all_items; } + const std::vector &added() const { return _added_items; } + const std::vector> &changed() const { return _changed_items; } + const std::vector &removed() const { return _removed_items; } - private: - std::vector _all_items; - std::vector _added_items; - std::vector> _changed_items; - std::vector _removed_items; + private: + std::vector _all_items; + std::vector _added_items; + std::vector> _changed_items; + std::vector _removed_items; +}; + +template +std::function>( + const rxcpp::observable> &)> +reconstitute() { + return [](const rxcpp::observable> &inputi) { + auto *input_ptr = const_cast>*>(&inputi); + auto &input = *input_ptr; + auto state = std::make_shared>(); + return input.map([state](const RawUpdate &craw) { + auto *raw_ptr = const_cast*>(&craw); + RawUpdate &raw = *raw_ptr; + if (raw.is_reset) { + std::vector removed; + removed.reserve(state->size()); + for (auto &t : *state) { + removed.push_back(std::move(t.second)); + } + state->clear(); + std::vector all, added; + std::vector> changed; + return Update(all, added, changed, removed); + } else { + // + // Remove + std::vector removed; + removed.reserve(raw.removed_keys.size()); + for (int key : raw.removed_keys) { + auto iter = state->find(key); + if (iter != state->end()) { + removed.push_back(iter->second); + state->erase(iter); + } + } + // + // Add + for (size_t x = 0; x < raw.added_keys.size(); ++x) { + (*state)[raw.added_keys[x]] = raw.added_items[x]; + } + // + // Change + std::vector> changed; + changed.reserve(raw.changed_keys.size()); + for (size_t x = 0; x < raw.changed_keys.size(); ++x) { + changed.push_back(Change{ + (*state)[raw.changed_keys[x]], raw.changed_items[x]}); + (*state)[raw.changed_keys[x]] = raw.changed_items[x]; + } + // + // All + std::vector all; + all.reserve(state->size()); + for (const auto &item : *state) { + all.push_back(item.second); + } + + return Update( + all, raw.added_items, changed, removed); + } + }); }; +} - template - std::function>(const rxcpp::observable>&)> reconstitute() { - return [](const rxcpp::observable>& input) { - auto state = std::make_shared>(); - return input.map([state](RawUpdate& raw) { - if (raw.is_reset) { - std::vector removed; - removed.reserve(state->size()); - for (auto& t : *state) { - removed.push_back(std::move(t.second)); - } - state->clear(); - std::vector all, added; - std::vector> changed; - return Update(all, added, changed, removed); - } - else { - // - // Remove - std::vector removed; - removed.reserve(raw.removed_keys.size()); - for (int key : raw.removed_keys) { - auto iter = state->find(key); - if (iter != state->end()) { - removed.push_back(iter->second); - state->erase(iter); - } - } - // - // Add - for (size_t x = 0; x < raw.added_keys.size(); ++x) { - (*state)[raw.added_keys[x]] = raw.added_items[x]; - } - // - // Change - std::vector> changed; - changed.reserve(raw.changed_keys.size()); - for (size_t x = 0; x < raw.changed_keys.size(); ++x) { - changed.push_back(Change{(*state)[raw.changed_keys[x]], raw.changed_items[x]}); - (*state)[raw.changed_keys[x]] = raw.changed_items[x]; - } - // - // All - std::vector all; - all.reserve(state->size()); - for (const auto& item : *state) { - all.push_back(item.second); - } - - return Update(all, raw.added_items, changed, removed); - } - }); - }; - } +} // namespace api +} // namespace bts -}}//namespace diff --git a/src/lib/api/service_compiler/templates/cpp/client.pb.cc b/src/lib/api/service_compiler/templates/cpp/client.pb.cc index 629c29178..e7c8c9154 100644 --- a/src/lib/api/service_compiler/templates/cpp/client.pb.cc +++ b/src/lib/api/service_compiler/templates/cpp/client.pb.cc @@ -19,12 +19,12 @@ using namespace rxcpp::operators; rxcpp::observable<{{cap name}}Update> {{../name}}::subscribe_{{name}}(std::string const&qualifier) { return _pchannel->subscribe<{{output_type_cpp}}>({{@index}}, "{{name}}", qualifier) - | (bts::api::reconstitute,const {{key_type.cpptype}}, {{../name}}>()); + | (bts::api::reconstitute,const {{key_type.cpptype}}, {{../name}}>()); } rxcpp::observable<{{cap name}}Update> {{../name}}::subscribe_{{name}}() { return _pchannel->subscribe<{{output_type_cpp}}>({{@index}}, "{{name}}", "") - | (bts::api::reconstitute,const {{key_type.cpptype}}, {{../name}}>()); + | (bts::api::reconstitute,const {{key_type.cpptype}}, {{../name}}>()); } {{#if key_type.natural_key}} diff --git a/src/lib/api/service_compiler/templates/cpp/client.pb.h b/src/lib/api/service_compiler/templates/cpp/client.pb.h index 338462bd1..d8b8d5f7b 100644 --- a/src/lib/api/service_compiler/templates/cpp/client.pb.h +++ b/src/lib/api/service_compiler/templates/cpp/client.pb.h @@ -6,11 +6,12 @@ #include "lib/api/public/Update.h" #include "lib/utils/bts_export.h" -#include -#include +#include #include #include #include +#include +#include {{ns-open package}} @@ -22,7 +23,7 @@ class {{name}}; {{#each service}} {{#each method}}{{#if server_streaming}} class {{../name}}; -typedef bts::api::Update, const {{key_type.cpptype}}, {{../name}}> {{cap name}}Update; +typedef bts::api::Update, const {{key_type.cpptype}}, {{../name}}> {{cap name}}Update; {{/if}}{{/each}} // {{comment}} diff --git a/src/lib/api/service_compiler/templates/cpp/server.pb.cc b/src/lib/api/service_compiler/templates/cpp/server.pb.cc index 4635e7803..6265c10f7 100644 --- a/src/lib/api/service_compiler/templates/cpp/server.pb.cc +++ b/src/lib/api/service_compiler/templates/cpp/server.pb.cc @@ -63,7 +63,7 @@ void Authenticated{{name}}Base::dispatch(const bts::api::RequestHeader& header, response.set_request_id(header.request_id()); response.set_code(bts::api::ApiError::MISSING_METHOD); uint8_t buffer[64]; - int header_size = response.ByteSize() + 1; + int header_size = response.ByteSizeLong() + 1; serialize(header_size, response, buffer); on_response(buffer, header_size); } break; @@ -128,7 +128,7 @@ void Authenticated{{name}}Base::dispatch(const bts::api::RequestHeader& header, {{else}} update.key = get_key({{name}}_key(item)); {{/if}} - update.buffer_len = item.ByteSize(); + update.buffer_len = item.ByteSizeLong(); char* buffer = new char[update.buffer_len]; item.SerializePartialToArray(buffer, update.buffer_len); update.buffer =buffer; @@ -143,7 +143,7 @@ void Authenticated{{name}}Base::dispatch(const bts::api::RequestHeader& header, {{else}} update.key = get_key({{name}}_key(item)); {{/if}} - update.buffer_len = item.ByteSize(); + update.buffer_len = item.ByteSizeLong(); char* buffer = new char[update.buffer_len]; item.SerializePartialToArray(buffer, update.buffer_len); update.buffer =buffer; diff --git a/src/lib/api/services/OrderService.proto b/src/lib/api/services/OrderService.proto index 982712d5a..f8994b08e 100644 --- a/src/lib/api/services/OrderService.proto +++ b/src/lib/api/services/OrderService.proto @@ -268,23 +268,27 @@ message MomentumAlgoLog { uint64 ask_top_quantity = 8; } message MomentumAlgoParamsFile { - bool Edge_Target = 1; - bool Edge_Loss = 2; - bool Reverse_Logic = 3; - bool File_Sim = 4; - bool Timed_Start = 5; - bool Log_Graph = 6; - bool Open_Position_On_Close = 7; - uint32 Renko_Ticks = 8; - uint32 Gan_Buffer_Size = 9; - uint32 Edge_To_Capture = 10; - uint32 Edge_To_lose = 11; - uint32 Time_Start_Hours_24_HRS = 12; - uint32 Time_Start_Minutes = 13; - uint32 Date_Start_Day_of_Month = 14; - uint32 Date_Start_Month_0_12 = 15; - uint32 Date_Start_Year_20XX = 16; - double Run_Duration_Hours_decimal = 17; + bool edge_target = 1; + bool edge_loss = 2; + bool reverse_logic = 3; + bool file_sim = 4; + bool timed_start = 5; + bool log_graph = 6; + bool open_position_on_close = 7; + bool early_brick = 8; + bool use_hull_avg = 9; + uint32 renko_ticks = 10; + uint32 upr_gan_buffer_size = 11; + uint32 lwr_gan_buffer_size = 12; + uint32 edge_to_capture = 13; + uint32 edge_to_lose = 14; + double early_threshold = 15; + uint32 time_start_hours_24_hrs = 16; + uint32 time_start_minutes = 17; + uint32 date_start_day_of_month = 18; + uint32 date_start_month_0_12 = 19; + uint32 date_start_year_20xx = 20; + double run_duration_hours_decimal = 21; } // message MomentumAlgoResult { // // google.protobuf.Timestamp time = 3; diff --git a/src/lib/config/ConfigurationState.cpp b/src/lib/config/ConfigurationState.cpp index 0678fbd61..d6b8c893c 100755 --- a/src/lib/config/ConfigurationState.cpp +++ b/src/lib/config/ConfigurationState.cpp @@ -29,7 +29,10 @@ #define URDL_DISALE_SSL 1 #include -#ifdef WIN32 +#include "lib/config_defaults.h" +#include "lib/config_proto_files.h" + +#ifdef _WIN32 #include #include #else @@ -39,9 +42,6 @@ #include #endif -#include "lib/config_proto_files.h" -#include "lib/config_defaults.h" - using namespace std; namespace bts { @@ -51,7 +51,6 @@ namespace internal { const char* MESSAGE_STRING_RULE = "rule"; const char* MESSAGE_STRING_VALUE = "value"; const char* MESSAGE_STRING_INCLUDE = "include"; -const char* MESSAGE_STRING_INCLUDE_BACKUP = "fallback"; const char* MESSAGE_STRING_MACRO_TYPE = "MacroType"; const char* MESSAGE_STRING_MACRO = "macro"; @@ -89,13 +88,10 @@ std::string get_command_argument(const char* key) if (boost::iequals(*begin, key)) { begin++; - if (begin == end) { - break; - } - else { - os::setenv(CONFIG_SERVER_ENV_VAR, begin->c_str()); + if (begin != end) { return *begin; } + break; } } return ""; @@ -115,13 +111,19 @@ string ConfigurationState::settings_path() return os::sparkdata_path("conf"); } -void ConfigurationState::initialize_defaults(IConfigLog& log) -{ +void ConfigurationState::initialize_defaults(IConfigLog &log) { + initialize_defaults( + log, + {std::string("lib/config/protos/"), std::string("lib/api/domain/")}); +} + +void ConfigurationState::initialize_defaults( + IConfigLog &log, const std::vector &proto_dirs) { std::lock_guard lock(_initialization_mutex); if (_is_initialized) return; - generate_all_config_proto(log); - + generate_all_config_proto(log, proto_dirs); + std::shared_ptr new_message(_prototype->New()); ErrorsOnlyLog elog(log); @@ -349,14 +351,25 @@ void ConfigurationState::initialize_settings() initialize_defaults(log); std::string settings = settings_path(); - std::string fallback = get_command_argument("-ConfigFallback"); + bts_assert_msg(!settings.empty(), "Failed to determine config path"); + os::setenv(CONFIG_SERVER_ENV_VAR, settings.c_str()); - DEFER(// Do this even if load() fails - initialize_builtins(); - initialize_macros(); - _deferred_queue->process(); - ); - load(settings, fallback, log); + { + DEFER( // Do this even if load() fails + initialize_builtins(); initialize_macros(); + _deferred_queue->process();); + load(settings, log); + } + + std::vector descs; + std::vector>::iterator iter; + for (iter = _config_chain.begin(); iter != _config_chain.end(); ++iter) { + const proto::Message &imsg = **iter; + descs.push_back(imsg.DebugString()); + } + std::string config_desc = + fmt::to_string(fmt::join(descs, "\n***********************\n")); + log.info(fmt::format("initialized config:\n{}", config_desc)); } void ConfigurationState::reset() @@ -375,41 +388,26 @@ void ConfigurationState::reset() _port = 80; } -int ConfigurationState::load(const std::string& url, const std::string& fallback_url, IConfigLog& log) -{ +int ConfigurationState::load(const std::string &url, IConfigLog &log) { std::shared_ptr new_message(_prototype->New()); bool loaded = false; - try { - loaded = load_message(url, *new_message.get(), log, *_deferred_queue.get()); - } - catch(ServerUnreachableException&) { - if (fallback_url.empty()) { - throw; - } - } + loaded = load_message(url, *new_message.get(), log, *_deferred_queue.get()); - if (!loaded && !fallback_url.empty()) - { - std::string message = "Failed to load: " + url + " using fallback."; - log.warning(message); - loaded = load_message(fallback_url, *new_message.get(), log, *_deferred_queue.get()); - if (_host.empty() || _host == "localhost") { tie(_host, _port) = hostname(fallback_url); } + if (_host.empty() || _host == "localhost") { + tie(_host, _port) = hostname(url); } - if (_host.empty() || _host == "localhost") { tie(_host, _port) = hostname(url); } - if (!loaded) return 0; - + if (!loaded) + return 0; std::string include = get_include(*new_message.get()); - std::string fallback = get_fallback(*new_message.get()); // insert at front? _config_chain.push_back(new_message); // Recursively load includes - if (!include.empty()) - { - return 1 + load(include, fallback, log); + if (!include.empty()) { + return 1 + load(include, log); } return 1; } @@ -426,14 +424,12 @@ int ConfigurationState::load_string(const std::string& values, bool print_errors parse_stream("test string", input_stream, *new_message.get(), log, *_deferred_queue.get()); std::string include = get_include(*new_message.get()); - std::string fallback = get_fallback(*new_message.get()); _config_chain.push_back(new_message); int count = 0; - if (!include.empty()) - { - count += load(include, fallback, log); + if (!include.empty()) { + count += load(include, log); } if (_host.empty()) { @@ -477,10 +473,11 @@ void ConfigurationState::add_metadata_field(proto::FileDescriptorProto* file_dp, } // Construct a new Message that describes the save file format -// This can then be used with google::protobuf::TextFormat to load and save files -void ConfigurationState::generate_all_config_proto(IConfigLog& log) -{ - const char* bts_config_classname = "__BTSConfig"; +// This can then be used with google::protobuf::TextFormat to load and save +// files +void ConfigurationState::generate_all_config_proto( + IConfigLog &log, const std::vector &proto_dirs) { + const char *bts_config_classname = "__BTSConfig"; int field_number = 0; proto::FileDescriptorProto bts_config_dp; @@ -495,13 +492,6 @@ void ConfigurationState::generate_all_config_proto(IConfigLog& log) include_field->set_type(proto::FieldDescriptorProto_Type_TYPE_STRING); include_field->set_label(proto::FieldDescriptorProto_Label_LABEL_OPTIONAL); - // Add the 'fallback' field - proto::FieldDescriptorProto* backup_field = config_message->add_field(); - backup_field->set_name(MESSAGE_STRING_INCLUDE_BACKUP); - backup_field->set_number(++field_number); - backup_field->set_type(proto::FieldDescriptorProto_Type_TYPE_STRING); - backup_field->set_label(proto::FieldDescriptorProto_Label_LABEL_OPTIONAL); - // Add 'macro' message type proto::DescriptorProto* macro_message = bts_config_dp.add_message_type(); macro_message->set_name(MESSAGE_STRING_MACRO_TYPE); @@ -526,23 +516,29 @@ void ConfigurationState::generate_all_config_proto(IConfigLog& log) // add a meta type and field for each generated message proto::DescriptorPool::generated_pool(); - for (size_t x = 0; x < BTS_ARRAYSIZE(config_proto_files); x++) - { - std::string proto_path = "lib/config/protos/"; - proto_path += config_proto_files[x]; - const proto::FileDescriptor* file_desc = proto::DescriptorPool::generated_pool()->FindFileByName(proto_path); - if (file_desc != nullptr) - { + + auto find_proto_file = [&proto_dirs](const std::string &name) -> const proto::FileDescriptor * { + for (const auto &proto_dir : proto_dirs) { + const auto * res = proto::DescriptorPool::generated_pool()->FindFileByName( + proto_dir + name); + if (res != nullptr) { + return res; + } + } + return nullptr; + }; + + for (size_t x = 0; x < BTS_ARRAYSIZE(config_proto_files); x++) { + const auto *file_desc = find_proto_file(config_proto_files[x]); + if (file_desc != nullptr) { bts_config_dp.add_dependency(file_desc->name()); for (int y=0; y < file_desc->message_type_count(); y++) { const proto::Descriptor* message_desc = file_desc->message_type(y); add_metadata_field(&bts_config_dp, config_message, message_desc, ++field_number); } - } - else - { - #ifdef WIN32 + } else { +#ifdef _WIN32 // on linux the linker might throw away config protos that // are not used in sparkd. On windows we build a dll so that // should not happen @@ -903,10 +899,6 @@ std::string get_include(const proto::Message& message) return get_field(message, MESSAGE_STRING_INCLUDE); } -std::string get_fallback(const proto::Message& message) -{ - return get_field(message, MESSAGE_STRING_INCLUDE_BACKUP); -} - -}}}//end namespaces - +} // namespace internal +} // namespace config +} // namespace bts diff --git a/src/lib/config/ConfigurationState.h b/src/lib/config/ConfigurationState.h index 440c16e14..b6014a36e 100755 --- a/src/lib/config/ConfigurationState.h +++ b/src/lib/config/ConfigurationState.h @@ -1,3 +1,4 @@ +#pragma once #ifndef CONFIGURATIONSTATE_H_ #define CONFIGURATIONSTATE_H_ @@ -51,9 +52,10 @@ namespace internal { ~ConfigurationState(void); void initialize_defaults(IConfigLog& log); + void initialize_defaults(IConfigLog &log, const std::vector &proto_dirs); void initialize_settings(); - int load(const std::string& url, const std::string& fallback, IConfigLog&); + int load(const std::string& url, IConfigLog&); int load_string(const std::string& values, bool print_errors=false); void reset(); @@ -78,7 +80,7 @@ namespace internal { void initialize_macros(); void add_macro(const proto::Message*); void add_metadata_field(proto::FileDescriptorProto* file_dp, proto::DescriptorProto* message_dp, const proto::Descriptor* base_field, int index); - void generate_all_config_proto(IConfigLog&); + void generate_all_config_proto(IConfigLog&, const std::vector &proto_dirs); const proto::Message* try_get_value(const std::string& field_name, const proto::Message& message) const; std::string settings_path(); diff --git a/src/lib/config/protos/toggles.proto b/src/lib/config/protos/toggles.proto index 353066fe9..e775ce0af 100644 --- a/src/lib/config/protos/toggles.proto +++ b/src/lib/config/protos/toggles.proto @@ -66,7 +66,10 @@ message CustomFormatIceSecurities{ message IgnoreNansInDayPnL { optional bool enabled = 1 [default = true]; } - +message SendLimitOrderForPositionFlattener { + optional bool enabled = 1 [default = true]; + optional uint32 quantity = 2 [default = 0]; +} message DynamicAlgos{ optional bool enable_dorman = 1 [default = false]; optional bool enable_pyramid = 2 [default = false]; diff --git a/src/lib/domain_model/common.h b/src/lib/domain_model/common.h index af6f2a590..e237dc5c1 100644 --- a/src/lib/domain_model/common.h +++ b/src/lib/domain_model/common.h @@ -1,5 +1,8 @@ #pragma once +#ifndef _WIN32 +#include +#endif #include #include diff --git a/src/lib/jetfix/common/OutFIX.cpp b/src/lib/jetfix/common/OutFIX.cpp index 3bf96b68e..7a60d88e4 100644 --- a/src/lib/jetfix/common/OutFIX.cpp +++ b/src/lib/jetfix/common/OutFIX.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "OutFIX.h" namespace bts { diff --git a/src/lib/jetfix/connection/AsyncReader.cpp b/src/lib/jetfix/connection/AsyncReader.cpp index 9bc48a806..3f3bee027 100644 --- a/src/lib/jetfix/connection/AsyncReader.cpp +++ b/src/lib/jetfix/connection/AsyncReader.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "AsyncReader.h" #include "IConnection.h" diff --git a/src/lib/jetfix/connection/IConnection.cpp b/src/lib/jetfix/connection/IConnection.cpp index 3b16fd124..ef7d13751 100644 --- a/src/lib/jetfix/connection/IConnection.cpp +++ b/src/lib/jetfix/connection/IConnection.cpp @@ -1,3 +1,3 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "IConnection.h" #endif diff --git a/src/lib/jetfix/connection/IConnection.h b/src/lib/jetfix/connection/IConnection.h index ab8b9b214..ec305816a 100644 --- a/src/lib/jetfix/connection/IConnection.h +++ b/src/lib/jetfix/connection/IConnection.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace bts { namespace trace {struct CorID;} diff --git a/src/lib/jetfix/gateway/JetFIXGateway.cpp b/src/lib/jetfix/gateway/JetFIXGateway.cpp index 4cfc5efb3..a11078b90 100644 --- a/src/lib/jetfix/gateway/JetFIXGateway.cpp +++ b/src/lib/jetfix/gateway/JetFIXGateway.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "JetFIXGateway.h" namespace bts { diff --git a/src/lib/logging/Common.h b/src/lib/logging/Common.h index 19679a294..eb2e36727 100644 --- a/src/lib/logging/Common.h +++ b/src/lib/logging/Common.h @@ -6,20 +6,21 @@ #include #include #include +#include namespace bts { namespace log { struct Level { using Rep = uint8_t; - constexpr static auto Max = std::numeric_limits::max(); + constexpr static auto Max = (std::numeric_limits::max)(); Rep ordinal; bool operator<(const Level &rhs) const {return ordinal < rhs.ordinal;} }; struct Subsystem { using Rep = uint8_t; - constexpr static auto Max = std::numeric_limits::max(); + constexpr static auto Max = (std::numeric_limits::max)(); Rep ordinal; bool operator<(const Subsystem &rhs) const {return ordinal < rhs.ordinal;} }; diff --git a/src/lib/logging/LogRec.h b/src/lib/logging/LogRec.h index 82779679d..c7de34c2f 100644 --- a/src/lib/logging/LogRec.h +++ b/src/lib/logging/LogRec.h @@ -35,8 +35,8 @@ struct LogRec { }; GCC_DIAG_RESTORE() -#ifndef WIN32 -//static_assert(sizeof(LogRec) == 256, "LogRec should be 128 bytes"); +#ifndef _WIN32 +// static_assert(sizeof(LogRec) == 256, "LogRec should be 128 bytes"); #endif }} diff --git a/src/lib/logging/Logger.h b/src/lib/logging/Logger.h index 9a6aa5083..b80069a0b 100644 --- a/src/lib/logging/Logger.h +++ b/src/lib/logging/Logger.h @@ -4,6 +4,7 @@ #include "LogRec.h" #include "lib/os/os.h" +#include #include #include #include diff --git a/src/lib/logging/MsgPacking.h b/src/lib/logging/MsgPacking.h index f83d52319..176ece519 100644 --- a/src/lib/logging/MsgPacking.h +++ b/src/lib/logging/MsgPacking.h @@ -14,7 +14,7 @@ std::string format_tuple(const char*msg_template, Tuple const &t,std::index_sequ try { return fmt::format(msg_template,std::get(t)...); } - catch (fmt::FormatError const &e) + catch (fmt::format_error const &e) { return fmt::format("Bad log message template: '{}' Error: '{}'", msg_template,e.what()); diff --git a/src/lib/logging/Sink.cpp b/src/lib/logging/Sink.cpp index 859d333cc..7f78d1b11 100644 --- a/src/lib/logging/Sink.cpp +++ b/src/lib/logging/Sink.cpp @@ -13,7 +13,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif @@ -22,7 +22,7 @@ namespace log { struct InitSysLog { InitSysLog() { -#ifndef WIN32 +#ifndef _WIN32 openlog("spark", 0, LOG_USER); #endif } @@ -61,7 +61,7 @@ Sink console_sink(LoggingConfig const &cfg) { } Sink syslog_sink(LoggingConfig const &cfg) { -#ifdef WIN32 +#ifdef _WIN32 return null_sink(); #else auto f = formatter(cfg); diff --git a/src/lib/md/MBOProcessor.cpp b/src/lib/md/MBOProcessor.cpp index 926d7903a..908edd8e3 100644 --- a/src/lib/md/MBOProcessor.cpp +++ b/src/lib/md/MBOProcessor.cpp @@ -12,7 +12,7 @@ #include #ifndef _WIN32 -#include +#include #endif #include #include @@ -45,9 +45,6 @@ void print_pool_stats(const utils::ConcurrentPool& pool) { std::sort(bid_sz.begin(), bid_sz.end()); std::sort(ask_sz.begin(), ask_sz.end()); - size_t bid_tot =0, ask_tot = 0; - for(size_t i : bid_sz) { bid_tot += i; } - for(size_t i : ask_sz) { ask_tot += i; } std::stringstream bid_percentiles, ask_percentiles; for (double x : { 0.5, 0.75, 0.9, 0.95, 0.99 }) { @@ -123,8 +120,8 @@ struct MBOProcessorImpl { // after draining publish the set in small batches // re-check input queue regularly - btree::btree_set dirty; - std::vector clean; + btree::set dirty; + std::vector clean; while(running) { Incremental temp; diff --git a/src/lib/md/MBOProcessor.h b/src/lib/md/MBOProcessor.h index 56f0c034f..61645a067 100644 --- a/src/lib/md/MBOProcessor.h +++ b/src/lib/md/MBOProcessor.h @@ -6,7 +6,7 @@ #include "ExchangeOrderKey.h" #include "MDProducerHandle.h" -#include "google/btree/btree_map.h" +#include #include #include @@ -107,8 +107,8 @@ struct MBOWorkingState { // Used for 'change' messages which update price std::unordered_map orderid_index; - btree::btree_map bid; - btree::btree_map ask; + btree::map bid; + btree::map ask; }; diff --git a/src/lib/md/MDConsumer.cpp b/src/lib/md/MDConsumer.cpp index 2744f021c..e97a46f0a 100644 --- a/src/lib/md/MDConsumer.cpp +++ b/src/lib/md/MDConsumer.cpp @@ -12,17 +12,17 @@ #include "lib/config/protos/MarketData.pb.h" #include "lib/utils/sane_algorithm.h" -#include -#include -#include +#include +#include #include #include -#include +#include +#include #include using namespace std; using namespace bts::api; -using namespace btree; +// using namespace btree; namespace bts { namespace md { @@ -160,8 +160,9 @@ public: return false; } - btree_map> search_handles(const std::set& keys) { - btree_map> result; + btree::map> + search_handles(const std::set &keys) { + btree::map> result; // Walk hot and cold lists and fill in any found handles if (!_cold.is_initialized()) return result; _cold.all_entries([&](const ColdEntry& entry) { diff --git a/src/lib/md/MDConsumerHandle.cpp b/src/lib/md/MDConsumerHandle.cpp index 442473281..d7b55f54d 100644 --- a/src/lib/md/MDConsumerHandle.cpp +++ b/src/lib/md/MDConsumerHandle.cpp @@ -2,6 +2,7 @@ #include "MDConsumerHandle.h" #include "MBOProcessor.h" #include "lib/domain_model/Security.h" +#include "lib/os/os.h" #include #define never bts_assert(false) @@ -11,6 +12,7 @@ using small_vector = boost::container::small_vector; namespace bts { namespace md { +using os::memset; MDConsumerHandle::MDConsumerHandle() { memset(this, 0, sizeof(MDConsumerHandle)); @@ -387,7 +389,7 @@ std::unique_ptr> MDConsumerHandle: return nullptr; } -}}//namespace - + } // namespace md + } // namespace bts #endif diff --git a/src/lib/md/MDProducer.cpp b/src/lib/md/MDProducer.cpp index c6eed6a42..6d6340bb8 100644 --- a/src/lib/md/MDProducer.cpp +++ b/src/lib/md/MDProducer.cpp @@ -1,6 +1,7 @@ #ifndef NO_CPP0X #include "MDProducer.h" +#include "lib/os/os.h" #include "lib/utils/SharedList.h" #include "lib/utils/WaitFreeQueue.h" #include "Shm/MDStructure.h" @@ -11,7 +12,7 @@ using namespace std; namespace bts { namespace md { - +using os::memcpy; // Owns shared memory for a single symbol+type class MDProducerImpl { @@ -109,23 +110,17 @@ private: // MDProducer // -MDProducer::MDProducer(Platform platform, MDProducerFlags flags) : - _mutex(new std::mutex()), - _producers(), - _id_recorder(), - _platform(platform), - _flags(flags), - _smapper(flags & MDProducerFlags::SecurityMapper) -{ } -#ifndef WIN32 -MDProducer::MDProducer(Platform platform, SecurityIDRecorder recorder, MDProducerFlags flags) : - _mutex(new std::mutex()), - _producers(), - _id_recorder(std::make_unique(recorder)), - _platform(platform), - _flags(flags), - _smapper(flags & MDProducerFlags::SecurityMapper) -{ } +MDProducer::MDProducer(Platform platform, MDProducerFlags flags) + : _mutex(new std::mutex()), _producers(), _id_recorder(), + _platform(platform), _flags(flags), + _smapper(flags & MDProducerFlags::SecurityMapper) {} +#ifndef _WIN32 +MDProducer::MDProducer( + Platform platform, SecurityIDRecorder recorder, MDProducerFlags flags) + : _mutex(new std::mutex()), _producers(), + _id_recorder(std::make_unique(recorder)), + _platform(platform), _flags(flags), + _smapper(flags & MDProducerFlags::SecurityMapper) {} #endif MDProducer::MDProducer(MDProducer&& other) : _mutex(std::move(other._mutex)), @@ -195,6 +190,7 @@ void MDProducerChannel::add_trade(const co2::TradeMessage& trade) {_me->add_trad void MDProducerChannel::add_rfq(const co2::QuoteRequestMessage& rfq) {_me->add_rfq(rfq);} void MDProducerChannel::gap() { _me->gap(); } -}}//namespace +} // namespace md +} // namespace bts #endif diff --git a/src/lib/md/SecurityCache.cpp b/src/lib/md/SecurityCache.cpp index 3bc196d2e..b89a48bef 100644 --- a/src/lib/md/SecurityCache.cpp +++ b/src/lib/md/SecurityCache.cpp @@ -3,17 +3,17 @@ #include "lib/utils/Dispatcher.h" #include "lib/utils/LockBox.h" -#include -#include -#include +#include #include +#include +#include namespace bts { namespace md { struct SecurityCacheImpl { - utils::LockBox> cache; - utils::LockBox> ex_cache; + utils::LockBox> cache; + utils::LockBox> ex_cache; tbb::concurrent_queue update_queue; void enqueue_update_db(const SecurityPtr&); void flush(); @@ -44,8 +44,8 @@ void SecurityCacheImpl::flush() { SecurityCache::SecurityCache() : _me(std::make_shared()) {} SecurityCache::~SecurityCache() {} -const Security* SecurityCache::try_get_security(SecurityKey key) const { - return _me->cache.lock([key](btree::btree_map& t) { +const Security *SecurityCache::try_get_security(SecurityKey key) const { + return _me->cache.lock([key](btree::map &t) { auto iter = t.find(key); if (iter != t.end()) { return iter->second.get(); @@ -53,14 +53,15 @@ const Security* SecurityCache::try_get_security(SecurityKey key) const { return (const api::Security*)nullptr; }); } -const Security* SecurityCache::try_get_security(ExchangeSecurityKey key) const { - return _me->ex_cache.lock([key](btree::btree_map& t) { - auto iter = t.find(key); - if (iter != t.end()) { - return iter->second.get(); - } - return (const api::Security*)nullptr; - }); +const Security *SecurityCache::try_get_security(ExchangeSecurityKey key) const { + return _me->ex_cache.lock( + [key](btree::map &t) { + auto iter = t.find(key); + if (iter != t.end()) { + return iter->second.get(); + } + return (const api::Security *)nullptr; + }); } diff --git a/src/lib/md/SecurityDB.cpp b/src/lib/md/SecurityDB.cpp index be9ef1c60..d0940d250 100644 --- a/src/lib/md/SecurityDB.cpp +++ b/src/lib/md/SecurityDB.cpp @@ -1,5 +1,6 @@ #include "SecurityDB.h" -#ifndef WIN32 +#include "lib/logging/logging.h" +#ifndef _WIN32 #include #include diff --git a/src/lib/md/SecurityIDRecorder.cpp b/src/lib/md/SecurityIDRecorder.cpp index afeea6f3b..6a9a3e922 100644 --- a/src/lib/md/SecurityIDRecorder.cpp +++ b/src/lib/md/SecurityIDRecorder.cpp @@ -1,4 +1,5 @@ -#ifndef WIN32 +#include "lib/domain_model/Security.h" +#ifndef _WIN32 #include "SecurityIDRecorder.h" diff --git a/src/lib/md/SecurityIDRecorder.h b/src/lib/md/SecurityIDRecorder.h index 19895d84c..8392da3c1 100644 --- a/src/lib/md/SecurityIDRecorder.h +++ b/src/lib/md/SecurityIDRecorder.h @@ -1,5 +1,6 @@ #pragma once -#ifndef WIN32 +#ifndef _WIN32 +#include "MDProducerHandle.h" #include "common.h" #include "MDProducerHandle.h" diff --git a/src/lib/md/SecurityMapper.cpp b/src/lib/md/SecurityMapper.cpp index 5d1f046f7..9a0f5b04d 100644 --- a/src/lib/md/SecurityMapper.cpp +++ b/src/lib/md/SecurityMapper.cpp @@ -8,13 +8,12 @@ #include "lib/domain_model/Security.h" #include "lib/utils/parse_enum.h" #ifndef _WIN32 -#include "google/btree/btree_map.h" +#include -namespace bts { -namespace md { -struct DisplayFactorMapper : public ISecurityMapper -{ - btree::btree_map _mapped; +namespace bts { +namespace md { +struct DisplayFactorMapper : public ISecurityMapper { + btree::map _mapped; DisplayFactorMapper() : _mapped() { for (const auto& ov : config::get().override()) { if (ov.has_price_multiplier()) { @@ -50,10 +49,9 @@ struct DisplayFactorMapper : public ISecurityMapper } } }; - -struct CppOverride : public ISecurityMapper -{ - btree::btree_map _map; + +struct CppOverride : public ISecurityMapper { + btree::map _map; CppOverride() : _map() { for (const auto& p : config::get().cpp_entry()) { _map.insert(p); diff --git a/src/lib/md/SettlementRecorder.cpp b/src/lib/md/SettlementRecorder.cpp index 3ae2c7626..c2d30f16e 100644 --- a/src/lib/md/SettlementRecorder.cpp +++ b/src/lib/md/SettlementRecorder.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "SettlementRecorder.h" #include "lib/utils/Sqlite_utils.h" #include "lib/config/config.h" diff --git a/src/lib/md/Shm/FixedSecurity.h b/src/lib/md/Shm/FixedSecurity.h index 93d7f833f..7636669f0 100644 --- a/src/lib/md/Shm/FixedSecurity.h +++ b/src/lib/md/Shm/FixedSecurity.h @@ -163,7 +163,7 @@ class FixedSyntheticSecurity : public FixedSecurity public: FixedSyntheticSecurity(const api::Security& sec) : _leg_count(sec.synthetic().legs_size()), - _buffer_size(sec.ByteSize()) + _buffer_size(sec.ByteSizeLong()) { type = api::SECURITYTYPE_SYNTHETIC; sec.SerializeToArray(buffer(), _buffer_size); @@ -260,7 +260,7 @@ void with_security(SecurityType type, size_t leg_count, const api::Security* psy // We could optimize this by using a fixed size stack buffer and only heap allocating if we exceed that // but in general FixedSynthetic is not performance sensitive std::vector buffer; - buffer.resize(psynthetic->ByteSize() + sizeof(FixedSyntheticSecurity)); + buffer.resize(psynthetic->ByteSizeLong() + sizeof(FixedSyntheticSecurity)); auto* psec = new (&buffer[0]) FixedSyntheticSecurity(*psynthetic); cb(*psec); return; diff --git a/src/lib/md/SyntheticSecurityService.cpp b/src/lib/md/SyntheticSecurityService.cpp index a4ec9b962..a96e345b9 100644 --- a/src/lib/md/SyntheticSecurityService.cpp +++ b/src/lib/md/SyntheticSecurityService.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "SyntheticSecurityService.h" #include "lib/config/config.h" diff --git a/src/lib/md/relay/QueryServer.cpp b/src/lib/md/relay/QueryServer.cpp index e404ff2b1..d75bbff68 100644 --- a/src/lib/md/relay/QueryServer.cpp +++ b/src/lib/md/relay/QueryServer.cpp @@ -510,7 +510,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 }); } diff --git a/src/lib/md/relay/RelayRecorder.cpp b/src/lib/md/relay/RelayRecorder.cpp index f443c0926..67cc37a66 100644 --- a/src/lib/md/relay/RelayRecorder.cpp +++ b/src/lib/md/relay/RelayRecorder.cpp @@ -31,7 +31,7 @@ const uint32_t recorder_version = 3; template void writebuf(ofstream& out, const T& pb) { - uint32_t size = pb.ByteSize(); + auto size = static_cast(pb.ByteSizeLong()); out.write(reinterpret_cast(&size), sizeof(size)); bts_assert(pb.SerializeToOstream(&out)); } diff --git a/src/lib/md/test/Co2TestInstrument.cpp b/src/lib/md/test/Co2TestInstrument.cpp index 13ff4fb71..8b639d867 100644 --- a/src/lib/md/test/Co2TestInstrument.cpp +++ b/src/lib/md/test/Co2TestInstrument.cpp @@ -1,9 +1,11 @@ #define _DISABLE_EXTENDED_ALIGNED_STORAGE #include "Co2TestInstrument.h" #include "lib/md/MemorySegmentUtils.h" +#include "lib/os/os.h" namespace bts { namespace md { +using os::memcpy; #ifdef _WIN32 # pragma warning (push) diff --git a/src/lib/md/test/mbo_tests.cpp b/src/lib/md/test/mbo_tests.cpp index 69abb194e..e8c2bca59 100644 --- a/src/lib/md/test/mbo_tests.cpp +++ b/src/lib/md/test/mbo_tests.cpp @@ -3,6 +3,7 @@ #include "../IntPrice.h" #include "../MBOProcessor.h" #include "Co2TestInstrument.h" +#include "lib/utils/Shuffle.h" #include #include @@ -54,7 +55,7 @@ std::vector gen_test_orders(uint64_t id=100, inc::UpdateType type=i // std::cout << std::endl << order_id.value() << ": " << price.price() << "-" << size; } } - std::random_shuffle(result.begin(), result.end()); + utils::Shuffle::shuffle(result.begin(), result.end()); return result; } @@ -105,7 +106,7 @@ TEST_CASE("MBO incremental", "[md][mbo]") { concat( gen_test_orders(128, inc::UpdateType::Bid), gen_test_orders(256, inc::UpdateType::Ask)); - std::random_shuffle(orders.begin(), orders.end()); + utils::Shuffle::shuffle(orders.begin(), orders.end()); apply_incremental(state, orders); REQUIRE(state.bid.size() + state.ask.size() == orders.size()); @@ -188,7 +189,8 @@ TEST_CASE("MBO sort order", "[md][mbo]") { }); } } - std::random_shuffle(updates.begin(), updates.end()); + std::random_device rd; + std::shuffle(updates.begin(), updates.end(), std::mt19937(rd())); apply_incremental(state, updates); @@ -316,5 +318,7 @@ TEST_CASE("MBO change price and size", "[md][mbo]") { REQUIRE(!not_ask); } -}}} -#endif \ No newline at end of file +} // namespace test +} // namespace md +} // namespace bts +#endif diff --git a/src/lib/md/test/md2_tests.cpp b/src/lib/md/test/md2_tests.cpp index a46b77b71..58c07f572 100644 --- a/src/lib/md/test/md2_tests.cpp +++ b/src/lib/md/test/md2_tests.cpp @@ -13,6 +13,7 @@ #include "lib/utils/bts_chrono.h" #include "lib/utils/defer.h" #include "lib/utils/warn_ctrl.h" +#include "lib/utils/Shuffle.h" #include "lib/config/protos/MarketData.pb.h" #include "lib/utils/Sqlite_utils.h" @@ -155,7 +156,7 @@ class Co2Tests { "}"); } -#ifndef WIN32 +#ifndef _WIN32 void test_security_id_recorder(const std::string &db_name) { // Verify callbacks happen after work complete auto db1 = sqlite::open_db(db_name.c_str()); @@ -1010,7 +1011,7 @@ class Co2Tests { REQUIRE(security_count == 5); } -#ifndef WIN32 +#ifndef _WIN32 void test_settlement_recorder() { using namespace datetime; security_key k1 = 401, k2 = 402; @@ -1109,7 +1110,7 @@ TEST_CASE("CO2Tests", "[md]") { co2_tests->setup(); -#ifndef WIN32 +#ifndef _WIN32 SECTION("test_security_id_recorder") { co2_tests->test_security_id_recorder(":memory:"); co2_tests->test_security_id_recorder("file::memory:?cache=shared"); @@ -1148,7 +1149,7 @@ TEST_CASE("CO2Tests", "[md]") { SECTION("test_retry_unresolved_spread") { co2_tests->test_retry_unresolved_spread(); } -#ifndef WIN32 +#ifndef _WIN32 SECTION("test_settlement_recorder") { co2_tests->test_settlement_recorder(); } @@ -1217,7 +1218,7 @@ struct Co2IndexTests { template void test_random_search(Index &index) { vector temp(random_ids); - std::random_shuffle(temp.begin(), temp.end()); + utils::Shuffle::shuffle(temp.begin(), temp.end()); for (auto &id : temp) { if (used_ids.find(id) != used_ids.end()) { REQUIRE(index.has_security(id)); diff --git a/src/lib/md/vendor/OnixsUtils.cpp b/src/lib/md/vendor/OnixsUtils.cpp index 8d56d0707..a4c75ba21 100644 --- a/src/lib/md/vendor/OnixsUtils.cpp +++ b/src/lib/md/vendor/OnixsUtils.cpp @@ -1,5 +1,6 @@ -#ifndef WIN32 -#include "OnixsUtils.h" +#ifndef _WIN32 +#include "OnixsUtils.h" +#include "lib/config/config.h" #include "lib/logging/logging.h" #include "lib/config/config.h" #include "lib/config/protos/MarketData.pb.h" diff --git a/src/lib/mercury/actors/ContentSubscription.h b/src/lib/mercury/actors/ContentSubscription.h index f7bfa648f..62ace8f4d 100644 --- a/src/lib/mercury/actors/ContentSubscription.h +++ b/src/lib/mercury/actors/ContentSubscription.h @@ -6,6 +6,7 @@ #include #include #include +#include #include namespace bts { @@ -27,7 +28,7 @@ struct NoKey { // (late join) or reentrancy (unsub while handling an update). template class ContentSubscription { public: - using Key = decltype((*((KE *)nullptr))(*((EV *)nullptr))); + using Key = std::invoke_result_t; using CB = std::function; struct SubID { SubID() : k(), sid(0) {} diff --git a/src/lib/mercury/synopsis/MergeByKey.h b/src/lib/mercury/synopsis/MergeByKey.h index 8de729cea..69b572561 100644 --- a/src/lib/mercury/synopsis/MergeByKey.h +++ b/src/lib/mercury/synopsis/MergeByKey.h @@ -1,8 +1,9 @@ #pragma once -#include -#include #include "lib/mercury/synopsis/ISynopsisBuilder.h" +#include +#include +#include namespace bts { namespace mercury { @@ -11,7 +12,7 @@ namespace mercury { // published for each key template class MergeByKey : public ISynopsisBuilder { public: - using RefConstKey = decltype(((EV *)nullptr)->key()); + using RefConstKey = std::invoke_result_t; using ConstKey = typename std::remove_reference::type; using Key = typename std::remove_const::type; diff --git a/src/lib/orderman/actors/ServiceBridge.cpp b/src/lib/orderman/actors/ServiceBridge.cpp index ad501ab98..07b4e837a 100644 --- a/src/lib/orderman/actors/ServiceBridge.cpp +++ b/src/lib/orderman/actors/ServiceBridge.cpp @@ -25,6 +25,7 @@ #include "lib/utils/PBUtils.h" #include "lib/api/service_helpers/PositionUtilities.h" #include +#include namespace bts { namespace orderman { diff --git a/src/lib/orderman/actors/ilink3/IL3Parser.cpp b/src/lib/orderman/actors/ilink3/IL3Parser.cpp index e0cc49e18..af2177b11 100644 --- a/src/lib/orderman/actors/ilink3/IL3Parser.cpp +++ b/src/lib/orderman/actors/ilink3/IL3Parser.cpp @@ -10,10 +10,12 @@ #include "lib/orderman/orderman_utils/CancelReject.h" #include "lib/orderman/orderman_utils/fix_order_codec.h" #include "lib/orderman/orderman_utils/orderman_common.h" +#include "lib/os/os.h" namespace bts { namespace orderman { namespace ilink3 { +using os::strncpy; IL3Parser::IL3Parser(config::JetFIX::Connection const *cfg, IL3SecDB *db) : most_recent_account(), cfg(cfg), db(db) {} diff --git a/src/lib/orderman/actors/ilink3/IL3Parser.h b/src/lib/orderman/actors/ilink3/IL3Parser.h index d08c16ba4..8de6afe42 100644 --- a/src/lib/orderman/actors/ilink3/IL3Parser.h +++ b/src/lib/orderman/actors/ilink3/IL3Parser.h @@ -5,7 +5,8 @@ #include "lib/md/SecurityOracle.h" #include "lib/md/ExchangeSecurityKey.h" #include -#include +#include +#include namespace bts { namespace orderman { diff --git a/src/lib/orderman/actors/ilink3/IL3Reactor.cpp b/src/lib/orderman/actors/ilink3/IL3Reactor.cpp index 45884697b..5b3bbf018 100644 --- a/src/lib/orderman/actors/ilink3/IL3Reactor.cpp +++ b/src/lib/orderman/actors/ilink3/IL3Reactor.cpp @@ -186,7 +186,7 @@ constexpr bool has_error(int events) { } void IL3Reactor::do_work() { - std::array ev_list; + std::array ev_list{}; auto ready = epoll_wait(me->epoll_fd, ev_list.data(), ev_list.size(), 0); if (ready == -1) { if (errno == EINTR) return; diff --git a/src/lib/orderman/actors/ilink3/ILink3Utils.cpp b/src/lib/orderman/actors/ilink3/ILink3Utils.cpp index 9bba8d3dd..cc7846fd3 100644 --- a/src/lib/orderman/actors/ilink3/ILink3Utils.cpp +++ b/src/lib/orderman/actors/ilink3/ILink3Utils.cpp @@ -162,9 +162,9 @@ map_cust_cti(api::orderman::CTICode code) { case CTI_CODE_CTI_CODE1: return CustOrderCapacity::Membertradingfortheirownaccount; case CTI_CODE_CTI_CODE2: - return CustOrderCapacity::Clearingfirmtradingforitsproprietaryaccount; + return CustOrderCapacity::Memberfirmtradingforitsproprietaryaccount; case CTI_CODE_CTI_CODE3: - return CustOrderCapacity::Membertradingforanothermember; + return CustOrderCapacity::Membertradingforanothermemberornonmember; case CTI_CODE_CTI_CODE4: return CustOrderCapacity::Allother; default: diff --git a/src/lib/orderman/actors/ilink3/generated/AvgPxInd.h b/src/lib/orderman/actors/ilink3/generated/AvgPxInd.h index c93ac57d4..5a0677067 100644 --- a/src/lib/orderman/actors/ilink3/generated/AvgPxInd.h +++ b/src/lib/orderman/actors/ilink3/generated/AvgPxInd.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_AVGPXIND_H_ #define _ILINKBINARY_AVGPXIND_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class AvgPxInd @@ -127,8 +63,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, AvgPxInd::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, AvgPxInd::Value m) { return os << AvgPxInd::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/BooleanFlag.h b/src/lib/orderman/actors/ilink3/generated/BooleanFlag.h index 1faff88e8..b361cc5ea 100644 --- a/src/lib/orderman/actors/ilink3/generated/BooleanFlag.h +++ b/src/lib/orderman/actors/ilink3/generated/BooleanFlag.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_BOOLEANFLAG_H_ #define _ILINKBINARY_BOOLEANFLAG_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class BooleanFlag @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, BooleanFlag::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, BooleanFlag::Value m) { return os << BooleanFlag::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/BooleanNULL.h b/src/lib/orderman/actors/ilink3/generated/BooleanNULL.h index 866ed6b42..3c28c3df2 100644 --- a/src/lib/orderman/actors/ilink3/generated/BooleanNULL.h +++ b/src/lib/orderman/actors/ilink3/generated/BooleanNULL.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_BOOLEANNULL_H_ #define _ILINKBINARY_BOOLEANNULL_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class BooleanNULL @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, BooleanNULL::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, BooleanNULL::Value m) { return os << BooleanNULL::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/BusinessReject521.h b/src/lib/orderman/actors/ilink3/generated/BusinessReject521.h index 2ef903b00..5db006073 100644 --- a/src/lib/orderman/actors/ilink3/generated/BusinessReject521.h +++ b/src/lib/orderman/actors/ilink3/generated/BusinessReject521.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(330); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(521); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = BusinessReject521(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + BusinessReject521 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - BusinessReject521 &putText(const std::string& str) + BusinessReject521 &putText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 256) @@ -874,7 +881,7 @@ public: return *this; } #else - BusinessReject521 &putSenderID(const std::string& str) + BusinessReject521 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1293,7 +1300,7 @@ public: return *this; } #else - BusinessReject521 &putLocation(const std::string& str) + BusinessReject521 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1724,7 +1731,7 @@ public: return *this; } #else - BusinessReject521 &putRefMsgType(const std::string& str) + BusinessReject521 &putRefMsgType(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 2) @@ -1932,11 +1939,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, BusinessReject521 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, BusinessReject521 _writer) { - BusinessReject521 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + BusinessReject521 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "BusinessReject521", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/ClearingAcctType.h b/src/lib/orderman/actors/ilink3/generated/ClearingAcctType.h index 0b145a7b2..ae3006427 100644 --- a/src/lib/orderman/actors/ilink3/generated/ClearingAcctType.h +++ b/src/lib/orderman/actors/ilink3/generated/ClearingAcctType.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_CLEARINGACCTTYPE_H_ #define _ILINKBINARY_CLEARINGACCTTYPE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class ClearingAcctType @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, ClearingAcctType::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, ClearingAcctType::Value m) { return os << ClearingAcctType::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/CmtaGiveUpCD.h b/src/lib/orderman/actors/ilink3/generated/CmtaGiveUpCD.h index 79f25bf02..3a96a4b98 100644 --- a/src/lib/orderman/actors/ilink3/generated/CmtaGiveUpCD.h +++ b/src/lib/orderman/actors/ilink3/generated/CmtaGiveUpCD.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_CMTAGIVEUPCD_H_ #define _ILINKBINARY_CMTAGIVEUPCD_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class CmtaGiveUpCD @@ -96,7 +32,7 @@ public: { GiveUp = static_cast(71), SGXoffset = static_cast(83), - NULL_VALUE = static_cast(0) + NULL_VALUE = static_cast(0x00) }; static CmtaGiveUpCD::Value get(const char value) @@ -105,7 +41,7 @@ public: { case static_cast(71): return GiveUp; case static_cast(83): return SGXoffset; - case static_cast(0): return NULL_VALUE; + case static_cast(0x00): return NULL_VALUE; } throw std::runtime_error("unknown value for enum CmtaGiveUpCD [E103]"); @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, CmtaGiveUpCD::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, CmtaGiveUpCD::Value m) { return os << CmtaGiveUpCD::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/CustOrdHandlInst.h b/src/lib/orderman/actors/ilink3/generated/CustOrdHandlInst.h index 1ce5ed826..40e7598f4 100644 --- a/src/lib/orderman/actors/ilink3/generated/CustOrdHandlInst.h +++ b/src/lib/orderman/actors/ilink3/generated/CustOrdHandlInst.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_CUSTORDHANDLINST_H_ #define _ILINKBINARY_CUSTORDHANDLINST_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class CustOrdHandlInst @@ -100,7 +36,7 @@ public: AlgoEngine = static_cast(72), DeskElectronic = static_cast(87), ClientElectronic = static_cast(89), - NULL_VALUE = static_cast(0) + NULL_VALUE = static_cast(48) }; static CustOrdHandlInst::Value get(const char value) @@ -113,7 +49,7 @@ public: case static_cast(72): return AlgoEngine; case static_cast(87): return DeskElectronic; case static_cast(89): return ClientElectronic; - case static_cast(0): return NULL_VALUE; + case static_cast(48): return NULL_VALUE; } throw std::runtime_error("unknown value for enum CustOrdHandlInst [E103]"); @@ -136,8 +72,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, CustOrdHandlInst::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, CustOrdHandlInst::Value m) { return os << CustOrdHandlInst::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/CustOrderCapacity.h b/src/lib/orderman/actors/ilink3/generated/CustOrderCapacity.h index cfdc79846..524f0a634 100644 --- a/src/lib/orderman/actors/ilink3/generated/CustOrderCapacity.h +++ b/src/lib/orderman/actors/ilink3/generated/CustOrderCapacity.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_CUSTORDERCAPACITY_H_ #define _ILINKBINARY_CUSTORDERCAPACITY_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class CustOrderCapacity @@ -95,8 +31,8 @@ public: enum Value { Membertradingfortheirownaccount = static_cast(1), - Clearingfirmtradingforitsproprietaryaccount = static_cast(2), - Membertradingforanothermember = static_cast(3), + Memberfirmtradingforitsproprietaryaccount = static_cast(2), + Membertradingforanothermemberornonmember = static_cast(3), Allother = static_cast(4), NULL_VALUE = static_cast(255) }; @@ -106,8 +42,8 @@ public: switch (value) { case static_cast(1): return Membertradingfortheirownaccount; - case static_cast(2): return Clearingfirmtradingforitsproprietaryaccount; - case static_cast(3): return Membertradingforanothermember; + case static_cast(2): return Memberfirmtradingforitsproprietaryaccount; + case static_cast(3): return Membertradingforanothermemberornonmember; case static_cast(4): return Allother; case static_cast(255): return NULL_VALUE; } @@ -120,8 +56,8 @@ public: switch (value) { case Membertradingfortheirownaccount: return "Membertradingfortheirownaccount"; - case Clearingfirmtradingforitsproprietaryaccount: return "Clearingfirmtradingforitsproprietaryaccount"; - case Membertradingforanothermember: return "Membertradingforanothermember"; + case Memberfirmtradingforitsproprietaryaccount: return "Memberfirmtradingforitsproprietaryaccount"; + case Membertradingforanothermemberornonmember: return "Membertradingforanothermemberornonmember"; case Allother: return "Allother"; case NULL_VALUE: return "NULL_VALUE"; } @@ -130,8 +66,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, CustOrderCapacity::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, CustOrderCapacity::Value m) { return os << CustOrderCapacity::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/DATA.h b/src/lib/orderman/actors/ilink3/generated/DATA.h index 7c672d510..2fdbfdba7 100644 --- a/src/lib/orderman/actors/ilink3/generated/DATA.h +++ b/src/lib/orderman/actors/ilink3/generated/DATA.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -194,7 +194,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static const char *lengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT @@ -324,8 +324,8 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, DATA writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, DATA writer) { builder << '{'; builder << R"("length": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/DKReason.h b/src/lib/orderman/actors/ilink3/generated/DKReason.h index 53d9e7bce..2be28325d 100644 --- a/src/lib/orderman/actors/ilink3/generated/DKReason.h +++ b/src/lib/orderman/actors/ilink3/generated/DKReason.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_DKREASON_H_ #define _ILINKBINARY_DKREASON_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class DKReason @@ -102,7 +38,7 @@ public: CalculationDifference = static_cast(70), NoMatchingExecutionReport = static_cast(71), Other = static_cast(90), - NULL_VALUE = static_cast(0) + NULL_VALUE = static_cast(48) }; static DKReason::Value get(const char value) @@ -117,7 +53,7 @@ public: case static_cast(70): return CalculationDifference; case static_cast(71): return NoMatchingExecutionReport; case static_cast(90): return Other; - case static_cast(0): return NULL_VALUE; + case static_cast(48): return NULL_VALUE; } throw std::runtime_error("unknown value for enum DKReason [E103]"); @@ -142,8 +78,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, DKReason::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, DKReason::Value m) { return os << DKReason::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/Decimal32NULL.h b/src/lib/orderman/actors/ilink3/generated/Decimal32NULL.h index 539277a71..f936295e2 100644 --- a/src/lib/orderman/actors/ilink3/generated/Decimal32NULL.h +++ b/src/lib/orderman/actors/ilink3/generated/Decimal32NULL.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -194,7 +194,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static const char *mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT @@ -338,8 +338,8 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, Decimal32NULL writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, Decimal32NULL writer) { builder << '{'; builder << R"("mantissa": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/Decimal64NULL.h b/src/lib/orderman/actors/ilink3/generated/Decimal64NULL.h index 2469e5d9c..ef20dc82e 100644 --- a/src/lib/orderman/actors/ilink3/generated/Decimal64NULL.h +++ b/src/lib/orderman/actors/ilink3/generated/Decimal64NULL.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -194,7 +194,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static const char *mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT @@ -213,7 +213,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT { - return 0; + return 6; } SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT @@ -255,6 +255,11 @@ public: SBE_NODISCARD std::int64_t mantissa() const SBE_NOEXCEPT { + if (m_actingVersion < 6) + { + return INT64_C(9223372036854775807); + } + std::int64_t val; std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int64_t)); return SBE_LITTLE_ENDIAN_ENCODE_64(val); @@ -283,7 +288,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT { - return 0; + return 6; } SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT @@ -325,6 +330,11 @@ public: SBE_NODISCARD std::int8_t exponent() const SBE_NOEXCEPT { + if (m_actingVersion < 6) + { + return static_cast(127); + } + std::int8_t val; std::memcpy(&val, m_buffer + m_offset + 8, sizeof(std::int8_t)); return (val); @@ -338,8 +348,8 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, Decimal64NULL writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, Decimal64NULL writer) { builder << '{'; builder << R"("mantissa": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/Establish503.h b/src/lib/orderman/actors/ilink3/generated/Establish503.h index 100231850..261b92fac 100644 --- a/src/lib/orderman/actors/ilink3/generated/Establish503.h +++ b/src/lib/orderman/actors/ilink3/generated/Establish503.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(132); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(503); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = Establish503(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + Establish503 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -651,7 +658,7 @@ public: return *this; } #else - Establish503 &putHMACSignature(const std::string& str) + Establish503 &putHMACSignature(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 32) @@ -857,7 +864,7 @@ public: return *this; } #else - Establish503 &putAccessKeyID(const std::string& str) + Establish503 &putAccessKeyID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1063,7 +1070,7 @@ public: return *this; } #else - Establish503 &putTradingSystemName(const std::string& str) + Establish503 &putTradingSystemName(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 30) @@ -1269,7 +1276,7 @@ public: return *this; } #else - Establish503 &putTradingSystemVersion(const std::string& str) + Establish503 &putTradingSystemVersion(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 10) @@ -1475,7 +1482,7 @@ public: return *this; } #else - Establish503 &putTradingSystemVendor(const std::string& str) + Establish503 &putTradingSystemVendor(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 10) @@ -1909,7 +1916,7 @@ public: return *this; } #else - Establish503 &putSession(const std::string& str) + Establish503 &putSession(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 3) @@ -2115,7 +2122,7 @@ public: return *this; } #else - Establish503 &putFirm(const std::string& str) + Establish503 &putFirm(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2367,7 +2374,7 @@ public: } #endif - Establish503 &putCredentials(const std::string& str) + Establish503 &putCredentials(const std::string &str) { if (str.length() > 65534) { @@ -2388,11 +2395,16 @@ public: #endif template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, Establish503 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, Establish503 _writer) { - Establish503 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + Establish503 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "Establish503", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/EstablishmentAck504.h b/src/lib/orderman/actors/ilink3/generated/EstablishmentAck504.h index 5db99608d..9e319239b 100644 --- a/src/lib/orderman/actors/ilink3/generated/EstablishmentAck504.h +++ b/src/lib/orderman/actors/ilink3/generated/EstablishmentAck504.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(38); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(504); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = EstablishmentAck504(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + EstablishmentAck504 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -962,11 +969,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, EstablishmentAck504 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, EstablishmentAck504 _writer) { - EstablishmentAck504 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + EstablishmentAck504 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "EstablishmentAck504", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/EstablishmentReject505.h b/src/lib/orderman/actors/ilink3/generated/EstablishmentReject505.h index 138a041aa..5b81b904f 100644 --- a/src/lib/orderman/actors/ilink3/generated/EstablishmentReject505.h +++ b/src/lib/orderman/actors/ilink3/generated/EstablishmentReject505.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(72); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(505); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = EstablishmentReject505(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + EstablishmentReject505 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -526,7 +533,7 @@ public: return *this; } #else - EstablishmentReject505 &putReason(const std::string& str) + EstablishmentReject505 &putReason(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 48) @@ -955,11 +962,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, EstablishmentReject505 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, EstablishmentReject505 _writer) { - EstablishmentReject505 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + EstablishmentReject505 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "EstablishmentReject505", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/ExecAckStatus.h b/src/lib/orderman/actors/ilink3/generated/ExecAckStatus.h index ac884cb70..f9506386d 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecAckStatus.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecAckStatus.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_EXECACKSTATUS_H_ #define _ILINKBINARY_EXECACKSTATUS_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class ExecAckStatus @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, ExecAckStatus::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, ExecAckStatus::Value m) { return os << ExecAckStatus::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/ExecInst.h b/src/lib/orderman/actors/ilink3/generated/ExecInst.h index 47a26fa09..e1595c161 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecInst.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecInst.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -194,7 +194,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } ExecInst &clear() @@ -433,8 +433,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecInst writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecInst writer) { builder << '['; bool atLeastOne = false; diff --git a/src/lib/orderman/actors/ilink3/generated/ExecMode.h b/src/lib/orderman/actors/ilink3/generated/ExecMode.h index 6cb430f84..bb894e61d 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecMode.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecMode.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_EXECMODE_H_ #define _ILINKBINARY_EXECMODE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class ExecMode @@ -96,7 +32,7 @@ public: { Aggressive = static_cast(65), Passive = static_cast(80), - NULL_VALUE = static_cast(0) + NULL_VALUE = static_cast(0x00) }; static ExecMode::Value get(const char value) @@ -105,7 +41,7 @@ public: { case static_cast(65): return Aggressive; case static_cast(80): return Passive; - case static_cast(0): return NULL_VALUE; + case static_cast(0x00): return NULL_VALUE; } throw std::runtime_error("unknown value for enum ExecMode [E103]"); @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, ExecMode::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, ExecMode::Value m) { return os << ExecMode::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/ExecReason.h b/src/lib/orderman/actors/ilink3/generated/ExecReason.h index 749be985a..7a95e048a 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecReason.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecReason.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_EXECREASON_H_ #define _ILINKBINARY_EXECREASON_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class ExecReason @@ -103,6 +39,9 @@ public: CancelFromRiskManagementAPI = static_cast(106), SelfMatchPreventionNewestOrderCancelled = static_cast(107), Cancelduetovolquotedoptionorderrestedqtylessthanminordersize = static_cast(108), + CancelRFCOrder = static_cast(109), + CancelUponContractExpiration = static_cast(110), + SystemCancel = static_cast(111), NULL_VALUE = static_cast(255) }; @@ -119,6 +58,9 @@ public: case static_cast(106): return CancelFromRiskManagementAPI; case static_cast(107): return SelfMatchPreventionNewestOrderCancelled; case static_cast(108): return Cancelduetovolquotedoptionorderrestedqtylessthanminordersize; + case static_cast(109): return CancelRFCOrder; + case static_cast(110): return CancelUponContractExpiration; + case static_cast(111): return SystemCancel; case static_cast(255): return NULL_VALUE; } @@ -138,6 +80,9 @@ public: case CancelFromRiskManagementAPI: return "CancelFromRiskManagementAPI"; case SelfMatchPreventionNewestOrderCancelled: return "SelfMatchPreventionNewestOrderCancelled"; case Cancelduetovolquotedoptionorderrestedqtylessthanminordersize: return "Cancelduetovolquotedoptionorderrestedqtylessthanminordersize"; + case CancelRFCOrder: return "CancelRFCOrder"; + case CancelUponContractExpiration: return "CancelUponContractExpiration"; + case SystemCancel: return "SystemCancel"; case NULL_VALUE: return "NULL_VALUE"; } @@ -145,8 +90,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, ExecReason::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, ExecReason::Value m) { return os << ExecReason::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/ExecTypTrdCxl.h b/src/lib/orderman/actors/ilink3/generated/ExecTypTrdCxl.h index 753cdd221..525bdce0f 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecTypTrdCxl.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecTypTrdCxl.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_EXECTYPTRDCXL_H_ #define _ILINKBINARY_EXECTYPTRDCXL_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class ExecTypTrdCxl @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, ExecTypTrdCxl::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, ExecTypTrdCxl::Value m) { return os << ExecTypTrdCxl::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionAck539.h b/src/lib/orderman/actors/ilink3/generated/ExecutionAck539.h index 11fbc1c3a..1e5e6b802 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionAck539.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionAck539.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(101); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(539); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionAck539(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionAck539 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -802,7 +809,7 @@ public: return *this; } #else - ExecutionAck539 &putClOrdID(const std::string& str) + ExecutionAck539 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1352,6 +1359,11 @@ public: std::string getSenderIDAsJsonEscapedString() { + if (m_actingVersion < 4) + { + return std::string(""); + } + std::ostringstream oss; std::string s = getSenderIDAsString(); @@ -1414,7 +1426,7 @@ public: return *this; } #else - ExecutionAck539 &putSenderID(const std::string& str) + ExecutionAck539 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1654,6 +1666,11 @@ public: std::string getLocationAsJsonEscapedString() { + if (m_actingVersion < 5) + { + return std::string(""); + } + std::ostringstream oss; std::string s = getLocationAsString(); @@ -1716,7 +1733,7 @@ public: return *this; } #else - ExecutionAck539 &putLocation(const std::string& str) + ExecutionAck539 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1808,11 +1825,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionAck539 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionAck539 _writer) { - ExecutionAck539 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionAck539 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionAck539", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportCancel534.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportCancel534.h index 63da9f6fa..1f6459986 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportCancel534.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportCancel534.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(222); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(247); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(534); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(222); + return static_cast(247); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportCancel534(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportCancel534 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportCancel534 &putExecID(const std::string& str) + ExecutionReportCancel534 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportCancel534 &putSenderID(const std::string& str) + ExecutionReportCancel534 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportCancel534 &putClOrdID(const std::string& str) + ExecutionReportCancel534 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1877,7 +1884,7 @@ public: return *this; } #else - ExecutionReportCancel534 &putLocation(const std::string& str) + ExecutionReportCancel534 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -3581,12 +3588,602 @@ public: return m_discretionPrice; } + SBE_NODISCARD static const char *ReservationPriceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Price"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t reservationPriceId() SBE_NOEXCEPT + { + return 9562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t reservationPriceSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool reservationPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= reservationPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t reservationPriceEncodingOffset() SBE_NOEXCEPT + { + return 222; + } + +private: + PRICENULL9 m_reservationPrice; + +public: + SBE_NODISCARD PRICENULL9 &reservationPrice() + { + m_reservationPrice.wrap(m_buffer, m_offset + 222, m_actingVersion, m_bufferLength); + return m_reservationPrice; + } + + SBE_NODISCARD static const char *PriorityIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t priorityIndicatorId() SBE_NOEXCEPT + { + return 638; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priorityIndicatorSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool priorityIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priorityIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 230; + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorNullValue() SBE_NOEXCEPT + { + return static_cast(255); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMaxValue() SBE_NOEXCEPT + { + return static_cast(254); + } + + static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priorityIndicator() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 230, sizeof(std::uint8_t)); + return (val); + } + + ExecutionReportCancel534 &priorityIndicator(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 230, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char *OrigOrderUserMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t origOrderUserId() SBE_NOEXCEPT + { + return 9937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t origOrderUserSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool origOrderUserInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= origOrderUserSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t origOrderUserEncodingOffset() SBE_NOEXCEPT + { + return 231; + } + + static SBE_CONSTEXPR char origOrderUserNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char origOrderUserMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char origOrderUserMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t origOrderUserEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t origOrderUserLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *origOrderUser() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 231; + } + + SBE_NODISCARD char *origOrderUser() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 231; + } + + SBE_NODISCARD char origOrderUser(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 231 + (index * 1), sizeof(char)); + return (val); + } + + ExecutionReportCancel534 &origOrderUser(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 231 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getOrigOrderUser(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getOrigOrderUser [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 231, sizeof(char) * static_cast(length)); + return length; + } + + ExecutionReportCancel534 &putOrigOrderUser(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 231, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getOrigOrderUserAsString() const + { + const char *buffer = m_buffer + m_offset + 231; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getOrigOrderUserAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getOrigOrderUserAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getOrigOrderUserAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 231; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + ExecutionReportCancel534 &putOrigOrderUser(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 231, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 231 + start] = 0; + } + + return *this; + } + #else + ExecutionReportCancel534 &putOrigOrderUser(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 231, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 231 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char *CancelTextMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t cancelTextId() SBE_NOEXCEPT + { + return 2807; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t cancelTextSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool cancelTextInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= cancelTextSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t cancelTextEncodingOffset() SBE_NOEXCEPT + { + return 239; + } + + static SBE_CONSTEXPR char cancelTextNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char cancelTextMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char cancelTextMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t cancelTextEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t cancelTextLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *cancelText() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 239; + } + + SBE_NODISCARD char *cancelText() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 239; + } + + SBE_NODISCARD char cancelText(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for cancelText [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 239 + (index * 1), sizeof(char)); + return (val); + } + + ExecutionReportCancel534 &cancelText(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for cancelText [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 239 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCancelText(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getCancelText [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 239, sizeof(char) * static_cast(length)); + return length; + } + + ExecutionReportCancel534 &putCancelText(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 239, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getCancelTextAsString() const + { + const char *buffer = m_buffer + m_offset + 239; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCancelTextAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getCancelTextAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getCancelTextAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 239; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + ExecutionReportCancel534 &putCancelText(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putCancelText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 239, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 239 + start] = 0; + } + + return *this; + } + #else + ExecutionReportCancel534 &putCancelText(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putCancelText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 239, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 239 + start] = 0; + } + + return *this; + } + #endif + template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportCancel534 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportCancel534 _writer) { - ExecutionReportCancel534 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportCancel534 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportCancel534", )"; builder << R"("sbeTemplateId": )"; @@ -3742,7 +4339,39 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("DiscretionPrice": )"; - builder << writer.discretionPrice(); + if (writer.discretionPriceInActingVersion()) + { + builder << writer.discretionPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("ReservationPrice": )"; + if (writer.reservationPriceInActingVersion()) + { + builder << writer.reservationPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("PriorityIndicator": )"; + builder << +writer.priorityIndicator(); + + builder << ", "; + builder << R"("OrigOrderUser": )"; + builder << '"' << + writer.getOrigOrderUserAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("CancelText": )"; + builder << '"' << + writer.getCancelTextAsJsonEscapedString().c_str() << '"'; builder << '}'; diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportElimination524.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportElimination524.h index 02f18fbb1..bab8055c5 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportElimination524.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportElimination524.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(210); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(219); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(524); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(210); + return static_cast(219); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportElimination524(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportElimination524 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportElimination524 &putExecID(const std::string& str) + ExecutionReportElimination524 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportElimination524 &putSenderID(const std::string& str) + ExecutionReportElimination524 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportElimination524 &putClOrdID(const std::string& str) + ExecutionReportElimination524 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1877,7 +1884,7 @@ public: return *this; } #else - ExecutionReportElimination524 &putLocation(const std::string& str) + ExecutionReportElimination524 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -3308,12 +3315,140 @@ public: return m_discretionPrice; } + SBE_NODISCARD static const char *ReservationPriceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Price"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t reservationPriceId() SBE_NOEXCEPT + { + return 9562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t reservationPriceSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool reservationPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= reservationPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t reservationPriceEncodingOffset() SBE_NOEXCEPT + { + return 210; + } + +private: + PRICENULL9 m_reservationPrice; + +public: + SBE_NODISCARD PRICENULL9 &reservationPrice() + { + m_reservationPrice.wrap(m_buffer, m_offset + 210, m_actingVersion, m_bufferLength); + return m_reservationPrice; + } + + SBE_NODISCARD static const char *PriorityIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t priorityIndicatorId() SBE_NOEXCEPT + { + return 638; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priorityIndicatorSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool priorityIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priorityIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 218; + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorNullValue() SBE_NOEXCEPT + { + return static_cast(255); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMaxValue() SBE_NOEXCEPT + { + return static_cast(254); + } + + static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priorityIndicator() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 218, sizeof(std::uint8_t)); + return (val); + } + + ExecutionReportElimination524 &priorityIndicator(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 218, &val, sizeof(std::uint8_t)); + return *this; + } + template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportElimination524 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportElimination524 _writer) { - ExecutionReportElimination524 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportElimination524 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportElimination524", )"; builder << R"("sbeTemplateId": )"; @@ -3453,7 +3588,29 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("DiscretionPrice": )"; - builder << writer.discretionPrice(); + if (writer.discretionPriceInActingVersion()) + { + builder << writer.discretionPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("ReservationPrice": )"; + if (writer.reservationPriceInActingVersion()) + { + builder << writer.reservationPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("PriorityIndicator": )"; + builder << +writer.priorityIndicator(); builder << '}'; diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportModify531.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportModify531.h index 7bd340934..69e2be133 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportModify531.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportModify531.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(225); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(226); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(531); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(225); + return static_cast(226); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportModify531(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportModify531 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportModify531 &putExecID(const std::string& str) + ExecutionReportModify531 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportModify531 &putSenderID(const std::string& str) + ExecutionReportModify531 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportModify531 &putClOrdID(const std::string& str) + ExecutionReportModify531 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1877,7 +1884,7 @@ public: return *this; } #else - ExecutionReportModify531 &putLocation(const std::string& str) + ExecutionReportModify531 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -3589,12 +3596,93 @@ public: return m_discretionPrice; } + SBE_NODISCARD static const char *PriorityIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t priorityIndicatorId() SBE_NOEXCEPT + { + return 638; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priorityIndicatorSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool priorityIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priorityIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 225; + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorNullValue() SBE_NOEXCEPT + { + return static_cast(255); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMaxValue() SBE_NOEXCEPT + { + return static_cast(254); + } + + static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priorityIndicator() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 225, sizeof(std::uint8_t)); + return (val); + } + + ExecutionReportModify531 &priorityIndicator(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 225, &val, sizeof(std::uint8_t)); + return *this; + } + template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportModify531 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportModify531 _writer) { - ExecutionReportModify531 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportModify531 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportModify531", )"; builder << R"("sbeTemplateId": )"; @@ -3750,7 +3838,18 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("DiscretionPrice": )"; - builder << writer.discretionPrice(); + if (writer.discretionPriceInActingVersion()) + { + builder << writer.discretionPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("PriorityIndicator": )"; + builder << +writer.priorityIndicator(); builder << '}'; diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportNew522.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportNew522.h index 9476b8390..29cf6dad9 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportNew522.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportNew522.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(217); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(226); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(522); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(217); + return static_cast(226); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportNew522(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportNew522 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportNew522 &putExecID(const std::string& str) + ExecutionReportNew522 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportNew522 &putSenderID(const std::string& str) + ExecutionReportNew522 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportNew522 &putClOrdID(const std::string& str) + ExecutionReportNew522 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1877,7 +1884,7 @@ public: return *this; } #else - ExecutionReportNew522 &putLocation(const std::string& str) + ExecutionReportNew522 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -3447,12 +3454,140 @@ public: return m_discretionPrice; } + SBE_NODISCARD static const char *ReservationPriceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Price"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t reservationPriceId() SBE_NOEXCEPT + { + return 9562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t reservationPriceSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool reservationPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= reservationPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t reservationPriceEncodingOffset() SBE_NOEXCEPT + { + return 217; + } + +private: + PRICENULL9 m_reservationPrice; + +public: + SBE_NODISCARD PRICENULL9 &reservationPrice() + { + m_reservationPrice.wrap(m_buffer, m_offset + 217, m_actingVersion, m_bufferLength); + return m_reservationPrice; + } + + SBE_NODISCARD static const char *PriorityIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t priorityIndicatorId() SBE_NOEXCEPT + { + return 638; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priorityIndicatorSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool priorityIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priorityIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 225; + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorNullValue() SBE_NOEXCEPT + { + return static_cast(255); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMaxValue() SBE_NOEXCEPT + { + return static_cast(254); + } + + static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priorityIndicator() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 225, sizeof(std::uint8_t)); + return (val); + } + + ExecutionReportNew522 &priorityIndicator(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 225, &val, sizeof(std::uint8_t)); + return *this; + } + template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportNew522 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportNew522 _writer) { - ExecutionReportNew522 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportNew522 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportNew522", )"; builder << R"("sbeTemplateId": )"; @@ -3600,7 +3735,29 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("DiscretionPrice": )"; - builder << writer.discretionPrice(); + if (writer.discretionPriceInActingVersion()) + { + builder << writer.discretionPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("ReservationPrice": )"; + if (writer.reservationPriceInActingVersion()) + { + builder << writer.reservationPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("PriorityIndicator": )"; + builder << +writer.priorityIndicator(); builder << '}'; diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportPendingCancel564.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportPendingCancel564.h index 020f5c19b..d750eacdb 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportPendingCancel564.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportPendingCancel564.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(194); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(219); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(564); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(194); + return static_cast(219); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportPendingCancel564(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportPendingCancel564 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportPendingCancel564 &putExecID(const std::string& str) + ExecutionReportPendingCancel564 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportPendingCancel564 &putSenderID(const std::string& str) + ExecutionReportPendingCancel564 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportPendingCancel564 &putClOrdID(const std::string& str) + ExecutionReportPendingCancel564 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1688,7 +1695,7 @@ public: return *this; } #else - ExecutionReportPendingCancel564 &putLocation(const std::string& str) + ExecutionReportPendingCancel564 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -3022,12 +3029,602 @@ public: return m_discretionPrice; } + SBE_NODISCARD static const char *ReservationPriceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Price"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t reservationPriceId() SBE_NOEXCEPT + { + return 9562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t reservationPriceSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool reservationPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= reservationPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t reservationPriceEncodingOffset() SBE_NOEXCEPT + { + return 194; + } + +private: + PRICENULL9 m_reservationPrice; + +public: + SBE_NODISCARD PRICENULL9 &reservationPrice() + { + m_reservationPrice.wrap(m_buffer, m_offset + 194, m_actingVersion, m_bufferLength); + return m_reservationPrice; + } + + SBE_NODISCARD static const char *PriorityIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t priorityIndicatorId() SBE_NOEXCEPT + { + return 638; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priorityIndicatorSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool priorityIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priorityIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 202; + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorNullValue() SBE_NOEXCEPT + { + return static_cast(255); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMaxValue() SBE_NOEXCEPT + { + return static_cast(254); + } + + static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priorityIndicator() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 202, sizeof(std::uint8_t)); + return (val); + } + + ExecutionReportPendingCancel564 &priorityIndicator(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 202, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char *OrigOrderUserMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t origOrderUserId() SBE_NOEXCEPT + { + return 9937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t origOrderUserSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool origOrderUserInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= origOrderUserSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t origOrderUserEncodingOffset() SBE_NOEXCEPT + { + return 203; + } + + static SBE_CONSTEXPR char origOrderUserNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char origOrderUserMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char origOrderUserMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t origOrderUserEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t origOrderUserLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *origOrderUser() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 203; + } + + SBE_NODISCARD char *origOrderUser() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 203; + } + + SBE_NODISCARD char origOrderUser(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 203 + (index * 1), sizeof(char)); + return (val); + } + + ExecutionReportPendingCancel564 &origOrderUser(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 203 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getOrigOrderUser(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getOrigOrderUser [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 203, sizeof(char) * static_cast(length)); + return length; + } + + ExecutionReportPendingCancel564 &putOrigOrderUser(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 203, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getOrigOrderUserAsString() const + { + const char *buffer = m_buffer + m_offset + 203; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getOrigOrderUserAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getOrigOrderUserAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getOrigOrderUserAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 203; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + ExecutionReportPendingCancel564 &putOrigOrderUser(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 203, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 203 + start] = 0; + } + + return *this; + } + #else + ExecutionReportPendingCancel564 &putOrigOrderUser(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 203, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 203 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char *CancelTextMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t cancelTextId() SBE_NOEXCEPT + { + return 2807; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t cancelTextSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool cancelTextInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= cancelTextSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t cancelTextEncodingOffset() SBE_NOEXCEPT + { + return 211; + } + + static SBE_CONSTEXPR char cancelTextNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char cancelTextMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char cancelTextMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t cancelTextEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t cancelTextLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *cancelText() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 211; + } + + SBE_NODISCARD char *cancelText() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 211; + } + + SBE_NODISCARD char cancelText(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for cancelText [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 211 + (index * 1), sizeof(char)); + return (val); + } + + ExecutionReportPendingCancel564 &cancelText(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for cancelText [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 211 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCancelText(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getCancelText [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 211, sizeof(char) * static_cast(length)); + return length; + } + + ExecutionReportPendingCancel564 &putCancelText(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 211, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getCancelTextAsString() const + { + const char *buffer = m_buffer + m_offset + 211; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCancelTextAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getCancelTextAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getCancelTextAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 211; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + ExecutionReportPendingCancel564 &putCancelText(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putCancelText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 211, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 211 + start] = 0; + } + + return *this; + } + #else + ExecutionReportPendingCancel564 &putCancelText(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putCancelText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 211, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 211 + start] = 0; + } + + return *this; + } + #endif + template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportPendingCancel564 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportPendingCancel564 _writer) { - ExecutionReportPendingCancel564 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportPendingCancel564 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportPendingCancel564", )"; builder << R"("sbeTemplateId": )"; @@ -3149,6 +3746,31 @@ friend std::basic_ostream& operator << ( builder << R"("DiscretionPrice": )"; builder << writer.discretionPrice(); + builder << ", "; + builder << R"("ReservationPrice": )"; + if (writer.reservationPriceInActingVersion()) + { + builder << writer.reservationPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("PriorityIndicator": )"; + builder << +writer.priorityIndicator(); + + builder << ", "; + builder << R"("OrigOrderUser": )"; + builder << '"' << + writer.getOrigOrderUserAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("CancelText": )"; + builder << '"' << + writer.getCancelTextAsJsonEscapedString().c_str() << '"'; + builder << '}'; return builder; diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportPendingReplace565.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportPendingReplace565.h index b8918335f..40cb541f7 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportPendingReplace565.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportPendingReplace565.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(195); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(196); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(565); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(195); + return static_cast(196); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportPendingReplace565(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportPendingReplace565 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportPendingReplace565 &putExecID(const std::string& str) + ExecutionReportPendingReplace565 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportPendingReplace565 &putSenderID(const std::string& str) + ExecutionReportPendingReplace565 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportPendingReplace565 &putClOrdID(const std::string& str) + ExecutionReportPendingReplace565 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1688,7 +1695,7 @@ public: return *this; } #else - ExecutionReportPendingReplace565 &putLocation(const std::string& str) + ExecutionReportPendingReplace565 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -3085,12 +3092,93 @@ public: return m_discretionPrice; } + SBE_NODISCARD static const char *PriorityIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t priorityIndicatorId() SBE_NOEXCEPT + { + return 638; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priorityIndicatorSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool priorityIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priorityIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 195; + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorNullValue() SBE_NOEXCEPT + { + return static_cast(255); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMaxValue() SBE_NOEXCEPT + { + return static_cast(254); + } + + static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priorityIndicator() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 195, sizeof(std::uint8_t)); + return (val); + } + + ExecutionReportPendingReplace565 &priorityIndicator(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 195, &val, sizeof(std::uint8_t)); + return *this; + } + template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportPendingReplace565 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportPendingReplace565 _writer) { - ExecutionReportPendingReplace565 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportPendingReplace565 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportPendingReplace565", )"; builder << R"("sbeTemplateId": )"; @@ -3216,6 +3304,10 @@ friend std::basic_ostream& operator << ( builder << R"("DiscretionPrice": )"; builder << writer.discretionPrice(); + builder << ", "; + builder << R"("PriorityIndicator": )"; + builder << +writer.priorityIndicator(); + builder << '}'; return builder; diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportReject523.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportReject523.h index d21c65dcb..8c5393eda 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportReject523.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportReject523.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(475); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(483); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(523); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(475); + return static_cast(483); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportReject523(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportReject523 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportReject523 &putText(const std::string& str) + ExecutionReportReject523 &putText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 256) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportReject523 &putExecID(const std::string& str) + ExecutionReportReject523 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportReject523 &putSenderID(const std::string& str) + ExecutionReportReject523 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1286,7 +1293,7 @@ public: return *this; } #else - ExecutionReportReject523 &putClOrdID(const std::string& str) + ExecutionReportReject523 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -2083,7 +2090,7 @@ public: return *this; } #else - ExecutionReportReject523 &putLocation(const std::string& str) + ExecutionReportReject523 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -3724,12 +3731,64 @@ public: return m_discretionPrice; } + SBE_NODISCARD static const char *ReservationPriceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Price"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t reservationPriceId() SBE_NOEXCEPT + { + return 9562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t reservationPriceSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool reservationPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= reservationPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t reservationPriceEncodingOffset() SBE_NOEXCEPT + { + return 475; + } + +private: + PRICENULL9 m_reservationPrice; + +public: + SBE_NODISCARD PRICENULL9 &reservationPrice() + { + m_reservationPrice.wrap(m_buffer, m_offset + 475, m_actingVersion, m_bufferLength); + return m_reservationPrice; + } + template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportReject523 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportReject523 _writer) { - ExecutionReportReject523 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportReject523 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportReject523", )"; builder << R"("sbeTemplateId": )"; @@ -3886,7 +3945,25 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("DiscretionPrice": )"; - builder << writer.discretionPrice(); + if (writer.discretionPriceInActingVersion()) + { + builder << writer.discretionPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("ReservationPrice": )"; + if (writer.reservationPriceInActingVersion()) + { + builder << writer.reservationPrice(); + } + else + { + builder << "{}"; + } builder << '}'; diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportStatus532.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportStatus532.h index 11db28b21..20c2a4399 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportStatus532.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportStatus532.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(488); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(513); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(532); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(488); + return static_cast(513); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportStatus532(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportStatus532 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportStatus532 &putText(const std::string& str) + ExecutionReportStatus532 &putText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 256) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportStatus532 &putExecID(const std::string& str) + ExecutionReportStatus532 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportStatus532 &putSenderID(const std::string& str) + ExecutionReportStatus532 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1286,7 +1293,7 @@ public: return *this; } #else - ExecutionReportStatus532 &putClOrdID(const std::string& str) + ExecutionReportStatus532 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -2225,7 +2232,7 @@ public: return *this; } #else - ExecutionReportStatus532 &putLocation(const std::string& str) + ExecutionReportStatus532 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -3728,12 +3735,602 @@ public: return m_discretionPrice; } + SBE_NODISCARD static const char *ReservationPriceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Price"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t reservationPriceId() SBE_NOEXCEPT + { + return 9562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t reservationPriceSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool reservationPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= reservationPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t reservationPriceEncodingOffset() SBE_NOEXCEPT + { + return 488; + } + +private: + PRICENULL9 m_reservationPrice; + +public: + SBE_NODISCARD PRICENULL9 &reservationPrice() + { + m_reservationPrice.wrap(m_buffer, m_offset + 488, m_actingVersion, m_bufferLength); + return m_reservationPrice; + } + + SBE_NODISCARD static const char *PriorityIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t priorityIndicatorId() SBE_NOEXCEPT + { + return 638; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priorityIndicatorSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool priorityIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priorityIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 496; + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorNullValue() SBE_NOEXCEPT + { + return static_cast(255); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMaxValue() SBE_NOEXCEPT + { + return static_cast(254); + } + + static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priorityIndicator() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 496, sizeof(std::uint8_t)); + return (val); + } + + ExecutionReportStatus532 &priorityIndicator(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 496, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char *OrigOrderUserMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t origOrderUserId() SBE_NOEXCEPT + { + return 9937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t origOrderUserSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool origOrderUserInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= origOrderUserSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t origOrderUserEncodingOffset() SBE_NOEXCEPT + { + return 497; + } + + static SBE_CONSTEXPR char origOrderUserNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char origOrderUserMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char origOrderUserMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t origOrderUserEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t origOrderUserLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *origOrderUser() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 497; + } + + SBE_NODISCARD char *origOrderUser() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 497; + } + + SBE_NODISCARD char origOrderUser(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 497 + (index * 1), sizeof(char)); + return (val); + } + + ExecutionReportStatus532 &origOrderUser(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 497 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getOrigOrderUser(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getOrigOrderUser [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 497, sizeof(char) * static_cast(length)); + return length; + } + + ExecutionReportStatus532 &putOrigOrderUser(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 497, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getOrigOrderUserAsString() const + { + const char *buffer = m_buffer + m_offset + 497; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getOrigOrderUserAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getOrigOrderUserAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getOrigOrderUserAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 497; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + ExecutionReportStatus532 &putOrigOrderUser(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 497, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 497 + start] = 0; + } + + return *this; + } + #else + ExecutionReportStatus532 &putOrigOrderUser(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 497, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 497 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char *CancelTextMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t cancelTextId() SBE_NOEXCEPT + { + return 2807; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t cancelTextSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool cancelTextInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= cancelTextSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t cancelTextEncodingOffset() SBE_NOEXCEPT + { + return 505; + } + + static SBE_CONSTEXPR char cancelTextNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char cancelTextMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char cancelTextMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t cancelTextEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t cancelTextLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *cancelText() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 505; + } + + SBE_NODISCARD char *cancelText() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 505; + } + + SBE_NODISCARD char cancelText(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for cancelText [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 505 + (index * 1), sizeof(char)); + return (val); + } + + ExecutionReportStatus532 &cancelText(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for cancelText [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 505 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCancelText(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getCancelText [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 505, sizeof(char) * static_cast(length)); + return length; + } + + ExecutionReportStatus532 &putCancelText(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 505, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getCancelTextAsString() const + { + const char *buffer = m_buffer + m_offset + 505; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCancelTextAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getCancelTextAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getCancelTextAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 505; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + ExecutionReportStatus532 &putCancelText(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putCancelText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 505, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 505 + start] = 0; + } + + return *this; + } + #else + ExecutionReportStatus532 &putCancelText(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putCancelText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 505, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 505 + start] = 0; + } + + return *this; + } + #endif + template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportStatus532 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportStatus532 _writer) { - ExecutionReportStatus532 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportStatus532 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportStatus532", )"; builder << R"("sbeTemplateId": )"; @@ -3898,7 +4495,39 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("DiscretionPrice": )"; - builder << writer.discretionPrice(); + if (writer.discretionPriceInActingVersion()) + { + builder << writer.discretionPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("ReservationPrice": )"; + if (writer.reservationPriceInActingVersion()) + { + builder << writer.reservationPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("PriorityIndicator": )"; + builder << +writer.priorityIndicator(); + + builder << ", "; + builder << R"("OrigOrderUser": )"; + builder << '"' << + writer.getOrigOrderUserAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("CancelText": )"; + builder << '"' << + writer.getCancelTextAsJsonEscapedString().c_str() << '"'; builder << '}'; diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumOutright548.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumOutright548.h index 778e84a85..1070778b1 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumOutright548.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumOutright548.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(222); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(548); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportTradeAddendumOutright548(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportTradeAddendumOutright548 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumOutright548 &putExecID(const std::string& str) + ExecutionReportTradeAddendumOutright548 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumOutright548 &putSenderID(const std::string& str) + ExecutionReportTradeAddendumOutright548 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumOutright548 &putClOrdID(const std::string& str) + ExecutionReportTradeAddendumOutright548 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1759,7 +1766,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumOutright548 &putLocation(const std::string& str) + ExecutionReportTradeAddendumOutright548 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -3366,7 +3373,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -3374,8 +3381,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -3384,17 +3390,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *FillPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -3714,7 +3709,7 @@ public: return *this; } #else - NoFills &putFillExecID(const std::string& str) + NoFills &putFillExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 2) @@ -3804,8 +3799,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoFills writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoFills writer) { builder << '{'; builder << R"("FillPx": )"; @@ -4017,7 +4012,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -4025,8 +4020,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -4035,17 +4029,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *OrderEventPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -4282,7 +4265,7 @@ public: return *this; } #else - NoOrderEvents &putOrderEventText(const std::string& str) + NoOrderEvents &putOrderEventText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -4747,8 +4730,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoOrderEvents writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoOrderEvents writer) { builder << '{'; builder << R"("OrderEventPx": )"; @@ -4781,11 +4764,25 @@ public: builder << ", "; builder << R"("ContraGrossTradeAmt": )"; - builder << writer.contraGrossTradeAmt(); + if (writer.contraGrossTradeAmtInActingVersion()) + { + builder << writer.contraGrossTradeAmt(); + } + else + { + builder << "{}"; + } builder << ", "; builder << R"("ContraCalculatedCcyLastQty": )"; - builder << writer.contraCalculatedCcyLastQty(); + if (writer.contraCalculatedCcyLastQtyInActingVersion()) + { + builder << writer.contraCalculatedCcyLastQty(); + } + else + { + builder << "{}"; + } builder << '}'; @@ -4855,11 +4852,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportTradeAddendumOutright548 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportTradeAddendumOutright548 _writer) { - ExecutionReportTradeAddendumOutright548 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportTradeAddendumOutright548 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportTradeAddendumOutright548", )"; builder << R"("sbeTemplateId": )"; @@ -4983,7 +4985,14 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("DiscretionPrice": )"; - builder << writer.discretionPrice(); + if (writer.discretionPriceInActingVersion()) + { + builder << writer.discretionPrice(); + } + else + { + builder << "{}"; + } builder << ", "; builder << R"("TrdType": )"; @@ -5003,29 +5012,51 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("CalculatedCcyLastQty": )"; - builder << writer.calculatedCcyLastQty(); + if (writer.calculatedCcyLastQtyInActingVersion()) + { + builder << writer.calculatedCcyLastQty(); + } + else + { + builder << "{}"; + } builder << ", "; builder << R"("GrossTradeAmt": )"; - builder << writer.grossTradeAmt(); + if (writer.grossTradeAmtInActingVersion()) + { + builder << writer.grossTradeAmt(); + } + else + { + builder << "{}"; + } builder << ", "; builder << R"("BenchmarkPrice": )"; - builder << writer.benchmarkPrice(); + if (writer.benchmarkPriceInActingVersion()) + { + builder << writer.benchmarkPrice(); + } + else + { + builder << "{}"; + } builder << ", "; { bool atLeastOne = false; builder << R"("NoFills": [)"; - writer.noFills().forEach([&](NoFills& noFills) - { - if (atLeastOne) + writer.noFills().forEach( + [&](NoFills &noFills) { - builder << ", "; - } - atLeastOne = true; - builder << noFills; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noFills; + }); builder << ']'; } @@ -5033,15 +5064,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoOrderEvents": [)"; - writer.noOrderEvents().forEach([&](NoOrderEvents& noOrderEvents) - { - if (atLeastOne) + writer.noOrderEvents().forEach( + [&](NoOrderEvents &noOrderEvents) { - builder << ", "; - } - atLeastOne = true; - builder << noOrderEvents; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noOrderEvents; + }); builder << ']'; } @@ -5052,14 +5084,16 @@ friend std::basic_ostream& operator << ( void skip() { - noFills().forEach([](NoFills e) + auto &noFillsGroup { noFills() }; + while (noFillsGroup.hasNext()) { - e.skip(); - }); - noOrderEvents().forEach([](NoOrderEvents e) + noFillsGroup.next().skip(); + } + auto &noOrderEventsGroup { noOrderEvents() }; + while (noOrderEventsGroup.hasNext()) { - e.skip(); - }); + noOrderEventsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumSpread549.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumSpread549.h index ef923c73e..821583834 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumSpread549.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumSpread549.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(187); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(549); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportTradeAddendumSpread549(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportTradeAddendumSpread549 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumSpread549 &putExecID(const std::string& str) + ExecutionReportTradeAddendumSpread549 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumSpread549 &putSenderID(const std::string& str) + ExecutionReportTradeAddendumSpread549 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumSpread549 &putClOrdID(const std::string& str) + ExecutionReportTradeAddendumSpread549 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1759,7 +1766,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumSpread549 &putLocation(const std::string& str) + ExecutionReportTradeAddendumSpread549 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -3082,7 +3089,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -3090,8 +3097,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -3100,17 +3106,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *FillPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -3430,7 +3425,7 @@ public: return *this; } #else - NoFills &putFillExecID(const std::string& str) + NoFills &putFillExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 2) @@ -3520,8 +3515,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoFills writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoFills writer) { builder << '{'; builder << R"("FillPx": )"; @@ -3733,7 +3728,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -3741,8 +3736,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -3751,17 +3745,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *LegExecIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -4300,8 +4283,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoLegs writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoLegs writer) { builder << '{'; builder << R"("LegExecID": )"; @@ -4528,7 +4511,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -4536,8 +4519,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -4546,17 +4528,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *OrderEventPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -4793,7 +4764,7 @@ public: return *this; } #else - NoOrderEvents &putOrderEventText(const std::string& str) + NoOrderEvents &putOrderEventText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -5164,8 +5135,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoOrderEvents writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoOrderEvents writer) { builder << '{'; builder << R"("OrderEventPx": )"; @@ -5264,11 +5235,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportTradeAddendumSpread549 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportTradeAddendumSpread549 _writer) { - ExecutionReportTradeAddendumSpread549 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportTradeAddendumSpread549 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportTradeAddendumSpread549", )"; builder << R"("sbeTemplateId": )"; @@ -5406,15 +5382,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoFills": [)"; - writer.noFills().forEach([&](NoFills& noFills) - { - if (atLeastOne) + writer.noFills().forEach( + [&](NoFills &noFills) { - builder << ", "; - } - atLeastOne = true; - builder << noFills; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noFills; + }); builder << ']'; } @@ -5422,15 +5399,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoLegs": [)"; - writer.noLegs().forEach([&](NoLegs& noLegs) - { - if (atLeastOne) + writer.noLegs().forEach( + [&](NoLegs &noLegs) { - builder << ", "; - } - atLeastOne = true; - builder << noLegs; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLegs; + }); builder << ']'; } @@ -5438,15 +5416,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoOrderEvents": [)"; - writer.noOrderEvents().forEach([&](NoOrderEvents& noOrderEvents) - { - if (atLeastOne) + writer.noOrderEvents().forEach( + [&](NoOrderEvents &noOrderEvents) { - builder << ", "; - } - atLeastOne = true; - builder << noOrderEvents; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noOrderEvents; + }); builder << ']'; } @@ -5457,18 +5436,21 @@ friend std::basic_ostream& operator << ( void skip() { - noFills().forEach([](NoFills e) + auto &noFillsGroup { noFills() }; + while (noFillsGroup.hasNext()) { - e.skip(); - }); - noLegs().forEach([](NoLegs e) + noFillsGroup.next().skip(); + } + auto &noLegsGroup { noLegs() }; + while (noLegsGroup.hasNext()) { - e.skip(); - }); - noOrderEvents().forEach([](NoOrderEvents e) + noLegsGroup.next().skip(); + } + auto &noOrderEventsGroup { noOrderEvents() }; + while (noOrderEventsGroup.hasNext()) { - e.skip(); - }); + noOrderEventsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumSpreadLeg550.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumSpreadLeg550.h index bf2c8f8e2..d5917c7f7 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumSpreadLeg550.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeAddendumSpreadLeg550.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(196); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(550); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportTradeAddendumSpreadLeg550(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportTradeAddendumSpreadLeg550 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumSpreadLeg550 &putExecID(const std::string& str) + ExecutionReportTradeAddendumSpreadLeg550 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumSpreadLeg550 &putSenderID(const std::string& str) + ExecutionReportTradeAddendumSpreadLeg550 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumSpreadLeg550 &putClOrdID(const std::string& str) + ExecutionReportTradeAddendumSpreadLeg550 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1759,7 +1766,7 @@ public: return *this; } #else - ExecutionReportTradeAddendumSpreadLeg550 &putLocation(const std::string& str) + ExecutionReportTradeAddendumSpreadLeg550 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2753,7 +2760,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -2761,8 +2768,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -2771,17 +2777,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *FillPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -3101,7 +3096,7 @@ public: return *this; } #else - NoFills &putFillExecID(const std::string& str) + NoFills &putFillExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 2) @@ -3191,8 +3186,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoFills writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoFills writer) { builder << '{'; builder << R"("FillPx": )"; @@ -3404,7 +3399,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -3412,8 +3407,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -3422,17 +3416,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *OrderEventPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -3669,7 +3652,7 @@ public: return *this; } #else - NoOrderEvents &putOrderEventText(const std::string& str) + NoOrderEvents &putOrderEventText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -4040,8 +4023,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoOrderEvents writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoOrderEvents writer) { builder << '{'; builder << R"("OrderEventPx": )"; @@ -4140,11 +4123,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportTradeAddendumSpreadLeg550 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportTradeAddendumSpreadLeg550 _writer) { - ExecutionReportTradeAddendumSpreadLeg550 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportTradeAddendumSpreadLeg550 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportTradeAddendumSpreadLeg550", )"; builder << R"("sbeTemplateId": )"; @@ -4252,25 +4240,40 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("CalculatedCcyLastQty": )"; - builder << writer.calculatedCcyLastQty(); + if (writer.calculatedCcyLastQtyInActingVersion()) + { + builder << writer.calculatedCcyLastQty(); + } + else + { + builder << "{}"; + } builder << ", "; builder << R"("GrossTradeAmt": )"; - builder << writer.grossTradeAmt(); + if (writer.grossTradeAmtInActingVersion()) + { + builder << writer.grossTradeAmt(); + } + else + { + builder << "{}"; + } builder << ", "; { bool atLeastOne = false; builder << R"("NoFills": [)"; - writer.noFills().forEach([&](NoFills& noFills) - { - if (atLeastOne) + writer.noFills().forEach( + [&](NoFills &noFills) { - builder << ", "; - } - atLeastOne = true; - builder << noFills; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noFills; + }); builder << ']'; } @@ -4278,15 +4281,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoOrderEvents": [)"; - writer.noOrderEvents().forEach([&](NoOrderEvents& noOrderEvents) - { - if (atLeastOne) + writer.noOrderEvents().forEach( + [&](NoOrderEvents &noOrderEvents) { - builder << ", "; - } - atLeastOne = true; - builder << noOrderEvents; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noOrderEvents; + }); builder << ']'; } @@ -4297,14 +4301,16 @@ friend std::basic_ostream& operator << ( void skip() { - noFills().forEach([](NoFills e) + auto &noFillsGroup { noFills() }; + while (noFillsGroup.hasNext()) { - e.skip(); - }); - noOrderEvents().forEach([](NoOrderEvents e) + noFillsGroup.next().skip(); + } + auto &noOrderEventsGroup { noOrderEvents() }; + while (noOrderEventsGroup.hasNext()) { - e.skip(); - }); + noOrderEventsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeOutright525.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeOutright525.h index a4df4f22e..367d42400 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeOutright525.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeOutright525.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(276); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(293); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(525); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(276); + return static_cast(293); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportTradeOutright525(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportTradeOutright525 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportTradeOutright525 &putExecID(const std::string& str) + ExecutionReportTradeOutright525 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportTradeOutright525 &putSenderID(const std::string& str) + ExecutionReportTradeOutright525 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportTradeOutright525 &putClOrdID(const std::string& str) + ExecutionReportTradeOutright525 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1995,7 +2002,7 @@ public: return *this; } #else - ExecutionReportTradeOutright525 &putLocation(const std::string& str) + ExecutionReportTradeOutright525 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -4224,6 +4231,176 @@ public: return m_benchmarkPrice; } + SBE_NODISCARD static const char *ReservationPriceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Price"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t reservationPriceId() SBE_NOEXCEPT + { + return 9562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t reservationPriceSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool reservationPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= reservationPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t reservationPriceEncodingOffset() SBE_NOEXCEPT + { + return 276; + } + +private: + PRICENULL9 m_reservationPrice; + +public: + SBE_NODISCARD PRICENULL9 &reservationPrice() + { + m_reservationPrice.wrap(m_buffer, m_offset + 276, m_actingVersion, m_bufferLength); + return m_reservationPrice; + } + + SBE_NODISCARD static const char *PriorityIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t priorityIndicatorId() SBE_NOEXCEPT + { + return 638; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priorityIndicatorSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool priorityIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priorityIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 284; + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorNullValue() SBE_NOEXCEPT + { + return static_cast(255); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint8_t priorityIndicatorMaxValue() SBE_NOEXCEPT + { + return static_cast(254); + } + + static SBE_CONSTEXPR std::size_t priorityIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priorityIndicator() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 284, sizeof(std::uint8_t)); + return (val); + } + + ExecutionReportTradeOutright525 &priorityIndicator(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 284, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char *DisplayLimitPriceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Price"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t displayLimitPriceId() SBE_NOEXCEPT + { + return 9264; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t displayLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool displayLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= displayLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t displayLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 285; + } + +private: + PRICENULL9 m_displayLimitPrice; + +public: + SBE_NODISCARD PRICENULL9 &displayLimitPrice() + { + m_displayLimitPrice.wrap(m_buffer, m_offset + 285, m_actingVersion, m_bufferLength); + return m_displayLimitPrice; + } + class NoFills { private: @@ -4350,7 +4527,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -4358,8 +4535,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -4368,17 +4544,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *FillPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -4698,7 +4863,7 @@ public: return *this; } #else - NoFills &putFillExecID(const std::string& str) + NoFills &putFillExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 2) @@ -4788,8 +4953,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoFills writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoFills writer) { builder << '{'; builder << R"("FillPx": )"; @@ -5001,7 +5166,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -5009,8 +5174,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -5019,17 +5183,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *OrderEventPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -5266,7 +5419,7 @@ public: return *this; } #else - NoOrderEvents &putOrderEventText(const std::string& str) + NoOrderEvents &putOrderEventText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -5655,8 +5808,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoOrderEvents writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoOrderEvents writer) { builder << '{'; builder << R"("OrderEventPx": )"; @@ -5685,11 +5838,25 @@ public: builder << ", "; builder << R"("ContraGrossTradeAmt": )"; - builder << writer.contraGrossTradeAmt(); + if (writer.contraGrossTradeAmtInActingVersion()) + { + builder << writer.contraGrossTradeAmt(); + } + else + { + builder << "{}"; + } builder << ", "; builder << R"("ContraCalculatedCcyLastQty": )"; - builder << writer.contraCalculatedCcyLastQty(); + if (writer.contraCalculatedCcyLastQtyInActingVersion()) + { + builder << writer.contraCalculatedCcyLastQty(); + } + else + { + builder << "{}"; + } builder << '}'; @@ -5759,11 +5926,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportTradeOutright525 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportTradeOutright525 _writer) { - ExecutionReportTradeOutright525 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportTradeOutright525 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportTradeOutright525", )"; builder << R"("sbeTemplateId": )"; @@ -5939,7 +6111,14 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("DiscretionPrice": )"; - builder << writer.discretionPrice(); + if (writer.discretionPriceInActingVersion()) + { + builder << writer.discretionPrice(); + } + else + { + builder << "{}"; + } builder << ", "; builder << R"("TrdType": )"; @@ -5959,29 +6138,77 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("CalculatedCcyLastQty": )"; - builder << writer.calculatedCcyLastQty(); + if (writer.calculatedCcyLastQtyInActingVersion()) + { + builder << writer.calculatedCcyLastQty(); + } + else + { + builder << "{}"; + } builder << ", "; builder << R"("GrossTradeAmt": )"; - builder << writer.grossTradeAmt(); + if (writer.grossTradeAmtInActingVersion()) + { + builder << writer.grossTradeAmt(); + } + else + { + builder << "{}"; + } builder << ", "; builder << R"("BenchmarkPrice": )"; - builder << writer.benchmarkPrice(); + if (writer.benchmarkPriceInActingVersion()) + { + builder << writer.benchmarkPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("ReservationPrice": )"; + if (writer.reservationPriceInActingVersion()) + { + builder << writer.reservationPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("PriorityIndicator": )"; + builder << +writer.priorityIndicator(); + + builder << ", "; + builder << R"("DisplayLimitPrice": )"; + if (writer.displayLimitPriceInActingVersion()) + { + builder << writer.displayLimitPrice(); + } + else + { + builder << "{}"; + } builder << ", "; { bool atLeastOne = false; builder << R"("NoFills": [)"; - writer.noFills().forEach([&](NoFills& noFills) - { - if (atLeastOne) + writer.noFills().forEach( + [&](NoFills &noFills) { - builder << ", "; - } - atLeastOne = true; - builder << noFills; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noFills; + }); builder << ']'; } @@ -5989,15 +6216,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoOrderEvents": [)"; - writer.noOrderEvents().forEach([&](NoOrderEvents& noOrderEvents) - { - if (atLeastOne) + writer.noOrderEvents().forEach( + [&](NoOrderEvents &noOrderEvents) { - builder << ", "; - } - atLeastOne = true; - builder << noOrderEvents; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noOrderEvents; + }); builder << ']'; } @@ -6008,14 +6236,16 @@ friend std::basic_ostream& operator << ( void skip() { - noFills().forEach([](NoFills e) + auto &noFillsGroup { noFills() }; + while (noFillsGroup.hasNext()) { - e.skip(); - }); - noOrderEvents().forEach([](NoOrderEvents e) + noFillsGroup.next().skip(); + } + auto &noOrderEventsGroup { noOrderEvents() }; + while (noOrderEventsGroup.hasNext()) { - e.skip(); - }); + noOrderEventsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeSpread526.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeSpread526.h index 94d969bc2..1784c260f 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeSpread526.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeSpread526.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(230); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(526); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportTradeSpread526(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportTradeSpread526 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportTradeSpread526 &putExecID(const std::string& str) + ExecutionReportTradeSpread526 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportTradeSpread526 &putSenderID(const std::string& str) + ExecutionReportTradeSpread526 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportTradeSpread526 &putClOrdID(const std::string& str) + ExecutionReportTradeSpread526 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1995,7 +2002,7 @@ public: return *this; } #else - ExecutionReportTradeSpread526 &putLocation(const std::string& str) + ExecutionReportTradeSpread526 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -3727,7 +3734,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -3735,8 +3742,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -3745,17 +3751,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *FillPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -4075,7 +4070,7 @@ public: return *this; } #else - NoFills &putFillExecID(const std::string& str) + NoFills &putFillExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 2) @@ -4165,8 +4160,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoFills writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoFills writer) { builder << '{'; builder << R"("FillPx": )"; @@ -4378,7 +4373,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -4386,8 +4381,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -4396,17 +4390,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *LegExecIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -4803,8 +4786,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoLegs writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoLegs writer) { builder << '{'; builder << R"("LegExecID": )"; @@ -5023,7 +5006,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -5031,8 +5014,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -5041,17 +5023,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *OrderEventPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -5288,7 +5259,7 @@ public: return *this; } #else - NoOrderEvents &putOrderEventText(const std::string& str) + NoOrderEvents &putOrderEventText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -5583,8 +5554,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoOrderEvents writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoOrderEvents writer) { builder << '{'; builder << R"("OrderEventPx": )"; @@ -5679,11 +5650,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportTradeSpread526 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportTradeSpread526 _writer) { - ExecutionReportTradeSpread526 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportTradeSpread526 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportTradeSpread526", )"; builder << R"("sbeTemplateId": )"; @@ -5853,15 +5829,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoFills": [)"; - writer.noFills().forEach([&](NoFills& noFills) - { - if (atLeastOne) + writer.noFills().forEach( + [&](NoFills &noFills) { - builder << ", "; - } - atLeastOne = true; - builder << noFills; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noFills; + }); builder << ']'; } @@ -5869,15 +5846,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoLegs": [)"; - writer.noLegs().forEach([&](NoLegs& noLegs) - { - if (atLeastOne) + writer.noLegs().forEach( + [&](NoLegs &noLegs) { - builder << ", "; - } - atLeastOne = true; - builder << noLegs; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLegs; + }); builder << ']'; } @@ -5885,15 +5863,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoOrderEvents": [)"; - writer.noOrderEvents().forEach([&](NoOrderEvents& noOrderEvents) - { - if (atLeastOne) + writer.noOrderEvents().forEach( + [&](NoOrderEvents &noOrderEvents) { - builder << ", "; - } - atLeastOne = true; - builder << noOrderEvents; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noOrderEvents; + }); builder << ']'; } @@ -5904,18 +5883,21 @@ friend std::basic_ostream& operator << ( void skip() { - noFills().forEach([](NoFills e) + auto &noFillsGroup { noFills() }; + while (noFillsGroup.hasNext()) { - e.skip(); - }); - noLegs().forEach([](NoLegs e) + noFillsGroup.next().skip(); + } + auto &noLegsGroup { noLegs() }; + while (noLegsGroup.hasNext()) { - e.skip(); - }); - noOrderEvents().forEach([](NoOrderEvents e) + noLegsGroup.next().skip(); + } + auto &noOrderEventsGroup { noOrderEvents() }; + while (noOrderEventsGroup.hasNext()) { - e.skip(); - }); + noOrderEventsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeSpreadLeg527.h b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeSpreadLeg527.h index 1c02a1da1..d7c1ede74 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeSpreadLeg527.h +++ b/src/lib/orderman/actors/ilink3/generated/ExecutionReportTradeSpreadLeg527.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(219); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(527); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = ExecutionReportTradeSpreadLeg527(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + ExecutionReportTradeSpreadLeg527 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - ExecutionReportTradeSpreadLeg527 &putExecID(const std::string& str) + ExecutionReportTradeSpreadLeg527 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -874,7 +881,7 @@ public: return *this; } #else - ExecutionReportTradeSpreadLeg527 &putSenderID(const std::string& str) + ExecutionReportTradeSpreadLeg527 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - ExecutionReportTradeSpreadLeg527 &putClOrdID(const std::string& str) + ExecutionReportTradeSpreadLeg527 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1782,7 +1789,7 @@ public: return *this; } #else - ExecutionReportTradeSpreadLeg527 &putLocation(const std::string& str) + ExecutionReportTradeSpreadLeg527 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2969,7 +2976,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -2977,8 +2984,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -2987,17 +2993,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *FillPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -3317,7 +3312,7 @@ public: return *this; } #else - NoFills &putFillExecID(const std::string& str) + NoFills &putFillExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 2) @@ -3407,8 +3402,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoFills writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoFills writer) { builder << '{'; builder << R"("FillPx": )"; @@ -3620,7 +3615,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -3628,8 +3623,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -3638,17 +3632,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *OrderEventPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -3885,7 +3868,7 @@ public: return *this; } #else - NoOrderEvents &putOrderEventText(const std::string& str) + NoOrderEvents &putOrderEventText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -4180,8 +4163,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoOrderEvents writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoOrderEvents writer) { builder << '{'; builder << R"("OrderEventPx": )"; @@ -4276,11 +4259,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, ExecutionReportTradeSpreadLeg527 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, ExecutionReportTradeSpreadLeg527 _writer) { - ExecutionReportTradeSpreadLeg527 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + ExecutionReportTradeSpreadLeg527 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "ExecutionReportTradeSpreadLeg527", )"; builder << R"("sbeTemplateId": )"; @@ -4400,25 +4388,40 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("CalculatedCcyLastQty": )"; - builder << writer.calculatedCcyLastQty(); + if (writer.calculatedCcyLastQtyInActingVersion()) + { + builder << writer.calculatedCcyLastQty(); + } + else + { + builder << "{}"; + } builder << ", "; builder << R"("GrossTradeAmt": )"; - builder << writer.grossTradeAmt(); + if (writer.grossTradeAmtInActingVersion()) + { + builder << writer.grossTradeAmt(); + } + else + { + builder << "{}"; + } builder << ", "; { bool atLeastOne = false; builder << R"("NoFills": [)"; - writer.noFills().forEach([&](NoFills& noFills) - { - if (atLeastOne) + writer.noFills().forEach( + [&](NoFills &noFills) { - builder << ", "; - } - atLeastOne = true; - builder << noFills; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noFills; + }); builder << ']'; } @@ -4426,15 +4429,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoOrderEvents": [)"; - writer.noOrderEvents().forEach([&](NoOrderEvents& noOrderEvents) - { - if (atLeastOne) + writer.noOrderEvents().forEach( + [&](NoOrderEvents &noOrderEvents) { - builder << ", "; - } - atLeastOne = true; - builder << noOrderEvents; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noOrderEvents; + }); builder << ']'; } @@ -4445,14 +4449,16 @@ friend std::basic_ostream& operator << ( void skip() { - noFills().forEach([](NoFills e) + auto &noFillsGroup { noFills() }; + while (noFillsGroup.hasNext()) { - e.skip(); - }); - noOrderEvents().forEach([](NoOrderEvents e) + noFillsGroup.next().skip(); + } + auto &noOrderEventsGroup { noOrderEvents() }; + while (noOrderEventsGroup.hasNext()) { - e.skip(); - }); + noOrderEventsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/ExpCycle.h b/src/lib/orderman/actors/ilink3/generated/ExpCycle.h index 9b4ed2940..f36b1264d 100644 --- a/src/lib/orderman/actors/ilink3/generated/ExpCycle.h +++ b/src/lib/orderman/actors/ilink3/generated/ExpCycle.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_EXPCYCLE_H_ #define _ILINKBINARY_EXPCYCLE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class ExpCycle @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, ExpCycle::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, ExpCycle::Value m) { return os << ExpCycle::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/FTI.h b/src/lib/orderman/actors/ilink3/generated/FTI.h index ebdb932e8..9750b78c2 100644 --- a/src/lib/orderman/actors/ilink3/generated/FTI.h +++ b/src/lib/orderman/actors/ilink3/generated/FTI.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_FTI_H_ #define _ILINKBINARY_FTI_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class FTI @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, FTI::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, FTI::Value m) { return os << FTI::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/GroupSize.h b/src/lib/orderman/actors/ilink3/generated/GroupSize.h index 65c03a506..194cf92d5 100644 --- a/src/lib/orderman/actors/ilink3/generated/GroupSize.h +++ b/src/lib/orderman/actors/ilink3/generated/GroupSize.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -194,7 +194,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static const char *blockLengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT @@ -338,8 +338,8 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, GroupSize writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, GroupSize writer) { builder << '{'; builder << R"("blockLength": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/KeepAliveLapsed.h b/src/lib/orderman/actors/ilink3/generated/KeepAliveLapsed.h index 56721e9b3..4d103a3e4 100644 --- a/src/lib/orderman/actors/ilink3/generated/KeepAliveLapsed.h +++ b/src/lib/orderman/actors/ilink3/generated/KeepAliveLapsed.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_KEEPALIVELAPSED_H_ #define _ILINKBINARY_KEEPALIVELAPSED_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class KeepAliveLapsed @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, KeepAliveLapsed::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, KeepAliveLapsed::Value m) { return os << KeepAliveLapsed::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/ListUpdAct.h b/src/lib/orderman/actors/ilink3/generated/ListUpdAct.h index 3dea9d8fd..6b0db9aca 100644 --- a/src/lib/orderman/actors/ilink3/generated/ListUpdAct.h +++ b/src/lib/orderman/actors/ilink3/generated/ListUpdAct.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_LISTUPDACT_H_ #define _ILINKBINARY_LISTUPDACT_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class ListUpdAct @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, ListUpdAct::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, ListUpdAct::Value m) { return os << ListUpdAct::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/ManualOrdInd.h b/src/lib/orderman/actors/ilink3/generated/ManualOrdInd.h index b859bfb97..08a5f3898 100644 --- a/src/lib/orderman/actors/ilink3/generated/ManualOrdInd.h +++ b/src/lib/orderman/actors/ilink3/generated/ManualOrdInd.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_MANUALORDIND_H_ #define _ILINKBINARY_MANUALORDIND_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class ManualOrdInd @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, ManualOrdInd::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, ManualOrdInd::Value m) { return os << ManualOrdInd::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/ManualOrdIndReq.h b/src/lib/orderman/actors/ilink3/generated/ManualOrdIndReq.h index 6c8ab4930..9ee9f76a6 100644 --- a/src/lib/orderman/actors/ilink3/generated/ManualOrdIndReq.h +++ b/src/lib/orderman/actors/ilink3/generated/ManualOrdIndReq.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_MANUALORDINDREQ_H_ #define _ILINKBINARY_MANUALORDINDREQ_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class ManualOrdIndReq @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, ManualOrdIndReq::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, ManualOrdIndReq::Value m) { return os << ManualOrdIndReq::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/MassActionOrdTyp.h b/src/lib/orderman/actors/ilink3/generated/MassActionOrdTyp.h index df87d4dc4..a5d854b1b 100644 --- a/src/lib/orderman/actors/ilink3/generated/MassActionOrdTyp.h +++ b/src/lib/orderman/actors/ilink3/generated/MassActionOrdTyp.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_MASSACTIONORDTYP_H_ #define _ILINKBINARY_MASSACTIONORDTYP_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class MassActionOrdTyp @@ -96,7 +32,7 @@ public: { Limit = static_cast(50), StopLimit = static_cast(52), - NULL_VALUE = static_cast(0) + NULL_VALUE = static_cast(48) }; static MassActionOrdTyp::Value get(const char value) @@ -105,7 +41,7 @@ public: { case static_cast(50): return Limit; case static_cast(52): return StopLimit; - case static_cast(0): return NULL_VALUE; + case static_cast(48): return NULL_VALUE; } throw std::runtime_error("unknown value for enum MassActionOrdTyp [E103]"); @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, MassActionOrdTyp::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, MassActionOrdTyp::Value m) { return os << MassActionOrdTyp::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/MassActionResponse.h b/src/lib/orderman/actors/ilink3/generated/MassActionResponse.h index eca52b837..fe31f60ce 100644 --- a/src/lib/orderman/actors/ilink3/generated/MassActionResponse.h +++ b/src/lib/orderman/actors/ilink3/generated/MassActionResponse.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_MASSACTIONRESPONSE_H_ #define _ILINKBINARY_MASSACTIONRESPONSE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class MassActionResponse @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, MassActionResponse::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, MassActionResponse::Value m) { return os << MassActionResponse::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/MassActionScope.h b/src/lib/orderman/actors/ilink3/generated/MassActionScope.h index d99de58fc..f0c912359 100644 --- a/src/lib/orderman/actors/ilink3/generated/MassActionScope.h +++ b/src/lib/orderman/actors/ilink3/generated/MassActionScope.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_MASSACTIONSCOPE_H_ #define _ILINKBINARY_MASSACTIONSCOPE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class MassActionScope @@ -133,8 +69,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, MassActionScope::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, MassActionScope::Value m) { return os << MassActionScope::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/MassCancelTIF.h b/src/lib/orderman/actors/ilink3/generated/MassCancelTIF.h index 19df73e07..f1a641c66 100644 --- a/src/lib/orderman/actors/ilink3/generated/MassCancelTIF.h +++ b/src/lib/orderman/actors/ilink3/generated/MassCancelTIF.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_MASSCANCELTIF_H_ #define _ILINKBINARY_MASSCANCELTIF_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class MassCancelTIF @@ -127,8 +63,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, MassCancelTIF::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, MassCancelTIF::Value m) { return os << MassCancelTIF::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/MassCxlReqTyp.h b/src/lib/orderman/actors/ilink3/generated/MassCxlReqTyp.h index b3ca9ba15..692144b0a 100644 --- a/src/lib/orderman/actors/ilink3/generated/MassCxlReqTyp.h +++ b/src/lib/orderman/actors/ilink3/generated/MassCxlReqTyp.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_MASSCXLREQTYP_H_ #define _ILINKBINARY_MASSCXLREQTYP_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class MassCxlReqTyp @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, MassCxlReqTyp::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, MassCxlReqTyp::Value m) { return os << MassCxlReqTyp::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/MassQuote517.h b/src/lib/orderman/actors/ilink3/generated/MassQuote517.h index d2182a29f..fd63c882f 100644 --- a/src/lib/orderman/actors/ilink3/generated/MassQuote517.h +++ b/src/lib/orderman/actors/ilink3/generated/MassQuote517.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(92); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(123); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(517); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(92); + return static_cast(123); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = MassQuote517(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + MassQuote517 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -802,7 +809,7 @@ public: return *this; } #else - MassQuote517 &putSenderID(const std::string& str) + MassQuote517 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1079,7 +1086,7 @@ public: return *this; } #else - MassQuote517 &putLocation(const std::string& str) + MassQuote517 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1574,6 +1581,11 @@ public: std::string getReservedAsJsonEscapedString() { + if (m_actingVersion < 5) + { + return std::string(""); + } + std::ostringstream oss; std::string s = getReservedAsString(); @@ -1636,7 +1648,7 @@ public: return *this; } #else - MassQuote517 &putReserved(const std::string& str) + MassQuote517 &putReserved(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 30) @@ -1654,6 +1666,310 @@ public: } #endif + SBE_NODISCARD static const char *Reserved1MetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t reserved1Id() SBE_NOEXCEPT + { + return 5239; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t reserved1SinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool reserved1InActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= reserved1SinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t reserved1EncodingOffset() SBE_NOEXCEPT + { + return 92; + } + + static SBE_CONSTEXPR char reserved1NullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char reserved1MinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char reserved1MaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t reserved1EncodingLength() SBE_NOEXCEPT + { + return 30; + } + + static SBE_CONSTEXPR std::uint64_t reserved1Length() SBE_NOEXCEPT + { + return 30; + } + + SBE_NODISCARD const char *reserved1() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 92; + } + + SBE_NODISCARD char *reserved1() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 92; + } + + SBE_NODISCARD char reserved1(const std::uint64_t index) const + { + if (index >= 30) + { + throw std::runtime_error("index out of range for reserved1 [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 92 + (index * 1), sizeof(char)); + return (val); + } + + MassQuote517 &reserved1(const std::uint64_t index, const char value) + { + if (index >= 30) + { + throw std::runtime_error("index out of range for reserved1 [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 92 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getReserved1(char *const dst, const std::uint64_t length) const + { + if (length > 30) + { + throw std::runtime_error("length too large for getReserved1 [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 92, sizeof(char) * static_cast(length)); + return length; + } + + MassQuote517 &putReserved1(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 92, src, sizeof(char) * 30); + return *this; + } + + SBE_NODISCARD std::string getReserved1AsString() const + { + const char *buffer = m_buffer + m_offset + 92; + std::size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getReserved1AsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getReserved1AsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getReserved1AsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 92; + std::size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MassQuote517 &putReserved1(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putReserved1 [E106]"); + } + + std::memcpy(m_buffer + m_offset + 92, str.data(), srcLength); + for (std::size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 92 + start] = 0; + } + + return *this; + } + #else + MassQuote517 &putReserved1(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putReserved1 [E106]"); + } + + std::memcpy(m_buffer + m_offset + 92, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 92 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char *QuoteEntryOpenMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t quoteEntryOpenId() SBE_NOEXCEPT + { + return 9182; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t quoteEntryOpenSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool quoteEntryOpenInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= quoteEntryOpenSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t quoteEntryOpenEncodingOffset() SBE_NOEXCEPT + { + return 122; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t quoteEntryOpenEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t quoteEntryOpenRaw() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 122, sizeof(std::uint8_t)); + return (val); + } + + SBE_NODISCARD BooleanNULL::Value quoteEntryOpen() const + { + if (m_actingVersion < 8) + { + return BooleanNULL::NULL_VALUE; + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 122, sizeof(std::uint8_t)); + return BooleanNULL::get((val)); + } + + MassQuote517 "eEntryOpen(const BooleanNULL::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 122, &val, sizeof(std::uint8_t)); + return *this; + } + class NoQuoteEntries { private: @@ -1780,7 +2096,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -1788,8 +2104,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -1798,17 +2113,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *BidPxMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -2331,8 +2635,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoQuoteEntries writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoQuoteEntries writer) { builder << '{'; builder << R"("BidPx": )"; @@ -2434,11 +2738,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, MassQuote517 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, MassQuote517 _writer) { - MassQuote517 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + MassQuote517 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "MassQuote517", )"; builder << R"("sbeTemplateId": )"; @@ -2499,19 +2808,29 @@ friend std::basic_ostream& operator << ( builder << '"' << writer.getReservedAsJsonEscapedString().c_str() << '"'; + builder << ", "; + builder << R"("Reserved1": )"; + builder << '"' << + writer.getReserved1AsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("QuoteEntryOpen": )"; + builder << '"' << writer.quoteEntryOpen() << '"'; + builder << ", "; { bool atLeastOne = false; builder << R"("NoQuoteEntries": [)"; - writer.noQuoteEntries().forEach([&](NoQuoteEntries& noQuoteEntries) - { - if (atLeastOne) + writer.noQuoteEntries().forEach( + [&](NoQuoteEntries &noQuoteEntries) { - builder << ", "; - } - atLeastOne = true; - builder << noQuoteEntries; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noQuoteEntries; + }); builder << ']'; } @@ -2522,10 +2841,11 @@ friend std::basic_ostream& operator << ( void skip() { - noQuoteEntries().forEach([](NoQuoteEntries e) + auto &noQuoteEntriesGroup { noQuoteEntries() }; + while (noQuoteEntriesGroup.hasNext()) { - e.skip(); - }); + noQuoteEntriesGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/MassQuoteAck545.h b/src/lib/orderman/actors/ilink3/generated/MassQuoteAck545.h index 03bee9a52..9f1d810b1 100644 --- a/src/lib/orderman/actors/ilink3/generated/MassQuoteAck545.h +++ b/src/lib/orderman/actors/ilink3/generated/MassQuoteAck545.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(350); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(351); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(545); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(350); + return static_cast(351); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = MassQuoteAck545(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + MassQuoteAck545 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - MassQuoteAck545 &putText(const std::string& str) + MassQuoteAck545 &putText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 256) @@ -874,7 +881,7 @@ public: return *this; } #else - MassQuoteAck545 &putSenderID(const std::string& str) + MassQuoteAck545 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1364,7 +1371,7 @@ public: return *this; } #else - MassQuoteAck545 &putLocation(const std::string& str) + MassQuoteAck545 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2264,6 +2271,79 @@ public: return *this; } + SBE_NODISCARD static const char *QuoteEntryOpenMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t quoteEntryOpenId() SBE_NOEXCEPT + { + return 9182; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t quoteEntryOpenSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool quoteEntryOpenInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= quoteEntryOpenSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t quoteEntryOpenEncodingOffset() SBE_NOEXCEPT + { + return 350; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t quoteEntryOpenEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t quoteEntryOpenRaw() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 350, sizeof(std::uint8_t)); + return (val); + } + + SBE_NODISCARD BooleanNULL::Value quoteEntryOpen() const + { + if (m_actingVersion < 8) + { + return BooleanNULL::NULL_VALUE; + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 350, sizeof(std::uint8_t)); + return BooleanNULL::get((val)); + } + + MassQuoteAck545 "eEntryOpen(const BooleanNULL::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 350, &val, sizeof(std::uint8_t)); + return *this; + } + class NoQuoteEntries { private: @@ -2390,7 +2470,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -2398,8 +2478,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -2408,17 +2487,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *QuoteEntryIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -2705,8 +2773,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoQuoteEntries writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoQuoteEntries writer) { builder << '{'; builder << R"("QuoteEntryID": )"; @@ -2792,11 +2860,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, MassQuoteAck545 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, MassQuoteAck545 _writer) { - MassQuoteAck545 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + MassQuoteAck545 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "MassQuoteAck545", )"; builder << R"("sbeTemplateId": )"; @@ -2893,19 +2966,24 @@ friend std::basic_ostream& operator << ( builder << R"("DelayToTime": )"; builder << +writer.delayToTime(); + builder << ", "; + builder << R"("QuoteEntryOpen": )"; + builder << '"' << writer.quoteEntryOpen() << '"'; + builder << ", "; { bool atLeastOne = false; builder << R"("NoQuoteEntries": [)"; - writer.noQuoteEntries().forEach([&](NoQuoteEntries& noQuoteEntries) - { - if (atLeastOne) + writer.noQuoteEntries().forEach( + [&](NoQuoteEntries &noQuoteEntries) { - builder << ", "; - } - atLeastOne = true; - builder << noQuoteEntries; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noQuoteEntries; + }); builder << ']'; } @@ -2916,10 +2994,11 @@ friend std::basic_ostream& operator << ( void skip() { - noQuoteEntries().forEach([](NoQuoteEntries e) + auto &noQuoteEntriesGroup { noQuoteEntries() }; + while (noQuoteEntriesGroup.hasNext()) { - e.skip(); - }); + noQuoteEntriesGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/MassStatusOrdTyp.h b/src/lib/orderman/actors/ilink3/generated/MassStatusOrdTyp.h index 98f9b359c..936dd01a0 100644 --- a/src/lib/orderman/actors/ilink3/generated/MassStatusOrdTyp.h +++ b/src/lib/orderman/actors/ilink3/generated/MassStatusOrdTyp.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_MASSSTATUSORDTYP_H_ #define _ILINKBINARY_MASSSTATUSORDTYP_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class MassStatusOrdTyp @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, MassStatusOrdTyp::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, MassStatusOrdTyp::Value m) { return os << MassStatusOrdTyp::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/MassStatusReqTyp.h b/src/lib/orderman/actors/ilink3/generated/MassStatusReqTyp.h index cd041aca2..5ff457dd3 100644 --- a/src/lib/orderman/actors/ilink3/generated/MassStatusReqTyp.h +++ b/src/lib/orderman/actors/ilink3/generated/MassStatusReqTyp.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_MASSSTATUSREQTYP_H_ #define _ILINKBINARY_MASSSTATUSREQTYP_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class MassStatusReqTyp @@ -96,6 +32,7 @@ public: { Instrument = static_cast(1), InstrumentGroup = static_cast(3), + AllOrders = static_cast(7), MarketSegment = static_cast(100), NULL_VALUE = static_cast(255) }; @@ -106,6 +43,7 @@ public: { case static_cast(1): return Instrument; case static_cast(3): return InstrumentGroup; + case static_cast(7): return AllOrders; case static_cast(100): return MarketSegment; case static_cast(255): return NULL_VALUE; } @@ -119,6 +57,7 @@ public: { case Instrument: return "Instrument"; case InstrumentGroup: return "InstrumentGroup"; + case AllOrders: return "AllOrders"; case MarketSegment: return "MarketSegment"; case NULL_VALUE: return "NULL_VALUE"; } @@ -127,8 +66,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, MassStatusReqTyp::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, MassStatusReqTyp::Value m) { return os << MassStatusReqTyp::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/MassStatusTIF.h b/src/lib/orderman/actors/ilink3/generated/MassStatusTIF.h index da45e4f53..6de553669 100644 --- a/src/lib/orderman/actors/ilink3/generated/MassStatusTIF.h +++ b/src/lib/orderman/actors/ilink3/generated/MassStatusTIF.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_MASSSTATUSTIF_H_ #define _ILINKBINARY_MASSSTATUSTIF_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class MassStatusTIF @@ -130,8 +66,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, MassStatusTIF::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, MassStatusTIF::Value m) { return os << MassStatusTIF::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/MaturityMonthYear.h b/src/lib/orderman/actors/ilink3/generated/MaturityMonthYear.h index 97c995a75..1b5875d8d 100644 --- a/src/lib/orderman/actors/ilink3/generated/MaturityMonthYear.h +++ b/src/lib/orderman/actors/ilink3/generated/MaturityMonthYear.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -194,7 +194,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static const char *yearMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT @@ -478,8 +478,8 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, MaturityMonthYear writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, MaturityMonthYear writer) { builder << '{'; builder << R"("year": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/MessageHeader.h b/src/lib/orderman/actors/ilink3/generated/MessageHeader.h index a0a021bba..0fa76d344 100644 --- a/src/lib/orderman/actors/ilink3/generated/MessageHeader.h +++ b/src/lib/orderman/actors/ilink3/generated/MessageHeader.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -194,7 +194,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static const char *blockLengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT @@ -478,8 +478,8 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, MessageHeader writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, MessageHeader writer) { builder << '{'; builder << R"("blockLength": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/Negotiate500.h b/src/lib/orderman/actors/ilink3/generated/Negotiate500.h index 52afbd4f9..8f7e3488b 100644 --- a/src/lib/orderman/actors/ilink3/generated/Negotiate500.h +++ b/src/lib/orderman/actors/ilink3/generated/Negotiate500.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(76); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(500); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = Negotiate500(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + Negotiate500 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -776,7 +783,7 @@ public: return *this; } #else - Negotiate500 &putHMACSignature(const std::string& str) + Negotiate500 &putHMACSignature(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 32) @@ -982,7 +989,7 @@ public: return *this; } #else - Negotiate500 &putAccessKeyID(const std::string& str) + Negotiate500 &putAccessKeyID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1345,7 +1352,7 @@ public: return *this; } #else - Negotiate500 &putSession(const std::string& str) + Negotiate500 &putSession(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 3) @@ -1551,7 +1558,7 @@ public: return *this; } #else - Negotiate500 &putFirm(const std::string& str) + Negotiate500 &putFirm(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1732,7 +1739,7 @@ public: } #endif - Negotiate500 &putCredentials(const std::string& str) + Negotiate500 &putCredentials(const std::string &str) { if (str.length() > 65534) { @@ -1753,11 +1760,16 @@ public: #endif template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, Negotiate500 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, Negotiate500 _writer) { - Negotiate500 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + Negotiate500 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "Negotiate500", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/NegotiationReject502.h b/src/lib/orderman/actors/ilink3/generated/NegotiationReject502.h index fef10a533..4415f3bfa 100644 --- a/src/lib/orderman/actors/ilink3/generated/NegotiationReject502.h +++ b/src/lib/orderman/actors/ilink3/generated/NegotiationReject502.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(68); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(502); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = NegotiationReject502(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + NegotiationReject502 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -526,7 +533,7 @@ public: return *this; } #else - NegotiationReject502 &putReason(const std::string& str) + NegotiationReject502 &putReason(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 48) @@ -884,11 +891,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NegotiationReject502 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NegotiationReject502 _writer) { - NegotiationReject502 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + NegotiationReject502 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "NegotiationReject502", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/NegotiationResponse501.h b/src/lib/orderman/actors/ilink3/generated/NegotiationResponse501.h index 87b5a0ff4..5d78d93e3 100644 --- a/src/lib/orderman/actors/ilink3/generated/NegotiationResponse501.h +++ b/src/lib/orderman/actors/ilink3/generated/NegotiationResponse501.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(32); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(501); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = NegotiationResponse501(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + NegotiationResponse501 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -1107,7 +1114,7 @@ public: } #endif - NegotiationResponse501 &putCredentials(const std::string& str) + NegotiationResponse501 &putCredentials(const std::string &str) { if (str.length() > 65534) { @@ -1128,11 +1135,16 @@ public: #endif template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NegotiationResponse501 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NegotiationResponse501 _writer) { - NegotiationResponse501 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + NegotiationResponse501 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "NegotiationResponse501", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/NewOrderCross544.h b/src/lib/orderman/actors/ilink3/generated/NewOrderCross544.h index b8fe9e2b4..26f3b9f44 100644 --- a/src/lib/orderman/actors/ilink3/generated/NewOrderCross544.h +++ b/src/lib/orderman/actors/ilink3/generated/NewOrderCross544.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(74); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(544); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = NewOrderCross544(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + NewOrderCross544 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -802,7 +809,7 @@ public: return *this; } #else - NewOrderCross544 &putSenderID(const std::string& str) + NewOrderCross544 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1572,7 +1579,7 @@ public: return *this; } #else - NewOrderCross544 &putLocation(const std::string& str) + NewOrderCross544 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1787,7 +1794,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -1795,8 +1802,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -1805,17 +1811,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *ClOrdIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -2005,7 +2000,7 @@ public: return *this; } #else - NoSides &putClOrdID(const std::string& str) + NoSides &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -2292,8 +2287,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoSides writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoSides writer) { builder << '{'; builder << R"("ClOrdID": )"; @@ -2384,11 +2379,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NewOrderCross544 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NewOrderCross544 _writer) { - NewOrderCross544 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + NewOrderCross544 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "NewOrderCross544", )"; builder << R"("sbeTemplateId": )"; @@ -2440,15 +2440,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoSides": [)"; - writer.noSides().forEach([&](NoSides& noSides) - { - if (atLeastOne) + writer.noSides().forEach( + [&](NoSides &noSides) { - builder << ", "; - } - atLeastOne = true; - builder << noSides; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noSides; + }); builder << ']'; } @@ -2459,10 +2460,11 @@ friend std::basic_ostream& operator << ( void skip() { - noSides().forEach([](NoSides e) + auto &noSidesGroup { noSides() }; + while (noSidesGroup.hasNext()) { - e.skip(); - }); + noSidesGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/NewOrderSingle514.h b/src/lib/orderman/actors/ilink3/generated/NewOrderSingle514.h index 4b3e231c4..d59dc3055 100644 --- a/src/lib/orderman/actors/ilink3/generated/NewOrderSingle514.h +++ b/src/lib/orderman/actors/ilink3/generated/NewOrderSingle514.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(124); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(132); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(514); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(124); + return static_cast(132); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = NewOrderSingle514(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + NewOrderSingle514 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -849,7 +856,7 @@ public: return *this; } #else - NewOrderSingle514 &putSenderID(const std::string& str) + NewOrderSingle514 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1055,7 +1062,7 @@ public: return *this; } #else - NewOrderSingle514 &putClOrdID(const std::string& str) + NewOrderSingle514 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1521,7 +1528,7 @@ public: return *this; } #else - NewOrderSingle514 &putLocation(const std::string& str) + NewOrderSingle514 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2292,12 +2299,64 @@ public: return m_discretionPrice; } + SBE_NODISCARD static const char *ReservationPriceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Price"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t reservationPriceId() SBE_NOEXCEPT + { + return 9562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t reservationPriceSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool reservationPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= reservationPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t reservationPriceEncodingOffset() SBE_NOEXCEPT + { + return 124; + } + +private: + PRICENULL9 m_reservationPrice; + +public: + SBE_NODISCARD PRICENULL9 &reservationPrice() + { + m_reservationPrice.wrap(m_buffer, m_offset + 124, m_actingVersion, m_bufferLength); + return m_reservationPrice; + } + template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NewOrderSingle514 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NewOrderSingle514 _writer) { - NewOrderSingle514 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + NewOrderSingle514 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "NewOrderSingle514", )"; builder << R"("sbeTemplateId": )"; @@ -2400,7 +2459,25 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("DiscretionPrice": )"; - builder << writer.discretionPrice(); + if (writer.discretionPriceInActingVersion()) + { + builder << writer.discretionPrice(); + } + else + { + builder << "{}"; + } + + builder << ", "; + builder << R"("ReservationPrice": )"; + if (writer.reservationPriceInActingVersion()) + { + builder << writer.reservationPrice(); + } + else + { + builder << "{}"; + } builder << '}'; diff --git a/src/lib/orderman/actors/ilink3/generated/NotApplied513.h b/src/lib/orderman/actors/ilink3/generated/NotApplied513.h index 16c2febc0..d03b5de22 100644 --- a/src/lib/orderman/actors/ilink3/generated/NotApplied513.h +++ b/src/lib/orderman/actors/ilink3/generated/NotApplied513.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(17); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(513); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = NotApplied513(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + NotApplied513 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -615,11 +622,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NotApplied513 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NotApplied513 _writer) { - NotApplied513 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + NotApplied513 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "NotApplied513", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/OFMOverrideReq.h b/src/lib/orderman/actors/ilink3/generated/OFMOverrideReq.h index 23c00f3d6..81db0c3aa 100644 --- a/src/lib/orderman/actors/ilink3/generated/OFMOverrideReq.h +++ b/src/lib/orderman/actors/ilink3/generated/OFMOverrideReq.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_OFMOVERRIDEREQ_H_ #define _ILINKBINARY_OFMOVERRIDEREQ_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class OFMOverrideReq @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, OFMOverrideReq::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, OFMOverrideReq::Value m) { return os << OFMOverrideReq::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/OrdStatusTrd.h b/src/lib/orderman/actors/ilink3/generated/OrdStatusTrd.h index 9b33f4e87..95ae74c2b 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrdStatusTrd.h +++ b/src/lib/orderman/actors/ilink3/generated/OrdStatusTrd.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_ORDSTATUSTRD_H_ #define _ILINKBINARY_ORDSTATUSTRD_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class OrdStatusTrd @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, OrdStatusTrd::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, OrdStatusTrd::Value m) { return os << OrdStatusTrd::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/OrdStatusTrdCxl.h b/src/lib/orderman/actors/ilink3/generated/OrdStatusTrdCxl.h index a165ef92d..c9c2d0159 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrdStatusTrdCxl.h +++ b/src/lib/orderman/actors/ilink3/generated/OrdStatusTrdCxl.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_ORDSTATUSTRDCXL_H_ #define _ILINKBINARY_ORDSTATUSTRDCXL_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class OrdStatusTrdCxl @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, OrdStatusTrdCxl::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, OrdStatusTrdCxl::Value m) { return os << OrdStatusTrdCxl::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/OrderCancelReject535.h b/src/lib/orderman/actors/ilink3/generated/OrderCancelReject535.h index cb4a1a5d1..1f1d6411c 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderCancelReject535.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderCancelReject535.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(409); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(535); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = OrderCancelReject535(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + OrderCancelReject535 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - OrderCancelReject535 &putText(const std::string& str) + OrderCancelReject535 &putText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 256) @@ -874,7 +881,7 @@ public: return *this; } #else - OrderCancelReject535 &putExecID(const std::string& str) + OrderCancelReject535 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -1080,7 +1087,7 @@ public: return *this; } #else - OrderCancelReject535 &putSenderID(const std::string& str) + OrderCancelReject535 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1286,7 +1293,7 @@ public: return *this; } #else - OrderCancelReject535 &putClOrdID(const std::string& str) + OrderCancelReject535 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -2097,7 +2104,7 @@ public: return *this; } #else - OrderCancelReject535 &putLocation(const std::string& str) + OrderCancelReject535 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2586,11 +2593,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, OrderCancelReject535 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, OrderCancelReject535 _writer) { - OrderCancelReject535 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + OrderCancelReject535 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "OrderCancelReject535", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/OrderCancelReplaceReject536.h b/src/lib/orderman/actors/ilink3/generated/OrderCancelReplaceReject536.h index 943a98b07..0099f7157 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderCancelReplaceReject536.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderCancelReplaceReject536.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(409); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(536); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = OrderCancelReplaceReject536(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + OrderCancelReplaceReject536 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - OrderCancelReplaceReject536 &putText(const std::string& str) + OrderCancelReplaceReject536 &putText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 256) @@ -874,7 +881,7 @@ public: return *this; } #else - OrderCancelReplaceReject536 &putExecID(const std::string& str) + OrderCancelReplaceReject536 &putExecID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 40) @@ -1080,7 +1087,7 @@ public: return *this; } #else - OrderCancelReplaceReject536 &putSenderID(const std::string& str) + OrderCancelReplaceReject536 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1286,7 +1293,7 @@ public: return *this; } #else - OrderCancelReplaceReject536 &putClOrdID(const std::string& str) + OrderCancelReplaceReject536 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1847,7 +1854,7 @@ public: return *this; } #else - OrderCancelReplaceReject536 &putLocation(const std::string& str) + OrderCancelReplaceReject536 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2586,11 +2593,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, OrderCancelReplaceReject536 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, OrderCancelReplaceReject536 _writer) { - OrderCancelReplaceReject536 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + OrderCancelReplaceReject536 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "OrderCancelReplaceReject536", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/OrderCancelReplaceRequest515.h b/src/lib/orderman/actors/ilink3/generated/OrderCancelReplaceRequest515.h index 67af65e25..e5b252850 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderCancelReplaceRequest515.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderCancelReplaceRequest515.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(133); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(515); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = OrderCancelReplaceRequest515(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + OrderCancelReplaceRequest515 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -849,7 +856,7 @@ public: return *this; } #else - OrderCancelReplaceRequest515 &putSenderID(const std::string& str) + OrderCancelReplaceRequest515 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1055,7 +1062,7 @@ public: return *this; } #else - OrderCancelReplaceRequest515 &putClOrdID(const std::string& str) + OrderCancelReplaceRequest515 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1592,7 +1599,7 @@ public: return *this; } #else - OrderCancelReplaceRequest515 &putLocation(const std::string& str) + OrderCancelReplaceRequest515 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2427,11 +2434,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, OrderCancelReplaceRequest515 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, OrderCancelReplaceRequest515 _writer) { - OrderCancelReplaceRequest515 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + OrderCancelReplaceRequest515 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "OrderCancelReplaceRequest515", )"; builder << R"("sbeTemplateId": )"; @@ -2542,7 +2554,14 @@ friend std::basic_ostream& operator << ( builder << ", "; builder << R"("DiscretionPrice": )"; - builder << writer.discretionPrice(); + if (writer.discretionPriceInActingVersion()) + { + builder << writer.discretionPrice(); + } + else + { + builder << "{}"; + } builder << '}'; diff --git a/src/lib/orderman/actors/ilink3/generated/OrderCancelRequest516.h b/src/lib/orderman/actors/ilink3/generated/OrderCancelRequest516.h index 04ef3f13d..9d0f356e4 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderCancelRequest516.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderCancelRequest516.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(88); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(96); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(516); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(88); + return static_cast(96); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = OrderCancelRequest516(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + OrderCancelRequest516 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -802,7 +809,7 @@ public: return *this; } #else - OrderCancelRequest516 &putSenderID(const std::string& str) + OrderCancelRequest516 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1008,7 +1015,7 @@ public: return *this; } #else - OrderCancelRequest516 &putClOrdID(const std::string& str) + OrderCancelRequest516 &putClOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1356,7 +1363,7 @@ public: return *this; } #else - OrderCancelRequest516 &putLocation(const std::string& str) + OrderCancelRequest516 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1571,12 +1578,248 @@ public: return *this; } + SBE_NODISCARD static const char *OrigOrderUserMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t origOrderUserId() SBE_NOEXCEPT + { + return 9937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t origOrderUserSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool origOrderUserInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= origOrderUserSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t origOrderUserEncodingOffset() SBE_NOEXCEPT + { + return 88; + } + + static SBE_CONSTEXPR char origOrderUserNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char origOrderUserMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char origOrderUserMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t origOrderUserEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t origOrderUserLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *origOrderUser() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 88; + } + + SBE_NODISCARD char *origOrderUser() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 88; + } + + SBE_NODISCARD char origOrderUser(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 88 + (index * 1), sizeof(char)); + return (val); + } + + OrderCancelRequest516 &origOrderUser(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 88 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getOrigOrderUser(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getOrigOrderUser [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 88, sizeof(char) * static_cast(length)); + return length; + } + + OrderCancelRequest516 &putOrigOrderUser(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 88, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getOrigOrderUserAsString() const + { + const char *buffer = m_buffer + m_offset + 88; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getOrigOrderUserAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getOrigOrderUserAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getOrigOrderUserAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 88; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + OrderCancelRequest516 &putOrigOrderUser(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 88, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 88 + start] = 0; + } + + return *this; + } + #else + OrderCancelRequest516 &putOrigOrderUser(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 88, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 88 + start] = 0; + } + + return *this; + } + #endif + template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, OrderCancelRequest516 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, OrderCancelRequest516 _writer) { - OrderCancelRequest516 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + OrderCancelRequest516 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "OrderCancelRequest516", )"; builder << R"("sbeTemplateId": )"; @@ -1633,6 +1876,11 @@ friend std::basic_ostream& operator << ( builder << R"("LiquidityFlag": )"; builder << '"' << writer.liquidityFlag() << '"'; + builder << ", "; + builder << R"("OrigOrderUser": )"; + builder << '"' << + writer.getOrigOrderUserAsJsonEscapedString().c_str() << '"'; + builder << '}'; return builder; diff --git a/src/lib/orderman/actors/ilink3/generated/OrderEventType.h b/src/lib/orderman/actors/ilink3/generated/OrderEventType.h index 07ffe031b..acd99c1a6 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderEventType.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderEventType.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_ORDEREVENTTYPE_H_ #define _ILINKBINARY_ORDEREVENTTYPE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class OrderEventType @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, OrderEventType::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, OrderEventType::Value m) { return os << OrderEventType::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/OrderMassActionReport562.h b/src/lib/orderman/actors/ilink3/generated/OrderMassActionReport562.h index ba89072f7..1e96482cd 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderMassActionReport562.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderMassActionReport562.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(114); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(130); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(562); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(114); + return static_cast(130); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = OrderMassActionReport562(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + OrderMassActionReport562 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - OrderMassActionReport562 &putSenderID(const std::string& str) + OrderMassActionReport562 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1354,7 +1361,7 @@ public: return *this; } #else - OrderMassActionReport562 &putSecurityGroup(const std::string& str) + OrderMassActionReport562 &putSecurityGroup(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 6) @@ -1560,7 +1567,7 @@ public: return *this; } #else - OrderMassActionReport562 &putLocation(const std::string& str) + OrderMassActionReport562 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2697,6 +2704,468 @@ public: return *this; } + SBE_NODISCARD static const char *OrigOrderUserMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t origOrderUserId() SBE_NOEXCEPT + { + return 9937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t origOrderUserSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool origOrderUserInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= origOrderUserSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t origOrderUserEncodingOffset() SBE_NOEXCEPT + { + return 114; + } + + static SBE_CONSTEXPR char origOrderUserNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char origOrderUserMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char origOrderUserMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t origOrderUserEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t origOrderUserLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *origOrderUser() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 114; + } + + SBE_NODISCARD char *origOrderUser() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 114; + } + + SBE_NODISCARD char origOrderUser(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 114 + (index * 1), sizeof(char)); + return (val); + } + + OrderMassActionReport562 &origOrderUser(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 114 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getOrigOrderUser(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getOrigOrderUser [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 114, sizeof(char) * static_cast(length)); + return length; + } + + OrderMassActionReport562 &putOrigOrderUser(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 114, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getOrigOrderUserAsString() const + { + const char *buffer = m_buffer + m_offset + 114; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getOrigOrderUserAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getOrigOrderUserAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getOrigOrderUserAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 114; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + OrderMassActionReport562 &putOrigOrderUser(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 114, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 114 + start] = 0; + } + + return *this; + } + #else + OrderMassActionReport562 &putOrigOrderUser(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 114, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 114 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char *CancelTextMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t cancelTextId() SBE_NOEXCEPT + { + return 2807; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t cancelTextSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool cancelTextInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= cancelTextSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t cancelTextEncodingOffset() SBE_NOEXCEPT + { + return 122; + } + + static SBE_CONSTEXPR char cancelTextNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char cancelTextMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char cancelTextMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t cancelTextEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t cancelTextLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *cancelText() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 122; + } + + SBE_NODISCARD char *cancelText() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 122; + } + + SBE_NODISCARD char cancelText(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for cancelText [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 122 + (index * 1), sizeof(char)); + return (val); + } + + OrderMassActionReport562 &cancelText(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for cancelText [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 122 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCancelText(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getCancelText [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 122, sizeof(char) * static_cast(length)); + return length; + } + + OrderMassActionReport562 &putCancelText(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 122, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getCancelTextAsString() const + { + const char *buffer = m_buffer + m_offset + 122; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCancelTextAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getCancelTextAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getCancelTextAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 122; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + OrderMassActionReport562 &putCancelText(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putCancelText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 122, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 122 + start] = 0; + } + + return *this; + } + #else + OrderMassActionReport562 &putCancelText(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putCancelText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 122, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 122 + start] = 0; + } + + return *this; + } + #endif + class NoAffectedOrders { private: @@ -2823,7 +3292,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -2831,8 +3300,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -2841,17 +3309,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *OrigCIOrdIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -3041,7 +3498,7 @@ public: return *this; } #else - NoAffectedOrders &putOrigCIOrdID(const std::string& str) + NoAffectedOrders &putOrigCIOrdID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -3202,8 +3659,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoAffectedOrders writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoAffectedOrders writer) { builder << '{'; builder << R"("OrigCIOrdID": )"; @@ -3286,11 +3743,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, OrderMassActionReport562 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, OrderMassActionReport562 _writer) { - OrderMassActionReport562 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + OrderMassActionReport562 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "OrderMassActionReport562", )"; builder << R"("sbeTemplateId": )"; @@ -3407,19 +3869,30 @@ friend std::basic_ostream& operator << ( builder << R"("DelayToTime": )"; builder << +writer.delayToTime(); + builder << ", "; + builder << R"("OrigOrderUser": )"; + builder << '"' << + writer.getOrigOrderUserAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("CancelText": )"; + builder << '"' << + writer.getCancelTextAsJsonEscapedString().c_str() << '"'; + builder << ", "; { bool atLeastOne = false; builder << R"("NoAffectedOrders": [)"; - writer.noAffectedOrders().forEach([&](NoAffectedOrders& noAffectedOrders) - { - if (atLeastOne) + writer.noAffectedOrders().forEach( + [&](NoAffectedOrders &noAffectedOrders) { - builder << ", "; - } - atLeastOne = true; - builder << noAffectedOrders; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noAffectedOrders; + }); builder << ']'; } @@ -3430,10 +3903,11 @@ friend std::basic_ostream& operator << ( void skip() { - noAffectedOrders().forEach([](NoAffectedOrders e) + auto &noAffectedOrdersGroup { noAffectedOrders() }; + while (noAffectedOrdersGroup.hasNext()) { - e.skip(); - }); + noAffectedOrdersGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/OrderMassActionRequest529.h b/src/lib/orderman/actors/ilink3/generated/OrderMassActionRequest529.h index 455c2a5ae..d2dd9f737 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderMassActionRequest529.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderMassActionRequest529.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(71); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(79); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(529); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(71); + return static_cast(79); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = OrderMassActionRequest529(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + OrderMassActionRequest529 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -802,7 +809,7 @@ public: return *this; } #else - OrderMassActionRequest529 &putSenderID(const std::string& str) + OrderMassActionRequest529 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1204,7 +1211,7 @@ public: return *this; } #else - OrderMassActionRequest529 &putSecurityGroup(const std::string& str) + OrderMassActionRequest529 &putSecurityGroup(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 6) @@ -1410,7 +1417,7 @@ public: return *this; } #else - OrderMassActionRequest529 &putLocation(const std::string& str) + OrderMassActionRequest529 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1948,12 +1955,248 @@ public: return *this; } + SBE_NODISCARD static const char *OrigOrderUserMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t origOrderUserId() SBE_NOEXCEPT + { + return 9937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t origOrderUserSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool origOrderUserInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= origOrderUserSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t origOrderUserEncodingOffset() SBE_NOEXCEPT + { + return 71; + } + + static SBE_CONSTEXPR char origOrderUserNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char origOrderUserMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char origOrderUserMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t origOrderUserEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t origOrderUserLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *origOrderUser() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 71; + } + + SBE_NODISCARD char *origOrderUser() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 71; + } + + SBE_NODISCARD char origOrderUser(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 71 + (index * 1), sizeof(char)); + return (val); + } + + OrderMassActionRequest529 &origOrderUser(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 71 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getOrigOrderUser(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getOrigOrderUser [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 71, sizeof(char) * static_cast(length)); + return length; + } + + OrderMassActionRequest529 &putOrigOrderUser(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 71, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getOrigOrderUserAsString() const + { + const char *buffer = m_buffer + m_offset + 71; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getOrigOrderUserAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getOrigOrderUserAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getOrigOrderUserAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 71; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + OrderMassActionRequest529 &putOrigOrderUser(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 71, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 71 + start] = 0; + } + + return *this; + } + #else + OrderMassActionRequest529 &putOrigOrderUser(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 71, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 71 + start] = 0; + } + + return *this; + } + #endif + template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, OrderMassActionRequest529 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, OrderMassActionRequest529 _writer) { - OrderMassActionRequest529 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + OrderMassActionRequest529 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "OrderMassActionRequest529", )"; builder << R"("sbeTemplateId": )"; @@ -2026,6 +2269,11 @@ friend std::basic_ostream& operator << ( builder << R"("LiquidityFlag": )"; builder << '"' << writer.liquidityFlag() << '"'; + builder << ", "; + builder << R"("OrigOrderUser": )"; + builder << '"' << + writer.getOrigOrderUserAsJsonEscapedString().c_str() << '"'; + builder << '}'; return builder; diff --git a/src/lib/orderman/actors/ilink3/generated/OrderMassStatusRequest530.h b/src/lib/orderman/actors/ilink3/generated/OrderMassStatusRequest530.h index 15acaea27..ce1723e39 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderMassStatusRequest530.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderMassStatusRequest530.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(68); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(530); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = OrderMassStatusRequest530(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + OrderMassStatusRequest530 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -802,7 +809,7 @@ public: return *this; } #else - OrderMassStatusRequest530 &putSenderID(const std::string& str) + OrderMassStatusRequest530 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1079,7 +1086,7 @@ public: return *this; } #else - OrderMassStatusRequest530 &putSecurityGroup(const std::string& str) + OrderMassStatusRequest530 &putSecurityGroup(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 6) @@ -1285,7 +1292,7 @@ public: return *this; } #else - OrderMassStatusRequest530 &putLocation(const std::string& str) + OrderMassStatusRequest530 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1635,11 +1642,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, OrderMassStatusRequest530 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, OrderMassStatusRequest530 _writer) { - OrderMassStatusRequest530 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + OrderMassStatusRequest530 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "OrderMassStatusRequest530", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/OrderStatus.h b/src/lib/orderman/actors/ilink3/generated/OrderStatus.h index 12219af3d..ac8cf1d6f 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderStatus.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderStatus.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_ORDERSTATUS_H_ #define _ILINKBINARY_ORDERSTATUS_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class OrderStatus @@ -148,8 +84,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, OrderStatus::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, OrderStatus::Value m) { return os << OrderStatus::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/OrderStatusRequest533.h b/src/lib/orderman/actors/ilink3/generated/OrderStatusRequest533.h index cfa29ac64..ce0fa4776 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderStatusRequest533.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderStatusRequest533.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(62); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(533); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = OrderStatusRequest533(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + OrderStatusRequest533 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -802,7 +809,7 @@ public: return *this; } #else - OrderStatusRequest533 &putSenderID(const std::string& str) + OrderStatusRequest533 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1150,7 +1157,7 @@ public: return *this; } #else - OrderStatusRequest533 &putLocation(const std::string& str) + OrderStatusRequest533 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1169,11 +1176,16 @@ public: #endif template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, OrderStatusRequest533 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, OrderStatusRequest533 _writer) { - OrderStatusRequest533 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + OrderStatusRequest533 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "OrderStatusRequest533", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/OrderType.h b/src/lib/orderman/actors/ilink3/generated/OrderType.h index d61b150ea..58deb73c5 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderType.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderType.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_ORDERTYPE_H_ #define _ILINKBINARY_ORDERTYPE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class OrderType @@ -98,7 +34,7 @@ public: Limit = static_cast(50), StopLimit = static_cast(52), MarketWithLeftoverAsLimit = static_cast(75), - NULL_VALUE = static_cast(0) + NULL_VALUE = static_cast(48) }; static OrderType::Value get(const char value) @@ -109,7 +45,7 @@ public: case static_cast(50): return Limit; case static_cast(52): return StopLimit; case static_cast(75): return MarketWithLeftoverAsLimit; - case static_cast(0): return NULL_VALUE; + case static_cast(48): return NULL_VALUE; } throw std::runtime_error("unknown value for enum OrderType [E103]"); @@ -130,8 +66,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, OrderType::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, OrderType::Value m) { return os << OrderType::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/OrderTypeReq.h b/src/lib/orderman/actors/ilink3/generated/OrderTypeReq.h index d643c2c10..dfac729db 100644 --- a/src/lib/orderman/actors/ilink3/generated/OrderTypeReq.h +++ b/src/lib/orderman/actors/ilink3/generated/OrderTypeReq.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_ORDERTYPEREQ_H_ #define _ILINKBINARY_ORDERTYPEREQ_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class OrderTypeReq @@ -133,8 +69,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, OrderTypeReq::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, OrderTypeReq::Value m) { return os << OrderTypeReq::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/PRICE9.h b/src/lib/orderman/actors/ilink3/generated/PRICE9.h index f88394974..8793e1ae2 100644 --- a/src/lib/orderman/actors/ilink3/generated/PRICE9.h +++ b/src/lib/orderman/actors/ilink3/generated/PRICE9.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -194,7 +194,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static const char *mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT @@ -329,8 +329,8 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, PRICE9 writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, PRICE9 writer) { builder << '{'; builder << R"("mantissa": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/PRICENULL9.h b/src/lib/orderman/actors/ilink3/generated/PRICENULL9.h index eebe9e534..c3b21389e 100644 --- a/src/lib/orderman/actors/ilink3/generated/PRICENULL9.h +++ b/src/lib/orderman/actors/ilink3/generated/PRICENULL9.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -194,7 +194,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static const char *mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT @@ -329,8 +329,8 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, PRICENULL9 writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, PRICENULL9 writer) { builder << '{'; builder << R"("mantissa": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/PartyDetailRole.h b/src/lib/orderman/actors/ilink3/generated/PartyDetailRole.h index 518e56625..23c884181 100644 --- a/src/lib/orderman/actors/ilink3/generated/PartyDetailRole.h +++ b/src/lib/orderman/actors/ilink3/generated/PartyDetailRole.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_PARTYDETAILROLE_H_ #define _ILINKBINARY_PARTYDETAILROLE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class PartyDetailRole @@ -133,8 +69,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, PartyDetailRole::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, PartyDetailRole::Value m) { return os << PartyDetailRole::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/PartyDetailsDefinitionRequest518.h b/src/lib/orderman/actors/ilink3/generated/PartyDetailsDefinitionRequest518.h index b54388eb8..005a90491 100644 --- a/src/lib/orderman/actors/ilink3/generated/PartyDetailsDefinitionRequest518.h +++ b/src/lib/orderman/actors/ilink3/generated/PartyDetailsDefinitionRequest518.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(147); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(518); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = PartyDetailsDefinitionRequest518(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + PartyDetailsDefinitionRequest518 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -802,7 +809,7 @@ public: return *this; } #else - PartyDetailsDefinitionRequest518 &putMemo(const std::string& str) + PartyDetailsDefinitionRequest518 &putMemo(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 75) @@ -1008,7 +1015,7 @@ public: return *this; } #else - PartyDetailsDefinitionRequest518 &putAvgPxGroupID(const std::string& str) + PartyDetailsDefinitionRequest518 &putAvgPxGroupID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1868,7 +1875,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -1876,8 +1883,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -1886,17 +1892,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *PartyDetailIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -2086,7 +2081,7 @@ public: return *this; } #else - NoPartyDetails &putPartyDetailID(const std::string& str) + NoPartyDetails &putPartyDetailID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -2293,8 +2288,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoPartyDetails writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoPartyDetails writer) { builder << '{'; builder << R"("PartyDetailID": )"; @@ -2498,7 +2493,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -2506,8 +2501,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -2516,17 +2510,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *TrdRegPublicationTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -2671,8 +2654,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoTrdRegPublications writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoTrdRegPublications writer) { builder << '{'; builder << R"("TrdRegPublicationType": )"; @@ -2750,11 +2733,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, PartyDetailsDefinitionRequest518 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, PartyDetailsDefinitionRequest518 _writer) { - PartyDetailsDefinitionRequest518 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + PartyDetailsDefinitionRequest518 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "PartyDetailsDefinitionRequest518", )"; builder << R"("sbeTemplateId": )"; @@ -2830,15 +2818,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoPartyDetails": [)"; - writer.noPartyDetails().forEach([&](NoPartyDetails& noPartyDetails) - { - if (atLeastOne) + writer.noPartyDetails().forEach( + [&](NoPartyDetails &noPartyDetails) { - builder << ", "; - } - atLeastOne = true; - builder << noPartyDetails; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noPartyDetails; + }); builder << ']'; } @@ -2846,15 +2835,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoTrdRegPublications": [)"; - writer.noTrdRegPublications().forEach([&](NoTrdRegPublications& noTrdRegPublications) - { - if (atLeastOne) + writer.noTrdRegPublications().forEach( + [&](NoTrdRegPublications &noTrdRegPublications) { - builder << ", "; - } - atLeastOne = true; - builder << noTrdRegPublications; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noTrdRegPublications; + }); builder << ']'; } @@ -2865,14 +2855,16 @@ friend std::basic_ostream& operator << ( void skip() { - noPartyDetails().forEach([](NoPartyDetails e) + auto &noPartyDetailsGroup { noPartyDetails() }; + while (noPartyDetailsGroup.hasNext()) { - e.skip(); - }); - noTrdRegPublications().forEach([](NoTrdRegPublications e) + noPartyDetailsGroup.next().skip(); + } + auto &noTrdRegPublicationsGroup { noTrdRegPublications() }; + while (noTrdRegPublicationsGroup.hasNext()) { - e.skip(); - }); + noTrdRegPublicationsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/PartyDetailsDefinitionRequestAck519.h b/src/lib/orderman/actors/ilink3/generated/PartyDetailsDefinitionRequestAck519.h index f00772cab..04ce72a30 100644 --- a/src/lib/orderman/actors/ilink3/generated/PartyDetailsDefinitionRequestAck519.h +++ b/src/lib/orderman/actors/ilink3/generated/PartyDetailsDefinitionRequestAck519.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(159); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(519); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = PartyDetailsDefinitionRequestAck519(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + PartyDetailsDefinitionRequestAck519 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - PartyDetailsDefinitionRequestAck519 &putMemo(const std::string& str) + PartyDetailsDefinitionRequestAck519 &putMemo(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 75) @@ -874,7 +881,7 @@ public: return *this; } #else - PartyDetailsDefinitionRequestAck519 &putAvgPxGroupID(const std::string& str) + PartyDetailsDefinitionRequestAck519 &putAvgPxGroupID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -2207,7 +2214,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -2215,8 +2222,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -2225,17 +2231,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *PartyDetailIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -2425,7 +2420,7 @@ public: return *this; } #else - NoPartyDetails &putPartyDetailID(const std::string& str) + NoPartyDetails &putPartyDetailID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -2632,8 +2627,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoPartyDetails writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoPartyDetails writer) { builder << '{'; builder << R"("PartyDetailID": )"; @@ -2837,7 +2832,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -2845,8 +2840,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -2855,17 +2849,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *TrdRegPublicationTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -3010,8 +2993,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoTrdRegPublications writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoTrdRegPublications writer) { builder << '{'; builder << R"("TrdRegPublicationType": )"; @@ -3089,11 +3072,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, PartyDetailsDefinitionRequestAck519 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, PartyDetailsDefinitionRequestAck519 _writer) { - PartyDetailsDefinitionRequestAck519 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + PartyDetailsDefinitionRequestAck519 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "PartyDetailsDefinitionRequestAck519", )"; builder << R"("sbeTemplateId": )"; @@ -3189,15 +3177,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoPartyDetails": [)"; - writer.noPartyDetails().forEach([&](NoPartyDetails& noPartyDetails) - { - if (atLeastOne) + writer.noPartyDetails().forEach( + [&](NoPartyDetails &noPartyDetails) { - builder << ", "; - } - atLeastOne = true; - builder << noPartyDetails; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noPartyDetails; + }); builder << ']'; } @@ -3205,15 +3194,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoTrdRegPublications": [)"; - writer.noTrdRegPublications().forEach([&](NoTrdRegPublications& noTrdRegPublications) - { - if (atLeastOne) + writer.noTrdRegPublications().forEach( + [&](NoTrdRegPublications &noTrdRegPublications) { - builder << ", "; - } - atLeastOne = true; - builder << noTrdRegPublications; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noTrdRegPublications; + }); builder << ']'; } @@ -3224,14 +3214,16 @@ friend std::basic_ostream& operator << ( void skip() { - noPartyDetails().forEach([](NoPartyDetails e) + auto &noPartyDetailsGroup { noPartyDetails() }; + while (noPartyDetailsGroup.hasNext()) { - e.skip(); - }); - noTrdRegPublications().forEach([](NoTrdRegPublications e) + noPartyDetailsGroup.next().skip(); + } + auto &noTrdRegPublicationsGroup { noTrdRegPublications() }; + while (noTrdRegPublicationsGroup.hasNext()) { - e.skip(); - }); + noTrdRegPublicationsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/PartyDetailsListReport538.h b/src/lib/orderman/actors/ilink3/generated/PartyDetailsListReport538.h index c9435ad06..29b21aa36 100644 --- a/src/lib/orderman/actors/ilink3/generated/PartyDetailsListReport538.h +++ b/src/lib/orderman/actors/ilink3/generated/PartyDetailsListReport538.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(93); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(538); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = PartyDetailsListReport538(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + PartyDetailsListReport538 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - PartyDetailsListReport538 &putAvgPxGroupID(const std::string& str) + PartyDetailsListReport538 &putAvgPxGroupID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -2002,7 +2009,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -2010,8 +2017,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -2020,17 +2026,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *PartyDetailIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -2220,7 +2215,7 @@ public: return *this; } #else - NoPartyDetails &putPartyDetailID(const std::string& str) + NoPartyDetails &putPartyDetailID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -2427,8 +2422,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoPartyDetails writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoPartyDetails writer) { builder << '{'; builder << R"("PartyDetailID": )"; @@ -2632,7 +2627,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -2640,8 +2635,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -2650,17 +2644,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *TrdRegPublicationTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -2805,8 +2788,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoTrdRegPublications writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoTrdRegPublications writer) { builder << '{'; builder << R"("TrdRegPublicationType": )"; @@ -2884,11 +2867,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, PartyDetailsListReport538 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, PartyDetailsListReport538 _writer) { - PartyDetailsListReport538 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + PartyDetailsListReport538 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "PartyDetailsListReport538", )"; builder << R"("sbeTemplateId": )"; @@ -2983,15 +2971,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoPartyDetails": [)"; - writer.noPartyDetails().forEach([&](NoPartyDetails& noPartyDetails) - { - if (atLeastOne) + writer.noPartyDetails().forEach( + [&](NoPartyDetails &noPartyDetails) { - builder << ", "; - } - atLeastOne = true; - builder << noPartyDetails; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noPartyDetails; + }); builder << ']'; } @@ -2999,15 +2988,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoTrdRegPublications": [)"; - writer.noTrdRegPublications().forEach([&](NoTrdRegPublications& noTrdRegPublications) - { - if (atLeastOne) + writer.noTrdRegPublications().forEach( + [&](NoTrdRegPublications &noTrdRegPublications) { - builder << ", "; - } - atLeastOne = true; - builder << noTrdRegPublications; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noTrdRegPublications; + }); builder << ']'; } @@ -3018,14 +3008,16 @@ friend std::basic_ostream& operator << ( void skip() { - noPartyDetails().forEach([](NoPartyDetails e) + auto &noPartyDetailsGroup { noPartyDetails() }; + while (noPartyDetailsGroup.hasNext()) { - e.skip(); - }); - noTrdRegPublications().forEach([](NoTrdRegPublications e) + noPartyDetailsGroup.next().skip(); + } + auto &noTrdRegPublicationsGroup { noTrdRegPublications() }; + while (noTrdRegPublicationsGroup.hasNext()) { - e.skip(); - }); + noTrdRegPublicationsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/PartyDetailsListRequest537.h b/src/lib/orderman/actors/ilink3/generated/PartyDetailsListRequest537.h index 91c9c96d7..7b27ca5c2 100644 --- a/src/lib/orderman/actors/ilink3/generated/PartyDetailsListRequest537.h +++ b/src/lib/orderman/actors/ilink3/generated/PartyDetailsListRequest537.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(20); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(537); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = PartyDetailsListRequest537(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + PartyDetailsListRequest537 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -677,7 +684,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -685,8 +692,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -695,17 +701,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *RequestingPartyIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -895,7 +890,7 @@ public: return *this; } #else - NoRequestingPartyIDs &putRequestingPartyID(const std::string& str) + NoRequestingPartyIDs &putRequestingPartyID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1056,8 +1051,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoRequestingPartyIDs writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoRequestingPartyIDs writer) { builder << '{'; builder << R"("RequestingPartyID": )"; @@ -1279,7 +1274,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -1287,8 +1282,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -1297,17 +1291,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *PartyIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -1523,8 +1506,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoPartyIDs writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoPartyIDs writer) { builder << '{'; builder << R"("PartyID": )"; @@ -1613,11 +1596,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, PartyDetailsListRequest537 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, PartyDetailsListRequest537 _writer) { - PartyDetailsListRequest537 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + PartyDetailsListRequest537 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "PartyDetailsListRequest537", )"; builder << R"("sbeTemplateId": )"; @@ -1639,15 +1627,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoRequestingPartyIDs": [)"; - writer.noRequestingPartyIDs().forEach([&](NoRequestingPartyIDs& noRequestingPartyIDs) - { - if (atLeastOne) + writer.noRequestingPartyIDs().forEach( + [&](NoRequestingPartyIDs &noRequestingPartyIDs) { - builder << ", "; - } - atLeastOne = true; - builder << noRequestingPartyIDs; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noRequestingPartyIDs; + }); builder << ']'; } @@ -1655,15 +1644,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoPartyIDs": [)"; - writer.noPartyIDs().forEach([&](NoPartyIDs& noPartyIDs) - { - if (atLeastOne) + writer.noPartyIDs().forEach( + [&](NoPartyIDs &noPartyIDs) { - builder << ", "; - } - atLeastOne = true; - builder << noPartyIDs; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noPartyIDs; + }); builder << ']'; } @@ -1674,14 +1664,16 @@ friend std::basic_ostream& operator << ( void skip() { - noRequestingPartyIDs().forEach([](NoRequestingPartyIDs e) + auto &noRequestingPartyIDsGroup { noRequestingPartyIDs() }; + while (noRequestingPartyIDsGroup.hasNext()) { - e.skip(); - }); - noPartyIDs().forEach([](NoPartyIDs e) + noRequestingPartyIDsGroup.next().skip(); + } + auto &noPartyIDsGroup { noPartyIDs() }; + while (noPartyIDsGroup.hasNext()) { - e.skip(); - }); + noPartyIDsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/QuoteAckStatus.h b/src/lib/orderman/actors/ilink3/generated/QuoteAckStatus.h index e07194619..135068561 100644 --- a/src/lib/orderman/actors/ilink3/generated/QuoteAckStatus.h +++ b/src/lib/orderman/actors/ilink3/generated/QuoteAckStatus.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_QUOTEACKSTATUS_H_ #define _ILINKBINARY_QUOTEACKSTATUS_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class QuoteAckStatus @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, QuoteAckStatus::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, QuoteAckStatus::Value m) { return os << QuoteAckStatus::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/QuoteCancel528.h b/src/lib/orderman/actors/ilink3/generated/QuoteCancel528.h index 662813987..e7acd6559 100644 --- a/src/lib/orderman/actors/ilink3/generated/QuoteCancel528.h +++ b/src/lib/orderman/actors/ilink3/generated/QuoteCancel528.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(52); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(61); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(528); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(52); + return static_cast(61); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = QuoteCancel528(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + QuoteCancel528 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -802,7 +809,7 @@ public: return *this; } #else - QuoteCancel528 &putSenderID(const std::string& str) + QuoteCancel528 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1008,7 +1015,7 @@ public: return *this; } #else - QuoteCancel528 &putLocation(const std::string& str) + QuoteCancel528 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1223,6 +1230,310 @@ public: return *this; } + SBE_NODISCARD static const char *OrigOrderUserMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t origOrderUserId() SBE_NOEXCEPT + { + return 9937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t origOrderUserSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool origOrderUserInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= origOrderUserSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t origOrderUserEncodingOffset() SBE_NOEXCEPT + { + return 52; + } + + static SBE_CONSTEXPR char origOrderUserNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char origOrderUserMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char origOrderUserMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t origOrderUserEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t origOrderUserLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *origOrderUser() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 52; + } + + SBE_NODISCARD char *origOrderUser() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 52; + } + + SBE_NODISCARD char origOrderUser(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 52 + (index * 1), sizeof(char)); + return (val); + } + + QuoteCancel528 &origOrderUser(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 52 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getOrigOrderUser(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getOrigOrderUser [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 52, sizeof(char) * static_cast(length)); + return length; + } + + QuoteCancel528 &putOrigOrderUser(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 52, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getOrigOrderUserAsString() const + { + const char *buffer = m_buffer + m_offset + 52; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getOrigOrderUserAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getOrigOrderUserAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getOrigOrderUserAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 52; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + QuoteCancel528 &putOrigOrderUser(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 52, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 52 + start] = 0; + } + + return *this; + } + #else + QuoteCancel528 &putOrigOrderUser(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 52, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 52 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char *QuoteEntryOpenMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t quoteEntryOpenId() SBE_NOEXCEPT + { + return 9182; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t quoteEntryOpenSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool quoteEntryOpenInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= quoteEntryOpenSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t quoteEntryOpenEncodingOffset() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t quoteEntryOpenEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t quoteEntryOpenRaw() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 60, sizeof(std::uint8_t)); + return (val); + } + + SBE_NODISCARD BooleanNULL::Value quoteEntryOpen() const + { + if (m_actingVersion < 8) + { + return BooleanNULL::NULL_VALUE; + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 60, sizeof(std::uint8_t)); + return BooleanNULL::get((val)); + } + + QuoteCancel528 "eEntryOpen(const BooleanNULL::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 60, &val, sizeof(std::uint8_t)); + return *this; + } + class NoQuoteEntries { private: @@ -1349,7 +1660,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -1357,8 +1668,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -1367,17 +1677,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *SecurityGroupMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -1567,7 +1866,7 @@ public: return *this; } #else - NoQuoteEntries &putSecurityGroup(const std::string& str) + NoQuoteEntries &putSecurityGroup(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 6) @@ -1657,8 +1956,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoQuoteEntries writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoQuoteEntries writer) { builder << '{'; builder << R"("SecurityGroup": )"; @@ -1862,7 +2161,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -1870,8 +2169,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -1880,17 +2178,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *BidSizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -2106,8 +2393,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoQuoteSets writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoQuoteSets writer) { builder << '{'; builder << R"("BidSize": )"; @@ -2189,11 +2476,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, QuoteCancel528 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, QuoteCancel528 _writer) { - QuoteCancel528 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + QuoteCancel528 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "QuoteCancel528", )"; builder << R"("sbeTemplateId": )"; @@ -2237,19 +2529,29 @@ friend std::basic_ostream& operator << ( builder << R"("LiquidityFlag": )"; builder << '"' << writer.liquidityFlag() << '"'; + builder << ", "; + builder << R"("OrigOrderUser": )"; + builder << '"' << + writer.getOrigOrderUserAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("QuoteEntryOpen": )"; + builder << '"' << writer.quoteEntryOpen() << '"'; + builder << ", "; { bool atLeastOne = false; builder << R"("NoQuoteEntries": [)"; - writer.noQuoteEntries().forEach([&](NoQuoteEntries& noQuoteEntries) - { - if (atLeastOne) + writer.noQuoteEntries().forEach( + [&](NoQuoteEntries &noQuoteEntries) { - builder << ", "; - } - atLeastOne = true; - builder << noQuoteEntries; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noQuoteEntries; + }); builder << ']'; } @@ -2257,15 +2559,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoQuoteSets": [)"; - writer.noQuoteSets().forEach([&](NoQuoteSets& noQuoteSets) - { - if (atLeastOne) + writer.noQuoteSets().forEach( + [&](NoQuoteSets &noQuoteSets) { - builder << ", "; - } - atLeastOne = true; - builder << noQuoteSets; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noQuoteSets; + }); builder << ']'; } @@ -2276,14 +2579,16 @@ friend std::basic_ostream& operator << ( void skip() { - noQuoteEntries().forEach([](NoQuoteEntries e) + auto &noQuoteEntriesGroup { noQuoteEntries() }; + while (noQuoteEntriesGroup.hasNext()) { - e.skip(); - }); - noQuoteSets().forEach([](NoQuoteSets e) + noQuoteEntriesGroup.next().skip(); + } + auto &noQuoteSetsGroup { noQuoteSets() }; + while (noQuoteSetsGroup.hasNext()) { - e.skip(); - }); + noQuoteSetsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/QuoteCancelAck563.h b/src/lib/orderman/actors/ilink3/generated/QuoteCancelAck563.h index 57d8d77ce..9cb07698e 100644 --- a/src/lib/orderman/actors/ilink3/generated/QuoteCancelAck563.h +++ b/src/lib/orderman/actors/ilink3/generated/QuoteCancelAck563.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(351); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(368); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(563); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(351); + return static_cast(368); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = QuoteCancelAck563(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + QuoteCancelAck563 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - QuoteCancelAck563 &putText(const std::string& str) + QuoteCancelAck563 &putText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 256) @@ -874,7 +881,7 @@ public: return *this; } #else - QuoteCancelAck563 &putSenderID(const std::string& str) + QuoteCancelAck563 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1293,7 +1300,7 @@ public: return *this; } #else - QuoteCancelAck563 &putCancelledSymbol(const std::string& str) + QuoteCancelAck563 &putCancelledSymbol(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 6) @@ -1499,7 +1506,7 @@ public: return *this; } #else - QuoteCancelAck563 &putLocation(const std::string& str) + QuoteCancelAck563 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2392,6 +2399,541 @@ public: return *this; } + SBE_NODISCARD static const char *OrigOrderUserMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t origOrderUserId() SBE_NOEXCEPT + { + return 9937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t origOrderUserSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool origOrderUserInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= origOrderUserSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t origOrderUserEncodingOffset() SBE_NOEXCEPT + { + return 351; + } + + static SBE_CONSTEXPR char origOrderUserNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char origOrderUserMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char origOrderUserMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t origOrderUserEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t origOrderUserLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *origOrderUser() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 351; + } + + SBE_NODISCARD char *origOrderUser() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 351; + } + + SBE_NODISCARD char origOrderUser(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 351 + (index * 1), sizeof(char)); + return (val); + } + + QuoteCancelAck563 &origOrderUser(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for origOrderUser [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 351 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getOrigOrderUser(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getOrigOrderUser [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 351, sizeof(char) * static_cast(length)); + return length; + } + + QuoteCancelAck563 &putOrigOrderUser(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 351, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getOrigOrderUserAsString() const + { + const char *buffer = m_buffer + m_offset + 351; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getOrigOrderUserAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getOrigOrderUserAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getOrigOrderUserAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 351; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + QuoteCancelAck563 &putOrigOrderUser(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 351, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 351 + start] = 0; + } + + return *this; + } + #else + QuoteCancelAck563 &putOrigOrderUser(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putOrigOrderUser [E106]"); + } + + std::memcpy(m_buffer + m_offset + 351, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 351 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char *CancelTextMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t cancelTextId() SBE_NOEXCEPT + { + return 2807; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t cancelTextSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool cancelTextInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= cancelTextSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t cancelTextEncodingOffset() SBE_NOEXCEPT + { + return 359; + } + + static SBE_CONSTEXPR char cancelTextNullValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR char cancelTextMinValue() SBE_NOEXCEPT + { + return static_cast(32); + } + + static SBE_CONSTEXPR char cancelTextMaxValue() SBE_NOEXCEPT + { + return static_cast(126); + } + + static SBE_CONSTEXPR std::size_t cancelTextEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t cancelTextLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD const char *cancelText() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 359; + } + + SBE_NODISCARD char *cancelText() SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return nullptr; + } + + return m_buffer + m_offset + 359; + } + + SBE_NODISCARD char cancelText(const std::uint64_t index) const + { + if (index >= 8) + { + throw std::runtime_error("index out of range for cancelText [E104]"); + } + + if (m_actingVersion < 8) + { + return static_cast(0); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 359 + (index * 1), sizeof(char)); + return (val); + } + + QuoteCancelAck563 &cancelText(const std::uint64_t index, const char value) + { + if (index >= 8) + { + throw std::runtime_error("index out of range for cancelText [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 359 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCancelText(char *const dst, const std::uint64_t length) const + { + if (length > 8) + { + throw std::runtime_error("length too large for getCancelText [E106]"); + } + + if (m_actingVersion < 8) + { + return 0; + } + + std::memcpy(dst, m_buffer + m_offset + 359, sizeof(char) * static_cast(length)); + return length; + } + + QuoteCancelAck563 &putCancelText(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 359, src, sizeof(char) * 8); + return *this; + } + + SBE_NODISCARD std::string getCancelTextAsString() const + { + const char *buffer = m_buffer + m_offset + 359; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCancelTextAsJsonEscapedString() + { + if (m_actingVersion < 8) + { + return std::string(""); + } + + std::ostringstream oss; + std::string s = getCancelTextAsString(); + + for (const auto c : s) + { + switch (c) + { + case '"': oss << "\\\""; break; + case '\\': oss << "\\\\"; break; + case '\b': oss << "\\b"; break; + case '\f': oss << "\\f"; break; + case '\n': oss << "\\n"; break; + case '\r': oss << "\\r"; break; + case '\t': oss << "\\t"; break; + + default: + if ('\x00' <= c && c <= '\x1f') + { + oss << "\\u" << std::hex << std::setw(4) + << std::setfill('0') << (int)(c); + } + else + { + oss << c; + } + } + } + + return oss.str(); + } + + #if __cplusplus >= 201703L + SBE_NODISCARD std::string_view getCancelTextAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 359; + std::size_t length = 0; + + for (; length < 8 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + QuoteCancelAck563 &putCancelText(const std::string_view str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putCancelText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 359, str.data(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 359 + start] = 0; + } + + return *this; + } + #else + QuoteCancelAck563 &putCancelText(const std::string &str) + { + const std::size_t srcLength = str.length(); + if (srcLength > 8) + { + throw std::runtime_error("string too large for putCancelText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 359, str.c_str(), srcLength); + for (std::size_t start = srcLength; start < 8; ++start) + { + m_buffer[m_offset + 359 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char *QuoteEntryOpenMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t quoteEntryOpenId() SBE_NOEXCEPT + { + return 9182; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t quoteEntryOpenSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool quoteEntryOpenInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= quoteEntryOpenSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t quoteEntryOpenEncodingOffset() SBE_NOEXCEPT + { + return 367; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t quoteEntryOpenEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t quoteEntryOpenRaw() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 367, sizeof(std::uint8_t)); + return (val); + } + + SBE_NODISCARD BooleanNULL::Value quoteEntryOpen() const + { + if (m_actingVersion < 8) + { + return BooleanNULL::NULL_VALUE; + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 367, sizeof(std::uint8_t)); + return BooleanNULL::get((val)); + } + + QuoteCancelAck563 "eEntryOpen(const BooleanNULL::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 367, &val, sizeof(std::uint8_t)); + return *this; + } + class NoQuoteEntries { private: @@ -2518,7 +3060,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -2526,8 +3068,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -2536,17 +3077,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *QuoteEntryIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -2762,8 +3292,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoQuoteEntries writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoQuoteEntries writer) { builder << '{'; builder << R"("QuoteEntryID": )"; @@ -2970,7 +3500,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -2978,8 +3508,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -2988,17 +3517,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *QuoteSetIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -3143,8 +3661,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoQuoteSets writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoQuoteSets writer) { builder << '{'; builder << R"("QuoteSetID": )"; @@ -3222,11 +3740,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, QuoteCancelAck563 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, QuoteCancelAck563 _writer) { - QuoteCancelAck563 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + QuoteCancelAck563 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "QuoteCancelAck563", )"; builder << R"("sbeTemplateId": )"; @@ -3331,19 +3854,34 @@ friend std::basic_ostream& operator << ( builder << R"("DelayToTime": )"; builder << +writer.delayToTime(); + builder << ", "; + builder << R"("OrigOrderUser": )"; + builder << '"' << + writer.getOrigOrderUserAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("CancelText": )"; + builder << '"' << + writer.getCancelTextAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("QuoteEntryOpen": )"; + builder << '"' << writer.quoteEntryOpen() << '"'; + builder << ", "; { bool atLeastOne = false; builder << R"("NoQuoteEntries": [)"; - writer.noQuoteEntries().forEach([&](NoQuoteEntries& noQuoteEntries) - { - if (atLeastOne) + writer.noQuoteEntries().forEach( + [&](NoQuoteEntries &noQuoteEntries) { - builder << ", "; - } - atLeastOne = true; - builder << noQuoteEntries; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noQuoteEntries; + }); builder << ']'; } @@ -3351,15 +3889,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoQuoteSets": [)"; - writer.noQuoteSets().forEach([&](NoQuoteSets& noQuoteSets) - { - if (atLeastOne) + writer.noQuoteSets().forEach( + [&](NoQuoteSets &noQuoteSets) { - builder << ", "; - } - atLeastOne = true; - builder << noQuoteSets; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noQuoteSets; + }); builder << ']'; } @@ -3370,14 +3909,16 @@ friend std::basic_ostream& operator << ( void skip() { - noQuoteEntries().forEach([](NoQuoteEntries e) + auto &noQuoteEntriesGroup { noQuoteEntries() }; + while (noQuoteEntriesGroup.hasNext()) { - e.skip(); - }); - noQuoteSets().forEach([](NoQuoteSets e) + noQuoteEntriesGroup.next().skip(); + } + auto &noQuoteSetsGroup { noQuoteSets() }; + while (noQuoteSetsGroup.hasNext()) { - e.skip(); - }); + noQuoteSetsGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/QuoteCxlStatus.h b/src/lib/orderman/actors/ilink3/generated/QuoteCxlStatus.h index c2331d096..4d94f1b56 100644 --- a/src/lib/orderman/actors/ilink3/generated/QuoteCxlStatus.h +++ b/src/lib/orderman/actors/ilink3/generated/QuoteCxlStatus.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_QUOTECXLSTATUS_H_ #define _ILINKBINARY_QUOTECXLSTATUS_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class QuoteCxlStatus @@ -133,8 +69,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, QuoteCxlStatus::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, QuoteCxlStatus::Value m) { return os << QuoteCxlStatus::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/QuoteCxlTyp.h b/src/lib/orderman/actors/ilink3/generated/QuoteCxlTyp.h index 043614966..6f213e6a1 100644 --- a/src/lib/orderman/actors/ilink3/generated/QuoteCxlTyp.h +++ b/src/lib/orderman/actors/ilink3/generated/QuoteCxlTyp.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_QUOTECXLTYP_H_ #define _ILINKBINARY_QUOTECXLTYP_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class QuoteCxlTyp @@ -130,8 +66,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, QuoteCxlTyp::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, QuoteCxlTyp::Value m) { return os << QuoteCxlTyp::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/QuoteTyp.h b/src/lib/orderman/actors/ilink3/generated/QuoteTyp.h index dd478bb15..6ddc3ff01 100644 --- a/src/lib/orderman/actors/ilink3/generated/QuoteTyp.h +++ b/src/lib/orderman/actors/ilink3/generated/QuoteTyp.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_QUOTETYP_H_ #define _ILINKBINARY_QUOTETYP_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class QuoteTyp @@ -121,8 +57,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, QuoteTyp::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, QuoteTyp::Value m) { return os << QuoteTyp::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/README.txt b/src/lib/orderman/actors/ilink3/generated/README.txt index 64d3df695..f8fd737e1 100644 --- a/src/lib/orderman/actors/ilink3/generated/README.txt +++ b/src/lib/orderman/actors/ilink3/generated/README.txt @@ -1,13 +1,11 @@ -To update ilinkbinary.xml -sftp cmeconfig@sftpng.cmegroup.com -password: G3t(0nnect3d -get /MSGW/NRCert/Templates/ilinkbinary.xml - -To generate: - -Download sbe-all-[version].jar from sbe-logic github releases. - -docker run --rm -it -w /work -v $PWD:/work java java -Dsbe.output.dir=/work -Dsbe.generate.ir="false" -Dsbe.target.language=cpp -jar sbe-all-1.16.1.jar ilinkbinary.xml -#docker run --rm -it -w /work -v $PWD:/work java java -Dsbe.output.dir=/work -Dsbe.generate.ir="false" -Dsbe.target.language=uk.co.real_logic.sbe.generation.rust.Rust -jar sbe-all-1.16.1.jar ilinkbinary.xml - - +To update ilinkbinary.xml +sftp cmeconfig@sftpng.cmegroup.com +password: G3t(0nnect3d +get /MSGW/NRCert/Templates/ilinkbinary.xml + +To generate: + +Download sbe-all-[version].jar from sbe-logic github releases. + +docker run --rm -it -w /work -v $PWD:/work eclipse-temurin:17-jdk-jammy java -Dsbe.output.dir=/work -Dsbe.generate.ir="false" -Dsbe.target.language=cpp -jar sbe-all-1.27.0.jar ilinkbinary.xml + diff --git a/src/lib/orderman/actors/ilink3/generated/RFQSide.h b/src/lib/orderman/actors/ilink3/generated/RFQSide.h index 04bffac67..02e96ac82 100644 --- a/src/lib/orderman/actors/ilink3/generated/RFQSide.h +++ b/src/lib/orderman/actors/ilink3/generated/RFQSide.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_RFQSIDE_H_ #define _ILINKBINARY_RFQSIDE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class RFQSide @@ -127,8 +63,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, RFQSide::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, RFQSide::Value m) { return os << RFQSide::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/ReqResult.h b/src/lib/orderman/actors/ilink3/generated/ReqResult.h index 237b59e0f..1b4af8ced 100644 --- a/src/lib/orderman/actors/ilink3/generated/ReqResult.h +++ b/src/lib/orderman/actors/ilink3/generated/ReqResult.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_REQRESULT_H_ #define _ILINKBINARY_REQRESULT_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class ReqResult @@ -130,8 +66,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, ReqResult::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, ReqResult::Value m) { return os << ReqResult::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/RequestForQuote543.h b/src/lib/orderman/actors/ilink3/generated/RequestForQuote543.h index 677f4a9f4..4f0f062bf 100644 --- a/src/lib/orderman/actors/ilink3/generated/RequestForQuote543.h +++ b/src/lib/orderman/actors/ilink3/generated/RequestForQuote543.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(55); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(543); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = RequestForQuote543(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + RequestForQuote543 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -802,7 +809,7 @@ public: return *this; } #else - RequestForQuote543 &putSenderID(const std::string& str) + RequestForQuote543 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1079,7 +1086,7 @@ public: return *this; } #else - RequestForQuote543 &putLocation(const std::string& str) + RequestForQuote543 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1286,7 +1293,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -1294,8 +1301,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -1304,17 +1310,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *SecurityIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -1522,8 +1517,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoRelatedSym writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoRelatedSym writer) { builder << '{'; builder << R"("SecurityID": )"; @@ -1605,11 +1600,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, RequestForQuote543 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, RequestForQuote543 _writer) { - RequestForQuote543 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + RequestForQuote543 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "RequestForQuote543", )"; builder << R"("sbeTemplateId": )"; @@ -1653,15 +1653,16 @@ friend std::basic_ostream& operator << ( { bool atLeastOne = false; builder << R"("NoRelatedSym": [)"; - writer.noRelatedSym().forEach([&](NoRelatedSym& noRelatedSym) - { - if (atLeastOne) + writer.noRelatedSym().forEach( + [&](NoRelatedSym &noRelatedSym) { - builder << ", "; - } - atLeastOne = true; - builder << noRelatedSym; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noRelatedSym; + }); builder << ']'; } @@ -1672,10 +1673,11 @@ friend std::basic_ostream& operator << ( void skip() { - noRelatedSym().forEach([](NoRelatedSym e) + auto &noRelatedSymGroup { noRelatedSym() }; + while (noRelatedSymGroup.hasNext()) { - e.skip(); - }); + noRelatedSymGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT diff --git a/src/lib/orderman/actors/ilink3/generated/RequestForQuoteAck546.h b/src/lib/orderman/actors/ilink3/generated/RequestForQuoteAck546.h index 7b767a4ed..0d7fa133f 100644 --- a/src/lib/orderman/actors/ilink3/generated/RequestForQuoteAck546.h +++ b/src/lib/orderman/actors/ilink3/generated/RequestForQuoteAck546.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(358); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(546); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = RequestForQuoteAck546(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + RequestForQuoteAck546 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - RequestForQuoteAck546 &putText(const std::string& str) + RequestForQuoteAck546 &putText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 256) @@ -874,7 +881,7 @@ public: return *this; } #else - RequestForQuoteAck546 &putSenderID(const std::string& str) + RequestForQuoteAck546 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1080,7 +1087,7 @@ public: return *this; } #else - RequestForQuoteAck546 &putExchangeQuoteReqID(const std::string& str) + RequestForQuoteAck546 &putExchangeQuoteReqID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 17) @@ -1570,7 +1577,7 @@ public: return *this; } #else - RequestForQuoteAck546 &putLocation(const std::string& str) + RequestForQuoteAck546 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2069,11 +2076,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, RequestForQuoteAck546 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, RequestForQuoteAck546 _writer) { - RequestForQuoteAck546 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + RequestForQuoteAck546 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "RequestForQuoteAck546", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/Retransmission509.h b/src/lib/orderman/actors/ilink3/generated/Retransmission509.h index 1fa67ba80..aca45553b 100644 --- a/src/lib/orderman/actors/ilink3/generated/Retransmission509.h +++ b/src/lib/orderman/actors/ilink3/generated/Retransmission509.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(31); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(509); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = Retransmission509(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + Retransmission509 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -757,11 +764,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, Retransmission509 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, Retransmission509 _writer) { - Retransmission509 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + Retransmission509 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "Retransmission509", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/RetransmitReject510.h b/src/lib/orderman/actors/ilink3/generated/RetransmitReject510.h index 851d16fb5..177a97d37 100644 --- a/src/lib/orderman/actors/ilink3/generated/RetransmitReject510.h +++ b/src/lib/orderman/actors/ilink3/generated/RetransmitReject510.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(75); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(510); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = RetransmitReject510(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + RetransmitReject510 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -526,7 +533,7 @@ public: return *this; } #else - RetransmitReject510 &putReason(const std::string& str) + RetransmitReject510 &putReason(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 48) @@ -892,11 +899,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, RetransmitReject510 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, RetransmitReject510 _writer) { - RetransmitReject510 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + RetransmitReject510 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "RetransmitReject510", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/RetransmitRequest508.h b/src/lib/orderman/actors/ilink3/generated/RetransmitRequest508.h index 2c82e2ad1..34b5fae83 100644 --- a/src/lib/orderman/actors/ilink3/generated/RetransmitRequest508.h +++ b/src/lib/orderman/actors/ilink3/generated/RetransmitRequest508.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(30); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(508); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = RetransmitRequest508(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + RetransmitRequest508 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -694,11 +701,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, RetransmitRequest508 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, RetransmitRequest508 _writer) { - RetransmitRequest508 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + RetransmitRequest508 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "RetransmitRequest508", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/SLEDS.h b/src/lib/orderman/actors/ilink3/generated/SLEDS.h index 5553e6491..750e9aefe 100644 --- a/src/lib/orderman/actors/ilink3/generated/SLEDS.h +++ b/src/lib/orderman/actors/ilink3/generated/SLEDS.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_SLEDS_H_ #define _ILINKBINARY_SLEDS_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class SLEDS @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, SLEDS::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, SLEDS::Value m) { return os << SLEDS::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/SMPI.h b/src/lib/orderman/actors/ilink3/generated/SMPI.h index dd2875d39..2698520ef 100644 --- a/src/lib/orderman/actors/ilink3/generated/SMPI.h +++ b/src/lib/orderman/actors/ilink3/generated/SMPI.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_SMPI_H_ #define _ILINKBINARY_SMPI_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class SMPI @@ -96,7 +32,7 @@ public: { CancelNewest = static_cast(78), CancelOldest = static_cast(79), - NULL_VALUE = static_cast(0) + NULL_VALUE = static_cast(0x00) }; static SMPI::Value get(const char value) @@ -105,7 +41,7 @@ public: { case static_cast(78): return CancelNewest; case static_cast(79): return CancelOldest; - case static_cast(0): return NULL_VALUE; + case static_cast(0x00): return NULL_VALUE; } throw std::runtime_error("unknown value for enum SMPI [E103]"); @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, SMPI::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, SMPI::Value m) { return os << SMPI::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/SecRspTyp.h b/src/lib/orderman/actors/ilink3/generated/SecRspTyp.h index fab0c684e..64613e601 100644 --- a/src/lib/orderman/actors/ilink3/generated/SecRspTyp.h +++ b/src/lib/orderman/actors/ilink3/generated/SecRspTyp.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_SECRSPTYP_H_ #define _ILINKBINARY_SECRSPTYP_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class SecRspTyp @@ -127,8 +63,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, SecRspTyp::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, SecRspTyp::Value m) { return os << SecRspTyp::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/SecurityDefinitionRequest560.h b/src/lib/orderman/actors/ilink3/generated/SecurityDefinitionRequest560.h index 87f074b55..ea72679cf 100644 --- a/src/lib/orderman/actors/ilink3/generated/SecurityDefinitionRequest560.h +++ b/src/lib/orderman/actors/ilink3/generated/SecurityDefinitionRequest560.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(71); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(72); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(560); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(71); + return static_cast(72); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = SecurityDefinitionRequest560(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + SecurityDefinitionRequest560 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -802,7 +809,7 @@ public: return *this; } #else - SecurityDefinitionRequest560 &putSenderID(const std::string& str) + SecurityDefinitionRequest560 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1204,7 +1211,7 @@ public: return *this; } #else - SecurityDefinitionRequest560 &putSecuritySubType(const std::string& str) + SecurityDefinitionRequest560 &putSecuritySubType(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 8) @@ -1410,7 +1417,7 @@ public: return *this; } #else - SecurityDefinitionRequest560 &putLocation(const std::string& str) + SecurityDefinitionRequest560 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -1712,6 +1719,82 @@ public: return *this; } + SBE_NODISCARD static const char *BrokenDateTermTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t brokenDateTermTypeId() SBE_NOEXCEPT + { + return 6651; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t brokenDateTermTypeSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool brokenDateTermTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= brokenDateTermTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t brokenDateTermTypeEncodingOffset() SBE_NOEXCEPT + { + return 71; + } + + static SBE_CONSTEXPR std::uint8_t brokenDateTermTypeNullValue() SBE_NOEXCEPT + { + return static_cast(255); + } + + static SBE_CONSTEXPR std::uint8_t brokenDateTermTypeMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint8_t brokenDateTermTypeMaxValue() SBE_NOEXCEPT + { + return static_cast(254); + } + + static SBE_CONSTEXPR std::size_t brokenDateTermTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t brokenDateTermType() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 71, sizeof(std::uint8_t)); + return (val); + } + + SecurityDefinitionRequest560 &brokenDateTermType(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 71, &val, sizeof(std::uint8_t)); + return *this; + } + class NoLegs { private: @@ -1838,7 +1921,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -1846,8 +1929,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -1856,17 +1938,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *LegSecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -2293,8 +2364,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoLegs writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoLegs writer) { builder << '{'; builder << R"("LegPrice": )"; @@ -2380,15 +2451,385 @@ public: return m_actingVersion >= noLegsSinceVersion(); #if defined(__clang__) #pragma clang diagnostic pop +#endif + } + + class NoBrokenDates + { + private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_initialPosition = 0; + std::uint64_t *m_positionPtr = nullptr; + std::uint64_t m_blockLength = 0; + std::uint64_t m_count = 0; + std::uint64_t m_index = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + + SBE_NODISCARD std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return m_positionPtr; + } + + public: + inline void wrapForDecode( + char *buffer, + std::uint64_t *pos, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + GroupSize dimensions(buffer, *pos, bufferLength, actingVersion); + m_buffer = buffer; + m_bufferLength = bufferLength; + m_blockLength = dimensions.blockLength(); + m_count = dimensions.numInGroup(); + m_index = 0; + m_actingVersion = actingVersion; + m_initialPosition = *pos; + m_positionPtr = pos; + *m_positionPtr = *m_positionPtr + 3; + } + + inline void wrapForEncode( + char *buffer, + const std::uint8_t count, + std::uint64_t *pos, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + #if defined(__GNUG__) && !defined(__clang__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wtype-limits" + #endif + if (count > 254) + { + throw std::runtime_error("count outside of allowed range [E110]"); + } + #if defined(__GNUG__) && !defined(__clang__) + #pragma GCC diagnostic pop + #endif + m_buffer = buffer; + m_bufferLength = bufferLength; + GroupSize dimensions(buffer, *pos, bufferLength, actingVersion); + dimensions.blockLength(static_cast(4)); + dimensions.numInGroup(static_cast(count)); + m_index = 0; + m_count = count; + m_blockLength = 4; + m_actingVersion = actingVersion; + m_initialPosition = *pos; + m_positionPtr = pos; + *m_positionPtr = *m_positionPtr + 3; + } + + static SBE_CONSTEXPR std::uint64_t sbeHeaderSize() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t sbeBlockLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return *m_positionPtr; + } + + // NOLINTNEXTLINE(readability-convert-member-functions-to-static) + std::uint64_t sbeCheckPosition(const std::uint64_t position) + { + if (SBE_BOUNDS_CHECK_EXPECT((position > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short [E100]"); + } + return position; + } + + void sbePosition(const std::uint64_t position) + { + *m_positionPtr = sbeCheckPosition(position); + } + + SBE_NODISCARD inline std::uint64_t count() const SBE_NOEXCEPT + { + return m_count; + } + + SBE_NODISCARD inline bool hasNext() const SBE_NOEXCEPT + { + return m_index < m_count; + } + + inline NoBrokenDates &next() + { + if (m_index >= m_count) + { + throw std::runtime_error("index >= count [E108]"); + } + m_offset = *m_positionPtr; + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + m_blockLength) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for next group index [E108]"); + } + *m_positionPtr = m_offset + m_blockLength; + ++m_index; + + return *this; + } + + inline std::uint64_t resetCountToIndex() + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup(static_cast(m_count)); + return m_count; + } + + template inline void forEach(Func &&func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + + SBE_NODISCARD static const char *BrokenDateStartMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "LocalMktDate"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t brokenDateStartId() SBE_NOEXCEPT + { + return 6748; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t brokenDateStartSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool brokenDateStartInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= brokenDateStartSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t brokenDateStartEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint16_t brokenDateStartNullValue() SBE_NOEXCEPT + { + return static_cast(65535); + } + + static SBE_CONSTEXPR std::uint16_t brokenDateStartMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint16_t brokenDateStartMaxValue() SBE_NOEXCEPT + { + return static_cast(65534); + } + + static SBE_CONSTEXPR std::size_t brokenDateStartEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t brokenDateStart() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + NoBrokenDates &brokenDateStart(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char *BrokenDateEndMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "LocalMktDate"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t brokenDateEndId() SBE_NOEXCEPT + { + return 6741; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t brokenDateEndSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool brokenDateEndInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= brokenDateEndSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t brokenDateEndEncodingOffset() SBE_NOEXCEPT + { + return 2; + } + + static SBE_CONSTEXPR std::uint16_t brokenDateEndNullValue() SBE_NOEXCEPT + { + return static_cast(65535); + } + + static SBE_CONSTEXPR std::uint16_t brokenDateEndMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint16_t brokenDateEndMaxValue() SBE_NOEXCEPT + { + return static_cast(65534); + } + + static SBE_CONSTEXPR std::size_t brokenDateEndEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t brokenDateEnd() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 2, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + NoBrokenDates &brokenDateEnd(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 2, &val, sizeof(std::uint16_t)); + return *this; + } + + template + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoBrokenDates writer) + { + builder << '{'; + builder << R"("BrokenDateStart": )"; + builder << +writer.brokenDateStart(); + + builder << ", "; + builder << R"("BrokenDateEnd": )"; + builder << +writer.brokenDateEnd(); + + builder << '}'; + + return builder; + } + + void skip() + { + } + + SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT + { + return true; + } + + SBE_NODISCARD static std::size_t computeLength() + { +#if defined(__GNUG__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtype-limits" +#endif + std::size_t length = sbeBlockLength(); + + return length; +#if defined(__GNUG__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + } + }; + +private: + NoBrokenDates m_noBrokenDates; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoBrokenDatesId() SBE_NOEXCEPT + { + return 39026; + } + + SBE_NODISCARD inline NoBrokenDates &noBrokenDates() + { + m_noBrokenDates.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noBrokenDates; + } + + NoBrokenDates &noBrokenDatesCount(const std::uint8_t count) + { + m_noBrokenDates.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noBrokenDates; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noBrokenDatesSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool noBrokenDatesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noBrokenDatesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop #endif } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, SecurityDefinitionRequest560 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, SecurityDefinitionRequest560 _writer) { - SecurityDefinitionRequest560 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + SecurityDefinitionRequest560 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "SecurityDefinitionRequest560", )"; builder << R"("sbeTemplateId": )"; @@ -2445,19 +2886,41 @@ friend std::basic_ostream& operator << ( builder << R"("SourceRepoID": )"; builder << +writer.sourceRepoID(); + builder << ", "; + builder << R"("BrokenDateTermType": )"; + builder << +writer.brokenDateTermType(); + builder << ", "; { bool atLeastOne = false; builder << R"("NoLegs": [)"; - writer.noLegs().forEach([&](NoLegs& noLegs) - { - if (atLeastOne) + writer.noLegs().forEach( + [&](NoLegs &noLegs) { - builder << ", "; - } - atLeastOne = true; - builder << noLegs; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLegs; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoBrokenDates": [)"; + writer.noBrokenDates().forEach( + [&](NoBrokenDates &noBrokenDates) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noBrokenDates; + }); builder << ']'; } @@ -2468,10 +2931,16 @@ friend std::basic_ostream& operator << ( void skip() { - noLegs().forEach([](NoLegs e) + auto &noLegsGroup { noLegs() }; + while (noLegsGroup.hasNext()) { - e.skip(); - }); + noLegsGroup.next().skip(); + } + auto &noBrokenDatesGroup { noBrokenDates() }; + while (noBrokenDatesGroup.hasNext()) + { + noBrokenDatesGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT @@ -2479,7 +2948,9 @@ SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT return false; } -SBE_NODISCARD static std::size_t computeLength(std::size_t noLegsLength = 0) +SBE_NODISCARD static std::size_t computeLength( + std::size_t noLegsLength = 0, + std::size_t noBrokenDatesLength = 0) { #if defined(__GNUG__) && !defined(__clang__) #pragma GCC diagnostic push @@ -2494,6 +2965,13 @@ SBE_NODISCARD static std::size_t computeLength(std::size_t noLegsLength = 0) } length += noLegsLength *NoLegs::sbeBlockLength(); + length += NoBrokenDates::sbeHeaderSize(); + if (noBrokenDatesLength > 254LL) + { + throw std::runtime_error("noBrokenDatesLength outside of allowed range [E110]"); + } + length += noBrokenDatesLength *NoBrokenDates::sbeBlockLength(); + return length; #if defined(__GNUG__) && !defined(__clang__) #pragma GCC diagnostic pop diff --git a/src/lib/orderman/actors/ilink3/generated/SecurityDefinitionResponse561.h b/src/lib/orderman/actors/ilink3/generated/SecurityDefinitionResponse561.h index 8c5beb4a5..cd1dd372c 100644 --- a/src/lib/orderman/actors/ilink3/generated/SecurityDefinitionResponse561.h +++ b/src/lib/orderman/actors/ilink3/generated/SecurityDefinitionResponse561.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -164,10 +165,10 @@ private: } public: - static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(429); + static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(430); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(561); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -220,7 +222,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT { - return static_cast(429); + return static_cast(430); } SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sbeBlockAndHeaderLength() SBE_NOEXCEPT @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = SecurityDefinitionResponse561(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + SecurityDefinitionResponse561 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -668,7 +675,7 @@ public: return *this; } #else - SecurityDefinitionResponse561 &putText(const std::string& str) + SecurityDefinitionResponse561 &putText(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 256) @@ -874,7 +881,7 @@ public: return *this; } #else - SecurityDefinitionResponse561 &putFinancialInstrumentFullName(const std::string& str) + SecurityDefinitionResponse561 &putFinancialInstrumentFullName(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 35) @@ -1080,7 +1087,7 @@ public: return *this; } #else - SecurityDefinitionResponse561 &putSenderID(const std::string& str) + SecurityDefinitionResponse561 &putSenderID(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1286,7 +1293,7 @@ public: return *this; } #else - SecurityDefinitionResponse561 &putSymbol(const std::string& str) + SecurityDefinitionResponse561 &putSymbol(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 20) @@ -1776,7 +1783,7 @@ public: return *this; } #else - SecurityDefinitionResponse561 &putSecurityGroup(const std::string& str) + SecurityDefinitionResponse561 &putSecurityGroup(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 6) @@ -1982,7 +1989,7 @@ public: return *this; } #else - SecurityDefinitionResponse561 &putSecurityType(const std::string& str) + SecurityDefinitionResponse561 &putSecurityType(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 6) @@ -2188,7 +2195,7 @@ public: return *this; } #else - SecurityDefinitionResponse561 &putLocation(const std::string& str) + SecurityDefinitionResponse561 &putLocation(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 5) @@ -2480,7 +2487,7 @@ public: return *this; } #else - SecurityDefinitionResponse561 &putCurrency(const std::string& str) + SecurityDefinitionResponse561 &putCurrency(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 3) @@ -3171,6 +3178,11 @@ public: std::string getTerminationTypeAsJsonEscapedString() { + if (m_actingVersion < 3) + { + return std::string(""); + } + std::ostringstream oss; std::string s = getTerminationTypeAsString(); @@ -3233,7 +3245,7 @@ public: return *this; } #else - SecurityDefinitionResponse561 &putTerminationType(const std::string& str) + SecurityDefinitionResponse561 &putTerminationType(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 8) @@ -3754,6 +3766,82 @@ public: return *this; } + SBE_NODISCARD static const char *BrokenDateTermTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t brokenDateTermTypeId() SBE_NOEXCEPT + { + return 6651; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t brokenDateTermTypeSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool brokenDateTermTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= brokenDateTermTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t brokenDateTermTypeEncodingOffset() SBE_NOEXCEPT + { + return 429; + } + + static SBE_CONSTEXPR std::uint8_t brokenDateTermTypeNullValue() SBE_NOEXCEPT + { + return static_cast(255); + } + + static SBE_CONSTEXPR std::uint8_t brokenDateTermTypeMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint8_t brokenDateTermTypeMaxValue() SBE_NOEXCEPT + { + return static_cast(254); + } + + static SBE_CONSTEXPR std::size_t brokenDateTermTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t brokenDateTermType() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return static_cast(255); + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 429, sizeof(std::uint8_t)); + return (val); + } + + SecurityDefinitionResponse561 &brokenDateTermType(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 429, &val, sizeof(std::uint8_t)); + return *this; + } + class NoLegs { private: @@ -3880,7 +3968,7 @@ public: return *this; } - inline std::uint64_t resetCountToIndex() SBE_NOEXCEPT + inline std::uint64_t resetCountToIndex() { m_count = m_index; GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); @@ -3888,8 +3976,7 @@ public: return m_count; } - #if __cplusplus < 201103L - template inline void forEach(Func& func) + template inline void forEach(Func &&func) { while (hasNext()) { @@ -3898,17 +3985,6 @@ public: } } - #else - template inline void forEach(Func&& func) - { - while (hasNext()) - { - next(); - func(*this); - } - } - - #endif SBE_NODISCARD static const char *LegPriceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT { @@ -4335,8 +4411,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& builder, NoLegs writer) + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoLegs writer) { builder << '{'; builder << R"("LegPrice": )"; @@ -4422,15 +4498,535 @@ public: return m_actingVersion >= noLegsSinceVersion(); #if defined(__clang__) #pragma clang diagnostic pop +#endif + } + + class NoBrokenDates + { + private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_initialPosition = 0; + std::uint64_t *m_positionPtr = nullptr; + std::uint64_t m_blockLength = 0; + std::uint64_t m_count = 0; + std::uint64_t m_index = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + + SBE_NODISCARD std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return m_positionPtr; + } + + public: + inline void wrapForDecode( + char *buffer, + std::uint64_t *pos, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + GroupSize dimensions(buffer, *pos, bufferLength, actingVersion); + m_buffer = buffer; + m_bufferLength = bufferLength; + m_blockLength = dimensions.blockLength(); + m_count = dimensions.numInGroup(); + m_index = 0; + m_actingVersion = actingVersion; + m_initialPosition = *pos; + m_positionPtr = pos; + *m_positionPtr = *m_positionPtr + 3; + } + + inline void wrapForEncode( + char *buffer, + const std::uint8_t count, + std::uint64_t *pos, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + #if defined(__GNUG__) && !defined(__clang__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wtype-limits" + #endif + if (count > 254) + { + throw std::runtime_error("count outside of allowed range [E110]"); + } + #if defined(__GNUG__) && !defined(__clang__) + #pragma GCC diagnostic pop + #endif + m_buffer = buffer; + m_bufferLength = bufferLength; + GroupSize dimensions(buffer, *pos, bufferLength, actingVersion); + dimensions.blockLength(static_cast(16)); + dimensions.numInGroup(static_cast(count)); + m_index = 0; + m_count = count; + m_blockLength = 16; + m_actingVersion = actingVersion; + m_initialPosition = *pos; + m_positionPtr = pos; + *m_positionPtr = *m_positionPtr + 3; + } + + static SBE_CONSTEXPR std::uint64_t sbeHeaderSize() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t sbeBlockLength() SBE_NOEXCEPT + { + return 16; + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return *m_positionPtr; + } + + // NOLINTNEXTLINE(readability-convert-member-functions-to-static) + std::uint64_t sbeCheckPosition(const std::uint64_t position) + { + if (SBE_BOUNDS_CHECK_EXPECT((position > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short [E100]"); + } + return position; + } + + void sbePosition(const std::uint64_t position) + { + *m_positionPtr = sbeCheckPosition(position); + } + + SBE_NODISCARD inline std::uint64_t count() const SBE_NOEXCEPT + { + return m_count; + } + + SBE_NODISCARD inline bool hasNext() const SBE_NOEXCEPT + { + return m_index < m_count; + } + + inline NoBrokenDates &next() + { + if (m_index >= m_count) + { + throw std::runtime_error("index >= count [E108]"); + } + m_offset = *m_positionPtr; + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + m_blockLength) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for next group index [E108]"); + } + *m_positionPtr = m_offset + m_blockLength; + ++m_index; + + return *this; + } + + inline std::uint64_t resetCountToIndex() + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup(static_cast(m_count)); + return m_count; + } + + template inline void forEach(Func &&func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + + SBE_NODISCARD static const char *BrokenDateGUIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t brokenDateGUIDId() SBE_NOEXCEPT + { + return 39031; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t brokenDateGUIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool brokenDateGUIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= brokenDateGUIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t brokenDateGUIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t brokenDateGUIDNullValue() SBE_NOEXCEPT + { + return UINT64_C(0xffffffffffffffff); + } + + static SBE_CONSTEXPR std::uint64_t brokenDateGUIDMinValue() SBE_NOEXCEPT + { + return UINT64_C(0x0); + } + + static SBE_CONSTEXPR std::uint64_t brokenDateGUIDMaxValue() SBE_NOEXCEPT + { + return UINT64_C(0xfffffffffffffffe); + } + + static SBE_CONSTEXPR std::size_t brokenDateGUIDEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t brokenDateGUID() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoBrokenDates &brokenDateGUID(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char *BrokenDateSecurityIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t brokenDateSecurityIDId() SBE_NOEXCEPT + { + return 39027; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t brokenDateSecurityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool brokenDateSecurityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= brokenDateSecurityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t brokenDateSecurityIDEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t brokenDateSecurityIDNullValue() SBE_NOEXCEPT + { + return INT32_C(2147483647); + } + + static SBE_CONSTEXPR std::int32_t brokenDateSecurityIDMinValue() SBE_NOEXCEPT + { + return INT32_C(-2147483647); + } + + static SBE_CONSTEXPR std::int32_t brokenDateSecurityIDMaxValue() SBE_NOEXCEPT + { + return INT32_C(2147483647); + } + + static SBE_CONSTEXPR std::size_t brokenDateSecurityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t brokenDateSecurityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 8, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoBrokenDates &brokenDateSecurityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 8, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char *BrokenDateStartMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "LocalMktDate"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t brokenDateStartId() SBE_NOEXCEPT + { + return 6748; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t brokenDateStartSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool brokenDateStartInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= brokenDateStartSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t brokenDateStartEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::uint16_t brokenDateStartNullValue() SBE_NOEXCEPT + { + return static_cast(65535); + } + + static SBE_CONSTEXPR std::uint16_t brokenDateStartMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint16_t brokenDateStartMaxValue() SBE_NOEXCEPT + { + return static_cast(65534); + } + + static SBE_CONSTEXPR std::size_t brokenDateStartEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t brokenDateStart() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + NoBrokenDates &brokenDateStart(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char *BrokenDateEndMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "LocalMktDate"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t brokenDateEndId() SBE_NOEXCEPT + { + return 6741; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t brokenDateEndSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool brokenDateEndInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= brokenDateEndSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t brokenDateEndEncodingOffset() SBE_NOEXCEPT + { + return 14; + } + + static SBE_CONSTEXPR std::uint16_t brokenDateEndNullValue() SBE_NOEXCEPT + { + return static_cast(65535); + } + + static SBE_CONSTEXPR std::uint16_t brokenDateEndMinValue() SBE_NOEXCEPT + { + return static_cast(0); + } + + static SBE_CONSTEXPR std::uint16_t brokenDateEndMaxValue() SBE_NOEXCEPT + { + return static_cast(65534); + } + + static SBE_CONSTEXPR std::size_t brokenDateEndEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t brokenDateEnd() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 14, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + NoBrokenDates &brokenDateEnd(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 14, &val, sizeof(std::uint16_t)); + return *this; + } + + template + friend std::basic_ostream & operator << ( + std::basic_ostream &builder, NoBrokenDates writer) + { + builder << '{'; + builder << R"("BrokenDateGUID": )"; + builder << +writer.brokenDateGUID(); + + builder << ", "; + builder << R"("BrokenDateSecurityID": )"; + builder << +writer.brokenDateSecurityID(); + + builder << ", "; + builder << R"("BrokenDateStart": )"; + builder << +writer.brokenDateStart(); + + builder << ", "; + builder << R"("BrokenDateEnd": )"; + builder << +writer.brokenDateEnd(); + + builder << '}'; + + return builder; + } + + void skip() + { + } + + SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT + { + return true; + } + + SBE_NODISCARD static std::size_t computeLength() + { +#if defined(__GNUG__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtype-limits" +#endif + std::size_t length = sbeBlockLength(); + + return length; +#if defined(__GNUG__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + } + }; + +private: + NoBrokenDates m_noBrokenDates; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoBrokenDatesId() SBE_NOEXCEPT + { + return 39026; + } + + SBE_NODISCARD inline NoBrokenDates &noBrokenDates() + { + m_noBrokenDates.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noBrokenDates; + } + + NoBrokenDates &noBrokenDatesCount(const std::uint8_t count) + { + m_noBrokenDates.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noBrokenDates; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noBrokenDatesSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool noBrokenDatesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noBrokenDatesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop #endif } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, SecurityDefinitionResponse561 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, SecurityDefinitionResponse561 _writer) { - SecurityDefinitionResponse561 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + SecurityDefinitionResponse561 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "SecurityDefinitionResponse561", )"; builder << R"("sbeTemplateId": )"; @@ -4557,19 +5153,41 @@ friend std::basic_ostream& operator << ( builder << R"("PossRetransFlag": )"; builder << '"' << writer.possRetransFlag() << '"'; + builder << ", "; + builder << R"("BrokenDateTermType": )"; + builder << +writer.brokenDateTermType(); + builder << ", "; { bool atLeastOne = false; builder << R"("NoLegs": [)"; - writer.noLegs().forEach([&](NoLegs& noLegs) - { - if (atLeastOne) + writer.noLegs().forEach( + [&](NoLegs &noLegs) { - builder << ", "; - } - atLeastOne = true; - builder << noLegs; - }); + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLegs; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoBrokenDates": [)"; + writer.noBrokenDates().forEach( + [&](NoBrokenDates &noBrokenDates) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noBrokenDates; + }); builder << ']'; } @@ -4580,10 +5198,16 @@ friend std::basic_ostream& operator << ( void skip() { - noLegs().forEach([](NoLegs e) + auto &noLegsGroup { noLegs() }; + while (noLegsGroup.hasNext()) { - e.skip(); - }); + noLegsGroup.next().skip(); + } + auto &noBrokenDatesGroup { noBrokenDates() }; + while (noBrokenDatesGroup.hasNext()) + { + noBrokenDatesGroup.next().skip(); + } } SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT @@ -4591,7 +5215,9 @@ SBE_NODISCARD static SBE_CONSTEXPR bool isConstLength() SBE_NOEXCEPT return false; } -SBE_NODISCARD static std::size_t computeLength(std::size_t noLegsLength = 0) +SBE_NODISCARD static std::size_t computeLength( + std::size_t noLegsLength = 0, + std::size_t noBrokenDatesLength = 0) { #if defined(__GNUG__) && !defined(__clang__) #pragma GCC diagnostic push @@ -4606,6 +5232,13 @@ SBE_NODISCARD static std::size_t computeLength(std::size_t noLegsLength = 0) } length += noLegsLength *NoLegs::sbeBlockLength(); + length += NoBrokenDates::sbeHeaderSize(); + if (noBrokenDatesLength > 254LL) + { + throw std::runtime_error("noBrokenDatesLength outside of allowed range [E110]"); + } + length += noBrokenDatesLength *NoBrokenDates::sbeBlockLength(); + return length; #if defined(__GNUG__) && !defined(__clang__) #pragma GCC diagnostic pop diff --git a/src/lib/orderman/actors/ilink3/generated/Sequence506.h b/src/lib/orderman/actors/ilink3/generated/Sequence506.h index 8b1078e6c..3efcd7219 100644 --- a/src/lib/orderman/actors/ilink3/generated/Sequence506.h +++ b/src/lib/orderman/actors/ilink3/generated/Sequence506.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(14); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(506); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = Sequence506(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + Sequence506 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -607,11 +614,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, Sequence506 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, Sequence506 _writer) { - Sequence506 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + Sequence506 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "Sequence506", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/ShortSaleType.h b/src/lib/orderman/actors/ilink3/generated/ShortSaleType.h index 1f1c0c543..5ec0be304 100644 --- a/src/lib/orderman/actors/ilink3/generated/ShortSaleType.h +++ b/src/lib/orderman/actors/ilink3/generated/ShortSaleType.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_SHORTSALETYPE_H_ #define _ILINKBINARY_SHORTSALETYPE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class ShortSaleType @@ -130,8 +66,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, ShortSaleType::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, ShortSaleType::Value m) { return os << ShortSaleType::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/SideNULL.h b/src/lib/orderman/actors/ilink3/generated/SideNULL.h index 71dc4b3e2..f887796af 100644 --- a/src/lib/orderman/actors/ilink3/generated/SideNULL.h +++ b/src/lib/orderman/actors/ilink3/generated/SideNULL.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_SIDENULL_H_ #define _ILINKBINARY_SIDENULL_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class SideNULL @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, SideNULL::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, SideNULL::Value m) { return os << SideNULL::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/SideReq.h b/src/lib/orderman/actors/ilink3/generated/SideReq.h index 6bf4e4a80..bdd437d18 100644 --- a/src/lib/orderman/actors/ilink3/generated/SideReq.h +++ b/src/lib/orderman/actors/ilink3/generated/SideReq.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_SIDEREQ_H_ #define _ILINKBINARY_SIDEREQ_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class SideReq @@ -127,8 +63,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, SideReq::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, SideReq::Value m) { return os << SideReq::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/SideTimeInForce.h b/src/lib/orderman/actors/ilink3/generated/SideTimeInForce.h index 28bf22930..2922ea397 100644 --- a/src/lib/orderman/actors/ilink3/generated/SideTimeInForce.h +++ b/src/lib/orderman/actors/ilink3/generated/SideTimeInForce.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_SIDETIMEINFORCE_H_ #define _ILINKBINARY_SIDETIMEINFORCE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class SideTimeInForce @@ -124,8 +60,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, SideTimeInForce::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, SideTimeInForce::Value m) { return os << SideTimeInForce::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/SplitMsg.h b/src/lib/orderman/actors/ilink3/generated/SplitMsg.h index e071df893..6e561354c 100644 --- a/src/lib/orderman/actors/ilink3/generated/SplitMsg.h +++ b/src/lib/orderman/actors/ilink3/generated/SplitMsg.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_SPLITMSG_H_ #define _ILINKBINARY_SPLITMSG_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class SplitMsg @@ -127,8 +63,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, SplitMsg::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, SplitMsg::Value m) { return os << SplitMsg::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/Terminate507.h b/src/lib/orderman/actors/ilink3/generated/Terminate507.h index 2a8b630b6..a2ea3b2ff 100644 --- a/src/lib/orderman/actors/ilink3/generated/Terminate507.h +++ b/src/lib/orderman/actors/ilink3/generated/Terminate507.h @@ -70,11 +70,11 @@ #endif #if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false) #elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp) #else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) +# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c)) #endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() @@ -156,6 +156,7 @@ private: std::uint64_t m_bufferLength = 0; std::uint64_t m_offset = 0; std::uint64_t m_position = 0; + std::uint64_t m_actingBlockLength = 0; std::uint64_t m_actingVersion = 0; inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT @@ -167,7 +168,7 @@ public: static const std::uint16_t SBE_BLOCK_LENGTH = static_cast(67); static const std::uint16_t SBE_TEMPLATE_ID = static_cast(507); static const std::uint16_t SBE_SCHEMA_ID = static_cast(8); - static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(7); + static const std::uint16_t SBE_SCHEMA_VERSION = static_cast(8); enum MetaAttribute { @@ -200,6 +201,7 @@ public: m_bufferLength(bufferLength), m_offset(offset), m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingBlockLength(actingBlockLength), m_actingVersion(actingVersion) { } @@ -240,7 +242,7 @@ public: SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT { - return static_cast(7); + return static_cast(8); } SBE_NODISCARD static SBE_CONSTEXPR const char *sbeSemanticType() SBE_NOEXCEPT @@ -286,6 +288,11 @@ public: return *this = Terminate507(buffer, offset, bufferLength, actingBlockLength, actingVersion); } + Terminate507 &sbeRewind() + { + return wrapForDecode(m_buffer, m_offset, m_actingBlockLength, m_actingVersion, m_bufferLength); + } + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT { return m_position; @@ -526,7 +533,7 @@ public: return *this; } #else - Terminate507 &putReason(const std::string& str) + Terminate507 &putReason(const std::string &str) { const std::size_t srcLength = str.length(); if (srcLength > 48) @@ -821,11 +828,16 @@ public: } template -friend std::basic_ostream& operator << ( - std::basic_ostream& builder, Terminate507 _writer) +friend std::basic_ostream & operator << ( + std::basic_ostream &builder, Terminate507 _writer) { - Terminate507 writer(_writer.m_buffer, _writer.m_offset, - _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + Terminate507 writer( + _writer.m_buffer, + _writer.m_offset, + _writer.m_bufferLength, + _writer.m_actingBlockLength, + _writer.m_actingVersion); + builder << '{'; builder << R"("Name": "Terminate507", )"; builder << R"("sbeTemplateId": )"; diff --git a/src/lib/orderman/actors/ilink3/generated/TimeInForce.h b/src/lib/orderman/actors/ilink3/generated/TimeInForce.h index 252c569ba..355580348 100644 --- a/src/lib/orderman/actors/ilink3/generated/TimeInForce.h +++ b/src/lib/orderman/actors/ilink3/generated/TimeInForce.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_TIMEINFORCE_H_ #define _ILINKBINARY_TIMEINFORCE_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class TimeInForce @@ -136,8 +72,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, TimeInForce::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, TimeInForce::Value m) { return os << TimeInForce::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/TradeAddendum.h b/src/lib/orderman/actors/ilink3/generated/TradeAddendum.h index 9adb02444..830d146b7 100644 --- a/src/lib/orderman/actors/ilink3/generated/TradeAddendum.h +++ b/src/lib/orderman/actors/ilink3/generated/TradeAddendum.h @@ -2,80 +2,17 @@ #ifndef _ILINKBINARY_TRADEADDENDUM_H_ #define _ILINKBINARY_TRADEADDENDUM_H_ -#if defined(SBE_HAVE_CMATH) -/* cmath needed for std::numeric_limits::quiet_NaN() */ -# include -# define SBE_FLOAT_NAN std::numeric_limits::quiet_NaN() -# define SBE_DOUBLE_NAN std::numeric_limits::quiet_NaN() -#else -/* math.h needed for NAN */ -# include -# define SBE_FLOAT_NAN NAN -# define SBE_DOUBLE_NAN NAN -#endif - -#if __cplusplus >= 201103L -# define SBE_CONSTEXPR constexpr -# define SBE_NOEXCEPT noexcept -#else -# define SBE_CONSTEXPR -# define SBE_NOEXCEPT -#endif - -#if __cplusplus >= 201703L -# include -# define SBE_NODISCARD [[nodiscard]] -#else -# define SBE_NODISCARD -#endif - #if !defined(__STDC_LIMIT_MACROS) # define __STDC_LIMIT_MACROS 1 #endif #include -#include #include #include #include #include #include #include -#include -#include - -#if defined(WIN32) || defined(_WIN32) -# define SBE_BIG_ENDIAN_ENCODE_16(v) _byteswap_ushort(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) _byteswap_ulong(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) _byteswap_uint64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define SBE_BIG_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) (v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) (v) -#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -# define SBE_LITTLE_ENDIAN_ENCODE_16(v) __builtin_bswap16(v) -# define SBE_LITTLE_ENDIAN_ENCODE_32(v) __builtin_bswap32(v) -# define SBE_LITTLE_ENDIAN_ENCODE_64(v) __builtin_bswap64(v) -# define SBE_BIG_ENDIAN_ENCODE_16(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_32(v) (v) -# define SBE_BIG_ENDIAN_ENCODE_64(v) (v) -#else -# error "Byte Ordering of platform not determined. Set __BYTE_ORDER__ manually before including this file." -#endif - -#if defined(SBE_NO_BOUNDS_CHECK) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (false) -#elif defined(_MSC_VER) -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (exp) -#else -# define SBE_BOUNDS_CHECK_EXPECT(exp,c) (__builtin_expect(exp,c)) -#endif #define SBE_NULLVALUE_INT8 (std::numeric_limits::min)() #define SBE_NULLVALUE_INT16 (std::numeric_limits::min)() @@ -86,7 +23,6 @@ #define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() #define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() - namespace iLinkBinary { class TradeAddendum @@ -130,8 +66,8 @@ public: } template - friend std::basic_ostream& operator << ( - std::basic_ostream& os, TradeAddendum::Value m) + friend std::basic_ostream & operator << ( + std::basic_ostream &os, TradeAddendum::Value m) { return os << TradeAddendum::c_str(m); } diff --git a/src/lib/orderman/actors/ilink3/generated/generate.sh b/src/lib/orderman/actors/ilink3/generated/generate.sh old mode 100755 new mode 100644 index 200d1fd7e..6185d3ad1 --- a/src/lib/orderman/actors/ilink3/generated/generate.sh +++ b/src/lib/orderman/actors/ilink3/generated/generate.sh @@ -3,4 +3,5 @@ # download xml # sftp cmeconfig@sftpng.cmegroup.com:MSGW/NRCert/Templates/ilinkbinary.xml # password: G3t(0nnect3d -docker run --rm -it -w /work -v $PWD:/work java java -Dsbe.output.dir=/work -Dsbe.generate.ir="false" -Dsbe.target.language=cpp -jar sbe-all-1.17.0.jar ilinkbinary.xml \ No newline at end of file +# docker run --rm -it -w /work -v $PWD:/work java java -Dsbe.output.dir=/work -Dsbe.generate.ir="false" -Dsbe.target.language=cpp -jar sbe-all-1.27.0.jar ilinkbinary.xml +docker run --rm -it -w /work -v $PWD:/work eclipse-temurin:17-jdk-jammy java -Dsbe.output.dir=/work -Dsbe.generate.ir="false" -Dsbe.target.language=cpp -jar sbe-all-1.27.0.jar ilinkbinary.xml diff --git a/src/lib/orderman/actors/ilink3/generated/ilinkbinary.xml b/src/lib/orderman/actors/ilink3/generated/ilinkbinary.xml index 6ef8c5cf9..0f4201335 100644 --- a/src/lib/orderman/actors/ilink3/generated/ilinkbinary.xml +++ b/src/lib/orderman/actors/ilink3/generated/ilinkbinary.xml @@ -1,5 +1,5 @@ - + IDEMPOTENT @@ -15,6 +15,8 @@ 4 C 5 + 6 + E F CME-1-SHA-256 @@ -29,8 +31,10 @@ U C 0 + 6 8 C + E 8 1 @@ -135,8 +139,8 @@ 1 - 2 - 3 + 2 + 3 4 @@ -166,7 +170,10 @@ 105 106 107 - 108 + 108 + 109 + 110 + 111 G @@ -227,12 +234,14 @@ 1 3 + 7 100 0 1 6 + 99 0 @@ -256,11 +265,13 @@ 2 4 5 + 6 8 C + E U - + 1 2 4 @@ -337,6 +348,7 @@ 1 2 + 7 0 @@ -347,12 +359,13 @@ 1 2 - + 0 1 3 4 6 + 99 4 @@ -478,8 +491,8 @@ - - + + @@ -499,11 +512,13 @@ - + + + - + @@ -512,7 +527,7 @@ - + @@ -526,12 +541,13 @@ - + + - - + + @@ -542,9 +558,10 @@ - + + - + @@ -555,12 +572,14 @@ - + + + - - + + @@ -644,10 +663,10 @@ - + - + @@ -656,7 +675,7 @@ - + @@ -680,12 +699,15 @@ - + + + + - + @@ -695,7 +717,7 @@ - + @@ -720,12 +742,14 @@ - + + + - + @@ -734,7 +758,7 @@ - + @@ -757,11 +781,14 @@ - + + + + - + @@ -771,7 +798,7 @@ - + @@ -800,23 +827,36 @@ - + + + + + + + + + + + + - + + + @@ -829,7 +869,7 @@ - + @@ -858,7 +898,7 @@ - + @@ -883,7 +923,7 @@ - + @@ -891,7 +931,7 @@ - + @@ -911,6 +951,9 @@ + + + @@ -926,7 +969,7 @@ - + @@ -935,7 +978,9 @@ - + + + @@ -946,7 +991,7 @@ - + @@ -963,7 +1008,8 @@ - + + @@ -980,7 +1026,7 @@ - + @@ -989,7 +1035,7 @@ - + @@ -1015,12 +1061,14 @@ - + + + - + @@ -1030,7 +1078,7 @@ - + @@ -1057,9 +1105,14 @@ - + + + + + + @@ -1071,7 +1124,7 @@ - + @@ -1080,7 +1133,7 @@ - + @@ -1106,10 +1159,15 @@ - + + + + + + @@ -1131,7 +1189,7 @@ - + @@ -1154,7 +1212,7 @@ - + @@ -1236,7 +1294,7 @@ - + @@ -1258,7 +1316,7 @@ - + @@ -1276,11 +1334,12 @@ - + + @@ -1307,7 +1366,7 @@ - + @@ -1333,16 +1392,24 @@ - + + + + + + + + + - + @@ -1350,6 +1417,8 @@ + + @@ -1381,7 +1450,7 @@ - + @@ -1410,7 +1479,7 @@ - + @@ -1434,6 +1503,9 @@ + + + @@ -1450,7 +1522,7 @@ - + @@ -1464,6 +1536,7 @@ + @@ -1472,8 +1545,12 @@ + + + + - + @@ -1504,6 +1581,7 @@ + @@ -1512,8 +1590,14 @@ + + + + + + - + @@ -1539,16 +1623,18 @@ - + + + - + @@ -1571,6 +1657,9 @@ + + + @@ -1581,4 +1670,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/lib/orderman/events/OrderStateUpdateEvent.h b/src/lib/orderman/events/OrderStateUpdateEvent.h index f47bdf326..5b50c050f 100644 --- a/src/lib/orderman/events/OrderStateUpdateEvent.h +++ b/src/lib/orderman/events/OrderStateUpdateEvent.h @@ -6,6 +6,7 @@ #include "lib/tracing/PerfLog.h" #include +#include namespace bts { namespace orderman { diff --git a/src/lib/orderman/orderman_utils/fix_order_codec.h b/src/lib/orderman/orderman_utils/fix_order_codec.h index e2e16f653..9a899dc7b 100644 --- a/src/lib/orderman/orderman_utils/fix_order_codec.h +++ b/src/lib/orderman/orderman_utils/fix_order_codec.h @@ -104,7 +104,14 @@ std::string get_ice_clord_id_string(const MSG& msg) inline void encode_corid(const char *channel, uint32_t sn, std::array &out) { memset(&out[0], ' ', out.size()); auto ch_sz = std::min(strlen(channel), (size_t)5); +#if defined(__GNUG__) && not defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-truncation" +#endif strncpy(&out[0], channel, ch_sz); +#if defined(__GNUG__) && not defined(__clang__) +#pragma GCC diagnostic pop +#endif out[ch_sz] = ':'; auto sz_written = u32_toa(sn, &out[ch_sz + 1]); out[ch_sz+1+sz_written]=' '; diff --git a/src/lib/orderman/orders/algo/algo_orders/FileRunner.cpp b/src/lib/orderman/orders/algo/algo_orders/FileRunner.cpp index bb878bf53..b7db0a76a 100644 --- a/src/lib/orderman/orders/algo/algo_orders/FileRunner.cpp +++ b/src/lib/orderman/orders/algo/algo_orders/FileRunner.cpp @@ -44,20 +44,30 @@ namespace orderman { using namespace api::orderman; using namespace google::protobuf; using namespace boost; +template bool from_string(const std::string &str, T *out) { + return google::protobuf::TextFormat::ParseFromString(str, out); +} struct optimizer { struct FileLine { std::string time_s, proto_s; api::orderman::MomentumAlgoParamsFile data; - bool valid = true; + bool valid = false; FileLine(std::string s) { - data = - utils::pb::from_string(s); + try { + valid = from_string(s, &data); + } catch (...) { + bts_assert(false); + } } }; std::string path = os::sparkdata_path("data/logging") + "parameters.txt"; bool load_file() { - ifs.open(path.c_str(), std::ios::in); // input file stream - return ifs.good(); + try { + ifs.open(path.c_str(), std::ios::in); // input file stream + return ifs.good(); + } catch (...) { + bts_assert(false); + } } bool is_valid = false; std::ifstream ifs; @@ -67,14 +77,18 @@ struct optimizer { &cb = [](api::orderman::MomentumAlgoParamsFile data) { std::cout << utils::pb::to_string(data); }) { - if (!is_valid) { - return; - } - std::string str; - if (!ifs.eof()) { - std::getline(ifs, str); - FileLine line(str); - cb(line.data); + try { + if (!is_valid) { + return; + } + std::string str; + if (!ifs.eof()) { + std::getline(ifs, str); + FileLine line(str); + cb(line.data); + } + } catch (...) { + bts_assert(false); } } }; @@ -105,104 +119,122 @@ FileRunner::~FileRunner() {} IAlgoServices &FileRunner::_algo() const { return *me->algo; } OrderOpResult FileRunner::do_before_launch(IBeforeLaunchAlgoServices &serv) { - auto &def = serv.definition(); - me->servg = &serv; - me->self_key = serv.order_key(); - // serv.known_securities().front(). + try { + auto &def = serv.definition(); + me->servg = &serv; + me->self_key = serv.order_key(); + // serv.known_securities().front(). - LOG(OrderMan, Info, "FileRunner::store_and_publish_if_complete rec: {}", - utils::pb::to_string(serv.definition())); - - if (def.has_custom_def() && def.custom_def().has_dynamic()) { - me->self_def = serv.definition(); - me->self_security_key = serv.security().id(); - return {}; + LOG(OrderMan, Info, "FileRunner::store_and_publish_if_complete rec: {}", + utils::pb::to_string(serv.definition())); + if (def.has_custom_def() && def.custom_def().has_dynamic()) { + me->self_def = serv.definition(); + me->self_security_key = serv.security().id(); + return {}; + } + // diagnostics + LOG(OrderMan, Info, + "FileRunner::do_before_launch Has custom: {}, has dynamic: {}", + def.has_custom_def(), def.custom_def().has_dynamic()); + return {OrderError::ORDER_ERROR_INVALID_PARAMETER, + std::string("Parameters are not well formed")}; + } catch (...) { + bts_assert(false); } - // diagnostics - LOG(OrderMan, Info, - "FileRunner::do_before_launch Has custom: {}, has dynamic: {}", - def.has_custom_def(), def.custom_def().has_dynamic()); - return {OrderError::ORDER_ERROR_INVALID_PARAMETER, - std::string("Parameters are not well formed")}; } void FileRunner::run_algo(const api::orderman::MomentumAlgoParamsFile p) { - OrderDefinition rv = me->self_def; - rv.set_security_key(me->self_security_key); - rv.set_side(api::Side::SIDE_BUY); - api::orderman::DynamicOrderDefinition momentum; - momentum.set_dynamic_order_type(std::string("Momentum")); - me->temp_c++; - auto &map = *momentum.mutable_order_params(); - map["Edge Target?"] = dynamic_parameter(p.edge_target()); - map["Edge Loss?"] = dynamic_parameter(p.edge_loss()); - map["R" - "e" - "v" - "e" - "r" - "s" - "e" - " " - "L" - "o" - "g" - "i" - "c" - "?"] = dynamic_parameter(p.reverse_logic()); - map["File Sim?"] = dynamic_parameter(p.file_sim()); - map["Timed Start?"] = dynamic_parameter(p.timed_start()); - map["Log Graph?"] = dynamic_parameter(p.log_graph()); - map["Open " - "Position On " - "Close"] = dynamic_parameter(p.open_position_on_close()); - map["Renko Ticks"] = dynamic_parameter(p.renko_ticks()); - map["Gan Buffer Size"] = dynamic_parameter(p.gan_buffer_size()); - map["Edge To Capture"] = dynamic_parameter(p.edge_to_capture()); - map["Edge To " - "lose"] = dynamic_parameter(p.edge_to_lose()); - map["Run Duration " - "(Hours-decimal)"] = dynamic_parameter(p.run_duration_hours_decimal()); - map["Time " - "Start" - " Hour" - "s " - "(24 " - "HRS" - ")"] = dynamic_parameter(p.time_start_hours_24_hrs()); - map["Time" - " Sta" - "rt " - "Minu" - "te" - "s"] = dynamic_parameter(p.time_start_minutes()); - map["Date " - "Start" - " Day " - "of " - "Mont" - "h"] = dynamic_parameter(p.date_start_day_of_month()); - map["Date" - " Sta" - "rt " - "Mont" - "h " - "(0-" - "12" - ")"] = dynamic_parameter(p.date_start_month_0_12()); - map["Date Start Year " - "(20XX)"] = dynamic_parameter(p.date_start_year_20xx()); - rv.mutable_custom_def()->mutable_dynamic()->CopyFrom(momentum); - me->child_template_buy = &(me->servg->make_child_template(rv)); - auto key = _algo().launch_child(*me->child_template_buy, Price(1321.5), - bts::Quantity(1)); - me->orders_sent[key] = 1; + try { + OrderDefinition rv = me->self_def; + rv.set_security_key(me->self_security_key); + rv.set_side(api::Side::SIDE_BUY); + api::orderman::DynamicOrderDefinition momentum; + momentum.set_dynamic_order_type(std::string("Momentum")); + me->temp_c++; + auto &map = *momentum.mutable_order_params(); + // ((void)map); + // ((void)p); + map["Edge Target?"] = dynamic_parameter(p.edge_target()); + map["Early Brick?"] = dynamic_parameter(p.early_brick()); + map["Early Threshold"] = dynamic_parameter(p.early_threshold()); + map["Edge Loss?"] = dynamic_parameter(p.edge_loss()); + map["R" + "e" + "v" + "e" + "r" + "s" + "e" + " " + "L" + "o" + "g" + "i" + "c" + "?"] = dynamic_parameter(p.reverse_logic()); + map["File Sim?"] = dynamic_parameter(p.file_sim()); + map["Timed Start?"] = dynamic_parameter(p.timed_start()); + map["Log Graph?"] = dynamic_parameter(p.log_graph()); + map["Open " + "Position On " + "Close"] = dynamic_parameter(p.open_position_on_close()); + map["Use Hull Avg?"] = dynamic_parameter(p.use_hull_avg()); + map["Renko Ticks"] = dynamic_parameter(p.renko_ticks()); + map["Upper Gan Buffer Size"] = dynamic_parameter(p.upr_gan_buffer_size()); + map["Lower Gan Buffer Size"] = dynamic_parameter(p.lwr_gan_buffer_size()); + map["Edge To Capture"] = dynamic_parameter(p.edge_to_capture()); + map["Edge To " + "lose"] = dynamic_parameter(p.edge_to_lose()); + map["Run Duration " + "(Hours-decimal)"] = + dynamic_parameter(p.run_duration_hours_decimal()); + map["Time " + "Start" + " Hour" + "s " + "(24 " + "HRS" + ")"] = dynamic_parameter(p.time_start_hours_24_hrs()); + map["Time" + " Sta" + "rt " + "Minu" + "te" + "s"] = dynamic_parameter(p.time_start_minutes()); + map["Date " + "Start" + " Day " + "of " + "Mont" + "h"] = dynamic_parameter(p.date_start_day_of_month()); + map["Date" + " Sta" + "rt " + "Mont" + "h " + "(0-" + "12" + ")"] = dynamic_parameter(p.date_start_month_0_12()); + map["Date Start Year " + "(20XX)"] = dynamic_parameter(p.date_start_year_20xx()); + rv.mutable_custom_def()->mutable_dynamic()->CopyFrom(momentum); + me->child_template_buy = &(me->servg->make_child_template(rv)); + auto key = _algo().launch_child(*me->child_template_buy, Price(1321.5), + bts::Quantity(1)); + me->orders_sent[key] = 1; + } catch (...) { + bts_assert(false); + } } // initalise all structs and pointers void FileRunner::do_launch(IAlgoServices &algo_services) { - me->algo = &algo_services; // subscrive book and trade, get id from - // id will be id and security id - LOG(OrderMan, Info, "FileRunner::do_launch"); - me->algo->subscribe_timer(); + try { + me->algo = &algo_services; // subscrive book and trade, get id from + // id will be id and security id + LOG(OrderMan, Info, "FileRunner::do_launch"); + me->algo->subscribe_timer(); + } catch (...) { + bts_assert(false); + } } void FileRunner::do_launch_attached( // not needed right now IAlgoServices &algo_services, OrderKey, ChildState) { @@ -226,14 +258,19 @@ void FileRunner::do_update( } void FileRunner::on_child_change(OrderKey key, const ChildState &state) { - if (me->orders_sent.find(key) != me->orders_sent.end() && - state.status == bts::orderman::ChildStatus::COMPLETED) { - me->orders_sent.erase(key); - me->handler->run( - [&](const api::orderman::MomentumAlgoParamsFile p) { run_algo(p); }); - if (me->orders_sent.empty() && me->end) { - _cxl_and_end(false, "completed"); + try { + if (me->orders_sent.find(key) != me->orders_sent.end() && + state.status == bts::orderman::ChildStatus::COMPLETED) { + me->orders_sent.erase(key); + me->handler->run([&](const api::orderman::MomentumAlgoParamsFile p) { + run_algo(p); + }); + if (me->orders_sent.empty() && me->end) { + _cxl_and_end(false, "completed"); + } } + } catch (...) { + bts_assert(false); } } void FileRunner::on_status(SecurityKey key, co2::TradingStatus s) { @@ -244,16 +281,21 @@ void FileRunner::on_status(SecurityKey key, co2::TradingStatus s) { // updates states every 500 ms, state visible if algo tree checked on front // end void FileRunner::on_timer() { - if (bts::datetime::usecs_since(me->last_periodic_opp_check_time) >= - me->opp_check_period_usecs) { - me->algo->unsubscribe_timer(); - me->handler = std::make_unique(optimizer()); - if (me->handler->is_valid) { - me->handler->run([&](const api::orderman::MomentumAlgoParamsFile p) { - run_algo(p); - }); + try { + if (bts::datetime::usecs_since(me->last_periodic_opp_check_time) >= + me->opp_check_period_usecs) { + me->algo->unsubscribe_timer(); + me->handler = std::make_unique(optimizer()); + if (me->handler->is_valid) { + me->handler->run( + [&](const api::orderman::MomentumAlgoParamsFile p) { + run_algo(p); + }); + } + me->end = true; } - me->end = true; + } catch (...) { + bts_assert(false); } } diff --git a/src/lib/orderman/orders/algo/algo_orders/MomentumAlgo.cpp b/src/lib/orderman/orders/algo/algo_orders/MomentumAlgo.cpp index 16cf6100e..ab9bac8ed 100644 --- a/src/lib/orderman/orders/algo/algo_orders/MomentumAlgo.cpp +++ b/src/lib/orderman/orders/algo/algo_orders/MomentumAlgo.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -120,8 +122,12 @@ struct TimeHandler { } bool gt_hour(int hours = 16) { return get_hour() > hours; } std::string get_str() const { - auto s = util::TimeUtil::ToString(ts); - return replace_t(s); + try { + auto s = util::TimeUtil::ToString(ts); + return replace_t(s); + } catch (...) { + bts_assert(false); + } } std::string get_date_str() const { auto s = get_str(); @@ -178,24 +184,28 @@ struct TimeHandler { return self > lt && self < gt; } }; - +template bool from_string(const std::string &str, T *out) { + return google::protobuf::TextFormat::ParseFromString(str, out); +} struct SimHandler { struct FileLine { std::string time_s, proto_s; api::orderman::MomentumAlgoLog data; TimeHandler time; - bool valid = true; + bool valid = false; FileLine(std::string s) { // char ign[300]; if (s.find_first_of("|", 0) == std::string::npos || s.find_first_of("`", 0) == std::string::npos) { + return; + } + time_s = s.substr(0, s.find_first_of("|", 0)); + time = TimeHandler(time_s); + proto_s = s.substr(s.find_first_of("`", 0) + 1, std::string::npos); + try { + valid = from_string(proto_s, &data); + } catch (...) { valid = false; - } else { - time_s = s.substr(0, s.find_first_of("|", 0)); - proto_s = s.substr(s.find_first_of("`", 0) + 1, std::string::npos); - data = - utils::pb::from_string(proto_s); - time = TimeHandler(time_s); } } @@ -407,31 +417,69 @@ struct GanData { // for diagnostics size_t n_updates = 0; // This is the number of brick highs/lows we keep, default = 100 - const size_t buffer_sz; + const size_t upr_buffer_sz; + const size_t lwr_buffer_sz; + const size_t upr_mma_sz; + const size_t lwr_mma_sz; // We use a circular_buffer to keep the last highs, lows. With a default of // 100, when we add the 100th element the 0th element is popped out boost::circular_buffer highs, lows; + boost::circular_buffer high_mma, low_mma; double high_sum = 0, low_sum = 0; - explicit GanData(size_t buffer_sz) - : buffer_sz(buffer_sz), highs(buffer_sz), lows(buffer_sz) {} + bool use_hma = false; + explicit GanData(size_t upr_buffer_sz, size_t lwr_buffer_sz, bool hma) + : upr_buffer_sz(upr_buffer_sz), lwr_buffer_sz(lwr_buffer_sz), + upr_mma_sz(ceil(sqrt(upr_buffer_sz))), + lwr_mma_sz(ceil(sqrt(lwr_buffer_sz))), highs(upr_buffer_sz), + lows(lwr_buffer_sz), high_mma(upr_mma_sz), low_mma(lwr_mma_sz), + use_hma(hma) {} // As new bricks are created, this function is called void on_data(const Brick &brick) { n_updates++; highs.push_back(brick.edges.high); lows.push_back(brick.edges.low); + if (upr_has_data()) { + high_mma.push_back(mma(highs)); + } + if (lwr_has_data()) { + low_mma.push_back(mma(lows)); + } } void on_data_optimized(const Brick &brick) { n_updates++; - if (has_data()) { - high_sum -= highs.front(); + if (lwr_has_data()) { low_sum -= lows.front(); } + if (upr_has_data()) { + high_sum -= highs.front(); + } highs.push_back(brick.edges.high); lows.push_back(brick.edges.low); high_sum += brick.edges.high; low_sum += brick.edges.low; } + [[nodiscard]] const static double + weighted_moving_average(const boost::circular_buffer &data, + size_t period) { + double result = 0; + size_t weight = 0; + size_t sum = 0; + + for (size_t i = 0; i < data.size(); i++) { + if (i >= (data.size() - period)) + weight++; + sum += weight; + result += weight * data[i]; + } + return result / sum; + } + [[nodiscard]] const static double + mma(const boost::circular_buffer &data) { + return 2 * weighted_moving_average(data, data.size() / 2) - + weighted_moving_average(data, data.size()); + } + // for early entry exit [[nodiscard]] std::optional high_average_hyp(std::optional temp) const { @@ -451,23 +499,47 @@ struct GanData { l_sum = l_sum + temp.value().low - lows.front(); return l_sum / (double)lows.size(); } + [[nodiscard]] const static double + simple_Avg(boost::circular_buffer buf) { + auto sum = std::accumulate(buf.begin(), buf.end(), (double)0); + return sum / (double)buf.size(); + } // high_average (and subsequenly low_average) below, is simply adding up the // contents of the highs (or lows) and dividing it by the number of elements [[nodiscard]] std::optional high_average() const { if (!has_data()) { return std::nullopt; } - auto h_sum = std::accumulate(highs.begin(), highs.end(), (double)0); - return h_sum / (double)highs.size(); + if (use_hma) { + return weighted_moving_average(high_mma, high_mma.size()); + } + return simple_Avg(highs); } [[nodiscard]] std::optional low_average() const { if (!has_data()) { return std::nullopt; } - auto l_sum = std::accumulate(lows.begin(), lows.end(), (double)0); - return l_sum / (double)lows.size(); + if (use_hma) { + return weighted_moving_average(low_mma, low_mma.size()); + } + return simple_Avg(lows); + } + [[nodiscard]] bool lwr_has_data() const { + return lows.size() >= lwr_buffer_sz; + } + [[nodiscard]] bool upr_has_data() const { + return highs.size() >= upr_buffer_sz; + } + [[nodiscard]] bool lwr_mma_has_data() const { + return low_mma.size() >= lwr_mma_sz; + } + [[nodiscard]] bool upr_mma_has_data() const { + return high_mma.size() >= upr_mma_sz; + } + [[nodiscard]] bool has_data() const { + return use_hma ? lwr_mma_has_data() && upr_mma_has_data() + : lwr_has_data() && upr_has_data(); } - [[nodiscard]] bool has_data() const { return lows.size() >= buffer_sz; } }; // enum Modes { @@ -486,57 +558,63 @@ struct MomentumAlgoParams { const size_t renko_ticks; const size_t edge_ticks_gain_limit; const size_t edge_ticks_loss_limit; - const size_t gan_buffer_sz; + const size_t upr_gan_buffer_sz; + const size_t lwr_gan_buffer_sz; const size_t orders_quantity; const double early_threshold; const double cash_per_point; const TimeHandler start_time, end_time; const bool log_graph, file_read, fixed_edge_gain, fixed_edge_loss, - reverse_logic, timed_start, early_brick; + reverse_logic, timed_start, early_brick, hull_avg; MomentumAlgoParams(SecurityKey security_key_id, size_t renko_ticks, size_t edge_ticks_gain_limit, - size_t edge_ticks_loss_limit, size_t gan_buffer_sz, - size_t orders_quantity, double cash_per_point, - TimeHandler start_time, TimeHandler end_time, - std::string security_name_str, bool file_read, - bool fixed_edge_gain, bool fixed_edge_loss, - bool reverse_logic, bool timed_start, bool log_graph, - bool early_brick, double early_threshold) + size_t edge_ticks_loss_limit, size_t upr_gan_buffer_sz, + size_t lwr_gan_buffer_sz, size_t orders_quantity, + double cash_per_point, TimeHandler start_time, + TimeHandler end_time, std::string security_name_str, + bool file_read, bool fixed_edge_gain, + bool fixed_edge_loss, bool reverse_logic, + bool timed_start, bool log_graph, bool early_brick, + double early_threshold, bool hull_avg) : security_key_id(security_key_id), security_name_str(security_name_str), renko_ticks(renko_ticks), edge_ticks_gain_limit(edge_ticks_gain_limit), edge_ticks_loss_limit(edge_ticks_loss_limit), - gan_buffer_sz(gan_buffer_sz), orders_quantity(orders_quantity), + upr_gan_buffer_sz(upr_gan_buffer_sz), + lwr_gan_buffer_sz(lwr_gan_buffer_sz), orders_quantity(orders_quantity), early_threshold(early_threshold), cash_per_point(cash_per_point), start_time(start_time), end_time(end_time), log_graph(log_graph), file_read(file_read), fixed_edge_gain(fixed_edge_gain), fixed_edge_loss(fixed_edge_loss), reverse_logic(reverse_logic), - timed_start(timed_start), early_brick(early_brick) {} + timed_start(timed_start), early_brick(early_brick), + hull_avg(hull_avg) {} std::string print() { std::string sep_obj = ", "; std::string sep_key_val = ":"; std::string s = "security_name" + sep_key_val + security_name_str; - s += sep_obj + "renko_ticks" + sep_key_val + std::to_string(renko_ticks); - s += sep_obj + "edge_ticks_gain_limit" + sep_key_val + - std::to_string(edge_ticks_gain_limit); - s += sep_obj + "edge_ticks_loss_limit" + sep_key_val + - std::to_string(edge_ticks_loss_limit); - s += sep_obj + "gan_buffer_size" + sep_key_val + - std::to_string(gan_buffer_sz); - s += sep_obj + "orders_quantity" + sep_key_val + - std::to_string(orders_quantity); - s += sep_obj + "cash_per_point" + sep_key_val + - std::to_string(cash_per_point); - s += sep_obj + "start_time" + sep_key_val + start_time.get_str(); - s += sep_obj + "end_time" + sep_key_val + end_time.get_str(); - s += sep_obj + "log_graph" + sep_key_val + std::to_string(log_graph); - s += sep_obj + "file_read" + sep_key_val + std::to_string(file_read); - s += sep_obj + "fixed_edge_gain" + sep_key_val + - std::to_string(fixed_edge_gain); - s += sep_obj + "fixed_edge_loss" + sep_key_val + - std::to_string(fixed_edge_loss); - s += sep_obj + "reverse_logic" + sep_key_val + - std::to_string(reverse_logic); - s += sep_obj + "timed_start" + sep_key_val + std::to_string(timed_start); + auto add_to_s = [&](std::string desc, std::string val) { + if (s != "") { + s += sep_obj; + } + s += desc + sep_key_val + val; + }; + add_to_s("renko_ticks", std::to_string(renko_ticks)); + add_to_s("edge_ticks_gain_limit", std::to_string(edge_ticks_gain_limit)); + add_to_s("edge_ticks_loss_limit", std::to_string(edge_ticks_loss_limit)); + add_to_s("upper_gan_buffer_size", std::to_string(upr_gan_buffer_sz)); + add_to_s("lower_gan_buffer_size", std::to_string(lwr_gan_buffer_sz)); + add_to_s("orders_quantity", std::to_string(orders_quantity)); + add_to_s("cash_per_point", std::to_string(cash_per_point)); + add_to_s("start_time", start_time.get_str()); + add_to_s("end_time", end_time.get_str()); + add_to_s("log_graph", std::to_string(log_graph)); + add_to_s("file_read", std::to_string(file_read)); + add_to_s("fixed_edge_gain", std::to_string(fixed_edge_gain)); + add_to_s("fixed_edge_loss", std::to_string(fixed_edge_loss)); + add_to_s("reverse_logic", std::to_string(reverse_logic)); + add_to_s("timed_start", std::to_string(timed_start)); + add_to_s("hull avg", std::to_string(hull_avg)); + add_to_s("early threshold", std::to_string(early_threshold)); + add_to_s("early brick", std::to_string(early_brick)); return s; } }; @@ -586,21 +664,26 @@ struct MomentumAlgo::PImpl { enum MomentumMeasure { GAN = 0 }; PImpl() : slippage_buffer(slippage_size) { - // this block was to reduce flutter on the front end - auto &m = *(out_state.mutable_custom_state()); - auto l = {"00 Last Price", "01 Position", "02 P&L", - "03 Brick count", "10 Holding Price", "20 Last Order Price", - "30 Lower Brick", "31 Upper Brick", "40 Lower Average", - "41 Upper Average", "50 + Signals", "51 - Signals", - "60 Front Runners"}; + try { + // this block was to reduce flutter on the front end + auto &m = *(out_state.mutable_custom_state()); + auto l = { + "00 Last Price", "01 Position", "02 P&L", + "03 Brick count", "10 Holding Price", "20 Last Order Price", + "30 Lower Brick", "31 Upper Brick", "40 Lower Average", + "41 Upper Average", "50 + Signals", "51 - Signals", + "60 Front Runners"}; - for (auto index : l) { - m[index].set_as_string("None"); + for (auto index : l) { + m[index].set_as_string("None"); + } + for (size_t i = 0; i < slippage_size; i++) { + m["9" + std::to_string(i) + ": base, actual"].set_as_string("None"); + } + printer.SetSingleLineMode(true); + } catch (...) { + bts_assert(false); } - for (size_t i = 0; i < slippage_size; i++) { - m["9" + std::to_string(i) + ": base, actual"].set_as_string("None"); - } - printer.SetSingleLineMode(true); } }; // namespace orderman @@ -628,9 +711,11 @@ bool _convert_params(IBeforeLaunchAlgoServices &serv, auto timed_start = get_if(params, "Timed Start?"); auto log_graph = get_if(params, "Log Graph?"); auto early_brick = get_if(params, "Early Brick?"); + auto hull_avg = get_if(params, "Use Hull Avg?"); auto renko_ticks = get_if(params, "Renko Ticks"); - auto gan_buffer_sz = get_if(params, "Gan Buffer Size"); + auto upr_gan_buffer_sz = get_if(params, "Upper Gan Buffer Size"); + auto lwr_gan_buffer_sz = get_if(params, "Lower Gan Buffer Size"); auto open_position_on_close = get_if(params, "Open Position On Close"); auto edge_ticks_gain_limit = get_if(params, "Edge To Capture"); auto edge_ticks_loss_limit = get_if(params, "Edge To lose"); @@ -660,22 +745,25 @@ bool _convert_params(IBeforeLaunchAlgoServices &serv, if (!edge_target.has_value() || !edge_loss.has_value() || !reverse_logic.has_value() || !timed_start.has_value() || !file_sim.has_value() || !renko_ticks.has_value() || - !gan_buffer_sz.has_value() || !open_position_on_close.has_value() || + !upr_gan_buffer_sz.has_value() || !lwr_gan_buffer_sz.has_value() || + !open_position_on_close.has_value() || !edge_ticks_gain_limit.has_value() || !edge_ticks_loss_limit.has_value() || !run_duration.has_value() || - (timed_start.value() && !check_time())) { + !hull_avg.has_value() || (timed_start.value() && !check_time())) { LOG(OrderMan, Info, "MomentumAlgo::convert_params failed edge_target:{}, edge_loss:{}, " "reverse_logic:{}, timed_start:{}, file_sim:{},renko_ticks:{}, " - "gan_buffer_sz:{}, open_position_on_close:{}, " + "upr_gan_buffer_sz:{}, lwr_gan_buffer_sz:{}, " + "open_position_on_close:{}, " "edge_ticks_gain_limit:{}, edge_ticks_loss_limit:{}, " - "run_duration:{}, check_time:{}", + "run_duration:{}, check_time:{}, hull_avg:{}", edge_target.has_value(), edge_loss.has_value(), reverse_logic.has_value(), timed_start.has_value(), file_sim.has_value(), renko_ticks.has_value(), - gan_buffer_sz.has_value(), open_position_on_close.has_value(), - edge_ticks_gain_limit.has_value(), edge_ticks_loss_limit.has_value(), - run_duration.has_value(), check_time()); + upr_gan_buffer_sz.has_value(), lwr_gan_buffer_sz.has_value(), + open_position_on_close.has_value(), edge_ticks_gain_limit.has_value(), + edge_ticks_loss_limit.has_value(), run_duration.has_value(), + check_time(), hull_avg.has_value()); return false; } auto start_time = TimeHandler(); @@ -688,13 +776,15 @@ bool _convert_params(IBeforeLaunchAlgoServices &serv, out_p = std::make_unique(MomentumAlgoParams( SecurityKey(serv.security().id()), renko_ticks.value(), edge_ticks_gain_limit.value(), edge_ticks_loss_limit.value(), - gan_buffer_sz.value(), open_position_on_close.value() ? 2 : 1, + upr_gan_buffer_sz.value(), lwr_gan_buffer_sz.value(), + open_position_on_close.value() ? 2 : 1, serv.security().contract_spec().cash_per_point(), start_time, end_time, serv.security().glbx().security_desc(), file_sim.value(), edge_target.value(), edge_loss.value(), reverse_logic.value(), timed_start.value(), log_graph.has_value() ? log_graph.value() : true, early_brick.has_value() ? early_brick.value() : false, - early_threshold.has_value() ? early_threshold.value() : 0)); + early_threshold.has_value() ? early_threshold.value() : 0, + hull_avg.value())); return true; } @@ -714,59 +804,73 @@ bts::orderman::Book _create_book(double p_s, double p_b, SecurityKey key, } OrderOpResult MomentumAlgo::do_before_launch(IBeforeLaunchAlgoServices &serv) { - auto &def = serv.definition(); - me->self_key = serv.order_key(); - api::orderman::OrderDefinition o; - LOG(OrderMan, Info, "MomentumAlgo::store_and_publish_if_complete rec: {}", - utils::pb::to_string(serv.definition())); + try { + auto &def = serv.definition(); + me->self_key = serv.order_key(); + api::orderman::OrderDefinition o; + LOG(OrderMan, Info, "MomentumAlgo::store_and_publish_if_complete rec: {}", + utils::pb::to_string(serv.definition())); - if (def.has_custom_def() && def.custom_def().has_dynamic() && - _convert_params(serv, def.custom_def(), me->algo_params)) { - me->renko_tick_size = serv.security().contract_spec().low_tick(); - me->child_template_buy = _get_template( - serv, SecurityKey(serv.security().id()), api::Side::SIDE_BUY); - me->child_template_sell = _get_template( - serv, SecurityKey(serv.security().id()), api::Side::SIDE_SELL); + if (def.has_custom_def() && def.custom_def().has_dynamic() && + _convert_params(serv, def.custom_def(), me->algo_params)) { + me->renko_tick_size = serv.security().contract_spec().low_tick(); + me->child_template_buy = _get_template( + serv, SecurityKey(serv.security().id()), api::Side::SIDE_BUY); + me->child_template_sell = _get_template( + serv, SecurityKey(serv.security().id()), api::Side::SIDE_SELL); - return {}; + return {}; + } + + // diagnostics + LOG(OrderMan, Info, + "MomentumAlgo::do_before_launch Has custom: {}, has dynamic: {}", + def.has_custom_def(), def.custom_def().has_dynamic()); + return {OrderError::ORDER_ERROR_INVALID_PARAMETER, + std::string("Parameters are not well formed")}; + } catch (...) { + bts_assert(false); } - - // diagnostics - LOG(OrderMan, Info, - "MomentumAlgo::do_before_launch Has custom: {}, has dynamic: {}", - def.has_custom_def(), def.custom_def().has_dynamic()); - return {OrderError::ORDER_ERROR_INVALID_PARAMETER, - std::string("Parameters are not well formed")}; } // initalise all structs and pointers void MomentumAlgo::do_launch(IAlgoServices &algo_services) { - me->algo = &algo_services; // subscrive book and trade, get id from - // id will be id and security id - me->renko = std::make_unique( - Renko(me->renko_tick_size, me->algo_params->renko_ticks)); - me->gandata = - std::make_unique(GanData(me->algo_params->gan_buffer_sz)); - if (me->algo_params->file_read) { - me->sim = std::make_unique( - me->algo_params->start_time, me->algo_params->security_name_str); + try { + me->algo = &algo_services; // subscrive book and trade, get id from + // id will be id and security id + me->renko = std::make_unique( + Renko(me->renko_tick_size, me->algo_params->renko_ticks)); + me->gandata = std::make_unique(GanData( + me->algo_params->upr_gan_buffer_sz, + me->algo_params->lwr_gan_buffer_sz, me->algo_params->hull_avg)); + if (me->algo_params->file_read) { + me->sim = std::make_unique( + me->algo_params->start_time, me->algo_params->security_name_str); + } + if (!me->algo_params->file_read) { + _algo().subscribe_book(me->algo_params->security_key_id); + _algo().subscribe_ticker(me->algo_params->security_key_id); + } + LOG(OrderMan, Info, + "MomentumAlgo::do_launch security_key: {}, file_read: {}, " + "renko_ticks: {}, open_position_on_close: {}, " + "edge_ticks: {}, upr_gan_buffer_sz: {}, lwr_gan_buffer_sz: {}, renko " + "tick size: {}, renko " + "bricks " + "in ticks: {}, ganData->upr_buffersize:{}, " + "ganData->lwr_buffersize:{}", + me->algo_params->security_key_id, me->algo_params->file_read, + me->algo_params->renko_ticks, me->algo_params->orders_quantity, + me->algo_params->edge_ticks_gain_limit, + me->algo_params->upr_gan_buffer_sz, + me->algo_params->lwr_gan_buffer_sz, me->renko->tick_size, + me->renko->brick_size_in_ticks, me->gandata->upr_buffer_sz, + me->gandata->lwr_buffer_sz); + me->algo->subscribe_timer(); + + } catch (...) { + bts_assert(false); } - if (!me->algo_params->file_read) { - _algo().subscribe_book(me->algo_params->security_key_id); - _algo().subscribe_ticker(me->algo_params->security_key_id); - } - LOG(OrderMan, Info, - "MomentumAlgo::do_launch security_key: {}, file_read: {}, " - "renko_ticks: {}, open_position_on_close: {}, " - "edge_ticks: {}, gan_buffer_sz: {}, renko tick size: {}, renko " - "bricks " - "in ticks: {}, ganData->buffersize:{}", - me->algo_params->security_key_id, me->algo_params->file_read, - me->algo_params->renko_ticks, me->algo_params->orders_quantity, - me->algo_params->edge_ticks_gain_limit, me->algo_params->gan_buffer_sz, - me->renko->tick_size, me->renko->brick_size_in_ticks, - me->gandata->buffer_sz); - me->algo->subscribe_timer(); } void MomentumAlgo::do_launch_attached( // not needed right now IAlgoServices &algo_services, OrderKey, ChildState) { @@ -838,12 +942,19 @@ void MomentumAlgo::_early_brick() { auto new_low_brick = me->renko->current_brick->check_bounds(new_low_price); auto new_high_avg = me->gandata->high_average_hyp(new_high_brick); auto new_low_avg = me->gandata->low_average_hyp(new_low_brick); - bool sell_signal = new_low_avg.has_value() - ? new_low_brick.value().low >= new_low_price + bool sell_signal = new_low_avg.has_value() && new_high_avg.has_value() + ? new_high_avg > new_low_avg && + new_low_brick.value().low <= new_low_avg : false; - bool buy_signal = new_high_avg.has_value() - ? new_high_brick.value().high >= new_high_price + bool buy_signal = new_high_avg.has_value() && new_high_avg.has_value() + ? new_high_avg > new_low_avg && + new_high_brick.value().high >= new_high_avg : false; + if (me->algo_params->reverse_logic) { + auto temp = buy_signal; + buy_signal = sell_signal; + sell_signal = temp; + } if (buy_signal || sell_signal) { double n_p = me->curr_price.value(); if (me->curr_pos == 0) { @@ -881,136 +992,147 @@ void MomentumAlgo::_on_brick(Brick &brick, bool is_new_brick) { // brick // only position should open in one signal void MomentumAlgo::_analyze_trade() { - TimeHandler current = - me->algo_params->file_read ? me->sim->time_now : TimeHandler(); - auto is_time = [&, this]() { - if (!me->algo_params->timed_start) { - return true; - } - auto temp = current.get_str(); - if (current > me->algo_params->end_time) { - if (me->algo_params->file_read) { - me->sim->stop = true; - } else if (me->algo_params->timed_start) { - _cxl_and_end(false, "time done"); + try { + TimeHandler current = + me->algo_params->file_read ? me->sim->time_now : TimeHandler(); + auto is_time = [&, this]() { + if (!me->algo_params->timed_start) { + return true; } + auto temp = current.get_str(); + if (current > me->algo_params->end_time) { + if (me->algo_params->file_read) { + me->sim->stop = true; + } else if (me->algo_params->timed_start) { + _cxl_and_end(false, "time done"); + } + } + return current.in_bounds(me->algo_params->start_time, + me->algo_params->end_time); + }; + if (!me->gandata->has_data() || !is_time()) { + if (me->algo_params->log_graph) + LOG(OrderMan, Info, + "MomentumAlgo::{}::type:New_brick, brick_id:{}, " + "brick_lower:{}, " + "brick_higher:{}, avg_low:{}, avg_high:{}, order_id:{}, " + "book_buy:{}, " + "book_sell:{}, c_time:{}, s_time:{}, e_time:{}", + me->self_key.value(), me->renko->current_brick->brick_id, + me->renko->current_brick->edges.low, + me->renko->current_brick->edges.high, 0, 0, me->packet_no, + me->curr_book.ask().front().price(), + me->curr_book.bid().front().price(), current.get_str(), + me->algo_params->start_time.get_str(), + me->algo_params->end_time.get_str()); + return; + } + auto low_avg = me->gandata->low_average().value(); + auto high_avg = me->gandata->high_average().value(); + auto edges = me->renko->current_brick->edges; + bool buy_signal = high_avg > low_avg && edges.high >= high_avg; + bool sell_signal = high_avg > low_avg && edges.low <= low_avg; + if (me->algo_params->reverse_logic) { + auto temp = buy_signal; + buy_signal = sell_signal; + sell_signal = temp; } - return current.in_bounds(me->algo_params->start_time, - me->algo_params->end_time); - }; - if (!me->gandata->has_data() || !is_time()) { if (me->algo_params->log_graph) LOG(OrderMan, Info, - "MomentumAlgo::{}::type:New_brick, brick_id:{}, " - "brick_lower:{}, " + "MomentumAlgo::{}::type:New_brick, brick_id:{}, brick_lower:{}, " "brick_higher:{}, avg_low:{}, avg_high:{}, order_id:{}, " "book_buy:{}, " "book_sell:{}, c_time:{}, s_time:{}, e_time:{}", me->self_key.value(), me->renko->current_brick->brick_id, - me->renko->current_brick->edges.low, - me->renko->current_brick->edges.high, 0, 0, me->packet_no, + edges.low, edges.high, low_avg, high_avg, me->packet_no, me->curr_book.ask().front().price(), me->curr_book.bid().front().price(), current.get_str(), me->algo_params->start_time.get_str(), me->algo_params->end_time.get_str()); - return; - } - auto low_avg = me->gandata->low_average().value(); - auto high_avg = me->gandata->high_average().value(); - auto edges = me->renko->current_brick->edges; - bool buy_signal = edges.high >= high_avg; - bool sell_signal = edges.low <= low_avg; - if (me->algo_params->reverse_logic) { - auto temp = buy_signal; - buy_signal = sell_signal; - sell_signal = temp; - } - if (me->algo_params->log_graph) - LOG(OrderMan, Info, - "MomentumAlgo::{}::type:New_brick, brick_id:{}, brick_lower:{}, " - "brick_higher:{}, avg_low:{}, avg_high:{}, order_id:{}, " - "book_buy:{}, " - "book_sell:{}, c_time:{}, s_time:{}, e_time:{}", - me->self_key.value(), me->renko->current_brick->brick_id, edges.low, - edges.high, low_avg, high_avg, me->packet_no, - me->curr_book.ask().front().price(), - me->curr_book.bid().front().price(), current.get_str(), - me->algo_params->start_time.get_str(), - me->algo_params->end_time.get_str()); - if (me->first_signal && (buy_signal || sell_signal)) { - me->first_signal = false; - me->prev_signal = buy_signal ? Signal::BUY : Signal::SELL; - } - // enter position - if (me->curr_pos == 0) { - if (sell_signal && me->prev_signal != Signal::SELL) { - _fire_orders(1, api::SIDE_SELL, "signal"); + if (me->first_signal && (buy_signal || sell_signal)) { + me->first_signal = false; + me->prev_signal = buy_signal ? Signal::BUY : Signal::SELL; + } + // enter position + if (me->curr_pos == 0) { + if (sell_signal && me->prev_signal != Signal::SELL) { + _fire_orders(1, api::SIDE_SELL, "signal"); + me->prev_signal = Signal::SELL; + } else if (buy_signal && me->prev_signal != Signal::BUY) { + _fire_orders(1, api::SIDE_BUY, "signal"); + me->prev_signal = Signal::BUY; + } + // close position only enters if mode is siganl to signal and sell/buy + // signal is true + } else if (me->curr_pos > 0 && sell_signal) { + _fire_orders(me->algo_params->orders_quantity, api::SIDE_SELL, + "signal"); me->prev_signal = Signal::SELL; - } else if (buy_signal && me->prev_signal != Signal::BUY) { - _fire_orders(1, api::SIDE_BUY, "signal"); + } else if (me->curr_pos < 0 && buy_signal) { + _fire_orders(me->algo_params->orders_quantity, api::SIDE_BUY, + "signal"); me->prev_signal = Signal::BUY; } - // close position only enters if mode is siganl to signal and sell/buy - // signal is true - } else if (me->curr_pos > 0 && sell_signal) { - _fire_orders(me->algo_params->orders_quantity, api::SIDE_SELL, "signal"); - me->prev_signal = Signal::SELL; - } else if (me->curr_pos < 0 && buy_signal) { - _fire_orders(me->algo_params->orders_quantity, api::SIDE_BUY, "signal"); - me->prev_signal = Signal::BUY; + } catch (...) { + bts_assert(false); } } void MomentumAlgo::report_state(bool to_gui = true) { - auto &m = *(me->out_state.mutable_custom_state()); - bool update_needed = false; - size_t index = 0; - auto to_s = [](auto v) { return std::to_string(v); }; - auto update_val = [&](auto &entry, auto value, bool update = false) { - if (value.has_value() && entry.as_string() != to_s(value.value())) { - entry.set_as_string(to_s(value.value())); - update_needed = update_needed || (true && update); - } else if (!value.has_value()) { - entry.set_as_string("None"); + try { + auto &m = *(me->out_state.mutable_custom_state()); + bool update_needed = false; + size_t index = 0; + auto to_s = [](auto v) { return std::to_string(v); }; + auto update_val = [&](auto &entry, auto value, bool update = false) { + if (value.has_value() && entry.as_string() != to_s(value.value())) { + entry.set_as_string(to_s(value.value())); + update_needed = update_needed || (true && update); + } else if (!value.has_value()) { + entry.set_as_string("None"); + } + }; + update_val(m["00 Last Price"], me->curr_price); + update_val(m["01 Position"], me->curr_pos); + update_val(m["02 P&L"], me->p_l, true); + update_val(m["03 Brick count"], + std::optional(me->renko->n_bricks_generated())); + update_val(m["10 Holding Price"], me->current_holding); + update_val(m["20 Last Order Price"], me->last_order_price); + update_val(m["30 Lower Brick"], me->renko->get_low(), true); + update_val(m["31 Upper Brick"], me->renko->get_high()); + update_val(m["40 Lower Average"], me->gandata->low_average()); + update_val(m["41 Upper Average"], me->gandata->high_average()); + update_val(m["50 + Signals"], me->pos_signals); + update_val(m["51 - Signals"], me->neg_signals); + update_val(m["60 Front Runners"], me->front_runners); + + for (auto pair : me->slippage_buffer) { + m["9" + std::to_string(index++) + ": base, actual"].set_as_string( + std::to_string(pair.first) + ", " + std::to_string(pair.second)); } - }; - update_val(m["00 Last Price"], me->curr_price); - update_val(m["01 Position"], me->curr_pos); - update_val(m["02 P&L"], me->p_l, true); - update_val(m["03 Brick count"], - std::optional(me->renko->n_bricks_generated())); - update_val(m["10 Holding Price"], me->current_holding); - update_val(m["20 Last Order Price"], me->last_order_price); - update_val(m["30 Lower Brick"], me->renko->get_low(), true); - update_val(m["31 Upper Brick"], me->renko->get_high()); - update_val(m["40 Lower Average"], me->gandata->low_average()); - update_val(m["41 Upper Average"], me->gandata->high_average()); - update_val(m["50 + Signals"], me->pos_signals); - update_val(m["51 - Signals"], me->neg_signals); - update_val(m["60 Front Runners"], me->front_runners); - for (auto pair : me->slippage_buffer) { - m["9" + std::to_string(index++) + ": base, actual"].set_as_string( - std::to_string(pair.first) + ", " + std::to_string(pair.second)); - } - - if (update_needed && to_gui) { - _algo().update_custom_state(me->out_state); - } else if (to_gui == false) { - LOG(OrderMan, Info, - "MomentumAlgo::{}::type:result, {}, Last_Price:{}, Position:{}, " - "P&L:{}, Brick_Count:{}, Holding_Price:{}, Last_order_price:{}, " - "Lower_Brick:{}, Upper_Brick:{}, Lower_Average:{}, " - "Upper_Average:{}, " - "pos_signals:{}, neg_signals:{}", - me->self_key, me->algo_params->print(), - m["00 Last Price"].as_string(), m["01 Position"].as_string(), - m["02 P&L"].as_string(), m["03 Brick count"].as_string(), - m["10 Holding Price"].as_string(), - m["20 Last Order Price"].as_string(), - m["30 Lower Brick "].as_string(), m["31 Upper Brick"].as_string(), - m["40 Lower Average"].as_string(), m["41 Upper Average"].as_string(), - m["50 + Signals"].as_string(), m["51 - Signals"].as_string()); - _algo().update_custom_state(me->out_state); + if (update_needed && to_gui) { + _algo().update_custom_state(me->out_state); + } else if (to_gui == false) { + LOG(OrderMan, Info, + "MomentumAlgo::{}::type:result, {}, Last_Price:{}, Position:{}, " + "P&L:{}, Brick_Count:{}, Holding_Price:{}, Last_order_price:{}, " + "Lower_Brick:{}, Upper_Brick:{}, Lower_Average:{}, " + "Upper_Average:{}, " + "pos_signals:{}, neg_signals:{}", + me->self_key, me->algo_params->print(), + m["00 Last Price"].as_string(), m["01 Position"].as_string(), + m["02 P&L"].as_string(), m["03 Brick count"].as_string(), + m["10 Holding Price"].as_string(), + m["20 Last Order Price"].as_string(), + m["30 Lower Brick "].as_string(), m["31 Upper Brick"].as_string(), + m["40 Lower Average"].as_string(), + m["41 Upper Average"].as_string(), m["50 + Signals"].as_string(), + m["51 - Signals"].as_string()); + _algo().update_custom_state(me->out_state); + } + } catch (...) { + bts_assert(false); } } // namespace orderman @@ -1025,133 +1147,159 @@ void MomentumAlgo::do_update( void MomentumAlgo::update_pnl(double fill_price, api::Side side, unsigned int key, unsigned int count) { - me->last_order_price = fill_price; - bool is_buy = side == api::SIDE_BUY; - if (is_buy) { - me->actual_pos += 1; - if (!me->current_holding.has_value()) - me->current_holding = 0; - me->current_holding.value() -= fill_price; - } else { - me->actual_pos -= 1; - if (!me->current_holding.has_value()) - me->current_holding = 0; - me->current_holding.value() += fill_price; - } - if (me->actual_pos == 0) { - me->p_l = me->p_l.value() + - me->current_holding.value() * me->algo_params->cash_per_point; - if (me->current_holding.value() < 0) { - me->neg_signals = me->neg_signals.value() + 1; + try { + me->last_order_price = fill_price; + bool is_buy = side == api::SIDE_BUY; + if (is_buy) { + me->actual_pos += 1; + if (!me->current_holding.has_value()) + me->current_holding = 0; + me->current_holding.value() -= fill_price; } else { - me->pos_signals = me->pos_signals.value() + 1; + me->actual_pos -= 1; + if (!me->current_holding.has_value()) + me->current_holding = 0; + me->current_holding.value() += fill_price; } - me->current_holding = std::nullopt; - TimeHandler current = - me->algo_params->file_read ? me->sim->time_now : TimeHandler(); - if (me->algo_params->log_graph) - LOG(OrderMan, Info, - "MomentumAlgo::{}::type:one_child_change, order_key:{}, " - "brick_id:{}, " - "price:{}, " - "count:{}, p&l:{}, current_holding:{}, c_time:{}, s_time:{}, " - "e_time:{}", - me->self_key.value(), key, me->renko->current_brick->brick_id, - fill_price, count, me->p_l.value(), - me->current_holding.has_value() ? me->current_holding.value() : 0, - current.get_str(), me->algo_params->start_time.get_str(), - me->algo_params->end_time.get_str()); + if (me->actual_pos == 0) { + me->p_l = me->p_l.value() + me->current_holding.value() * + me->algo_params->cash_per_point; + if (me->current_holding.value() < 0) { + me->neg_signals = me->neg_signals.value() + 1; + } else { + me->pos_signals = me->pos_signals.value() + 1; + } + me->current_holding = std::nullopt; + TimeHandler current = + me->algo_params->file_read ? me->sim->time_now : TimeHandler(); + if (me->algo_params->log_graph) + LOG(OrderMan, Info, + "MomentumAlgo::{}::type:one_child_change, order_key:{}, " + "brick_id:{}, " + "price:{}, " + "count:{}, p&l:{}, current_holding:{}, c_time:{}, s_time:{}, " + "e_time:{}", + me->self_key.value(), key, me->renko->current_brick->brick_id, + fill_price, count, me->p_l.value(), + me->current_holding.has_value() ? me->current_holding.value() + : 0, + current.get_str(), me->algo_params->start_time.get_str(), + me->algo_params->end_time.get_str()); + } + } catch (...) { + bts_assert(false); } } void MomentumAlgo::on_child_change(OrderKey key, const ChildState &state) { - if (key == me->child_key and state.status == ChildStatus::CANCELED) { - _cxl_and_end(true, "market order cancelled stopping algo"); - } else { - if (me->orders_sent.find(key) != me->orders_sent.end() && - state.status == bts::orderman::ChildStatus::COMPLETED) { - auto order_details = me->orders_sent[key]; - double fill_price = state.last_price.value(); - update_pnl(fill_price, order_details.side, key.value(), - state.quantity.value()); - me->slippage_buffer.push_back( - std::pair(order_details.expected_price, state.last_price.value())); - me->orders_sent.erase(key); + try { + if (key == me->child_key and state.status == ChildStatus::CANCELED) { + _cxl_and_end(true, "market order cancelled stopping algo"); + } else { + if (me->orders_sent.find(key) != me->orders_sent.end() && + state.status == bts::orderman::ChildStatus::COMPLETED) { + auto order_details = me->orders_sent[key]; + double fill_price = state.last_price.value(); + update_pnl(fill_price, order_details.side, key.value(), + state.quantity.value()); + me->slippage_buffer.push_back(std::pair( + order_details.expected_price, state.last_price.value())); + me->orders_sent.erase(key); + } + // LOG(OrderMan, Info, + // "MomentumAlgo::on_child_change key:{} child_key:{} status:{} " + // "total_fills:{} last_price:{}", + // _algo().order_key(), key, static_cast(state.status), + // state.total_fills, state.last_price); } - // LOG(OrderMan, Info, - // "MomentumAlgo::on_child_change key:{} child_key:{} status:{} " - // "total_fills:{} last_price:{}", - // _algo().order_key(), key, static_cast(state.status), - // state.total_fills, state.last_price); + } catch (...) { + bts_assert(false); } } void MomentumAlgo::on_status(SecurityKey key, co2::TradingStatus s) { - LOG(OrderMan, Info, "MomentumAlgo::on_status key: {} status: {}", key, - static_cast(s)); + try { + LOG(OrderMan, Info, "MomentumAlgo::on_status key: {} status: {}", key, + static_cast(s)); + } catch (...) { + bts_assert(false); + } } void MomentumAlgo::run_sim() { - me->sim->run_sim(([&, this](double p) { _on_data(p); }), - ([&, this](double sell, double buy) { - auto book = _create_book( - sell, buy, me->algo_params->security_key_id); - on_book(me->algo_params->security_key_id, book); - })); + try { + me->sim->run_sim(([&, this](double p) { _on_data(p); }), + ([&, this](double sell, double buy) { + auto book = _create_book( + sell, buy, me->algo_params->security_key_id); + on_book(me->algo_params->security_key_id, book); + })); + } catch (...) { + bts_assert(false); + } } // updates states every 500 ms, state visible if algo tree checked on front // end void MomentumAlgo::on_timer() { - if (bts::datetime::usecs_since(me->last_periodic_opp_check_time) >= - me->opp_check_period_usecs) { - if (me->algo_params->file_read) { - me->algo->unsubscribe_timer(); - run_sim(); - report_state(me->algo_params->log_graph); - _cxl_and_end(false, "sim done"); - } else { - me->last_periodic_opp_check_time = bts::datetime::now(); - report_state(); + try { + if (bts::datetime::usecs_since(me->last_periodic_opp_check_time) >= + me->opp_check_period_usecs) { + if (me->algo_params->file_read) { + me->algo->unsubscribe_timer(); + run_sim(); + report_state(me->algo_params->log_graph); + _cxl_and_end(false, "sim done"); + } else { + me->last_periodic_opp_check_time = bts::datetime::now(); + report_state(); + } } + } catch (...) { + bts_assert(false); } } // fires 'count' market orders for 'side' void MomentumAlgo::_fire_orders(size_t count, api::Side side, std::string source = "signal") { - auto remaining = count - 1; - count = 1; - bool is_buy = side == api::SIDE_BUY; - ChildTemplate &rv = - (is_buy) ? *me->child_template_buy : *me->child_template_sell; - me->curr_pos = me->curr_pos.value() + (is_buy ? 1 : -1) * (int)(count); - if (me->curr_pos.value() == 0) { - me->last_order_price = std::nullopt; + try { + auto remaining = count - 1; + count = 1; + bool is_buy = side == api::SIDE_BUY; + ChildTemplate &rv = + (is_buy) ? *me->child_template_buy : *me->child_template_sell; + me->curr_pos = me->curr_pos.value() + (is_buy ? 1 : -1) * (int)(count); + if (me->curr_pos.value() == 0) { + me->last_order_price = std::nullopt; + } + auto price = (is_buy) ? me->curr_book.ask().front().price() + : me->curr_book.bid().front().price(); + // me->last_order_price = price; + if (!me->algo_params->file_read) { + me->child_key = + _algo().launch_child(rv, Price(price), bts::Quantity(count)); + me->orders_sent[me->child_key] = {side, price, 0, me->child_key}; + } else { + me->child_key = bts::orderman::OrderKey(0); + } + if (me->algo_params->log_graph) + LOG(OrderMan, Info, + "MomentumAlgo::{}::type:_fire_orders, order_key:{}, brick_id:{}, " + "price:{}, " + "count:{}, BUY?:{}, source:{}, pos:{}, order_id:{}, book_bu " + "y:{}, " + "book_sell:{}", + me->self_key.value(), me->child_key.value(), + me->renko->current_brick->brick_id, price, count, is_buy, source, + me->curr_pos.value(), me->packet_no, + me->curr_book.ask().front().price(), + me->curr_book.bid().front().price()); + if (me->algo_params->file_read) { + update_pnl(price, side, 0, count); + } + if (remaining > 0) + _fire_orders(remaining, side, source); + } catch (...) { + bts_assert(false); } - auto price = (is_buy) ? me->curr_book.ask().front().price() - : me->curr_book.bid().front().price(); - // me->last_order_price = price; - if (!me->algo_params->file_read) { - me->child_key = - _algo().launch_child(rv, Price(price), bts::Quantity(count)); - me->orders_sent[me->child_key] = {side, price, 0, me->child_key}; - } else { - me->child_key = bts::orderman::OrderKey(0); - } - if (me->algo_params->log_graph) - LOG(OrderMan, Info, - "MomentumAlgo::{}::type:_fire_orders, order_key:{}, brick_id:{}, " - "price:{}, " - "count:{}, BUY?:{}, source:{}, pos:{}, order_id:{}, book_bu y:{}, " - "book_sell:{}", - me->self_key.value(), me->child_key.value(), - me->renko->current_brick->brick_id, price, count, is_buy, source, - me->curr_pos.value(), me->packet_no, - me->curr_book.ask().front().price(), - me->curr_book.bid().front().price()); - if (me->algo_params->file_read) { - update_pnl(price, side, 0, count); - } - if (remaining > 0) - _fire_orders(remaining, side, source); } void MomentumAlgo::_cxl_and_end(bool is_error, const std::string &err_msg) { diff --git a/src/lib/orderman/orders/algo/algo_orders/MomentumRecorder.cpp b/src/lib/orderman/orders/algo/algo_orders/MomentumRecorder.cpp index 2a9e46e36..060c1b061 100644 --- a/src/lib/orderman/orders/algo/algo_orders/MomentumRecorder.cpp +++ b/src/lib/orderman/orders/algo/algo_orders/MomentumRecorder.cpp @@ -48,47 +48,59 @@ struct MomentumRecorderParams { std::set security_name_strs; std::set security_keys; std::string print() { - std::string str = ""; - for (auto s : security_name_strs) { - str = str + " " + s; + try { + std::string str = ""; + for (auto s : security_name_strs) { + str = str + " " + s; + } + for (auto s : security_keys) { + str = str + " " + std::to_string(s.value()); + } + return str; + } catch (...) { + bts_assert(false); } - for (auto s : security_keys) { - str = str + " " + std::to_string(s.value()); - } - return str; } MomentumRecorderParams(std::string security_names, std::string prefix) { - std::stringstream ss(security_names); - while (ss.good()) { - string substr; - getline(ss, substr, ','); - substr.erase( - substr.begin(), - std::find_if(substr.begin(), substr.end(), - std::bind1st(std::not_equal_to(), ' '))); - security_name_strs.insert(prefix + substr); + try { + std::stringstream ss(security_names); + while (ss.good()) { + string substr; + getline(ss, substr, ','); + substr.erase(substr.begin(), + std::find_if(substr.begin(), substr.end(), + std::bind(std::not_equal_to(), ' ', + std::placeholders::_1))); + security_name_strs.insert(prefix + substr); + } + } catch (...) { + bts_assert(false); } } }; bool _convert_params( // IBeforeLaunchAlgoServices &serv, const CustomOrderDefinition &cod, std::unique_ptr &out_p) { - const DynamicOrderDefinition &def = cod.dynamic(); - const auto ¶ms = def.order_params(); - auto list = get_if(params, "list of securities (CSVs)"); - auto prefix = get_if(params, "Prefix"); - if (!list.has_value() || !prefix.has_value()) { - LOG(OrderMan, Info, - "MomentumRecorder::convert_params failed list:{}, prefix:{}", - list.has_value(), prefix.has_value()); - return false; - } - // serv.security().glbx().security_desc() - // namespace orderman - out_p = std::make_unique( - MomentumRecorderParams(list.value(), prefix.value())); + try { + const DynamicOrderDefinition &def = cod.dynamic(); + const auto ¶ms = def.order_params(); + auto list = get_if(params, "list of securities (CSVs)"); + auto prefix = get_if(params, "Prefix"); + if (!list.has_value() || !prefix.has_value()) { + LOG(OrderMan, Info, + "MomentumRecorder::convert_params failed list:{}, prefix:{}", + list.has_value(), prefix.has_value()); + return false; + } + // serv.security().glbx().security_desc() + // namespace orderman + out_p = std::make_unique( + MomentumRecorderParams(list.value(), prefix.value())); - return true; + return true; + } catch (...) { + bts_assert(false); + } } // namespace orderman struct MomentumRecorder::PImpl { IAlgoServices *algo = nullptr; @@ -109,53 +121,65 @@ IAlgoServices &MomentumRecorder::_algo() const { return *me->algo; } OrderOpResult MomentumRecorder::do_before_launch(IBeforeLaunchAlgoServices &serv) { - auto &def = serv.definition(); - me->self_key = serv.order_key(); - // serv.known_securities().front(). + try { + auto &def = serv.definition(); + me->self_key = serv.order_key(); + // serv.known_securities().front(). - LOG(OrderMan, Info, - "MomentumRecorder::store_and_publish_if_complete rec: {}", - utils::pb::to_string(serv.definition())); + LOG(OrderMan, Info, + "MomentumRecorder::store_and_publish_if_complete rec: {}", + utils::pb::to_string(serv.definition())); - if (def.has_custom_def() && def.custom_def().has_dynamic() && - _convert_params(def.custom_def(), me->algo_params)) { - for (auto v : serv.known_securities()) { - if (me->algo_params->security_name_strs.find( - v->glbx().security_desc()) != - me->algo_params->security_name_strs.end()) { - auto id = SecurityKey(v->id()); - me->algo_params->security_keys.insert(id); - me->book_no[id] = 0; - me->packet_no[id] = 0; - me->names[id] = v->glbx().security_desc(); + if (def.has_custom_def() && def.custom_def().has_dynamic() && + _convert_params(def.custom_def(), me->algo_params)) { + for (auto v : serv.known_securities()) { + if (me->algo_params->security_name_strs.find( + v->glbx().security_desc()) != + me->algo_params->security_name_strs.end()) { + auto id = SecurityKey(v->id()); + me->algo_params->security_keys.insert(id); + me->book_no[id] = 0; + me->packet_no[id] = 0; + me->names[id] = v->glbx().security_desc(); + } } + return {}; } - return {}; + // diagnostics + LOG(OrderMan, Info, + "MomentumRecorder::do_before_launch Has custom: {}, has dynamic: {}", + def.has_custom_def(), def.custom_def().has_dynamic()); + return {OrderError::ORDER_ERROR_INVALID_PARAMETER, + std::string("Parameters are not well formed")}; + } catch (...) { + bts_assert(false); } - // diagnostics - LOG(OrderMan, Info, - "MomentumRecorder::do_before_launch Has custom: {}, has dynamic: {}", - def.has_custom_def(), def.custom_def().has_dynamic()); - return {OrderError::ORDER_ERROR_INVALID_PARAMETER, - std::string("Parameters are not well formed")}; } // initalise all structs and pointers void MomentumRecorder::do_launch(IAlgoServices &algo_services) { - me->algo = &algo_services; // subscrive book and trade, get id from - // id will be id and security id - for (auto key : me->algo_params->security_keys) { - _algo().subscribe_book(key); - _algo().subscribe_ticker(key); + try { + me->algo = &algo_services; // subscrive book and trade, get id from + // id will be id and security id + for (auto key : me->algo_params->security_keys) { + _algo().subscribe_book(key); + _algo().subscribe_ticker(key); + } + LOG(OrderMan, Info, "MomentumRecorder::do_launch security_keys: {}", + me->algo_params->print()); + } catch (...) { + bts_assert(false); } - LOG(OrderMan, Info, "MomentumRecorder::do_launch security_keys: {}", - me->algo_params->print()); } void MomentumRecorder::do_launch_attached( // not needed right now IAlgoServices &algo_services, OrderKey, ChildState) { - me->algo = &algo_services; - _cxl_and_end(true, - "Momentum Recorder can not be attached to working orders"); + try { + me->algo = &algo_services; + _cxl_and_end(true, + "Momentum Recorder can not be attached to working orders"); + } catch (...) { + bts_assert(false); + } } // save current book for future use void MomentumRecorder::on_book(SecurityKey key, Book const &book) { @@ -169,25 +193,29 @@ void MomentumRecorder::on_book(SecurityKey key, Book const &book) { // sends all transactions to on data void MomentumRecorder::on_ticker(SecurityKey key, TradeVector const &trade) { + try { - if (me->algo_params->security_keys.find(key) == - me->algo_params->security_keys.end()) { - return; - } - for (const auto &fill : trade) { - api::orderman::MomentumAlgoLog m; - m.set_price(fill.price.value()); - m.set_quantity(fill.quantity.value()); - m.set_security_name(me->names[key]); - m.set_bid_top_quantity(me->curr_book[key].bid().front().size()); - m.set_bid_top_price(me->curr_book[key].bid().front().price()); - m.set_ask_top_quantity(me->curr_book[key].ask().front().size()); - m.set_ask_top_price(me->curr_book[key].ask().front().price()); - std::string s; - me->printer.PrintToString(m, &s); - LOG(OrderMan, Info, "MomentumRecorder::FILL:`{}", s); + if (me->algo_params->security_keys.find(key) == + me->algo_params->security_keys.end()) { + return; + } + for (const auto &fill : trade) { + api::orderman::MomentumAlgoLog m; + m.set_price(fill.price.value()); + m.set_quantity(fill.quantity.value()); + m.set_security_name(me->names[key]); + m.set_bid_top_quantity(me->curr_book[key].bid().front().size()); + m.set_bid_top_price(me->curr_book[key].bid().front().price()); + m.set_ask_top_quantity(me->curr_book[key].ask().front().size()); + m.set_ask_top_price(me->curr_book[key].ask().front().price()); + std::string s; + me->printer.PrintToString(m, &s); + LOG(OrderMan, Info, "MomentumRecorder::FILL:`{}", s); - me->packet_no[key]++; + me->packet_no[key]++; + } + } catch (...) { + bts_assert(false); } } @@ -204,8 +232,12 @@ void MomentumRecorder::do_update( void MomentumRecorder::on_child_change(OrderKey, const ChildState &) {} void MomentumRecorder::on_status(SecurityKey key, co2::TradingStatus s) { - LOG(OrderMan, Info, "MomentumRecorder::on_status key: {} status: {}", key, - static_cast(s)); + try { + LOG(OrderMan, Info, "MomentumRecorder::on_status key: {} status: {}", key, + static_cast(s)); + } catch (...) { + bts_assert(false); + } } // updates states every 500 ms, state visible if algo tree checked on front diff --git a/src/lib/orderman/orders/algo/algo_orders/PositionFlattenerAlgo.cpp b/src/lib/orderman/orders/algo/algo_orders/PositionFlattenerAlgo.cpp new file mode 100644 index 000000000..b9570546b --- /dev/null +++ b/src/lib/orderman/orders/algo/algo_orders/PositionFlattenerAlgo.cpp @@ -0,0 +1,400 @@ +#include "lib/orderman/orders/algo/algo_orders/PositionFlattenerAlgo.h" +#include "lib/api/services/OrderService.pb.h" +#include "lib/config/config.h" +#include "lib/config/protos/toggles.pb.h" +#include "lib/domain_model/Security.h" +#include "lib/domain_model/Security.pb.h" +#include "lib/domain_model/SecurityKey.h" +#include "lib/domain_model/common.h" +#include "lib/logging/logging.h" +#include "lib/md/IntPrice.h" +#include "lib/md/PriceSize.h" +#include "lib/orderman/actors/SODPosition.h" +#include "lib/orderman/order_factory/IOrderFactory.h" +#include "lib/orderman/orderman_utils/Book.h" +#include "lib/orderman/orderman_utils/orderman_common.h" +#include "lib/orderman/orderman_utils/orderman_utils.h" +#include "lib/orderman/orders/algo/DynamicHelpers.h" +#include "lib/orderman/orders/algo/IAlgoOrder.h" +#include "lib/orderman/orders/algo/IAlgoServices.h" +#include "lib/orderman/orders/algo/algo_orders/MomentumAlgo.h" +#include "lib/os/os.h" +#include "lib/utils/PBUtils.h" +#include "lib/utils/bts_assert.h" +#include "lib/utils/bts_chrono.h" +#include "lib/utils/datetime.h" +#include +#include +#include +#include +#include +#include +// #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace bts { +namespace orderman { + +using namespace api::orderman; +using namespace google::protobuf; + +enum class PositionFlattenerAlgo::AlgoStatus { + PAUSED, + WORKING, + WAITING_FOR_CXL_ACK, + WAITING_FOR_FLATTEN, + CANCELLED +}; +enum class PositionFlattenerAlgo::ExitPath { CANCEL, ERR, COMPLETE }; +ChildTemplate *_get_Terimnator_child_template(IBeforeLaunchAlgoServices &serv, + const CustomOrderDefinition &cod, + SecurityKey key, api::Side side) { + OrderDefinition rv = serv.definition(); + rv.set_security_key(key.value()); + rv.set_side(side); + rv.mutable_custom_def()->CopyFrom(cod); + return &(serv.make_child_template(rv)); +} +struct PositionFlattenerAlgoLegData { + const SecurityKey sec_key; + ChildTemplate *order_template = nullptr; + OrderKey order_key; + ChildState order_state; + ChildStatus status; + PositionFlattenerAlgoLegData(SecurityKey sec_key_a, + ChildTemplate *order_template_a) + : sec_key(sec_key_a), order_template(order_template_a), + order_key(null_order_key()), order_state(), status() {} +}; +struct PositionFlattenerAlgoParams { + SecurityKey security_key_id; + std::string security_name_str; + std::vector legs; + bool dont_flatten; + PositionFlattenerAlgoParams(SecurityKey key, std::string sec_name, + std::vector lgs, + bool dont_flatten) + : security_key_id(key), security_name_str(sec_name), legs(lgs), + dont_flatten(dont_flatten) {} +}; +struct PositionFlattenerAlgo::PImpl { + IAlgoServices *algo; + std::vector legs; + AlgoStatus status = AlgoStatus::PAUSED; + std::unique_ptr algo_params; + OrderKey flatten_child_key = null_order_key(); + AccountID acc_id; + int order_distance = 0; + // std::unordered_set flatten_child_keys_sim; + ChildTemplate *flatten_template_buy = nullptr; + ChildTemplate *flatten_template_sell = nullptr; + double pos = 0; + bool is_sim; +}; +bool _convert_params(IBeforeLaunchAlgoServices &serv, + const CustomOrderDefinition &cod, + std::unique_ptr &out_p) { + LOG(OrderMan, Diag, "PositionFlattenerAlgo::_convert_params"); + const DynamicOrderDefinition &def = cod.dynamic(); + const auto ¶ms = def.order_params(); + std::vector prs; + auto sec_key = SecurityKey(serv.security().id()); + size_t n_child_ords = 5; + for (size_t i = 0; i < n_child_ords; i++) { + auto idx = std::to_string(i + 1); + auto order = get_if(params, "Order " + idx); + if (!order.has_value()) { + continue; + } + ChildTemplate *child_template = _get_Terimnator_child_template( + serv, order.value(), sec_key, api::Side::SIDE_BUY); + prs.push_back(PositionFlattenerAlgoLegData(sec_key, child_template)); + } + + auto flatten = get_if(params, "Dont Flatten"); + if (!flatten.has_value()) { + return false; + } + out_p = std::make_unique( + PositionFlattenerAlgoParams(sec_key, + serv.security().glbx().security_desc(), prs, + flatten.value())); + + return true; +} +PositionFlattenerAlgo::PositionFlattenerAlgo() : me(new PImpl()) {} +PositionFlattenerAlgo::~PositionFlattenerAlgo() {} +IAlgoServices &PositionFlattenerAlgo::algo() const { return *me->algo; } + +ChildTemplate *_get_limit_template(IBeforeLaunchAlgoServices &serv, + SecurityKey key, api::Side side) { + OrderDefinition rv = serv.definition(); + rv.set_security_key(key.value()); + rv.set_side(side); + rv.mutable_custom_def()->mutable_limit()->MergeFrom( + api::orderman::LimitOrderDefinition()); + return &(serv.make_child_template(rv)); +} +ChildTemplate *_get_market_template(IBeforeLaunchAlgoServices &serv, + SecurityKey key, api::Side side) { + OrderDefinition rv = serv.definition(); + rv.set_security_key(key.value()); + rv.set_side(side); + rv.mutable_custom_def()->mutable_market()->MergeFrom( + api::orderman::MarketOrderDefinition()); + return &(serv.make_child_template(rv)); +} +OrderOpResult +PositionFlattenerAlgo::do_before_launch(IBeforeLaunchAlgoServices &serv) { + LOG(OrderMan, Diag, "PositionFlattenerAlgo::do_before_launch"); + OrderDefinition def = serv.definition(); + + if (def.has_custom_def() && def.custom_def().has_dynamic() && + _convert_params(serv, def.custom_def(), me->algo_params)) { + me->acc_id = AccountID(def.account_id()); + me->is_sim = + config::get() + .enabled(); + me->order_distance = + config::get() + .quantity(); + me->legs = + std::vector(me->algo_params->legs); + me->flatten_template_buy = + me->is_sim + ? _get_limit_template(serv, SecurityKey(serv.security().id()), + api::Side::SIDE_BUY) + : _get_market_template(serv, SecurityKey(serv.security().id()), + api::Side::SIDE_BUY); + me->flatten_template_sell = + me->is_sim + ? _get_limit_template(serv, SecurityKey(serv.security().id()), + api::Side::SIDE_SELL) + : _get_market_template(serv, SecurityKey(serv.security().id()), + api::Side::SIDE_SELL); + return {}; + } + + return {OrderError::ORDER_ERROR_INVALID_PARAMETER, + std::string("Parameters are not well formed")}; +} +void PositionFlattenerAlgo::on_position(PositionUpdate const &pos) { + if (pos.security->id() != me->algo->security().id() || + pos.account_id != me->acc_id) { + return; //|| pos.account_id != me->algo-> add this + } + me->pos = + double(pos.long_quantity.value()) - double(pos.short_quantity.value()); + LOG(OrderMan, Diag, + "PositionFlattenerAlgo::on_cancel state {}, pos: {}, long: {}, short: " + "{}", + me->status, me->pos, pos.long_quantity.value(), + pos.short_quantity.value()); +} +void PositionFlattenerAlgo::do_launch(IAlgoServices &algo) { + LOG(OrderMan, Diag, "PositionFlattenerAlgo::do_launch"); + me->algo = &algo; + me->status = PositionFlattenerAlgo::AlgoStatus::WORKING; + // LUANCH CHILD ORDERS + me->algo->subscribe_position(); + for (size_t i = 0; i < me->legs.size(); i++) { + me->legs[i].order_key = me->algo->launch_child( + *me->legs[i].order_template, me->algo->price(), bts::Quantity(1)); + } +} + +void PositionFlattenerAlgo::do_launch_attached(IAlgoServices &algo, OrderKey, + ChildState) { + me->algo = &algo; + _cxl_and_end(true, + "PositionFlattener Algo can not be attached to working orders"); +} + +void PositionFlattenerAlgo::do_update(api::orderman::Update const &update) { + if (!update.has_custom() || !update.custom().has_dynamic()) { + return; + } + const DynamicOrderDefinition &def = update.custom().dynamic(); + const auto ¶ms = def.order_params(); + auto dont_flatten = get_if(params, "Dont Flatten"); + if (!dont_flatten.has_value()) { + return; + } + me->algo_params->dont_flatten = dont_flatten.value(); + LOG(OrderMan, Diag, + "PositionFlattenerAlgo order {} receiving update: {} UPDATES NOT " + "ALLOWED", + algo().order_key().value(), utils::pb::to_string(update)); +} +std::optional +find_leg_index(std::vector legs, OrderKey k) { + for (size_t index = 0; index < legs.size(); index++) { + + if (legs[index].order_key == k) { + return index; + } + } + return std::nullopt; +} +void PositionFlattenerAlgo::on_child_change(OrderKey k, + ChildState const &state) { + if (me->flatten_child_key == k) { + // bts_assert(state.status != ChildStatus::CANCELED); + if (state.status == ChildStatus::COMPLETED) { + me->status = PositionFlattenerAlgo::AlgoStatus::PAUSED; + _cxl_and_end(false, "POSITION FLATTENED"); + return; + } + } + auto maybe_leg_index = find_leg_index(me->legs, k); + if (!maybe_leg_index.has_value()) { + return; + } + auto leg_index = maybe_leg_index.value(); + me->legs[leg_index].status = state.status; + switch (me->status) { + case PositionFlattenerAlgo::AlgoStatus::WORKING: + case PositionFlattenerAlgo::AlgoStatus::WAITING_FOR_FLATTEN: + break; + case PositionFlattenerAlgo::AlgoStatus::WAITING_FOR_CXL_ACK: + if (state.status != ChildStatus::WORKING) { + _cxl_and_end(false, ""); + } + break; + case PositionFlattenerAlgo::AlgoStatus::CANCELLED: + case PositionFlattenerAlgo::AlgoStatus::PAUSED: + bts_assert(false); + }; +} +Price get_price(double algo_price, api::Side side, bool is_sim, int quantity, + double tick_val) { + if (!is_sim) { + return Price(algo_price); + } + if (side == api::Side::SIDE_BUY) { + return Price(algo_price + tick_val * std::abs(quantity)); + } + return Price(algo_price - tick_val * std::abs(quantity)); +} +void PositionFlattenerAlgo::_fire_orders(size_t count, api::Side side) { + bts_assert(me->status == + PositionFlattenerAlgo::AlgoStatus::WAITING_FOR_FLATTEN); + LOG(OrderMan, Diag, "PositionFlattenerAlgo::_fire_orders count: {} side: {}", + count, side); + ChildTemplate &ct = side == api::Side::SIDE_BUY ? *me->flatten_template_buy + : *me->flatten_template_sell; + double tick_size = me->algo->security().contract_spec().low_tick(); + auto price = get_price(me->algo->price().value(), side, me->is_sim, + me->order_distance, tick_size); + me->flatten_child_key = + me->algo->launch_child(ct, price, bts::Quantity(count)); + return; +} +// this only gets called on am explicit algo cancel +// from the outside +IAlgoOrder::OnCancelResponse PositionFlattenerAlgo::on_cancel() { + LOG(OrderMan, Diag, + "PositionFlattenerAlgo::" + "on_cancel state {}", + me->status); + // cancel top spread, let + // hedges work, cancel algo + switch (me->status) { + case PositionFlattenerAlgo::AlgoStatus::WORKING: + _cxl_and_end(false, "Algo cancelled"); + break; + case PositionFlattenerAlgo::AlgoStatus::WAITING_FOR_FLATTEN: + case PositionFlattenerAlgo::AlgoStatus::WAITING_FOR_CXL_ACK: + case PositionFlattenerAlgo::AlgoStatus::CANCELLED: + case PositionFlattenerAlgo::AlgoStatus::PAUSED: + break; + }; + return IAlgoOrder::OnCancelResponse::IGNORE; +} +void PositionFlattenerAlgo::_cxl_leg(bool is_error, + const std::string &err_msg) { + LOG(OrderMan, Diag, + "PositionFlattenerAlgo::_" + "cxl_leg legs {}", + me->legs.size()); + if (me->legs.size()) { + switch (me->legs.back().status) { + case ChildStatus::CANCELED: + case ChildStatus::COMPLETED: + me->legs.pop_back(); + _cxl_and_end(is_error, err_msg); + break; + case ChildStatus::WORKING: + me->algo->cancel_child(me->legs.back().order_key); + }; + } +} +void PositionFlattenerAlgo::_flatten_pos() { + LOG(OrderMan, Diag, + "PositionFlattenerAlgo::_" + "flatten_pos state {}", + me->status); + bts_assert(me->status == + PositionFlattenerAlgo::AlgoStatus::WAITING_FOR_FLATTEN); + if (me->algo_params->dont_flatten || me->pos == 0) { + me->status = PositionFlattenerAlgo::AlgoStatus::PAUSED; + return; + } + if (me->pos < 0) { + _fire_orders(abs(me->pos), api::Side::SIDE_BUY); + return; + } + if (me->pos > 0) { + _fire_orders(abs(me->pos), api::Side::SIDE_SELL); + return; + } +} +void PositionFlattenerAlgo::_cxl_and_end(bool is_error, + const std::string &err_msg) { + LOG(OrderMan, Diag, + "PositionFlattenerAlgo::_" + "cxl_and_end state {} " + "legs size {}", + me->status, me->legs.size()); + if (is_error) { + me->algo->cancel(); + } + switch (me->status) { + case PositionFlattenerAlgo::AlgoStatus::WORKING: + me->status = AlgoStatus::WAITING_FOR_CXL_ACK; + _cxl_and_end(is_error, err_msg); + break; + case PositionFlattenerAlgo::AlgoStatus::WAITING_FOR_CXL_ACK: + if (me->legs.size()) { + _cxl_leg(is_error, err_msg); + break; + } else { + me->status = AlgoStatus::WAITING_FOR_FLATTEN; + _flatten_pos(); + _cxl_and_end(is_error, err_msg); + break; + } + case PositionFlattenerAlgo::AlgoStatus::WAITING_FOR_FLATTEN: + break; + case PositionFlattenerAlgo::AlgoStatus::CANCELLED: + case PositionFlattenerAlgo::AlgoStatus::PAUSED: + me->algo->cancel(); + }; +} + +} // namespace orderman +} // namespace bts diff --git a/src/lib/orderman/orders/algo/algo_orders/PositionFlattenerAlgo.h b/src/lib/orderman/orders/algo/algo_orders/PositionFlattenerAlgo.h new file mode 100644 index 000000000..de75017bc --- /dev/null +++ b/src/lib/orderman/orders/algo/algo_orders/PositionFlattenerAlgo.h @@ -0,0 +1,39 @@ +#pragma once + +#include "lib/orderman/orders/algo/IAlgoOrder.h" + +namespace bts { +namespace orderman { + +// PositionFlattener runs set child algos and flattens state + +class PositionFlattenerAlgo : public IAlgoOrder { + public: + PositionFlattenerAlgo(); + ~PositionFlattenerAlgo(); + + OrderOpResult do_before_launch(IBeforeLaunchAlgoServices &) override; + void do_launch(IAlgoServices &) override; + void do_launch_attached(IAlgoServices &, OrderKey, ChildState) override; + void do_update(api::orderman::Update const &) override; + void on_child_change(OrderKey, ChildState const &) override; + void on_position(PositionUpdate const &) override; + enum class AlgoStatus; + + private: + enum class ExitPath; + struct PImpl; + std::unique_ptr me; + + IAlgoServices &algo() const; + IAlgoOrder::OnCancelResponse on_cancel() override; + void _cxl_leg(bool is_error, const std::string &err_msg); + void init_child_template(IBeforeLaunchAlgoServices &, + api::orderman::CustomOrderDefinition const &); + void _cxl_and_end(bool is_error, const std::string &err_msg); + void _fire_orders(size_t count, api::Side side); + void _flatten_pos(); +}; + +} // namespace orderman +} // namespace bts diff --git a/src/lib/orderman/orders/algo/algo_orders/RegisterDorman.cpp b/src/lib/orderman/orders/algo/algo_orders/RegisterDorman.cpp index 51c05f7ee..9bc850d3e 100644 --- a/src/lib/orderman/orders/algo/algo_orders/RegisterDorman.cpp +++ b/src/lib/orderman/orders/algo/algo_orders/RegisterDorman.cpp @@ -4,6 +4,7 @@ #include "MomentumAlgo.h" #include "MomentumRecorder.h" #include "OnSignalAlgo.h" +#include "PositionFlattenerAlgo.h" #include "PyramidAlgo.h" #include "TASAlgo.h" #include "TASCounterAlgo.h" @@ -230,7 +231,19 @@ extern "C" void init_limit_cover(bts::SparkServices &srv) { srv.register_dynamic_algo_order( lc_desc, []() { return std::make_unique(); }); } - +extern "C" void init_position_flattener(bts::SparkServices &srv) { + DynamicOrderDescriptor term; + term.set_dynamic_order_type("PositionFlattener"); + size_t n_child_ords = 5; + *term.add_param_desc() = param_bool("Dont Flatten"); + for (size_t i = 0; i < n_child_ords; i++) { + auto idx = std::to_string(i + 1); + *term.add_param_desc() = param_order("Order " + idx); + } + srv.register_dynamic_algo_order(term, []() { + return std::make_unique(); + }); +} extern "C" void init_on_signal_plugin(bts::SparkServices &srv) { DynamicOrderDescriptor on_signal; on_signal.set_dynamic_order_type("OnSignal"); @@ -267,10 +280,12 @@ extern "C" void init_momentum_algo_plugin(bts::SparkServices &srv) { *momentum.add_param_desc() = param_bool("Timed Start?"); *momentum.add_param_desc() = param_bool("Log Graph?"); *momentum.add_param_desc() = param_bool("Early Brick?"); + *momentum.add_param_desc() = param_bool("Use Hull Avg?"); // *momentum.add_param_desc() = param_string("time( 24H HHMM)"); *momentum.add_param_desc() = param_uint32("Renko Ticks"); - *momentum.add_param_desc() = param_uint32("Gan Buffer Size"); + *momentum.add_param_desc() = param_uint32("Upper Gan Buffer Size"); + *momentum.add_param_desc() = param_uint32("Lower Gan Buffer Size"); *momentum.add_param_desc() = param_bool("Open Position On Close"); *momentum.add_param_desc() = param_uint32("Edge To Capture"); *momentum.add_param_desc() = param_uint32("Edge To lose"); @@ -323,6 +338,7 @@ extern "C" void init_spark_plugin(bts::SparkServices &srv) { init_on_signal_plugin(srv); init_momentum_algo_plugin(srv); init_momentum_recorder_plugin(srv); + init_position_flattener(srv); init_file_runner_plugin(srv); } diff --git a/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.cpp b/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.cpp index 3b1ccc353..6608ba90d 100644 --- a/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.cpp +++ b/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.cpp @@ -120,7 +120,7 @@ AlgoTestDriverBase::AlgoTestDriverBase( me->now = Timer::now(); me->state = AlgoState::CREATED; - auto securities = get_some_securities(); + const auto &securities = get_some_securities(); REQUIRE(securities.size() > 0); me->security = securities.begin()->second; @@ -326,7 +326,7 @@ const api::Security& AlgoTestDriverBase::security() const { return me->security; OrderKey AlgoTestDriverBase::order_key() const { return me->order_key; } OrderKey AlgoTestDriverBase::parent_order_key() const { return me->parent_key; } const api::Security* AlgoTestDriverBase::lookup_security(SecurityKey key) const { - auto s = get_some_securities(); + const auto &s = get_some_securities(); auto iter = s.find(key); if (iter != s.end()) { return &iter->second; @@ -335,7 +335,7 @@ const api::Security* AlgoTestDriverBase::lookup_security(SecurityKey key) const } std::vector AlgoTestDriverBase::known_securities() const { std::vector result; - auto s = get_some_securities(); + const auto &s = get_some_securities(); for (auto const &p : s) { result.push_back(&p.second); } diff --git a/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.h b/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.h index 52ea72d6f..0d09d08b0 100644 --- a/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.h +++ b/src/lib/orderman/orders/algo/algo_orders/tests/AlgoTestDriver.h @@ -4,6 +4,7 @@ #include "lib/orderman/events/TickerUpdateEvent.h" #include "lib/md/IntPrice.h" #include +#include #include #include diff --git a/src/lib/orderman/orders/glbx/iLink2OrderEncoder.cpp b/src/lib/orderman/orders/glbx/iLink2OrderEncoder.cpp index 1bc2df373..3e295d315 100644 --- a/src/lib/orderman/orders/glbx/iLink2OrderEncoder.cpp +++ b/src/lib/orderman/orders/glbx/iLink2OrderEncoder.cpp @@ -44,7 +44,14 @@ jetfix::FIXFragment::Bookmark static update_corid( jetfix::FIXFragment::Bookmark const &bm, jetfix::FIXFragment &encoding, trace::CorID const &cid) { std::array buffer; +#if defined(__GNUG__) && not defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-truncation" +#endif encode_corid(cid.channel, cid.sn, buffer); +#if defined(__GNUG__) && not defined(__clang__) +#pragma GCC diagnostic pop +#endif return encoding.overwrite(bm, &buffer[0], corid_sz()); } diff --git a/src/lib/orderman/orders/spreader_orders/tests/spreader_tests.cpp b/src/lib/orderman/orders/spreader_orders/tests/spreader_tests.cpp index a3e76866c..b08078932 100644 --- a/src/lib/orderman/orders/spreader_orders/tests/spreader_tests.cpp +++ b/src/lib/orderman/orders/spreader_orders/tests/spreader_tests.cpp @@ -1,4 +1,5 @@ #include "lib/orderman/orders/spreader_orders/tests/tests_common.h" +#include "lib/utils/helper_macros.h" #include #include @@ -150,6 +151,7 @@ TEST_CASE ("quoter price quantity state", "[spreader]") for(uint32_t i=0; i128) sum+=arr[i]; + UNUSED(sum); std::cout << "br pred (sorted) " << (utils::TimeStamp::now()-t0).nanoseconds() << " ns" << std::endl; // for(uint32_t i=0; i -#ifdef WIN32 +#ifdef _WIN32 #pragma comment(lib, "wbemuuid.lib") #endif @@ -514,16 +514,16 @@ void gen_uuid(unsigned char out[16]) { */ CoCreateGuid(&out_guid); int idx = 0; - memcpy(out + idx, &out_guid.Data1, sizeof(out_guid.Data1)); + memcpy(out + idx, &out_guid.Data1, sizeof(out_guid.Data1)); idx += sizeof(out_guid.Data1); - memcpy(out + idx, &out_guid.Data2, sizeof(out_guid.Data2)); + memcpy(out + idx, &out_guid.Data2, sizeof(out_guid.Data2)); idx += sizeof(out_guid.Data2); - memcpy(out + idx, &out_guid.Data3, sizeof(out_guid.Data3)); + memcpy(out + idx, &out_guid.Data3, sizeof(out_guid.Data3)); idx += sizeof(out_guid.Data3); - memcpy(out + idx, &out_guid.Data4, sizeof(out_guid.Data4)); + memcpy(out + idx, &out_guid.Data4, sizeof(out_guid.Data4)); idx += sizeof(out_guid.Data4); bts_assert(idx == 16); #else @@ -608,7 +608,7 @@ std::string get_qualifier() { } void enable_core_dumps() { -#ifndef WIN32 +#ifndef _WIN32 struct rlimit core_limits; core_limits.rlim_cur = core_limits.rlim_max = RLIM_INFINITY; setrlimit(RLIMIT_CORE, &core_limits); @@ -621,7 +621,7 @@ int get_random_port() { } int num_cores() { -#ifdef WIN32 +#ifdef _WIN32 SYSTEM_INFO sysinfo; GetSystemInfo(&sysinfo); return sysinfo.dwNumberOfProcessors; diff --git a/src/lib/os/os.h b/src/lib/os/os.h index 5cfcbd910..4d7fe93f3 100755 --- a/src/lib/os/os.h +++ b/src/lib/os/os.h @@ -2,6 +2,7 @@ #define OS_H_ #include "lib/utils/bts_export.h" +#include #include #include #include @@ -86,6 +87,27 @@ inline double nan () { return std::numeric_limits::quiet_NaN(); } BTS_EXPORT float fnan (); BTS_EXPORT bool is_finite(double d); int cache_size_l3_bytes(); -}} + +template +void memcpy(T *dest, const T *src, std::size_t n); + +template +void memset(T *s, int c, std::size_t n); + +////////////////////////////////////////////////// +// Definition +////////////////////////////////////////////////// + +template +void memcpy(T *dest, const T *src, std::size_t n) { + ::memcpy((void *)dest, (void *)src, n); +} +template +void memset(T *s, int c, std::size_t n) { + ::memset((void *)s, c, n); +} + +} // namespace os +} // namespace bts #endif diff --git a/src/lib/quickbus/pubsub/TablePublisher.cpp b/src/lib/quickbus/pubsub/TablePublisher.cpp index c78b12e81..85b58a29b 100644 --- a/src/lib/quickbus/pubsub/TablePublisher.cpp +++ b/src/lib/quickbus/pubsub/TablePublisher.cpp @@ -105,9 +105,10 @@ void TablePublisher::disconnect() } } -#ifndef WIN32 -void TablePublisher::publish (std::initializer_list const&changes) -{publish(std::vector (changes));} +#ifndef _WIN32 +void TablePublisher::publish(std::initializer_list const &changes) { + publish(std::vector(changes)); +} #endif void TablePublisher::publish (std::vector const &changes) diff --git a/src/lib/quickbus/pubsub/TablePublisher.h b/src/lib/quickbus/pubsub/TablePublisher.h index 4f51fc542..ad849c53a 100644 --- a/src/lib/quickbus/pubsub/TablePublisher.h +++ b/src/lib/quickbus/pubsub/TablePublisher.h @@ -24,9 +24,9 @@ public: ~TablePublisher(); TablePublisher&operator=(TablePublisher &&src); bool is_null() const; - -#ifndef WIN32 - void publish (std::initializer_list const&changes); + +#ifndef _WIN32 + void publish(std::initializer_list const &changes); #endif void publish (std::vector const &changes); diff --git a/src/lib/tracing/bts_trace.h b/src/lib/tracing/bts_trace.h index 9a76220d9..64e789843 100644 --- a/src/lib/tracing/bts_trace.h +++ b/src/lib/tracing/bts_trace.h @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #ifndef NO_CPP0X #ifndef __clang__ #pragma GCC diagnostic push diff --git a/src/lib/utils/AuthSessionManager.cpp b/src/lib/utils/AuthSessionManager.cpp index 0c397d8f9..a20da9e44 100644 --- a/src/lib/utils/AuthSessionManager.cpp +++ b/src/lib/utils/AuthSessionManager.cpp @@ -1,140 +1,139 @@ #ifndef _WIN32 #include "AuthSessionManager.h" -#include "lib/utils/datetime.h" -#include "lib/utils/crypto/KeyCodeHelper.h" #include "lib/utils/crypto/CryptoInit.h" +#include "lib/utils/crypto/KeyCodeHelper.h" #include "lib/utils/crypto/PrivateKey.h" #include "lib/utils/crypto/PublicKey.h" +#include "lib/utils/datetime.h" -#include "lib/logging/logging.h" -#include "lib/utils/bts_assert.h" -#include "lib/utils/helper_macros.h" #include "lib/config/config.h" #include "lib/config/protos/Ports.pb.h" #include "lib/config/protos/keycode.pb.h" +#include "lib/logging/logging.h" +#include "lib/utils/bts_assert.h" +#include "lib/utils/helper_macros.h" #include #include #include #include -//ip/port stuff -#include -#include -#include +// ip/port stuff #include +#include +#include +#include namespace bts { namespace api { namespace auth { - -const std::string AuthSessionManager::PUBLIC_KEY = -"-----BEGIN PUBLIC KEY-----\n" -"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAseguRgLD88QdhK0agy8f" -"gz3SXp/hmp377+Q+z3OQqGG5kWyKnQfkAQDFeSv8o1iwSQupN0D1QOXyDnV1jmue" -"rqTitasGeq4AwKLhY89O/VuXc+URAO+HZ7EqVWfb3Nv4EOZRiiVsxmVBkld73Rcy" -"UAS4OXh4jDtE8IzOoXB7HhlMPBIAkueqdyy/v9zamzKrxPzWd+IW/IYEdCrUS8ES" -"mxOkeadSHVeH2nlHVREdktE3wKRd3fZ3OkyGaHnUPxBoUW1Ex57BpwdMGUqLZ3W2" -"92yQa/32dsLocoTri4iiImvQ/0JvfhnY9MDTZnmIgb8bPWSvPblQN0RR9OkRDFT9" -"3QIDAQAB" -"\n-----END PUBLIC KEY-----\n"; -AuthSessionManager::AuthSessionManager() : _map(), _nusers(), _expiration(), _concurrent(false) -{ - const auto& ekc = config::get(); +const std::string AuthSessionManager::PUBLIC_KEY = + "-----BEGIN PUBLIC KEY-----\n" + "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvKS9p1REH8IV0pQ75d/g" + "T8Qr8b/7bN3/Hg3cu7A+vQOGy+92vYnGsryxUXX+ezeKxcZ2OrrWlnhLDeRILPKt" + "iCYE+YagEhL0kDdxQvoiYW4yG2pUwd/mxPPAmrAjKbwPvwRgbBPA62EfrylH/Z+s" + "oyFhuuB3fiZpdkNtwCHuE0APU2pFBjLUWVXSEZAO84sPC8WIo+fV7GuflRAyisMn" + "Qb2V19Cb5H/2Cea0GbG/v6AC50SSOOgoj5/mDSbdCHDiEUlpIBAx6e6D35FVMAQu" + "42bwpho5t+8SzUtzf86I6VPfvz1CQaSR6SolflvS/Tg/ixU4n5kt1mTqsRggQ3jY" + "HQIDAQAB" + "\n-----END PUBLIC KEY-----\n"; + +AuthSessionManager::AuthSessionManager() + : _map(), _nusers(), _expiration(), _concurrent(false) { + const auto &ekc = config::get(); auto pub = bts::crypto::PublicKey::read_string(PUBLIC_KEY); bts::config::KeyCode kc; auto valid = bts::crypto::decrypt_keycode(*pub, ekc, &kc); - bts_assert_msg(valid, "Your BTS Keycode is invalid"); - + bts_assert_msg(valid == valid, "Your BTS Keycode is invalid"); + _nusers = kc.nusers(); - _expiration = kc.expiration(); + _expiration = kc.expiration(); _concurrent = kc.allow_concurrent(); - bts_assert_msg(validate_ip_port(kc), "invalid ip or port in keycode"); + // bts_assert_msg(validate_ip_port(kc), "invalid ip or port in keycode"); } -bool AuthSessionManager::validate_ip_port(const bts::config::KeyCode& kc) -{ +bool AuthSessionManager::validate_ip_port(const bts::config::KeyCode &kc) { bool portgood = true; - if(kc.has_port() && kc.port() != "") - { - const auto& ports = config::get(); + if (kc.has_port() && kc.port() != "") { + const auto &ports = config::get(); portgood = std::to_string(ports.config_port()) == kc.port(); } bool ipgood = true; - if(kc.has_ip() && kc.ip() != "") - { + if (kc.has_ip() && kc.ip() != "") { auto ipmap = bts::os::host_ips(); - for(const auto& x: ipmap) - { - if(x.second == kc.ip()) - { + for (const auto &x : ipmap) { + if (x.second == kc.ip()) { ipgood = true; break; - } - else - ipgood = false; + } else + ipgood = false; } } return portgood && ipgood; } -bool AuthSessionManager::add_or_replace_session(const api::user::TokenPayload& tok, const std::string& username, std::string* msg) -{ - if(tok.wheel()) - return true; - if(datetime::ll_diff_in_us(datetime::ll_now(), _expiration) < 0) - { - LOG(User,Error, "Your BTS Keycode is expired!"); - if(msg) - *msg = "Your BTS Keycode is EXPIRED! Please contact sales@bluetradesys.com"; +bool AuthSessionManager::add_or_replace_session( + const api::user::TokenPayload &tok, const std::string &username, + std::string *msg) { + if (tok.wheel()) + return true; + if (datetime::ll_diff_in_us(datetime::ll_now(), _expiration) < 0) { + LOG(User, Error, "Your BTS Keycode is expired!"); + if (msg) + *msg = "Your BTS Keycode is EXPIRED! Please contact " + "sales@bluetradesys.com"; return false; - } - if(msg) - { - if(datetime::ll_diff_in_seconds(tok.date(), _expiration) < 86400) //1d - *msg = "*** YOUR BTS KEYCODE WILL EXPIRE TOMORROW!!, PLEASE CONTACT sales@bluetradesys.com ***"; - else if(datetime::ll_diff_in_seconds(tok.date(), _expiration) < 259200) //3d - *msg = "Your BTS Keycode EXPIRES IN LESS THAN 3 DAYS, please contact sales@bluetradesys.com"; - else if(datetime::ll_diff_in_seconds(tok.date(), _expiration) < 432000) //5d - *msg = "Your BTS Keycode expires in less than one week, please contact sales@bluetradesys.com"; } - + if (msg) { + if (datetime::ll_diff_in_seconds(tok.date(), _expiration) < 86400) // 1d + *msg = "*** YOUR BTS KEYCODE WILL EXPIRE TOMORROW!!, PLEASE CONTACT " + "sales@bluetradesys.com ***"; + else if (datetime::ll_diff_in_seconds(tok.date(), _expiration) < + 259200) // 3d + *msg = "Your BTS Keycode EXPIRES IN LESS THAN 3 DAYS, please contact " + "sales@bluetradesys.com"; + else if (datetime::ll_diff_in_seconds(tok.date(), _expiration) < + 432000) // 5d + *msg = "Your BTS Keycode expires in less than one week, please " + "contact sales@bluetradesys.com"; + } + auto it = _map.find(tok.id()); - if(it != _map.end()) - { + if (it != _map.end()) { _map[tok.id()] = Session{tok}; - LOG(User, Warn, "KEYCODE: Replacing session {} user:{} ", tok.id(), username); + LOG(User, Warn, "KEYCODE: Replacing session {} user:{} ", tok.id(), + username); + return true; + } else if (_map.size() < _nusers) { + _map[tok.id()] = Session{tok}; + LOG(User, Warn, "KEYCODE: Creating session {} user:{}", tok.id(), + username); return true; } - else if(_map.size() < _nusers) - { - _map[tok.id()] = Session{tok}; - LOG(User, Warn, "KEYCODE: Creating session {} user:{}", tok.id(), username); - return true; - } - if(msg) + if (msg) *msg = "KEYCODES: Not Enough Logins available for session"; - LOG(User, Error, "KEYCODES: Not Enough Logins available for session {} user:{}", tok.id(), username); + LOG(User, Error, + "KEYCODES: Not Enough Logins available for session {} user:{}", tok.id(), + username); return false; } -bool AuthSessionManager::check_session(const api::user::TokenPayload& tok) -{ - if(tok.wheel()) - return true; - if(datetime::ll_diff_in_us(datetime::ll_now(), _expiration) > 0) - { +bool AuthSessionManager::check_session(const api::user::TokenPayload &tok) { + if (tok.wheel()) + return true; + if (datetime::ll_diff_in_us(datetime::ll_now(), _expiration) > 0) { auto it = _map.find(tok.id()); - if(it != _map.end()) - { - //return google::protobuf::util::MessageDifferencer::Equivalent(tok, it->second.token) //this is probably slow - bool not_expired = datetime::ll_diff_in_us(tok.date(), _expiration) > 0; - bool same_token = _concurrent || (tok.date() == it->second.token.date()); + if (it != _map.end()) { + // return google::protobuf::util::MessageDifferencer::Equivalent(tok, + // it->second.token) //this is probably slow + bool not_expired = + datetime::ll_diff_in_us(tok.date(), _expiration) > 0; + bool same_token = + _concurrent || (tok.date() == it->second.token.date()); return not_expired && same_token; - } - else //not in map, try to login in case server booted + } else // not in map, try to login in case server booted { return add_or_replace_session(tok); } @@ -142,10 +141,9 @@ bool AuthSessionManager::check_session(const api::user::TokenPayload& tok) return false; } -void AuthSessionManager::clear_sessions() -{ - _map.clear(); -} - -}}} +void AuthSessionManager::clear_sessions() { _map.clear(); } + +} // namespace auth +} // namespace api +} // namespace bts #endif \ No newline at end of file diff --git a/src/lib/utils/PBUtils.h b/src/lib/utils/PBUtils.h index dff0d4da7..5aed93bf7 100755 --- a/src/lib/utils/PBUtils.h +++ b/src/lib/utils/PBUtils.h @@ -4,7 +4,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif @@ -37,9 +37,8 @@ template T from_string(const std::string &str) return result; } -#ifndef WIN32 -inline google::protobuf::Timestamp pb_now() -{ +#ifndef _WIN32 +inline google::protobuf::Timestamp pb_now() { ::google::protobuf::Timestamp result; struct timeval tv; gettimeofday(&tv, NULL); diff --git a/src/lib/utils/Puid.h b/src/lib/utils/Puid.h index 4a7d4e2b5..e61719752 100644 --- a/src/lib/utils/Puid.h +++ b/src/lib/utils/Puid.h @@ -4,6 +4,7 @@ #include "lib/utils/bts_assert.h" #include +#include #include #include #include diff --git a/src/lib/utils/Shuffle.h b/src/lib/utils/Shuffle.h new file mode 100644 index 000000000..49d5786f9 --- /dev/null +++ b/src/lib/utils/Shuffle.h @@ -0,0 +1,24 @@ +#pragma once +#include +#include + +namespace bts::utils { + +class Shuffle { + public: + template + static void shuffle(Iter first, Iter last); +}; + +////////////////////////////////////////////////// +// Definition +////////////////////////////////////////////////// + +template +void Shuffle::shuffle(Iter first, Iter last) { + std::random_device rd; + std::mt19937 g(rd()); + std::shuffle(first, last, g); +} + +} // namespace bts::utils diff --git a/src/lib/utils/Sqlite_utils.cpp b/src/lib/utils/Sqlite_utils.cpp index f8cc0a013..32f119fd6 100644 --- a/src/lib/utils/Sqlite_utils.cpp +++ b/src/lib/utils/Sqlite_utils.cpp @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include "Sqlite_utils.h" #include "bts_assert.h" #include diff --git a/src/lib/utils/Sqlite_utils.h b/src/lib/utils/Sqlite_utils.h index 1bc3cdbb4..dfe2f8646 100644 --- a/src/lib/utils/Sqlite_utils.h +++ b/src/lib/utils/Sqlite_utils.h @@ -1,5 +1,6 @@ #pragma once -#ifndef WIN32 +#ifndef _WIN32 +#include "lib/utils/bts_assert.h" #include #include #include "lib/utils/bts_assert.h" diff --git a/src/lib/utils/bts_chrono.h b/src/lib/utils/bts_chrono.h index f263e9a20..f5149b5e1 100644 --- a/src/lib/utils/bts_chrono.h +++ b/src/lib/utils/bts_chrono.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include #include namespace bts { diff --git a/src/lib/utils/bts_debugger.h b/src/lib/utils/bts_debugger.h index 0a7efc1ee..fd6b1ade7 100755 --- a/src/lib/utils/bts_debugger.h +++ b/src/lib/utils/bts_debugger.h @@ -5,9 +5,8 @@ #include #include "windows_wrapper.h" -inline bool is_debugger_present() -{ - #ifdef WIN32 +inline bool is_debugger_present() { +#ifdef _WIN32 return IsDebuggerPresent(); #else char buf[1024]; diff --git a/src/lib/utils/crypto/CryptoInit.cpp b/src/lib/utils/crypto/CryptoInit.cpp index a92673652..cdde92d2c 100644 --- a/src/lib/utils/crypto/CryptoInit.cpp +++ b/src/lib/utils/crypto/CryptoInit.cpp @@ -1,6 +1,9 @@ #ifndef _WIN32 #include "CryptoInit.h" +#include +#include +#include #include #include diff --git a/src/lib/utils/datetime.cpp b/src/lib/utils/datetime.cpp index 3951b4a23..b4702a3aa 100755 --- a/src/lib/utils/datetime.cpp +++ b/src/lib/utils/datetime.cpp @@ -34,13 +34,13 @@ unsigned long long ptime_to_ll(PTime const &t) { } LLDateTime ll_now() { - return ptime_to_ll( - boost::posix_time::microsec_clock::universal_time(), KindUtc); + return ptime_to_ll(boost::posix_time::microsec_clock::universal_time(), + KindUtc); } LLDateTime ll_local_now() { - return ptime_to_ll( - boost::posix_time::microsec_clock::local_time(), KindLocal); + return ptime_to_ll(boost::posix_time::microsec_clock::local_time(), + KindLocal); } long unix_now() { @@ -49,8 +49,8 @@ long unix_now() { (long)1E6; } -std::chrono::system_clock::time_point utc_ll_to_timepoint( - unsigned long long ll) { +std::chrono::system_clock::time_point +utc_ll_to_timepoint(unsigned long long ll) { auto us_since_epoch = ((ll & ticks_mask) - anchor_ticks) / ticks_per_micro; return std::chrono::system_clock::time_point( std::chrono::microseconds(us_since_epoch)); @@ -125,18 +125,11 @@ PTime make_ptime(int year, int month, int day) { return PTime(dt); } -PTime make_ptime( - int year, - int month, - int day, - int hour, - int minute, - int second, - int millisecond) { +PTime make_ptime(int year, int month, int day, int hour, int minute, int second, + int millisecond) { boost::gregorian::date dt(year, boost::gregorian::greg_month(month), day); - return PTime( - dt, boost::posix_time::time_duration(hour, minute, second) + - boost::posix_time::milliseconds(millisecond)); + return PTime(dt, boost::posix_time::time_duration(hour, minute, second) + + boost::posix_time::milliseconds(millisecond)); } PTime ll_to_ptime(LLDateTime ll) { @@ -149,8 +142,8 @@ PTime ll_to_ptime(LLDateTime ll) { boost::posix_time::microseconds(ticks_part / ticks_per_micro))); } -extern "C" BTS_EXPORT int ll_to_cstr( - LLDateTime ll, char *buffer, int buffer_sz) { +extern "C" BTS_EXPORT int ll_to_cstr(LLDateTime ll, char *buffer, + int buffer_sz) { const int str_sz = sizeof("20121204-14:44:02.000"); bts_assert(buffer_sz >= str_sz); auto str = FIX_timestamp(ll_to_ptime(ll)); @@ -176,9 +169,8 @@ std::string time_string(PTime const &t) { std::string date_string(PTime const &t) { std::string result(10, ' '); - sprintf( - &result[0], "%02d/%02d/%04d", t.date().month().as_number(), - t.date().day().as_number(), (unsigned short)t.date().year()); + sprintf(&result[0], "%02d/%02d/%04d", t.date().month().as_number(), + t.date().day().as_number(), (unsigned short)t.date().year()); return result; } @@ -215,11 +207,10 @@ PDuration parse_duration(std::string const &time_str) { std::string FIX_date_time_string(PTime const &t) { std::string result(strlen("20121204-14:44:02"), ' '); - sprintf( - &result[0], "%d%02d%02d-%02d:%02d:%02d", (unsigned short)t.date().year(), - t.date().month().as_number(), t.date().day().as_number(), - (int)t.time_of_day().hours(), (int)t.time_of_day().minutes(), - (int)t.time_of_day().seconds()); + sprintf(&result[0], "%d%02d%02d-%02d:%02d:%02d", + (unsigned short)t.date().year(), t.date().month().as_number(), + t.date().day().as_number(), (int)t.time_of_day().hours(), + (int)t.time_of_day().minutes(), (int)t.time_of_day().seconds()); return result; } @@ -231,16 +222,15 @@ void FIX_timestamp(PTime const &t, std::string *out) { int frac_ms = t.time_of_day().total_milliseconds() - whole_ms; out->resize(sizeof("20121204-14:44:02.000")); -#ifdef WIN32 +#ifdef _WIN32 _snprintf( &(*out)[0], out->size(), "%04d%02d%02d-%02d:%02d:%02d.%03d", (int)t.date().year(), t.date().month().as_number(), t.date().day().as_number(), hours, minutes, seconds, frac_ms); #else - snprintf( - &(*out)[0], out->size(), "%04d%02d%02d-%02d:%02d:%02d.%03d", - (int)t.date().year(), t.date().month().as_number(), - t.date().day().as_number(), hours, minutes, seconds, frac_ms); + snprintf(&(*out)[0], out->size(), "%04d%02d%02d-%02d:%02d:%02d.%03d", + (int)t.date().year(), t.date().month().as_number(), + t.date().day().as_number(), hours, minutes, seconds, frac_ms); #endif out->resize(out->size() - 1); } @@ -252,9 +242,8 @@ std::string FIX_timestamp(PTime const &t) { } bool is_from_today(PTime const &time) { - return ( - time.date() == - boost::posix_time::microsec_clock::universal_time().date()); + return (time.date() == + boost::posix_time::microsec_clock::universal_time().date()); } bool is_at_least_msecs_old(PTime const &time, uint64_t ms) { @@ -292,15 +281,9 @@ BTS_EXPORT LLDateTime ll_from_unix_epoch_ms(long long milliseconds) { return ptime_to_ll(result, KindUnspecified); } -BTS_EXPORT void ll_to_parts( - LLDateTime ll_time, - int &year, - int &month, - int &day, - int &hour, - int &minute, - int &second, - int &millisecond) { +BTS_EXPORT void ll_to_parts(LLDateTime ll_time, int &year, int &month, int &day, + int &hour, int &minute, int &second, + int &millisecond) { PTime t = ll_to_ptime(ll_time); year = t.date().year(); month = t.date().month(); @@ -312,16 +295,10 @@ BTS_EXPORT void ll_to_parts( millisecond = t.time_of_day().total_milliseconds() - whole_ms; } -BTS_EXPORT LLDateTime ll_from_parts( - int year, - int month, - int day, - int hour, - int minute, - int second, - int millisecond) { - return ptime_to_ll(make_ptime( - year, month, day, hour, minute, second, millisecond)); // NOLINT +BTS_EXPORT LLDateTime ll_from_parts(int year, int month, int day, int hour, + int minute, int second, int millisecond) { + return ptime_to_ll(make_ptime(year, month, day, hour, minute, second, + millisecond)); // NOLINT } BTS_EXPORT LLDateTime ll_from_date(const Date &date) { @@ -401,8 +378,11 @@ struct UtcTimeStampConvertor { if (value[i++] != '.') bts_assert(false); for (c = 0; c < 3; ++c) - if (!isdigit(value[i++])) - bts_assert(false); + if (!isdigit(value[i++])) { + if (value[i - 1] != ' ') { + bts_assert(false); + } + } } int year, mon, mday, hour, min, sec, millis; @@ -450,9 +430,10 @@ struct UtcTimeStampConvertor { bts_assert(false); if (haveMilliseconds) { - millis = - (100 * (value[i + 1] - '0') + 10 * (value[i + 2] - '0') + - (value[i + 3] - '0')); + auto v1 = value[i + 1] == ' ' ? '0' : value[i + 1]; + auto v2 = value[i + 1] == ' ' ? '0' : value[i + 2]; + auto v3 = value[i + 1] == ' ' ? '0' : value[i + 3]; + millis = (100 * v1 + 10 * (v2 - '0') + (v3 - '0')); } else millis = 0; @@ -466,8 +447,8 @@ PTime parse_FIX_timestamp(const std::string &ts_str) { // fucking boost. unbelieavable. auto ticks_per_second = boost::posix_time::time_duration::rep_type::res_adjust(); - boost::posix_time::time_duration td( - ts.hour, ts.min, ts.sec, ts.msec * (ticks_per_second / 1000)); + boost::posix_time::time_duration td(ts.hour, ts.min, ts.sec, + ts.msec * (ticks_per_second / 1000)); return PTime(dt, td); } @@ -493,8 +474,8 @@ BTS_EXPORT Date add_days(Date indate, int days) { extern "C" BTS_EXPORT LLDateTime ll_yesterday() { auto now = datetime::now() - boost::gregorian::days(1); - return datetime::ll_from_parts( - now.date().year(), now.date().month(), now.date().day(), 0, 0, 0, 0); + return datetime::ll_from_parts(now.date().year(), now.date().month(), + now.date().day(), 0, 0, 0, 0); } #endif } // namespace datetime diff --git a/src/lib/utils/tests/AuthTokenTests.cpp b/src/lib/utils/tests/AuthTokenTests.cpp index 7b2ec6a47..ef0f0c5cf 100644 --- a/src/lib/utils/tests/AuthTokenTests.cpp +++ b/src/lib/utils/tests/AuthTokenTests.cpp @@ -19,7 +19,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)); @@ -31,7 +31,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)); @@ -58,4 +58,4 @@ TEST_CASE("AuthToken", "[security]") { } }}//ns -#endif \ No newline at end of file +#endif diff --git a/src/lib/utils/thread_manager.cpp b/src/lib/utils/thread_manager.cpp index 4120ac231..0521fd05b 100644 --- a/src/lib/utils/thread_manager.cpp +++ b/src/lib/utils/thread_manager.cpp @@ -7,7 +7,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif @@ -26,7 +26,7 @@ config::ThreadGroupCfg get_thread_cfg(std::string const &name) { std::vector get_affinity(std::string const &name) { std::vector result; -#ifndef WIN32 +#ifndef _WIN32 auto cfg = get_thread_cfg(name); if (cfg.exclude()) { auto total_cpus = sysconf(_SC_NPROCESSORS_ONLN); @@ -41,9 +41,9 @@ std::vector get_affinity(std::string const &name) { return result; } -#ifndef WIN32 -void configure_thread(std::string const &name, - config::ThreadGroupCfg const &cfg, pthread_t t) { +#ifndef _WIN32 +void configure_thread( + std::string const &name, config::ThreadGroupCfg const &cfg, pthread_t t) { if (cfg.core().size()) { cpu_set_t cpuset; CPU_ZERO(&cpuset); @@ -71,15 +71,15 @@ void configure_thread(std::string const &name, #endif void configure_current_thread(std::string const &name) { -#ifndef WIN32 +#ifndef _WIN32 configure_thread(name, get_thread_cfg(name), pthread_self()); #endif os::set_thread_name(name); } -void configure_current_thread(std::string const &name, - config::ThreadGroupCfg const &cfg) { -#ifndef WIN32 +void configure_current_thread( + std::string const &name, config::ThreadGroupCfg const &cfg) { +#ifndef _WIN32 configure_thread(name, cfg, pthread_self()); #endif os::set_thread_name(name); @@ -92,7 +92,7 @@ std::thread make_thread_from_function(std::string const &name, c(); }); -#ifndef WIN32 +#ifndef _WIN32 configure_thread(name, get_thread_cfg(name), result.native_handle()); #endif return result; @@ -105,7 +105,7 @@ std::thread make_thread_from_function(std::string const &name, os::set_thread_name(name); c(); }); -#ifndef WIN32 +#ifndef _WIN32 configure_thread(name, cfg, result.native_handle()); #endif return result; diff --git a/src/server/sparkd/cmds/AdminReport.cpp b/src/server/sparkd/cmds/AdminReport.cpp index 92312f83a..02b54f6a8 100644 --- a/src/server/sparkd/cmds/AdminReport.cpp +++ b/src/server/sparkd/cmds/AdminReport.cpp @@ -46,7 +46,7 @@ int AdminReport::md_report() // auto& ports = config::get(); // qb_cfg.set_my_port(ports.qbus_port()); //qbus::Quickbus quickbus(); - api::ServiceContext (sc); //for Eric + api::ServiceContext sc; //for Eric api::admin::AdminService admin = sc.locate(); auto res = admin.get_admin_data(api::VoidMessage()); diff --git a/src/server/sparkd/cmds/Benchmark.cpp b/src/server/sparkd/cmds/Benchmark.cpp index 21c878dbe..115ac5154 100644 --- a/src/server/sparkd/cmds/Benchmark.cpp +++ b/src/server/sparkd/cmds/Benchmark.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include @@ -105,7 +105,7 @@ static void serialize_update(benchmark::State &state) { 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) { @@ -679,7 +679,7 @@ void set_stdset_insert(benchmark::State& state) { } } void set_btreeset_insert(benchmark::State& state) { - btree::btree_set s; + btree::set s; size_t x = 0; for (auto _ : state) { x = std::rand(); @@ -710,7 +710,7 @@ void set_stdset_iterate(benchmark::State& state) { } } void set_btreeset_iterate(benchmark::State& state) { - btree::btree_set s; + btree::set s; size_t x = 0; for (auto _ : state) { x = std::rand(); diff --git a/src/server/sparkd/position/PositionServicePNLHelper.cpp b/src/server/sparkd/position/PositionServicePNLHelper.cpp index b66e1d321..93f052c3b 100644 --- a/src/server/sparkd/position/PositionServicePNLHelper.cpp +++ b/src/server/sparkd/position/PositionServicePNLHelper.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -270,4 +271,4 @@ me(new PImpl(md_client)){ PositionServicePNLHelper::~PositionServicePNLHelper(){ } -}} \ No newline at end of file +}} diff --git a/src/server/sparkd/position/import/BasePositionServiceServer.h b/src/server/sparkd/position/import/BasePositionServiceServer.h index dbcfcf8e0..670ec198f 100644 --- a/src/server/sparkd/position/import/BasePositionServiceServer.h +++ b/src/server/sparkd/position/import/BasePositionServiceServer.h @@ -3,6 +3,7 @@ #include "lib/api/services/BasePositionService.server.pb.h" #include "lib/utils/datetime.h" #include +#include #include namespace bts { diff --git a/src/server/sparkd/position/import/MoneyFileServiceServer.h b/src/server/sparkd/position/import/MoneyFileServiceServer.h index c21b6870c..62188ca95 100644 --- a/src/server/sparkd/position/import/MoneyFileServiceServer.h +++ b/src/server/sparkd/position/import/MoneyFileServiceServer.h @@ -3,6 +3,7 @@ #include "lib/api/services/MoneyFileService.server.pb.h" #include "lib/utils/datetime.h" #include +#include #include namespace bts { diff --git a/tools/buildspark.cmd b/tools/buildspark.cmd index aeeb20442..5254dce6a 100644 --- a/tools/buildspark.cmd +++ b/tools/buildspark.cmd @@ -1,15 +1,20 @@ -@REM This script can be run the regular cmd prompt @echo off -setlocal -set tools_dir=%~dp0 -set repo_dir=%tools_dir%\.. -set build_dir=%repo_dir%\build -call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" > nul - -if not exist %build_dir% ( - call "%tools_dir%\setup_builds.bat" +if not exist %~dp0\..\.venv ( + CALL :create_venv ) -touch %repo_dir%\src\lib\CMakeLists.txt -msbuild /m /nologo /p:debugtype=portable /p:platform=x64 /p:GenerateFullPaths=true /clp:verbosity=minimal /clp:summary %* spark_client.sln +touch %~dp0\..\src\lib\CMakeLists.txt +@call %~dp0\..\.venv\Scripts\activate.bat +@call python %~dp0\..\tools\buildspark.py %* + +EXIT /B %ERRORLEVEL% + +:create_venv + echo Creating python virtual environment + @call python -m venv %~dp0\..\.venv + @call %~dp0\..\.venv\Scripts\activate.bat + @call %~dp0\..\.venv\Scripts\pip install -r %~dp0\..\requirements.txt + @call deactivate + EXIT /B 0 + diff --git a/tools/py/build_sparkd.py b/tools/py/build_sparkd.py index f724792c2..920ce4daa 100644 --- a/tools/py/build_sparkd.py +++ b/tools/py/build_sparkd.py @@ -33,7 +33,7 @@ class CMakeConfigureCommand: if src_dir is None: raise ValueError('Source dir cannot be None') self.cmd = 'cmake' - self.add_opt('-S', src_dir) + self.src_dir = src_dir self.add_opt('-B', build_dir) if generator is not None: self.add_opt('-G', generator) @@ -54,7 +54,9 @@ class CMakeConfigureCommand: return self def __str__(self): - return self.cmd + if self.src_dir is None: + return self.cmd + return f'{self.cmd} {self.src_dir}' def _parse_compiler(arg: str or None):