diff --git a/src/server/sparkd/cmds/spartan/docs/recorder.org b/src/server/sparkd/cmds/spartan/docs/recorder.org new file mode 100644 index 000000000..cb53066c2 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/docs/recorder.org @@ -0,0 +1,29 @@ +* Arbitration +on_msg (Msg* a, Msg *b) { + if (a && a->seq_num == seq_num) + seq_n++; + deliver(*a); + return; + } + if (b && b->seq_num == seq_num) + seq_n++; + deliver(*b); + return; + } + on_loss(seq_num); +} +* On startup +** In recovery +- join instrument feed +- join a, b +- join sambo + +- queued events is not 0 and its an unbroken sequence +- joined the snapshot feed, and it either has a seq n < the the top of the queue (so the snapshot is useless) or we are missing some messages in the snapshot +- we are either joined with the instrument feed but still not gone through a full cycle or we have a full set of securities + + - begin recovery + - b + + + diff --git a/src/server/sparkd/cmds/spartan/md/MDPParser.h b/src/server/sparkd/cmds/spartan/md/MDPParser.h new file mode 100644 index 000000000..9ea72add5 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/MDPParser.h @@ -0,0 +1,133 @@ +#pragma once + +#include "mdp3_gen/AdminHeartbeat12.h" +#include "mdp3_gen/AdminLogin15.h" +#include "mdp3_gen/AdminLogout16.h" +#include "mdp3_gen/ChannelReset4.h" +#include "mdp3_gen/MDIncrementalRefreshBook32.h" +#include "mdp3_gen/MDIncrementalRefreshBook46.h" +#include "mdp3_gen/MDIncrementalRefreshDailyStatistics33.h" +#include "mdp3_gen/MDIncrementalRefreshDailyStatistics49.h" +#include "mdp3_gen/MDIncrementalRefreshLimitsBanding34.h" +#include "mdp3_gen/MDIncrementalRefreshLimitsBanding50.h" +#include "mdp3_gen/MDIncrementalRefreshOrderBook43.h" +#include "mdp3_gen/MDIncrementalRefreshOrderBook47.h" +#include "mdp3_gen/MDIncrementalRefreshSessionStatistics35.h" +#include "mdp3_gen/MDIncrementalRefreshSessionStatistics51.h" +#include "mdp3_gen/MDIncrementalRefreshTradeSummary42.h" +#include "mdp3_gen/MDIncrementalRefreshTradeSummary48.h" +#include "mdp3_gen/MDIncrementalRefreshVolume37.h" +#include "mdp3_gen/MDInstrumentDefinitionFuture27.h" +#include "mdp3_gen/MDInstrumentDefinitionFuture54.h" +#include "mdp3_gen/MDInstrumentDefinitionOption41.h" +#include "mdp3_gen/MDInstrumentDefinitionOption55.h" +#include "mdp3_gen/MDInstrumentDefinitionSpread29.h" +#include "mdp3_gen/MDInstrumentDefinitionSpread56.h" +#include "mdp3_gen/QuoteRequest39.h" +#include "mdp3_gen/SecurityStatus30.h" +#include "mdp3_gen/SnapshotFullRefresh38.h" +#include "mdp3_gen/SnapshotFullRefresh52.h" +#include "mdp3_gen/SnapshotFullRefreshOrderBook44.h" +#include "mdp3_gen/SnapshotFullRefreshOrderBook53.h" +#include "../util/meta_type_pack.h" + +#include "lib/utils/bts_assert.h" + +#include + +namespace bts { +namespace spartan { + +struct __attribute__((__packed__)) PacketHeader { + uint32_t msg_seq_num; + uint64_t sending_time; +}; + +struct __attribute__((__packed__)) MessageHeader { + uint16_t msg_size; + uint16_t block_length; + uint16_t template_id; + uint16_t schema_id; + uint16_t version; +}; + +struct __attribute__((__packed__)) MDP3Msg { + MessageHeader message_header; + std::array::max()> payload; +}; + +class MDPParser { + public: + MDPParser() { + for (auto &h : handlers) + h = [](auto const&,auto const &) {}; + } + + void on_bytes(std::string_view const &bytes) { + bts_assert_d(bytes.size() >= + sizeof(spartan::PacketHeader) + sizeof(MessageHeader)); + auto packet_header = (PacketHeader*) bytes.data(); + spartan::MDP3Msg *msg = + (spartan::MDP3Msg *)(bytes.data() + sizeof(PacketHeader)); + while (((void *)msg) < (bytes.data() + bytes.size())) { + handlers[msg->message_header.template_id](*packet_header,*msg); + msg = (spartan::MDP3Msg *)((uint8_t *)msg + msg->message_header.msg_size); + } + } + + template void set_handler(C &c) { + handlers[T::sbeTemplateId()] = [&c](auto const&packet_header,auto const &msg) { + c(packet_header,T{(char *)msg.payload.data(), msg.payload.size()}); + return true; + }; + } + + private: + std::array, + std::numeric_limits::max()> + handlers; +}; + +template +void bind(MDPParser &p, Handler &h) { + p.set_handler(h); + bind(p, h); +} + +template void bind(MDPParser &, Handler &) {} + +template struct Binder { + template Binder(MDPParser &p, Handler &h) { + bind(p, h); + } +}; + +using ForAllMDPTypes = meta_type_pack< + mktdata::AdminLogin15, mktdata::AdminLogout16, mktdata::ChannelReset4, + mktdata::MDIncrementalRefreshBook32, mktdata::MDIncrementalRefreshBook46, + mktdata::MDIncrementalRefreshDailyStatistics33, + mktdata::MDIncrementalRefreshDailyStatistics49, + mktdata::MDIncrementalRefreshLimitsBanding34, + mktdata::MDIncrementalRefreshLimitsBanding50, + mktdata::MDIncrementalRefreshOrderBook43, + mktdata::MDIncrementalRefreshOrderBook47, + mktdata::MDIncrementalRefreshSessionStatistics35, + mktdata::MDIncrementalRefreshSessionStatistics51, + mktdata::MDIncrementalRefreshTradeSummary42, + mktdata::MDIncrementalRefreshTradeSummary48, + mktdata::MDIncrementalRefreshVolume37, + mktdata::MDInstrumentDefinitionFuture27, + mktdata::MDInstrumentDefinitionFuture54, + mktdata::MDInstrumentDefinitionOption41, + mktdata::MDInstrumentDefinitionOption55, + mktdata::MDInstrumentDefinitionSpread29, + mktdata::MDInstrumentDefinitionSpread56, + mktdata::QuoteRequest39, + mktdata::SecurityStatus30, mktdata::SnapshotFullRefresh38, + mktdata::SnapshotFullRefresh52, mktdata::SnapshotFullRefreshOrderBook44, + mktdata::SnapshotFullRefreshOrderBook53>; + +using AllMDTypesBinder = ForAllMDPTypes::type; + +} // namespace spartan +} // namespace bts diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/AdminHeartbeat12.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/AdminHeartbeat12.h new file mode 100644 index 000000000..3fb1071e0 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/AdminHeartbeat12.h @@ -0,0 +1,312 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_ADMINHEARTBEAT12_H_ +#define _MKTDATA_ADMINHEARTBEAT12_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class AdminHeartbeat12 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + AdminHeartbeat12() = default; + + AdminHeartbeat12( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + AdminHeartbeat12(char *buffer, const std::uint64_t bufferLength) : + AdminHeartbeat12(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + AdminHeartbeat12( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + AdminHeartbeat12(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)12; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "0"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + AdminHeartbeat12 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = AdminHeartbeat12(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + AdminHeartbeat12 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = AdminHeartbeat12( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + AdminHeartbeat12 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = AdminHeartbeat12(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, AdminHeartbeat12 _writer) + { + AdminHeartbeat12 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "AdminHeartbeat12", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/AdminLogin15.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/AdminLogin15.h new file mode 100644 index 000000000..b81f85ee4 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/AdminLogin15.h @@ -0,0 +1,386 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_ADMINLOGIN15_H_ +#define _MKTDATA_ADMINLOGIN15_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class AdminLogin15 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + AdminLogin15() = default; + + AdminLogin15( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + AdminLogin15(char *buffer, const std::uint64_t bufferLength) : + AdminLogin15(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + AdminLogin15( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + AdminLogin15(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)15; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "A"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + AdminLogin15 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = AdminLogin15(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + AdminLogin15 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = AdminLogin15( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + AdminLogin15 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = AdminLogin15(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * HeartBtIntMetaAttribute(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 heartBtIntId() SBE_NOEXCEPT + { + return 108; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t heartBtIntSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool heartBtIntInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= heartBtIntSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t heartBtIntEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t heartBtIntNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t heartBtIntMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t heartBtIntMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t heartBtIntEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t heartBtInt() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int8_t)); + return (val); + } + + AdminLogin15 &heartBtInt(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, AdminLogin15 _writer) + { + AdminLogin15 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "AdminLogin15", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("HeartBtInt": )"; + builder << +writer.heartBtInt(); + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/AdminLogout16.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/AdminLogout16.h new file mode 100644 index 000000000..8f87179a4 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/AdminLogout16.h @@ -0,0 +1,522 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_ADMINLOGOUT16_H_ +#define _MKTDATA_ADMINLOGOUT16_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class AdminLogout16 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + AdminLogout16() = default; + + AdminLogout16( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + AdminLogout16(char *buffer, const std::uint64_t bufferLength) : + AdminLogout16(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + AdminLogout16( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + AdminLogout16(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)180; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)16; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "5"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + AdminLogout16 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = AdminLogout16(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + AdminLogout16 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = AdminLogout16( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + AdminLogout16 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = AdminLogout16(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TextMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t textId() SBE_NOEXCEPT + { + return 58; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t textSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool textInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= textSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t textEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR char textNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char textMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char textMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t textEncodingLength() SBE_NOEXCEPT + { + return 180; + } + + static SBE_CONSTEXPR std::uint64_t textLength() SBE_NOEXCEPT + { + return 180; + } + + SBE_NODISCARD const char *text() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char *text() SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char text(const std::uint64_t index) const + { + if (index >= 180) + { + throw std::runtime_error("index out of range for text [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 0 + (index * 1), sizeof(char)); + return (val); + } + + AdminLogout16 &text(const std::uint64_t index, const char value) + { + if (index >= 180) + { + throw std::runtime_error("index out of range for text [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 0 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getText(char *const dst, const std::uint64_t length) const + { + if (length > 180) + { + throw std::runtime_error("length too large for getText [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 0, sizeof(char) * static_cast(length)); + return length; + } + + AdminLogout16 &putText(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 0, src, sizeof(char) * 180); + return *this; + } + + std::string getTextAsString() const + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 180 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getTextAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getTextAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getTextAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 180 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + AdminLogout16 &putText(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 180) + { + throw std::runtime_error("string too large for putText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.data(), srcLength); + for (size_t start = srcLength; start < 180; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #else + AdminLogout16 &putText(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 180) + { + throw std::runtime_error("string too large for putText [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.c_str(), srcLength); + for (size_t start = srcLength; start < 180; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #endif + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, AdminLogout16 _writer) + { + AdminLogout16 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "AdminLogout16", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("Text": )"; + builder << '"' << + writer.getTextAsJsonEscapedString().c_str() << '"'; + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/AggressorSide.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/AggressorSide.h new file mode 100644 index 000000000..f32e7a10e --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/AggressorSide.h @@ -0,0 +1,141 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_AGGRESSORSIDE_H_ +#define _MKTDATA_AGGRESSORSIDE_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class AggressorSide +{ +public: + enum Value + { + NoAggressor = (std::uint8_t)0, + Buy = (std::uint8_t)1, + Sell = (std::uint8_t)2, + NULL_VALUE = (std::uint8_t)255 + }; + + static AggressorSide::Value get(const std::uint8_t value) + { + switch (value) + { + case 0: return NoAggressor; + case 1: return Buy; + case 2: return Sell; + case 255: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum AggressorSide [E103]"); + } + + static const char* c_str(const AggressorSide::Value value) + { + switch (value) + { + case NoAggressor: return "NoAggressor"; + case Buy: return "Buy"; + case Sell: return "Sell"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum AggressorSide [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, AggressorSide::Value m) + { + return os << AggressorSide::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/ChannelReset4.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/ChannelReset4.h new file mode 100644 index 000000000..28ac3a37d --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/ChannelReset4.h @@ -0,0 +1,928 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_CHANNELRESET4_H_ +#define _MKTDATA_CHANNELRESET4_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class ChannelReset4 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + ChannelReset4() = default; + + ChannelReset4( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + ChannelReset4(char *buffer, const std::uint64_t bufferLength) : + ChannelReset4(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + ChannelReset4( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + ChannelReset4(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)4; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + ChannelReset4 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = ChannelReset4(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + ChannelReset4 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = ChannelReset4( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + ChannelReset4 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = ChannelReset4(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + ChannelReset4 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)2); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 2; + 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 2; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t mDUpdateActionNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t mDUpdateActionMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t mDUpdateActionMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t mDUpdateAction() SBE_NOEXCEPT + { + return (std::int8_t)0; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR char mDEntryTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDEntryTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDEntryTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t mDEntryTypeLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *mDEntryType() const + { + static const std::uint8_t mDEntryTypeValues[] = { 74 }; + + return (const char *)mDEntryTypeValues; + } + + SBE_NODISCARD char mDEntryType(const std::uint64_t index) const + { + static const std::uint8_t mDEntryTypeValues[] = { 74 }; + + return (char)mDEntryTypeValues[index]; + } + + std::uint64_t getMDEntryType(char *dst, const std::uint64_t length) const + { + static std::uint8_t mDEntryTypeValues[] = { 74 }; + std::uint64_t bytesToCopy = length < sizeof(mDEntryTypeValues) ? length : sizeof(mDEntryTypeValues); + + std::memcpy(dst, mDEntryTypeValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getMDEntryTypeAsString() const + { + static const std::uint8_t MDEntryTypeValues[] = { 74 }; + + return std::string((const char *)MDEntryTypeValues, 1); + } + + std::string getMDEntryTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDEntryTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * ApplIDMetaAttribute(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 applIDId() SBE_NOEXCEPT + { + return 1180; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t applIDSinceVersion() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD bool applIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= applIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t applIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int16_t applIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT16; + } + + static SBE_CONSTEXPR std::int16_t applIDMinValue() SBE_NOEXCEPT + { + return (std::int16_t)-32767; + } + + static SBE_CONSTEXPR std::int16_t applIDMaxValue() SBE_NOEXCEPT + { + return (std::int16_t)32767; + } + + static SBE_CONSTEXPR std::size_t applIDEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::int16_t applID() const SBE_NOEXCEPT + { + if (m_actingVersion < 3) + { + return (std::int16_t)-32768; + } + + std::int16_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + NoMDEntries &applID(const std::int16_t value) SBE_NOEXCEPT + { + std::int16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int16_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("ApplID": )"; + builder << +writer.applID(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, ChannelReset4 _writer) + { + ChannelReset4 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "ChannelReset4", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/Decimal9.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/Decimal9.h new file mode 100644 index 000000000..11cbd2694 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/Decimal9.h @@ -0,0 +1,340 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_DECIMAL9_H_ +#define _MKTDATA_DECIMAL9_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class Decimal9 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + Decimal9() = default; + + Decimal9( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 8) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + Decimal9( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + Decimal9(buffer, 0, bufferLength, actingVersion) + { + } + + Decimal9( + char *buffer, + const std::uint64_t bufferLength) : + Decimal9(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + Decimal9 &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = Decimal9(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mantissaSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mantissaEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int64_t mantissaNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT64; + } + + static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT + { + return -9223372036854775807L; + } + + static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT + { + return 9223372036854775807L; + } + + static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::int64_t mantissa() const SBE_NOEXCEPT + { + std::int64_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + Decimal9 &mantissa(const std::int64_t value) SBE_NOEXCEPT + { + std::int64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int64_t)); + return *this; + } + + SBE_NODISCARD static const char * exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= exponentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t exponentEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t exponent() SBE_NOEXCEPT + { + return (std::int8_t)-9; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, Decimal9 writer) + { + builder << '{'; + builder << R"("mantissa": )"; + builder << +writer.mantissa(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/Decimal9NULL.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/Decimal9NULL.h new file mode 100644 index 000000000..fe27d17fc --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/Decimal9NULL.h @@ -0,0 +1,340 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_DECIMAL9NULL_H_ +#define _MKTDATA_DECIMAL9NULL_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class Decimal9NULL +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + Decimal9NULL() = default; + + Decimal9NULL( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 8) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + Decimal9NULL( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + Decimal9NULL(buffer, 0, bufferLength, actingVersion) + { + } + + Decimal9NULL( + char *buffer, + const std::uint64_t bufferLength) : + Decimal9NULL(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + Decimal9NULL &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = Decimal9NULL(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mantissaSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mantissaEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int64_t mantissaNullValue() SBE_NOEXCEPT + { + return 9223372036854775807L; + } + + static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT + { + return -9223372036854775807L; + } + + static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT + { + return 9223372036854775807L; + } + + static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::int64_t mantissa() const SBE_NOEXCEPT + { + std::int64_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + Decimal9NULL &mantissa(const std::int64_t value) SBE_NOEXCEPT + { + std::int64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int64_t)); + return *this; + } + + SBE_NODISCARD static const char * exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= exponentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t exponentEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t exponent() SBE_NOEXCEPT + { + return (std::int8_t)-9; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, Decimal9NULL writer) + { + builder << '{'; + builder << R"("mantissa": )"; + builder << +writer.mantissa(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/DecimalQty.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/DecimalQty.h new file mode 100644 index 000000000..0ed9331cc --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/DecimalQty.h @@ -0,0 +1,340 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_DECIMALQTY_H_ +#define _MKTDATA_DECIMALQTY_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class DecimalQty +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + DecimalQty() = default; + + DecimalQty( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 4) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + DecimalQty( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + DecimalQty(buffer, 0, bufferLength, actingVersion) + { + } + + DecimalQty( + char *buffer, + const std::uint64_t bufferLength) : + DecimalQty(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + DecimalQty &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = DecimalQty(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mantissaSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mantissaEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int32_t mantissaNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mantissaMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mantissaMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mantissa() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + DecimalQty &mantissa(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= exponentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t exponentEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t exponent() SBE_NOEXCEPT + { + return (std::int8_t)-4; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, DecimalQty writer) + { + builder << '{'; + builder << R"("mantissa": )"; + builder << +writer.mantissa(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/EventType.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/EventType.h new file mode 100644 index 000000000..f18984f67 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/EventType.h @@ -0,0 +1,138 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_EVENTTYPE_H_ +#define _MKTDATA_EVENTTYPE_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class EventType +{ +public: + enum Value + { + Activation = (std::uint8_t)5, + LastEligibleTradeDate = (std::uint8_t)7, + NULL_VALUE = (std::uint8_t)255 + }; + + static EventType::Value get(const std::uint8_t value) + { + switch (value) + { + case 5: return Activation; + case 7: return LastEligibleTradeDate; + case 255: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum EventType [E103]"); + } + + static const char* c_str(const EventType::Value value) + { + switch (value) + { + case Activation: return "Activation"; + case LastEligibleTradeDate: return "LastEligibleTradeDate"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum EventType [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, EventType::Value m) + { + return os << EventType::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/FLOAT.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/FLOAT.h new file mode 100644 index 000000000..a12934454 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/FLOAT.h @@ -0,0 +1,340 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_FLOAT_H_ +#define _MKTDATA_FLOAT_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class FLOAT +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + FLOAT() = default; + + FLOAT( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 8) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + FLOAT( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + FLOAT(buffer, 0, bufferLength, actingVersion) + { + } + + FLOAT( + char *buffer, + const std::uint64_t bufferLength) : + FLOAT(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + FLOAT &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = FLOAT(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mantissaSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mantissaEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int64_t mantissaNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT64; + } + + static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT + { + return -9223372036854775807L; + } + + static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT + { + return 9223372036854775807L; + } + + static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::int64_t mantissa() const SBE_NOEXCEPT + { + std::int64_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + FLOAT &mantissa(const std::int64_t value) SBE_NOEXCEPT + { + std::int64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int64_t)); + return *this; + } + + SBE_NODISCARD static const char * exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= exponentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t exponentEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t exponent() SBE_NOEXCEPT + { + return (std::int8_t)-7; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, FLOAT writer) + { + builder << '{'; + builder << R"("mantissa": )"; + builder << +writer.mantissa(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/GroupSize.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/GroupSize.h new file mode 100644 index 000000000..d5b9418f4 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/GroupSize.h @@ -0,0 +1,353 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_GROUPSIZE_H_ +#define _MKTDATA_GROUPSIZE_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class GroupSize +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + GroupSize() = default; + + GroupSize( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 3) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + GroupSize( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + GroupSize(buffer, 0, bufferLength, actingVersion) + { + } + + GroupSize( + char *buffer, + const std::uint64_t bufferLength) : + GroupSize(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + GroupSize &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = GroupSize(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * blockLengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t blockLengthSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool blockLengthInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= blockLengthSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t blockLengthEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint16_t blockLengthNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT16; + } + + static SBE_CONSTEXPR std::uint16_t blockLengthMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t blockLengthMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t blockLengthEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t blockLength() 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); + } + + GroupSize &blockLength(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 * numInGroupMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t numInGroupSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool numInGroupInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= numInGroupSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t numInGroupEncodingOffset() SBE_NOEXCEPT + { + return 2; + } + + static SBE_CONSTEXPR std::uint8_t numInGroupNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t numInGroupMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t numInGroupMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t numInGroupEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t numInGroup() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 2, sizeof(std::uint8_t)); + return (val); + } + + GroupSize &numInGroup(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 2, &val, sizeof(std::uint8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, GroupSize writer) + { + builder << '{'; + builder << R"("blockLength": )"; + builder << +writer.blockLength(); + + builder << ", "; + builder << R"("numInGroup": )"; + builder << +writer.numInGroup(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/GroupSize8Byte.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/GroupSize8Byte.h new file mode 100644 index 000000000..4d4dbe0e7 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/GroupSize8Byte.h @@ -0,0 +1,353 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_GROUPSIZE8BYTE_H_ +#define _MKTDATA_GROUPSIZE8BYTE_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class GroupSize8Byte +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + GroupSize8Byte() = default; + + GroupSize8Byte( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 8) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + GroupSize8Byte( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + GroupSize8Byte(buffer, 0, bufferLength, actingVersion) + { + } + + GroupSize8Byte( + char *buffer, + const std::uint64_t bufferLength) : + GroupSize8Byte(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + GroupSize8Byte &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = GroupSize8Byte(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * blockLengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t blockLengthSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool blockLengthInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= blockLengthSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t blockLengthEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint16_t blockLengthNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT16; + } + + static SBE_CONSTEXPR std::uint16_t blockLengthMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t blockLengthMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t blockLengthEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t blockLength() 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); + } + + GroupSize8Byte &blockLength(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 * numInGroupMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t numInGroupSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool numInGroupInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= numInGroupSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t numInGroupEncodingOffset() SBE_NOEXCEPT + { + return 7; + } + + static SBE_CONSTEXPR std::uint8_t numInGroupNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t numInGroupMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t numInGroupMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t numInGroupEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t numInGroup() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 7, sizeof(std::uint8_t)); + return (val); + } + + GroupSize8Byte &numInGroup(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 7, &val, sizeof(std::uint8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, GroupSize8Byte writer) + { + builder << '{'; + builder << R"("blockLength": )"; + builder << +writer.blockLength(); + + builder << ", "; + builder << R"("numInGroup": )"; + builder << +writer.numInGroup(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/HaltReason.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/HaltReason.h new file mode 100644 index 000000000..0ce3cff8d --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/HaltReason.h @@ -0,0 +1,153 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_HALTREASON_H_ +#define _MKTDATA_HALTREASON_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class HaltReason +{ +public: + enum Value + { + GroupSchedule = (std::uint8_t)0, + SurveillanceIntervention = (std::uint8_t)1, + MarketEvent = (std::uint8_t)2, + InstrumentActivation = (std::uint8_t)3, + InstrumentExpiration = (std::uint8_t)4, + Unknown = (std::uint8_t)5, + RecoveryInProcess = (std::uint8_t)6, + NULL_VALUE = (std::uint8_t)255 + }; + + static HaltReason::Value get(const std::uint8_t value) + { + switch (value) + { + case 0: return GroupSchedule; + case 1: return SurveillanceIntervention; + case 2: return MarketEvent; + case 3: return InstrumentActivation; + case 4: return InstrumentExpiration; + case 5: return Unknown; + case 6: return RecoveryInProcess; + case 255: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum HaltReason [E103]"); + } + + static const char* c_str(const HaltReason::Value value) + { + switch (value) + { + case GroupSchedule: return "GroupSchedule"; + case SurveillanceIntervention: return "SurveillanceIntervention"; + case MarketEvent: return "MarketEvent"; + case InstrumentActivation: return "InstrumentActivation"; + case InstrumentExpiration: return "InstrumentExpiration"; + case Unknown: return "Unknown"; + case RecoveryInProcess: return "RecoveryInProcess"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum HaltReason [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, HaltReason::Value m) + { + return os << HaltReason::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/InstAttribValue.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/InstAttribValue.h new file mode 100644 index 000000000..bba17c40c --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/InstAttribValue.h @@ -0,0 +1,1015 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_INSTATTRIBVALUE_H_ +#define _MKTDATA_INSTATTRIBVALUE_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class InstAttribValue +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + InstAttribValue() = default; + + InstAttribValue( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 4) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + InstAttribValue( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + InstAttribValue(buffer, 0, bufferLength, actingVersion) + { + } + + InstAttribValue( + char *buffer, + const std::uint64_t bufferLength) : + InstAttribValue(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + InstAttribValue &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = InstAttribValue(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + InstAttribValue &clear() + { + std::uint32_t zero = 0; + std::memcpy(m_buffer + m_offset, &zero, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD bool isEmpty() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return 0 == val; + } + + SBE_NODISCARD std::uint32_t rawValue() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return val; + } + + InstAttribValue &rawValue(std::uint32_t value) + { + std::memcpy(m_buffer + m_offset, &value, sizeof(std::uint32_t)); + return *this; + } + + static bool electronicMatchEligible(const std::uint32_t bits) + { + return (bits & (1u << 0u)) != 0; + } + + static std::uint32_t electronicMatchEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 0u)) : static_cast(bits & ~(1u << 0u)); + } + + SBE_NODISCARD bool electronicMatchEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 0u)) != 0; + } + + InstAttribValue &electronicMatchEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 0u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 0u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool orderCrossEligible(const std::uint32_t bits) + { + return (bits & (1u << 1u)) != 0; + } + + static std::uint32_t orderCrossEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 1u)) : static_cast(bits & ~(1u << 1u)); + } + + SBE_NODISCARD bool orderCrossEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 1u)) != 0; + } + + InstAttribValue &orderCrossEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 1u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 1u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool blockTradeEligible(const std::uint32_t bits) + { + return (bits & (1u << 2u)) != 0; + } + + static std::uint32_t blockTradeEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 2u)) : static_cast(bits & ~(1u << 2u)); + } + + SBE_NODISCARD bool blockTradeEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 2u)) != 0; + } + + InstAttribValue &blockTradeEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 2u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 2u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool eFPEligible(const std::uint32_t bits) + { + return (bits & (1u << 3u)) != 0; + } + + static std::uint32_t eFPEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 3u)) : static_cast(bits & ~(1u << 3u)); + } + + SBE_NODISCARD bool eFPEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 3u)) != 0; + } + + InstAttribValue &eFPEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 3u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 3u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool eBFEligible(const std::uint32_t bits) + { + return (bits & (1u << 4u)) != 0; + } + + static std::uint32_t eBFEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 4u)) : static_cast(bits & ~(1u << 4u)); + } + + SBE_NODISCARD bool eBFEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 4u)) != 0; + } + + InstAttribValue &eBFEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 4u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 4u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool eFSEligible(const std::uint32_t bits) + { + return (bits & (1u << 5u)) != 0; + } + + static std::uint32_t eFSEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 5u)) : static_cast(bits & ~(1u << 5u)); + } + + SBE_NODISCARD bool eFSEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 5u)) != 0; + } + + InstAttribValue &eFSEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 5u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 5u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool eFREligible(const std::uint32_t bits) + { + return (bits & (1u << 6u)) != 0; + } + + static std::uint32_t eFREligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 6u)) : static_cast(bits & ~(1u << 6u)); + } + + SBE_NODISCARD bool eFREligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 6u)) != 0; + } + + InstAttribValue &eFREligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 6u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 6u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool oTCEligible(const std::uint32_t bits) + { + return (bits & (1u << 7u)) != 0; + } + + static std::uint32_t oTCEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 7u)) : static_cast(bits & ~(1u << 7u)); + } + + SBE_NODISCARD bool oTCEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 7u)) != 0; + } + + InstAttribValue &oTCEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 7u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 7u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool iLinkIndicativeMassQuotingEligible(const std::uint32_t bits) + { + return (bits & (1u << 8u)) != 0; + } + + static std::uint32_t iLinkIndicativeMassQuotingEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 8u)) : static_cast(bits & ~(1u << 8u)); + } + + SBE_NODISCARD bool iLinkIndicativeMassQuotingEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 8u)) != 0; + } + + InstAttribValue &iLinkIndicativeMassQuotingEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 8u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 8u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool negativeStrikeEligible(const std::uint32_t bits) + { + return (bits & (1u << 9u)) != 0; + } + + static std::uint32_t negativeStrikeEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 9u)) : static_cast(bits & ~(1u << 9u)); + } + + SBE_NODISCARD bool negativeStrikeEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 9u)) != 0; + } + + InstAttribValue &negativeStrikeEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 9u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 9u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool negativePriceOutrightEligible(const std::uint32_t bits) + { + return (bits & (1u << 10u)) != 0; + } + + static std::uint32_t negativePriceOutrightEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 10u)) : static_cast(bits & ~(1u << 10u)); + } + + SBE_NODISCARD bool negativePriceOutrightEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 10u)) != 0; + } + + InstAttribValue &negativePriceOutrightEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 10u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 10u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool isFractional(const std::uint32_t bits) + { + return (bits & (1u << 11u)) != 0; + } + + static std::uint32_t isFractional(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 11u)) : static_cast(bits & ~(1u << 11u)); + } + + SBE_NODISCARD bool isFractional() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 11u)) != 0; + } + + InstAttribValue &isFractional(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 11u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 11u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool volatilityQuotedOption(const std::uint32_t bits) + { + return (bits & (1u << 12u)) != 0; + } + + static std::uint32_t volatilityQuotedOption(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 12u)) : static_cast(bits & ~(1u << 12u)); + } + + SBE_NODISCARD bool volatilityQuotedOption() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 12u)) != 0; + } + + InstAttribValue &volatilityQuotedOption(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 12u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 12u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool rFQCrossEligible(const std::uint32_t bits) + { + return (bits & (1u << 13u)) != 0; + } + + static std::uint32_t rFQCrossEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 13u)) : static_cast(bits & ~(1u << 13u)); + } + + SBE_NODISCARD bool rFQCrossEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 13u)) != 0; + } + + InstAttribValue &rFQCrossEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 13u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 13u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool zeroPriceOutrightEligible(const std::uint32_t bits) + { + return (bits & (1u << 14u)) != 0; + } + + static std::uint32_t zeroPriceOutrightEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 14u)) : static_cast(bits & ~(1u << 14u)); + } + + SBE_NODISCARD bool zeroPriceOutrightEligible() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 14u)) != 0; + } + + InstAttribValue &zeroPriceOutrightEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 14u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 14u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool decayingProductEligibility(const std::uint32_t bits) + { + return (bits & (1u << 15u)) != 0; + } + + static std::uint32_t decayingProductEligibility(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 15u)) : static_cast(bits & ~(1u << 15u)); + } + + SBE_NODISCARD bool decayingProductEligibility() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 15u)) != 0; + } + + InstAttribValue &decayingProductEligibility(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 15u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 15u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool variableProductEligibility(const std::uint32_t bits) + { + return (bits & (1u << 16u)) != 0; + } + + static std::uint32_t variableProductEligibility(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 16u)) : static_cast(bits & ~(1u << 16u)); + } + + SBE_NODISCARD bool variableProductEligibility() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 16u)) != 0; + } + + InstAttribValue &variableProductEligibility(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 16u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 16u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool dailyProductEligibility(const std::uint32_t bits) + { + return (bits & (1u << 17u)) != 0; + } + + static std::uint32_t dailyProductEligibility(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 17u)) : static_cast(bits & ~(1u << 17u)); + } + + SBE_NODISCARD bool dailyProductEligibility() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 17u)) != 0; + } + + InstAttribValue &dailyProductEligibility(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 17u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 17u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool gTOrdersEligibility(const std::uint32_t bits) + { + return (bits & (1u << 18u)) != 0; + } + + static std::uint32_t gTOrdersEligibility(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 18u)) : static_cast(bits & ~(1u << 18u)); + } + + SBE_NODISCARD bool gTOrdersEligibility() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 18u)) != 0; + } + + InstAttribValue &gTOrdersEligibility(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 18u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 18u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool impliedMatchingEligibility(const std::uint32_t bits) + { + return (bits & (1u << 19u)) != 0; + } + + static std::uint32_t impliedMatchingEligibility(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 19u)) : static_cast(bits & ~(1u << 19u)); + } + + SBE_NODISCARD bool impliedMatchingEligibility() const + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 19u)) != 0; + } + + InstAttribValue &impliedMatchingEligibility(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 19u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 19u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool triangulationEligible(const std::uint32_t bits) + { + return (bits & (1u << 20u)) != 0; + } + + static std::uint32_t triangulationEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 20u)) : static_cast(bits & ~(1u << 20u)); + } + + SBE_NODISCARD bool triangulationEligible() const + { + if (m_actingVersion < 9) + { + return false; + } + + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 20u)) != 0; + } + + InstAttribValue &triangulationEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 20u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 20u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + static bool variableCabEligible(const std::uint32_t bits) + { + return (bits & (1u << 21u)) != 0; + } + + static std::uint32_t variableCabEligible(const std::uint32_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 21u)) : static_cast(bits & ~(1u << 21u)); + } + + SBE_NODISCARD bool variableCabEligible() const + { + if (m_actingVersion < 9) + { + return false; + } + + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint32_t)); + return (SBE_LITTLE_ENDIAN_ENCODE_32(val) & (1u << 21u)) != 0; + } + + InstAttribValue &variableCabEligible(const bool value) + { + std::uint32_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint32_t)); + bits = SBE_LITTLE_ENDIAN_ENCODE_32(value ? static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) | (1u << 21u)) : static_cast(SBE_LITTLE_ENDIAN_ENCODE_32(bits) & ~(1u << 21u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint32_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, InstAttribValue writer) + { + builder << '['; + bool atLeastOne = false; + if (writer.electronicMatchEligible()) + { + builder << R"("electronicMatchEligible")"; + atLeastOne = true; + } + if (writer.orderCrossEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("orderCrossEligible")"; + atLeastOne = true; + } + if (writer.blockTradeEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("blockTradeEligible")"; + atLeastOne = true; + } + if (writer.eFPEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("eFPEligible")"; + atLeastOne = true; + } + if (writer.eBFEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("eBFEligible")"; + atLeastOne = true; + } + if (writer.eFSEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("eFSEligible")"; + atLeastOne = true; + } + if (writer.eFREligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("eFREligible")"; + atLeastOne = true; + } + if (writer.oTCEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("oTCEligible")"; + atLeastOne = true; + } + if (writer.iLinkIndicativeMassQuotingEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("iLinkIndicativeMassQuotingEligible")"; + atLeastOne = true; + } + if (writer.negativeStrikeEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("negativeStrikeEligible")"; + atLeastOne = true; + } + if (writer.negativePriceOutrightEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("negativePriceOutrightEligible")"; + atLeastOne = true; + } + if (writer.isFractional()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("isFractional")"; + atLeastOne = true; + } + if (writer.volatilityQuotedOption()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("volatilityQuotedOption")"; + atLeastOne = true; + } + if (writer.rFQCrossEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("rFQCrossEligible")"; + atLeastOne = true; + } + if (writer.zeroPriceOutrightEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("zeroPriceOutrightEligible")"; + atLeastOne = true; + } + if (writer.decayingProductEligibility()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("decayingProductEligibility")"; + atLeastOne = true; + } + if (writer.variableProductEligibility()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("variableProductEligibility")"; + atLeastOne = true; + } + if (writer.dailyProductEligibility()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("dailyProductEligibility")"; + atLeastOne = true; + } + if (writer.gTOrdersEligibility()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("gTOrdersEligibility")"; + atLeastOne = true; + } + if (writer.impliedMatchingEligibility()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("impliedMatchingEligibility")"; + atLeastOne = true; + } + if (writer.triangulationEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("triangulationEligible")"; + atLeastOne = true; + } + if (writer.variableCabEligible()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("variableCabEligible")"; + } + builder << ']'; + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/LegSide.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/LegSide.h new file mode 100644 index 000000000..463058413 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/LegSide.h @@ -0,0 +1,138 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_LEGSIDE_H_ +#define _MKTDATA_LEGSIDE_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class LegSide +{ +public: + enum Value + { + BuySide = (std::uint8_t)1, + SellSide = (std::uint8_t)2, + NULL_VALUE = (std::uint8_t)255 + }; + + static LegSide::Value get(const std::uint8_t value) + { + switch (value) + { + case 1: return BuySide; + case 2: return SellSide; + case 255: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum LegSide [E103]"); + } + + static const char* c_str(const LegSide::Value value) + { + switch (value) + { + case BuySide: return "BuySide"; + case SellSide: return "SellSide"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum LegSide [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, LegSide::Value m) + { + return os << LegSide::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryType.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryType.h new file mode 100644 index 000000000..d9c634f2d --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryType.h @@ -0,0 +1,183 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDENTRYTYPE_H_ +#define _MKTDATA_MDENTRYTYPE_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class MDEntryType +{ +public: + enum Value + { + Bid = (char)48, + Offer = (char)49, + Trade = (char)50, + OpenPrice = (char)52, + SettlementPrice = (char)54, + TradingSessionHighPrice = (char)55, + TradingSessionLowPrice = (char)56, + ClearedVolume = (char)66, + OpenInterest = (char)67, + ImpliedBid = (char)69, + ImpliedOffer = (char)70, + BookReset = (char)74, + SessionHighBid = (char)78, + SessionLowOffer = (char)79, + FixingPrice = (char)87, + ElectronicVolume = (char)101, + ThresholdLimitsandPriceBandVariation = (char)103, + NULL_VALUE = (char)0 + }; + + static MDEntryType::Value get(const char value) + { + switch (value) + { + case 48: return Bid; + case 49: return Offer; + case 50: return Trade; + case 52: return OpenPrice; + case 54: return SettlementPrice; + case 55: return TradingSessionHighPrice; + case 56: return TradingSessionLowPrice; + case 66: return ClearedVolume; + case 67: return OpenInterest; + case 69: return ImpliedBid; + case 70: return ImpliedOffer; + case 74: return BookReset; + case 78: return SessionHighBid; + case 79: return SessionLowOffer; + case 87: return FixingPrice; + case 101: return ElectronicVolume; + case 103: return ThresholdLimitsandPriceBandVariation; + case 0: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum MDEntryType [E103]"); + } + + static const char* c_str(const MDEntryType::Value value) + { + switch (value) + { + case Bid: return "Bid"; + case Offer: return "Offer"; + case Trade: return "Trade"; + case OpenPrice: return "OpenPrice"; + case SettlementPrice: return "SettlementPrice"; + case TradingSessionHighPrice: return "TradingSessionHighPrice"; + case TradingSessionLowPrice: return "TradingSessionLowPrice"; + case ClearedVolume: return "ClearedVolume"; + case OpenInterest: return "OpenInterest"; + case ImpliedBid: return "ImpliedBid"; + case ImpliedOffer: return "ImpliedOffer"; + case BookReset: return "BookReset"; + case SessionHighBid: return "SessionHighBid"; + case SessionLowOffer: return "SessionLowOffer"; + case FixingPrice: return "FixingPrice"; + case ElectronicVolume: return "ElectronicVolume"; + case ThresholdLimitsandPriceBandVariation: return "ThresholdLimitsandPriceBandVariation"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum MDEntryType [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, MDEntryType::Value m) + { + return os << MDEntryType::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryTypeBook.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryTypeBook.h new file mode 100644 index 000000000..ebee5dbcf --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryTypeBook.h @@ -0,0 +1,147 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDENTRYTYPEBOOK_H_ +#define _MKTDATA_MDENTRYTYPEBOOK_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class MDEntryTypeBook +{ +public: + enum Value + { + Bid = (char)48, + Offer = (char)49, + ImpliedBid = (char)69, + ImpliedOffer = (char)70, + BookReset = (char)74, + NULL_VALUE = (char)0 + }; + + static MDEntryTypeBook::Value get(const char value) + { + switch (value) + { + case 48: return Bid; + case 49: return Offer; + case 69: return ImpliedBid; + case 70: return ImpliedOffer; + case 74: return BookReset; + case 0: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum MDEntryTypeBook [E103]"); + } + + static const char* c_str(const MDEntryTypeBook::Value value) + { + switch (value) + { + case Bid: return "Bid"; + case Offer: return "Offer"; + case ImpliedBid: return "ImpliedBid"; + case ImpliedOffer: return "ImpliedOffer"; + case BookReset: return "BookReset"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum MDEntryTypeBook [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, MDEntryTypeBook::Value m) + { + return os << MDEntryTypeBook::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryTypeDailyStatistics.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryTypeDailyStatistics.h new file mode 100644 index 000000000..8137f1e51 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryTypeDailyStatistics.h @@ -0,0 +1,144 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDENTRYTYPEDAILYSTATISTICS_H_ +#define _MKTDATA_MDENTRYTYPEDAILYSTATISTICS_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class MDEntryTypeDailyStatistics +{ +public: + enum Value + { + SettlementPrice = (char)54, + ClearedVolume = (char)66, + OpenInterest = (char)67, + FixingPrice = (char)87, + NULL_VALUE = (char)0 + }; + + static MDEntryTypeDailyStatistics::Value get(const char value) + { + switch (value) + { + case 54: return SettlementPrice; + case 66: return ClearedVolume; + case 67: return OpenInterest; + case 87: return FixingPrice; + case 0: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum MDEntryTypeDailyStatistics [E103]"); + } + + static const char* c_str(const MDEntryTypeDailyStatistics::Value value) + { + switch (value) + { + case SettlementPrice: return "SettlementPrice"; + case ClearedVolume: return "ClearedVolume"; + case OpenInterest: return "OpenInterest"; + case FixingPrice: return "FixingPrice"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum MDEntryTypeDailyStatistics [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, MDEntryTypeDailyStatistics::Value m) + { + return os << MDEntryTypeDailyStatistics::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryTypeStatistics.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryTypeStatistics.h new file mode 100644 index 000000000..8f127fdc0 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDEntryTypeStatistics.h @@ -0,0 +1,147 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDENTRYTYPESTATISTICS_H_ +#define _MKTDATA_MDENTRYTYPESTATISTICS_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class MDEntryTypeStatistics +{ +public: + enum Value + { + OpenPrice = (char)52, + HighTrade = (char)55, + LowTrade = (char)56, + HighestBid = (char)78, + LowestOffer = (char)79, + NULL_VALUE = (char)0 + }; + + static MDEntryTypeStatistics::Value get(const char value) + { + switch (value) + { + case 52: return OpenPrice; + case 55: return HighTrade; + case 56: return LowTrade; + case 78: return HighestBid; + case 79: return LowestOffer; + case 0: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum MDEntryTypeStatistics [E103]"); + } + + static const char* c_str(const MDEntryTypeStatistics::Value value) + { + switch (value) + { + case OpenPrice: return "OpenPrice"; + case HighTrade: return "HighTrade"; + case LowTrade: return "LowTrade"; + case HighestBid: return "HighestBid"; + case LowestOffer: return "LowestOffer"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum MDEntryTypeStatistics [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, MDEntryTypeStatistics::Value m) + { + return os << MDEntryTypeStatistics::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshBook32.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshBook32.h new file mode 100644 index 000000000..0ab377744 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshBook32.h @@ -0,0 +1,1796 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHBOOK32_H_ +#define _MKTDATA_MDINCREMENTALREFRESHBOOK32_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshBook32 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshBook32() = default; + + MDIncrementalRefreshBook32( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshBook32(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshBook32(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshBook32( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshBook32(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)32; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshBook32 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshBook32(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshBook32 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshBook32( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshBook32 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshBook32(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshBook32 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)32); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 32; + 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 32; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICENULL m_mDEntryPx; + +public: + SBE_NODISCARD PRICENULL &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDEntrySizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntrySizeId() SBE_NOEXCEPT + { + return 271; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntrySizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntrySizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntrySizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDEntrySize() 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); + } + + NoMDEntries &mDEntrySize(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 * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= rptSeqSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * NumberOfOrdersMetaAttribute(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 numberOfOrdersId() SBE_NOEXCEPT + { + return 346; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t numberOfOrdersSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool numberOfOrdersInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= numberOfOrdersSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t numberOfOrders() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &numberOfOrders(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * MDPriceLevelMetaAttribute(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 mDPriceLevelId() SBE_NOEXCEPT + { + return 1023; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDPriceLevelSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDPriceLevelInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDPriceLevelSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDPriceLevelEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::uint8_t mDPriceLevelNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t mDPriceLevelMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t mDPriceLevelMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t mDPriceLevelEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t mDPriceLevel() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::uint8_t)); + return (val); + } + + NoMDEntries &mDPriceLevel(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(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 mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 25; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDUpdateAction::Value mDUpdateAction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 25, sizeof(std::uint8_t)); + return MDUpdateAction::get((val)); + } + + NoMDEntries &mDUpdateAction(const MDUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 25, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 26; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryTypeBook::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 26, sizeof(char)); + return MDEntryTypeBook::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryTypeBook::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 26, &val, sizeof(char)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDEntrySize": )"; + builder << +writer.mDEntrySize(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << ", "; + builder << R"("NumberOfOrders": )"; + builder << +writer.numberOfOrders(); + + builder << ", "; + builder << R"("MDPriceLevel": )"; + builder << +writer.mDPriceLevel(); + + builder << ", "; + builder << R"("MDUpdateAction": )"; + builder << '"' << writer.mDUpdateAction() << '"'; + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoOrderIDEntries + { + 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) + { + GroupSize8Byte 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 + 8; + } + + 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; + GroupSize8Byte dimensions(buffer, *pos, bufferLength, actingVersion); + dimensions.blockLength((std::uint16_t)24); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 24; + m_actingVersion = actingVersion; + m_initialPosition = *pos; + m_positionPtr = pos; + *m_positionPtr = *m_positionPtr + 8; + } + + static SBE_CONSTEXPR std::uint64_t sbeHeaderSize() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t sbeBlockLength() SBE_NOEXCEPT + { + return 24; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoOrderIDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize8Byte dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * OrderIDMetaAttribute(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 orderIDId() SBE_NOEXCEPT + { + return 37; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t orderIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool orderIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= orderIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t orderIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t orderIDEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t orderID() 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); + } + + NoOrderIDEntries &orderID(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 * MDOrderPriorityMetaAttribute(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 mDOrderPriorityId() SBE_NOEXCEPT + { + return 37707; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDOrderPrioritySinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool mDOrderPriorityInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDOrderPrioritySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityNullValue() SBE_NOEXCEPT + { + return 0xffffffffffffffffL; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t mDOrderPriority() const SBE_NOEXCEPT + { + if (m_actingVersion < 7) + { + return 0xffffffffffffffffL; + } + + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 8, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoOrderIDEntries &mDOrderPriority(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 8, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDDisplayQtyMetaAttribute(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 mDDisplayQtyId() SBE_NOEXCEPT + { + return 37706; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDDisplayQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDDisplayQtyInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDDisplayQtySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDDisplayQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoOrderIDEntries &mDDisplayQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * ReferenceIDMetaAttribute(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 referenceIDId() SBE_NOEXCEPT + { + return 9633; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t referenceIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool referenceIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= referenceIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t referenceIDEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint8_t referenceIDNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t referenceIDMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t referenceIDMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t referenceIDEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t referenceID() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::uint8_t)); + return (val); + } + + NoOrderIDEntries &referenceID(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * OrderUpdateActionMetaAttribute(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 orderUpdateActionId() SBE_NOEXCEPT + { + return 37708; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t orderUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool orderUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= orderUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 21; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD OrderUpdateAction::Value orderUpdateAction() const SBE_NOEXCEPT + { + if (m_actingVersion < 7) + { + return OrderUpdateAction::NULL_VALUE; + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 21, sizeof(std::uint8_t)); + return OrderUpdateAction::get((val)); + } + + NoOrderIDEntries &orderUpdateAction(const OrderUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 21, &val, sizeof(std::uint8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoOrderIDEntries writer) + { + builder << '{'; + builder << R"("OrderID": )"; + builder << +writer.orderID(); + + builder << ", "; + builder << R"("MDOrderPriority": )"; + builder << +writer.mDOrderPriority(); + + builder << ", "; + builder << R"("MDDisplayQty": )"; + builder << +writer.mDDisplayQty(); + + builder << ", "; + builder << R"("ReferenceID": )"; + builder << +writer.referenceID(); + + builder << ", "; + builder << R"("OrderUpdateAction": )"; + builder << '"' << writer.orderUpdateAction() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoOrderIDEntries m_noOrderIDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoOrderIDEntriesId() SBE_NOEXCEPT + { + return 37705; + } + + SBE_NODISCARD inline NoOrderIDEntries &noOrderIDEntries() + { + m_noOrderIDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noOrderIDEntries; + } + + NoOrderIDEntries &noOrderIDEntriesCount(const std::uint8_t count) + { + m_noOrderIDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noOrderIDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noOrderIDEntriesSinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool noOrderIDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noOrderIDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshBook32 _writer) + { + MDIncrementalRefreshBook32 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshBook32", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoOrderIDEntries": [)"; + writer.noOrderIDEntries().forEach([&](NoOrderIDEntries& noOrderIDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noOrderIDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshBook46.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshBook46.h new file mode 100644 index 000000000..1880e1a59 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshBook46.h @@ -0,0 +1,1796 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHBOOK46_H_ +#define _MKTDATA_MDINCREMENTALREFRESHBOOK46_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshBook46 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshBook46() = default; + + MDIncrementalRefreshBook46( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshBook46(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshBook46(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshBook46( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshBook46(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)46; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshBook46 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshBook46(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshBook46 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshBook46( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshBook46 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshBook46(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshBook46 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)32); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 32; + 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 32; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICENULL9 m_mDEntryPx; + +public: + SBE_NODISCARD PRICENULL9 &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDEntrySizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntrySizeId() SBE_NOEXCEPT + { + return 271; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntrySizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntrySizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntrySizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDEntrySize() 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); + } + + NoMDEntries &mDEntrySize(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 * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= rptSeqSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * NumberOfOrdersMetaAttribute(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 numberOfOrdersId() SBE_NOEXCEPT + { + return 346; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t numberOfOrdersSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool numberOfOrdersInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= numberOfOrdersSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t numberOfOrders() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &numberOfOrders(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * MDPriceLevelMetaAttribute(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 mDPriceLevelId() SBE_NOEXCEPT + { + return 1023; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDPriceLevelSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDPriceLevelInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDPriceLevelSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDPriceLevelEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::uint8_t mDPriceLevelNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t mDPriceLevelMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t mDPriceLevelMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t mDPriceLevelEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t mDPriceLevel() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::uint8_t)); + return (val); + } + + NoMDEntries &mDPriceLevel(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(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 mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 25; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDUpdateAction::Value mDUpdateAction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 25, sizeof(std::uint8_t)); + return MDUpdateAction::get((val)); + } + + NoMDEntries &mDUpdateAction(const MDUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 25, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 26; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryTypeBook::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 26, sizeof(char)); + return MDEntryTypeBook::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryTypeBook::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 26, &val, sizeof(char)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDEntrySize": )"; + builder << +writer.mDEntrySize(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << ", "; + builder << R"("NumberOfOrders": )"; + builder << +writer.numberOfOrders(); + + builder << ", "; + builder << R"("MDPriceLevel": )"; + builder << +writer.mDPriceLevel(); + + builder << ", "; + builder << R"("MDUpdateAction": )"; + builder << '"' << writer.mDUpdateAction() << '"'; + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoOrderIDEntries + { + 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) + { + GroupSize8Byte 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 + 8; + } + + 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; + GroupSize8Byte dimensions(buffer, *pos, bufferLength, actingVersion); + dimensions.blockLength((std::uint16_t)24); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 24; + m_actingVersion = actingVersion; + m_initialPosition = *pos; + m_positionPtr = pos; + *m_positionPtr = *m_positionPtr + 8; + } + + static SBE_CONSTEXPR std::uint64_t sbeHeaderSize() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t sbeBlockLength() SBE_NOEXCEPT + { + return 24; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoOrderIDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize8Byte dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * OrderIDMetaAttribute(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 orderIDId() SBE_NOEXCEPT + { + return 37; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t orderIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool orderIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= orderIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t orderIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t orderIDEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t orderID() 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); + } + + NoOrderIDEntries &orderID(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 * MDOrderPriorityMetaAttribute(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 mDOrderPriorityId() SBE_NOEXCEPT + { + return 37707; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDOrderPrioritySinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool mDOrderPriorityInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDOrderPrioritySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityNullValue() SBE_NOEXCEPT + { + return 0xffffffffffffffffL; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t mDOrderPriority() const SBE_NOEXCEPT + { + if (m_actingVersion < 7) + { + return 0xffffffffffffffffL; + } + + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 8, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoOrderIDEntries &mDOrderPriority(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 8, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDDisplayQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDDisplayQtyId() SBE_NOEXCEPT + { + return 37706; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDDisplayQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDDisplayQtyInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDDisplayQtySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDDisplayQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoOrderIDEntries &mDDisplayQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * ReferenceIDMetaAttribute(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 referenceIDId() SBE_NOEXCEPT + { + return 9633; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t referenceIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool referenceIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= referenceIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t referenceIDEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint8_t referenceIDNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t referenceIDMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t referenceIDMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t referenceIDEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t referenceID() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::uint8_t)); + return (val); + } + + NoOrderIDEntries &referenceID(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * OrderUpdateActionMetaAttribute(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 orderUpdateActionId() SBE_NOEXCEPT + { + return 37708; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t orderUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool orderUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= orderUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 21; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD OrderUpdateAction::Value orderUpdateAction() const SBE_NOEXCEPT + { + if (m_actingVersion < 7) + { + return OrderUpdateAction::NULL_VALUE; + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 21, sizeof(std::uint8_t)); + return OrderUpdateAction::get((val)); + } + + NoOrderIDEntries &orderUpdateAction(const OrderUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 21, &val, sizeof(std::uint8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoOrderIDEntries writer) + { + builder << '{'; + builder << R"("OrderID": )"; + builder << +writer.orderID(); + + builder << ", "; + builder << R"("MDOrderPriority": )"; + builder << +writer.mDOrderPriority(); + + builder << ", "; + builder << R"("MDDisplayQty": )"; + builder << +writer.mDDisplayQty(); + + builder << ", "; + builder << R"("ReferenceID": )"; + builder << +writer.referenceID(); + + builder << ", "; + builder << R"("OrderUpdateAction": )"; + builder << '"' << writer.orderUpdateAction() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoOrderIDEntries m_noOrderIDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoOrderIDEntriesId() SBE_NOEXCEPT + { + return 37705; + } + + SBE_NODISCARD inline NoOrderIDEntries &noOrderIDEntries() + { + m_noOrderIDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noOrderIDEntries; + } + + NoOrderIDEntries &noOrderIDEntriesCount(const std::uint8_t count) + { + m_noOrderIDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noOrderIDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noOrderIDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noOrderIDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noOrderIDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshBook46 _writer) + { + MDIncrementalRefreshBook46 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshBook46", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoOrderIDEntries": [)"; + writer.noOrderIDEntries().forEach([&](NoOrderIDEntries& noOrderIDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noOrderIDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshDailyStatistics33.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshDailyStatistics33.h new file mode 100644 index 000000000..45c99fa13 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshDailyStatistics33.h @@ -0,0 +1,1188 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHDAILYSTATISTICS33_H_ +#define _MKTDATA_MDINCREMENTALREFRESHDAILYSTATISTICS33_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshDailyStatistics33 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshDailyStatistics33() = default; + + MDIncrementalRefreshDailyStatistics33( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshDailyStatistics33(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshDailyStatistics33(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshDailyStatistics33( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshDailyStatistics33(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)33; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshDailyStatistics33 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshDailyStatistics33(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshDailyStatistics33 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshDailyStatistics33( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshDailyStatistics33 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshDailyStatistics33(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshDailyStatistics33 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)32); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 32; + 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 32; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICENULL m_mDEntryPx; + +public: + SBE_NODISCARD PRICENULL &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDEntrySizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntrySizeId() SBE_NOEXCEPT + { + return 271; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntrySizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntrySizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntrySizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDEntrySize() 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); + } + + NoMDEntries &mDEntrySize(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 * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= rptSeqSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * TradingReferenceDateMetaAttribute(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 tradingReferenceDateId() SBE_NOEXCEPT + { + return 5796; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferenceDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradingReferenceDateInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= tradingReferenceDateSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradingReferenceDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + NoMDEntries &tradingReferenceDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char * SettlPriceTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlPriceTypeId() SBE_NOEXCEPT + { + return 731; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlPriceTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlPriceTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= settlPriceTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingOffset() SBE_NOEXCEPT + { + return 22; + } + + private: + SettlPriceType m_settlPriceType; + + public: + SBE_NODISCARD SettlPriceType &settlPriceType() + { + m_settlPriceType.wrap(m_buffer, m_offset + 22, m_actingVersion, m_bufferLength); + return m_settlPriceType; + } + + static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(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 mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 23; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDUpdateAction::Value mDUpdateAction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 23, sizeof(std::uint8_t)); + return MDUpdateAction::get((val)); + } + + NoMDEntries &mDUpdateAction(const MDUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 23, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryTypeDailyStatistics::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(char)); + return MDEntryTypeDailyStatistics::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryTypeDailyStatistics::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(char)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDEntrySize": )"; + builder << +writer.mDEntrySize(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << ", "; + builder << R"("TradingReferenceDate": )"; + builder << +writer.tradingReferenceDate(); + + builder << ", "; + builder << R"("SettlPriceType": )"; + builder << writer.settlPriceType(); + + builder << ", "; + builder << R"("MDUpdateAction": )"; + builder << '"' << writer.mDUpdateAction() << '"'; + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshDailyStatistics33 _writer) + { + MDIncrementalRefreshDailyStatistics33 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshDailyStatistics33", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshDailyStatistics49.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshDailyStatistics49.h new file mode 100644 index 000000000..b00d9437f --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshDailyStatistics49.h @@ -0,0 +1,1188 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHDAILYSTATISTICS49_H_ +#define _MKTDATA_MDINCREMENTALREFRESHDAILYSTATISTICS49_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshDailyStatistics49 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshDailyStatistics49() = default; + + MDIncrementalRefreshDailyStatistics49( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshDailyStatistics49(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshDailyStatistics49(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshDailyStatistics49( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshDailyStatistics49(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)49; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshDailyStatistics49 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshDailyStatistics49(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshDailyStatistics49 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshDailyStatistics49( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshDailyStatistics49 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshDailyStatistics49(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshDailyStatistics49 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)32); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 32; + 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 32; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICENULL9 m_mDEntryPx; + +public: + SBE_NODISCARD PRICENULL9 &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDEntrySizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntrySizeId() SBE_NOEXCEPT + { + return 271; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntrySizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntrySizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntrySizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDEntrySize() 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); + } + + NoMDEntries &mDEntrySize(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 * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= rptSeqSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * TradingReferenceDateMetaAttribute(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 tradingReferenceDateId() SBE_NOEXCEPT + { + return 5796; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferenceDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradingReferenceDateInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= tradingReferenceDateSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradingReferenceDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + NoMDEntries &tradingReferenceDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char * SettlPriceTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlPriceTypeId() SBE_NOEXCEPT + { + return 731; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlPriceTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlPriceTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= settlPriceTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingOffset() SBE_NOEXCEPT + { + return 22; + } + + private: + SettlPriceType m_settlPriceType; + + public: + SBE_NODISCARD SettlPriceType &settlPriceType() + { + m_settlPriceType.wrap(m_buffer, m_offset + 22, m_actingVersion, m_bufferLength); + return m_settlPriceType; + } + + static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(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 mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 23; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDUpdateAction::Value mDUpdateAction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 23, sizeof(std::uint8_t)); + return MDUpdateAction::get((val)); + } + + NoMDEntries &mDUpdateAction(const MDUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 23, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryTypeDailyStatistics::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(char)); + return MDEntryTypeDailyStatistics::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryTypeDailyStatistics::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(char)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDEntrySize": )"; + builder << +writer.mDEntrySize(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << ", "; + builder << R"("TradingReferenceDate": )"; + builder << +writer.tradingReferenceDate(); + + builder << ", "; + builder << R"("SettlPriceType": )"; + builder << writer.settlPriceType(); + + builder << ", "; + builder << R"("MDUpdateAction": )"; + builder << '"' << writer.mDUpdateAction() << '"'; + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshDailyStatistics49 _writer) + { + MDIncrementalRefreshDailyStatistics49 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshDailyStatistics49", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshLimitsBanding34.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshLimitsBanding34.h new file mode 100644 index 000000000..dba07337f --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshLimitsBanding34.h @@ -0,0 +1,1151 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHLIMITSBANDING34_H_ +#define _MKTDATA_MDINCREMENTALREFRESHLIMITSBANDING34_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshLimitsBanding34 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshLimitsBanding34() = default; + + MDIncrementalRefreshLimitsBanding34( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshLimitsBanding34(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshLimitsBanding34(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshLimitsBanding34( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshLimitsBanding34(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)34; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshLimitsBanding34 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshLimitsBanding34(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshLimitsBanding34 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshLimitsBanding34( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshLimitsBanding34 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshLimitsBanding34(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshLimitsBanding34 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)32); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 32; + 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 32; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * HighLimitPriceMetaAttribute(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 highLimitPriceId() SBE_NOEXCEPT + { + return 1149; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t highLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool highLimitPriceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= highLimitPriceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t highLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICENULL m_highLimitPrice; + +public: + SBE_NODISCARD PRICENULL &highLimitPrice() + { + m_highLimitPrice.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_highLimitPrice; + } + + SBE_NODISCARD static const char * LowLimitPriceMetaAttribute(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 lowLimitPriceId() SBE_NOEXCEPT + { + return 1148; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lowLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lowLimitPriceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= lowLimitPriceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lowLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + PRICENULL m_lowLimitPrice; + +public: + SBE_NODISCARD PRICENULL &lowLimitPrice() + { + m_lowLimitPrice.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_lowLimitPrice; + } + + SBE_NODISCARD static const char * MaxPriceVariationMetaAttribute(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 maxPriceVariationId() SBE_NOEXCEPT + { + return 1143; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxPriceVariationSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maxPriceVariationInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= maxPriceVariationSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxPriceVariationEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + +private: + PRICENULL m_maxPriceVariation; + +public: + SBE_NODISCARD PRICENULL &maxPriceVariation() + { + m_maxPriceVariation.wrap(m_buffer, m_offset + 16, m_actingVersion, m_bufferLength); + return m_maxPriceVariation; + } + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= rptSeqSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 28; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 28, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 28, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 32; + } + + static SBE_CONSTEXPR std::int8_t mDUpdateActionNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t mDUpdateActionMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t mDUpdateActionMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t mDUpdateAction() SBE_NOEXCEPT + { + return (std::int8_t)0; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 32; + } + + static SBE_CONSTEXPR char mDEntryTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDEntryTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDEntryTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t mDEntryTypeLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *mDEntryType() const + { + static const std::uint8_t mDEntryTypeValues[] = { 103 }; + + return (const char *)mDEntryTypeValues; + } + + SBE_NODISCARD char mDEntryType(const std::uint64_t index) const + { + static const std::uint8_t mDEntryTypeValues[] = { 103 }; + + return (char)mDEntryTypeValues[index]; + } + + std::uint64_t getMDEntryType(char *dst, const std::uint64_t length) const + { + static std::uint8_t mDEntryTypeValues[] = { 103 }; + std::uint64_t bytesToCopy = length < sizeof(mDEntryTypeValues) ? length : sizeof(mDEntryTypeValues); + + std::memcpy(dst, mDEntryTypeValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getMDEntryTypeAsString() const + { + static const std::uint8_t MDEntryTypeValues[] = { 103 }; + + return std::string((const char *)MDEntryTypeValues, 1); + } + + std::string getMDEntryTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDEntryTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("HighLimitPrice": )"; + builder << writer.highLimitPrice(); + + builder << ", "; + builder << R"("LowLimitPrice": )"; + builder << writer.lowLimitPrice(); + + builder << ", "; + builder << R"("MaxPriceVariation": )"; + builder << writer.maxPriceVariation(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshLimitsBanding34 _writer) + { + MDIncrementalRefreshLimitsBanding34 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshLimitsBanding34", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshLimitsBanding50.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshLimitsBanding50.h new file mode 100644 index 000000000..3e0df50c5 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshLimitsBanding50.h @@ -0,0 +1,1151 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHLIMITSBANDING50_H_ +#define _MKTDATA_MDINCREMENTALREFRESHLIMITSBANDING50_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshLimitsBanding50 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshLimitsBanding50() = default; + + MDIncrementalRefreshLimitsBanding50( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshLimitsBanding50(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshLimitsBanding50(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshLimitsBanding50( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshLimitsBanding50(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)50; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshLimitsBanding50 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshLimitsBanding50(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshLimitsBanding50 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshLimitsBanding50( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshLimitsBanding50 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshLimitsBanding50(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshLimitsBanding50 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)32); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 32; + 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 32; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * HighLimitPriceMetaAttribute(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 highLimitPriceId() SBE_NOEXCEPT + { + return 1149; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t highLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool highLimitPriceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= highLimitPriceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t highLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICENULL9 m_highLimitPrice; + +public: + SBE_NODISCARD PRICENULL9 &highLimitPrice() + { + m_highLimitPrice.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_highLimitPrice; + } + + SBE_NODISCARD static const char * LowLimitPriceMetaAttribute(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 lowLimitPriceId() SBE_NOEXCEPT + { + return 1148; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lowLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool lowLimitPriceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= lowLimitPriceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lowLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + PRICENULL9 m_lowLimitPrice; + +public: + SBE_NODISCARD PRICENULL9 &lowLimitPrice() + { + m_lowLimitPrice.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_lowLimitPrice; + } + + SBE_NODISCARD static const char * MaxPriceVariationMetaAttribute(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 maxPriceVariationId() SBE_NOEXCEPT + { + return 1143; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxPriceVariationSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool maxPriceVariationInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= maxPriceVariationSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxPriceVariationEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + +private: + PRICENULL9 m_maxPriceVariation; + +public: + SBE_NODISCARD PRICENULL9 &maxPriceVariation() + { + m_maxPriceVariation.wrap(m_buffer, m_offset + 16, m_actingVersion, m_bufferLength); + return m_maxPriceVariation; + } + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= rptSeqSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 28; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 28, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 28, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 32; + } + + static SBE_CONSTEXPR std::int8_t mDUpdateActionNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t mDUpdateActionMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t mDUpdateActionMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t mDUpdateAction() SBE_NOEXCEPT + { + return (std::int8_t)0; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 32; + } + + static SBE_CONSTEXPR char mDEntryTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDEntryTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDEntryTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t mDEntryTypeLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *mDEntryType() const + { + static const std::uint8_t mDEntryTypeValues[] = { 103 }; + + return (const char *)mDEntryTypeValues; + } + + SBE_NODISCARD char mDEntryType(const std::uint64_t index) const + { + static const std::uint8_t mDEntryTypeValues[] = { 103 }; + + return (char)mDEntryTypeValues[index]; + } + + std::uint64_t getMDEntryType(char *dst, const std::uint64_t length) const + { + static std::uint8_t mDEntryTypeValues[] = { 103 }; + std::uint64_t bytesToCopy = length < sizeof(mDEntryTypeValues) ? length : sizeof(mDEntryTypeValues); + + std::memcpy(dst, mDEntryTypeValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getMDEntryTypeAsString() const + { + static const std::uint8_t MDEntryTypeValues[] = { 103 }; + + return std::string((const char *)MDEntryTypeValues, 1); + } + + std::string getMDEntryTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDEntryTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("HighLimitPrice": )"; + builder << writer.highLimitPrice(); + + builder << ", "; + builder << R"("LowLimitPrice": )"; + builder << writer.lowLimitPrice(); + + builder << ", "; + builder << R"("MaxPriceVariation": )"; + builder << writer.maxPriceVariation(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshLimitsBanding50 _writer) + { + MDIncrementalRefreshLimitsBanding50 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshLimitsBanding50", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshOrderBook43.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshOrderBook43.h new file mode 100644 index 000000000..cce572e02 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshOrderBook43.h @@ -0,0 +1,1142 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHORDERBOOK43_H_ +#define _MKTDATA_MDINCREMENTALREFRESHORDERBOOK43_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshOrderBook43 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshOrderBook43() = default; + + MDIncrementalRefreshOrderBook43( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshOrderBook43(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshOrderBook43(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshOrderBook43( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshOrderBook43(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)43; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshOrderBook43 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshOrderBook43(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshOrderBook43 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshOrderBook43( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshOrderBook43 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshOrderBook43(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshOrderBook43 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)40); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 40; + 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 40; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * OrderIDMetaAttribute(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 orderIDId() SBE_NOEXCEPT + { + return 37; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t orderIDSinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool orderIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= orderIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t orderIDNullValue() SBE_NOEXCEPT + { + return 0xffffffffffffffffL; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t orderIDEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t orderID() const SBE_NOEXCEPT + { + if (m_actingVersion < 7) + { + return 0xffffffffffffffffL; + } + + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoMDEntries &orderID(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 * MDOrderPriorityMetaAttribute(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 mDOrderPriorityId() SBE_NOEXCEPT + { + return 37707; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDOrderPrioritySinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool mDOrderPriorityInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDOrderPrioritySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityNullValue() SBE_NOEXCEPT + { + return 0xffffffffffffffffL; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t mDOrderPriority() const SBE_NOEXCEPT + { + if (m_actingVersion < 7) + { + return 0xffffffffffffffffL; + } + + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 8, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoMDEntries &mDOrderPriority(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 8, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + +private: + PRICENULL m_mDEntryPx; + +public: + SBE_NODISCARD PRICENULL &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 16, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDDisplayQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDDisplayQtyId() SBE_NOEXCEPT + { + return 37706; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDDisplayQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDDisplayQtyInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDDisplayQtySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDDisplayQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &mDDisplayQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 28; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 28, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 28, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(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 mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 32; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDUpdateAction::Value mDUpdateAction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 32, sizeof(std::uint8_t)); + return MDUpdateAction::get((val)); + } + + NoMDEntries &mDUpdateAction(const MDUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 32, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 33; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryTypeBook::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 33, sizeof(char)); + return MDEntryTypeBook::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryTypeBook::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 33, &val, sizeof(char)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("OrderID": )"; + builder << +writer.orderID(); + + builder << ", "; + builder << R"("MDOrderPriority": )"; + builder << +writer.mDOrderPriority(); + + builder << ", "; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDDisplayQty": )"; + builder << +writer.mDDisplayQty(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("MDUpdateAction": )"; + builder << '"' << writer.mDUpdateAction() << '"'; + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshOrderBook43 _writer) + { + MDIncrementalRefreshOrderBook43 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshOrderBook43", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshOrderBook47.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshOrderBook47.h new file mode 100644 index 000000000..04884ab92 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshOrderBook47.h @@ -0,0 +1,1142 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHORDERBOOK47_H_ +#define _MKTDATA_MDINCREMENTALREFRESHORDERBOOK47_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshOrderBook47 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshOrderBook47() = default; + + MDIncrementalRefreshOrderBook47( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshOrderBook47(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshOrderBook47(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshOrderBook47( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshOrderBook47(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)47; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshOrderBook47 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshOrderBook47(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshOrderBook47 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshOrderBook47( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshOrderBook47 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshOrderBook47(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshOrderBook47 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)40); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 40; + 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 40; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * OrderIDMetaAttribute(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 orderIDId() SBE_NOEXCEPT + { + return 37; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t orderIDSinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool orderIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= orderIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t orderIDNullValue() SBE_NOEXCEPT + { + return 0xffffffffffffffffL; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t orderIDEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t orderID() const SBE_NOEXCEPT + { + if (m_actingVersion < 7) + { + return 0xffffffffffffffffL; + } + + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoMDEntries &orderID(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 * MDOrderPriorityMetaAttribute(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 mDOrderPriorityId() SBE_NOEXCEPT + { + return 37707; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDOrderPrioritySinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool mDOrderPriorityInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDOrderPrioritySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityNullValue() SBE_NOEXCEPT + { + return 0xffffffffffffffffL; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t mDOrderPriority() const SBE_NOEXCEPT + { + if (m_actingVersion < 7) + { + return 0xffffffffffffffffL; + } + + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 8, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoMDEntries &mDOrderPriority(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 8, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + +private: + PRICENULL9 m_mDEntryPx; + +public: + SBE_NODISCARD PRICENULL9 &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 16, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDDisplayQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDDisplayQtyId() SBE_NOEXCEPT + { + return 37706; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDDisplayQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDDisplayQtyInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDDisplayQtySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDDisplayQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &mDDisplayQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 28; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 28, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 28, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(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 mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 32; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDUpdateAction::Value mDUpdateAction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 32, sizeof(std::uint8_t)); + return MDUpdateAction::get((val)); + } + + NoMDEntries &mDUpdateAction(const MDUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 32, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 33; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryTypeBook::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 33, sizeof(char)); + return MDEntryTypeBook::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryTypeBook::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 33, &val, sizeof(char)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("OrderID": )"; + builder << +writer.orderID(); + + builder << ", "; + builder << R"("MDOrderPriority": )"; + builder << +writer.mDOrderPriority(); + + builder << ", "; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDDisplayQty": )"; + builder << +writer.mDDisplayQty(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("MDUpdateAction": )"; + builder << '"' << writer.mDUpdateAction() << '"'; + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshOrderBook47 _writer) + { + MDIncrementalRefreshOrderBook47 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshOrderBook47", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshSessionStatistics35.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshSessionStatistics35.h new file mode 100644 index 000000000..1116f0471 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshSessionStatistics35.h @@ -0,0 +1,1122 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHSESSIONSTATISTICS35_H_ +#define _MKTDATA_MDINCREMENTALREFRESHSESSIONSTATISTICS35_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshSessionStatistics35 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshSessionStatistics35() = default; + + MDIncrementalRefreshSessionStatistics35( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshSessionStatistics35(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshSessionStatistics35(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshSessionStatistics35( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshSessionStatistics35(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)35; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshSessionStatistics35 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshSessionStatistics35(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshSessionStatistics35 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshSessionStatistics35( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshSessionStatistics35 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshSessionStatistics35(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshSessionStatistics35 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)24); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 24; + 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 24; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICE m_mDEntryPx; + +public: + SBE_NODISCARD PRICE &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() 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); + } + + NoMDEntries &securityID(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 * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= rptSeqSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * OpenCloseSettlFlagMetaAttribute(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 openCloseSettlFlagId() SBE_NOEXCEPT + { + return 286; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t openCloseSettlFlagSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool openCloseSettlFlagInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= openCloseSettlFlagSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openCloseSettlFlagEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openCloseSettlFlagEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD OpenCloseSettlFlag::Value openCloseSettlFlag() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint8_t)); + return OpenCloseSettlFlag::get((val)); + } + + NoMDEntries &openCloseSettlFlag(const OpenCloseSettlFlag::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(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 mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 17; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDUpdateAction::Value mDUpdateAction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 17, sizeof(std::uint8_t)); + return MDUpdateAction::get((val)); + } + + NoMDEntries &mDUpdateAction(const MDUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 17, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 18; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryTypeStatistics::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 18, sizeof(char)); + return MDEntryTypeStatistics::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryTypeStatistics::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 18, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * MDEntrySizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntrySizeId() SBE_NOEXCEPT + { + return 271; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntrySizeSinceVersion() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD bool mDEntrySizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntrySizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingOffset() SBE_NOEXCEPT + { + return 19; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDEntrySize() const SBE_NOEXCEPT + { + if (m_actingVersion < 8) + { + return 2147483647; + } + + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 19, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &mDEntrySize(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 19, &val, sizeof(std::int32_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << ", "; + builder << R"("OpenCloseSettlFlag": )"; + builder << '"' << writer.openCloseSettlFlag() << '"'; + + builder << ", "; + builder << R"("MDUpdateAction": )"; + builder << '"' << writer.mDUpdateAction() << '"'; + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << ", "; + builder << R"("MDEntrySize": )"; + builder << +writer.mDEntrySize(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshSessionStatistics35 _writer) + { + MDIncrementalRefreshSessionStatistics35 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshSessionStatistics35", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshSessionStatistics51.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshSessionStatistics51.h new file mode 100644 index 000000000..7427fd7fe --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshSessionStatistics51.h @@ -0,0 +1,1117 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHSESSIONSTATISTICS51_H_ +#define _MKTDATA_MDINCREMENTALREFRESHSESSIONSTATISTICS51_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshSessionStatistics51 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshSessionStatistics51() = default; + + MDIncrementalRefreshSessionStatistics51( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshSessionStatistics51(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshSessionStatistics51(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshSessionStatistics51( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshSessionStatistics51(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)51; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshSessionStatistics51 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshSessionStatistics51(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshSessionStatistics51 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshSessionStatistics51( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshSessionStatistics51 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshSessionStatistics51(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshSessionStatistics51 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)24); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 24; + 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 24; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICE9 m_mDEntryPx; + +public: + SBE_NODISCARD PRICE9 &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() 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); + } + + NoMDEntries &securityID(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 * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= rptSeqSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * OpenCloseSettlFlagMetaAttribute(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 openCloseSettlFlagId() SBE_NOEXCEPT + { + return 286; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t openCloseSettlFlagSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool openCloseSettlFlagInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= openCloseSettlFlagSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openCloseSettlFlagEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openCloseSettlFlagEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD OpenCloseSettlFlag::Value openCloseSettlFlag() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint8_t)); + return OpenCloseSettlFlag::get((val)); + } + + NoMDEntries &openCloseSettlFlag(const OpenCloseSettlFlag::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(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 mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 17; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDUpdateAction::Value mDUpdateAction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 17, sizeof(std::uint8_t)); + return MDUpdateAction::get((val)); + } + + NoMDEntries &mDUpdateAction(const MDUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 17, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 18; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryTypeStatistics::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 18, sizeof(char)); + return MDEntryTypeStatistics::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryTypeStatistics::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 18, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * MDEntrySizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntrySizeId() SBE_NOEXCEPT + { + return 271; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntrySizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntrySizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntrySizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingOffset() SBE_NOEXCEPT + { + return 19; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDEntrySize() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 19, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &mDEntrySize(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 19, &val, sizeof(std::int32_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << ", "; + builder << R"("OpenCloseSettlFlag": )"; + builder << '"' << writer.openCloseSettlFlag() << '"'; + + builder << ", "; + builder << R"("MDUpdateAction": )"; + builder << '"' << writer.mDUpdateAction() << '"'; + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << ", "; + builder << R"("MDEntrySize": )"; + builder << +writer.mDEntrySize(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshSessionStatistics51 _writer) + { + MDIncrementalRefreshSessionStatistics51 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshSessionStatistics51", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshTradeSummary42.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshTradeSummary42.h new file mode 100644 index 000000000..307d24602 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshTradeSummary42.h @@ -0,0 +1,1706 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHTRADESUMMARY42_H_ +#define _MKTDATA_MDINCREMENTALREFRESHTRADESUMMARY42_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshTradeSummary42 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshTradeSummary42() = default; + + MDIncrementalRefreshTradeSummary42( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshTradeSummary42(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshTradeSummary42(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshTradeSummary42( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshTradeSummary42(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)42; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshTradeSummary42 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshTradeSummary42(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshTradeSummary42 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshTradeSummary42( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshTradeSummary42 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshTradeSummary42(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshTradeSummary42 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)32); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 32; + 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 32; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICE m_mDEntryPx; + +public: + SBE_NODISCARD PRICE &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDEntrySizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntrySizeId() SBE_NOEXCEPT + { + return 271; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntrySizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntrySizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntrySizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDEntrySize() 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); + } + + NoMDEntries &mDEntrySize(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 * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= rptSeqSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * NumberOfOrdersMetaAttribute(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 numberOfOrdersId() SBE_NOEXCEPT + { + return 346; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t numberOfOrdersSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool numberOfOrdersInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= numberOfOrdersSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t numberOfOrders() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &numberOfOrders(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * AggressorSideMetaAttribute(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 aggressorSideId() SBE_NOEXCEPT + { + return 5797; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t aggressorSideSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool aggressorSideInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= aggressorSideSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t aggressorSideEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t aggressorSideEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD AggressorSide::Value aggressorSide() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::uint8_t)); + return AggressorSide::get((val)); + } + + NoMDEntries &aggressorSide(const AggressorSide::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(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 mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 25; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDUpdateAction::Value mDUpdateAction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 25, sizeof(std::uint8_t)); + return MDUpdateAction::get((val)); + } + + NoMDEntries &mDUpdateAction(const MDUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 25, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 26; + } + + static SBE_CONSTEXPR char mDEntryTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDEntryTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDEntryTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t mDEntryTypeLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *mDEntryType() const + { + static const std::uint8_t mDEntryTypeValues[] = { 50 }; + + return (const char *)mDEntryTypeValues; + } + + SBE_NODISCARD char mDEntryType(const std::uint64_t index) const + { + static const std::uint8_t mDEntryTypeValues[] = { 50 }; + + return (char)mDEntryTypeValues[index]; + } + + std::uint64_t getMDEntryType(char *dst, const std::uint64_t length) const + { + static std::uint8_t mDEntryTypeValues[] = { 50 }; + std::uint64_t bytesToCopy = length < sizeof(mDEntryTypeValues) ? length : sizeof(mDEntryTypeValues); + + std::memcpy(dst, mDEntryTypeValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getMDEntryTypeAsString() const + { + static const std::uint8_t MDEntryTypeValues[] = { 50 }; + + return std::string((const char *)MDEntryTypeValues, 1); + } + + std::string getMDEntryTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDEntryTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * MDTradeEntryIDMetaAttribute(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 mDTradeEntryIDId() SBE_NOEXCEPT + { + return 37711; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDTradeEntryIDSinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool mDTradeEntryIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDTradeEntryIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDTradeEntryIDEncodingOffset() SBE_NOEXCEPT + { + return 26; + } + + static SBE_CONSTEXPR std::uint32_t mDTradeEntryIDNullValue() SBE_NOEXCEPT + { + return 4294967295; + } + + static SBE_CONSTEXPR std::uint32_t mDTradeEntryIDMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t mDTradeEntryIDMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t mDTradeEntryIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t mDTradeEntryID() const SBE_NOEXCEPT + { + if (m_actingVersion < 7) + { + return 4294967295; + } + + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 26, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &mDTradeEntryID(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 26, &val, sizeof(std::uint32_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDEntrySize": )"; + builder << +writer.mDEntrySize(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << ", "; + builder << R"("NumberOfOrders": )"; + builder << +writer.numberOfOrders(); + + builder << ", "; + builder << R"("AggressorSide": )"; + builder << '"' << writer.aggressorSide() << '"'; + + builder << ", "; + builder << R"("MDUpdateAction": )"; + builder << '"' << writer.mDUpdateAction() << '"'; + + builder << ", "; + builder << R"("MDTradeEntryID": )"; + builder << +writer.mDTradeEntryID(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoOrderIDEntries + { + 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) + { + GroupSize8Byte 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 + 8; + } + + 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; + GroupSize8Byte dimensions(buffer, *pos, bufferLength, actingVersion); + dimensions.blockLength((std::uint16_t)16); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 16; + m_actingVersion = actingVersion; + m_initialPosition = *pos; + m_positionPtr = pos; + *m_positionPtr = *m_positionPtr + 8; + } + + static SBE_CONSTEXPR std::uint64_t sbeHeaderSize() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t sbeBlockLength() SBE_NOEXCEPT + { + return 16; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoOrderIDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize8Byte dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * OrderIDMetaAttribute(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 orderIDId() SBE_NOEXCEPT + { + return 37; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t orderIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool orderIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= orderIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t orderIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t orderIDEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t orderID() 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); + } + + NoOrderIDEntries &orderID(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 * LastQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastQtyId() SBE_NOEXCEPT + { + return 32; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastQtyInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= lastQtySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastQtyEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t lastQtyNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t lastQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t lastQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t lastQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t lastQty() 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); + } + + NoOrderIDEntries &lastQty(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; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoOrderIDEntries writer) + { + builder << '{'; + builder << R"("OrderID": )"; + builder << +writer.orderID(); + + builder << ", "; + builder << R"("LastQty": )"; + builder << +writer.lastQty(); + + builder << '}'; + + return builder; + } + }; + +private: + NoOrderIDEntries m_noOrderIDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoOrderIDEntriesId() SBE_NOEXCEPT + { + return 37705; + } + + SBE_NODISCARD inline NoOrderIDEntries &noOrderIDEntries() + { + m_noOrderIDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noOrderIDEntries; + } + + NoOrderIDEntries &noOrderIDEntriesCount(const std::uint8_t count) + { + m_noOrderIDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noOrderIDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noOrderIDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noOrderIDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noOrderIDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshTradeSummary42 _writer) + { + MDIncrementalRefreshTradeSummary42 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshTradeSummary42", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoOrderIDEntries": [)"; + writer.noOrderIDEntries().forEach([&](NoOrderIDEntries& noOrderIDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noOrderIDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshTradeSummary48.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshTradeSummary48.h new file mode 100644 index 000000000..5a4a98dd9 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshTradeSummary48.h @@ -0,0 +1,1701 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHTRADESUMMARY48_H_ +#define _MKTDATA_MDINCREMENTALREFRESHTRADESUMMARY48_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshTradeSummary48 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshTradeSummary48() = default; + + MDIncrementalRefreshTradeSummary48( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshTradeSummary48(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshTradeSummary48(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshTradeSummary48( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshTradeSummary48(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshTradeSummary48 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshTradeSummary48(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshTradeSummary48 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshTradeSummary48( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshTradeSummary48 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshTradeSummary48(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshTradeSummary48 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)32); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 32; + 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 32; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICE9 m_mDEntryPx; + +public: + SBE_NODISCARD PRICE9 &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDEntrySizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntrySizeId() SBE_NOEXCEPT + { + return 271; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntrySizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntrySizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntrySizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDEntrySize() 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); + } + + NoMDEntries &mDEntrySize(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 * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= rptSeqSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * NumberOfOrdersMetaAttribute(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 numberOfOrdersId() SBE_NOEXCEPT + { + return 346; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t numberOfOrdersSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool numberOfOrdersInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= numberOfOrdersSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t numberOfOrders() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &numberOfOrders(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * AggressorSideMetaAttribute(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 aggressorSideId() SBE_NOEXCEPT + { + return 5797; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t aggressorSideSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool aggressorSideInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= aggressorSideSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t aggressorSideEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t aggressorSideEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD AggressorSide::Value aggressorSide() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::uint8_t)); + return AggressorSide::get((val)); + } + + NoMDEntries &aggressorSide(const AggressorSide::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(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 mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 25; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDUpdateAction::Value mDUpdateAction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 25, sizeof(std::uint8_t)); + return MDUpdateAction::get((val)); + } + + NoMDEntries &mDUpdateAction(const MDUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 25, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 26; + } + + static SBE_CONSTEXPR char mDEntryTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDEntryTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDEntryTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t mDEntryTypeLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *mDEntryType() const + { + static const std::uint8_t mDEntryTypeValues[] = { 50 }; + + return (const char *)mDEntryTypeValues; + } + + SBE_NODISCARD char mDEntryType(const std::uint64_t index) const + { + static const std::uint8_t mDEntryTypeValues[] = { 50 }; + + return (char)mDEntryTypeValues[index]; + } + + std::uint64_t getMDEntryType(char *dst, const std::uint64_t length) const + { + static std::uint8_t mDEntryTypeValues[] = { 50 }; + std::uint64_t bytesToCopy = length < sizeof(mDEntryTypeValues) ? length : sizeof(mDEntryTypeValues); + + std::memcpy(dst, mDEntryTypeValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getMDEntryTypeAsString() const + { + static const std::uint8_t MDEntryTypeValues[] = { 50 }; + + return std::string((const char *)MDEntryTypeValues, 1); + } + + std::string getMDEntryTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDEntryTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * MDTradeEntryIDMetaAttribute(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 mDTradeEntryIDId() SBE_NOEXCEPT + { + return 37711; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDTradeEntryIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDTradeEntryIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDTradeEntryIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDTradeEntryIDEncodingOffset() SBE_NOEXCEPT + { + return 26; + } + + static SBE_CONSTEXPR std::uint32_t mDTradeEntryIDNullValue() SBE_NOEXCEPT + { + return 4294967295; + } + + static SBE_CONSTEXPR std::uint32_t mDTradeEntryIDMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t mDTradeEntryIDMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t mDTradeEntryIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t mDTradeEntryID() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 26, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &mDTradeEntryID(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 26, &val, sizeof(std::uint32_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDEntrySize": )"; + builder << +writer.mDEntrySize(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << ", "; + builder << R"("NumberOfOrders": )"; + builder << +writer.numberOfOrders(); + + builder << ", "; + builder << R"("AggressorSide": )"; + builder << '"' << writer.aggressorSide() << '"'; + + builder << ", "; + builder << R"("MDUpdateAction": )"; + builder << '"' << writer.mDUpdateAction() << '"'; + + builder << ", "; + builder << R"("MDTradeEntryID": )"; + builder << +writer.mDTradeEntryID(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoOrderIDEntries + { + 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) + { + GroupSize8Byte 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 + 8; + } + + 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; + GroupSize8Byte dimensions(buffer, *pos, bufferLength, actingVersion); + dimensions.blockLength((std::uint16_t)16); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 16; + m_actingVersion = actingVersion; + m_initialPosition = *pos; + m_positionPtr = pos; + *m_positionPtr = *m_positionPtr + 8; + } + + static SBE_CONSTEXPR std::uint64_t sbeHeaderSize() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t sbeBlockLength() SBE_NOEXCEPT + { + return 16; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoOrderIDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize8Byte dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * OrderIDMetaAttribute(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 orderIDId() SBE_NOEXCEPT + { + return 37; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t orderIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool orderIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= orderIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t orderIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t orderIDEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t orderID() 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); + } + + NoOrderIDEntries &orderID(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 * LastQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastQtyId() SBE_NOEXCEPT + { + return 32; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastQtyInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= lastQtySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastQtyEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t lastQtyNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t lastQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t lastQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t lastQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t lastQty() 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); + } + + NoOrderIDEntries &lastQty(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; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoOrderIDEntries writer) + { + builder << '{'; + builder << R"("OrderID": )"; + builder << +writer.orderID(); + + builder << ", "; + builder << R"("LastQty": )"; + builder << +writer.lastQty(); + + builder << '}'; + + return builder; + } + }; + +private: + NoOrderIDEntries m_noOrderIDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoOrderIDEntriesId() SBE_NOEXCEPT + { + return 37705; + } + + SBE_NODISCARD inline NoOrderIDEntries &noOrderIDEntries() + { + m_noOrderIDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noOrderIDEntries; + } + + NoOrderIDEntries &noOrderIDEntriesCount(const std::uint8_t count) + { + m_noOrderIDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noOrderIDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noOrderIDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noOrderIDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noOrderIDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshTradeSummary48 _writer) + { + MDIncrementalRefreshTradeSummary48 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshTradeSummary48", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoOrderIDEntries": [)"; + writer.noOrderIDEntries().forEach([&](NoOrderIDEntries& noOrderIDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noOrderIDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshVolume37.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshVolume37.h new file mode 100644 index 000000000..91cff1883 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDIncrementalRefreshVolume37.h @@ -0,0 +1,1071 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINCREMENTALREFRESHVOLUME37_H_ +#define _MKTDATA_MDINCREMENTALREFRESHVOLUME37_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDIncrementalRefreshVolume37 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDIncrementalRefreshVolume37() = default; + + MDIncrementalRefreshVolume37( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDIncrementalRefreshVolume37(char *buffer, const std::uint64_t bufferLength) : + MDIncrementalRefreshVolume37(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDIncrementalRefreshVolume37( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDIncrementalRefreshVolume37(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)11; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)37; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "X"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDIncrementalRefreshVolume37 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshVolume37(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDIncrementalRefreshVolume37 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDIncrementalRefreshVolume37( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDIncrementalRefreshVolume37 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDIncrementalRefreshVolume37(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + MDIncrementalRefreshVolume37 &transactTime(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 * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 8, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoMDEntries + { + 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((std::uint16_t)16); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDEntrySizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntrySizeId() SBE_NOEXCEPT + { + return 271; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntrySizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntrySizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntrySizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDEntrySize() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &mDEntrySize(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 4, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 4, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= rptSeqSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 8, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 8, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MDUpdateActionMetaAttribute(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 mDUpdateActionId() SBE_NOEXCEPT + { + return 279; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDUpdateActionInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDUpdateActionSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDUpdateAction::Value mDUpdateAction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::uint8_t)); + return MDUpdateAction::get((val)); + } + + NoMDEntries &mDUpdateAction(const MDUpdateAction::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 13; + } + + static SBE_CONSTEXPR char mDEntryTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDEntryTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDEntryTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t mDEntryTypeLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *mDEntryType() const + { + static const std::uint8_t mDEntryTypeValues[] = { 101 }; + + return (const char *)mDEntryTypeValues; + } + + SBE_NODISCARD char mDEntryType(const std::uint64_t index) const + { + static const std::uint8_t mDEntryTypeValues[] = { 101 }; + + return (char)mDEntryTypeValues[index]; + } + + std::uint64_t getMDEntryType(char *dst, const std::uint64_t length) const + { + static std::uint8_t mDEntryTypeValues[] = { 101 }; + std::uint64_t bytesToCopy = length < sizeof(mDEntryTypeValues) ? length : sizeof(mDEntryTypeValues); + + std::memcpy(dst, mDEntryTypeValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getMDEntryTypeAsString() const + { + static const std::uint8_t MDEntryTypeValues[] = { 101 }; + + return std::string((const char *)MDEntryTypeValues, 1); + } + + std::string getMDEntryTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDEntryTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("MDEntrySize": )"; + builder << +writer.mDEntrySize(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << ", "; + builder << R"("MDUpdateAction": )"; + builder << '"' << writer.mDUpdateAction() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDIncrementalRefreshVolume37 _writer) + { + MDIncrementalRefreshVolume37 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDIncrementalRefreshVolume37", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionFuture27.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionFuture27.h new file mode 100644 index 000000000..6805c6d2d --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionFuture27.h @@ -0,0 +1,6304 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINSTRUMENTDEFINITIONFUTURE27_H_ +#define _MKTDATA_MDINSTRUMENTDEFINITIONFUTURE27_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDInstrumentDefinitionFuture27 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDInstrumentDefinitionFuture27() = default; + + MDInstrumentDefinitionFuture27( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDInstrumentDefinitionFuture27(char *buffer, const std::uint64_t bufferLength) : + MDInstrumentDefinitionFuture27(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDInstrumentDefinitionFuture27( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDInstrumentDefinitionFuture27(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)216; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)27; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "d"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDInstrumentDefinitionFuture27 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionFuture27(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDInstrumentDefinitionFuture27 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDInstrumentDefinitionFuture27( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDInstrumentDefinitionFuture27 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionFuture27(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * TotNumReportsMetaAttribute(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 totNumReportsId() SBE_NOEXCEPT + { + return 911; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t totNumReportsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool totNumReportsInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= totNumReportsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t totNumReportsEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsNullValue() SBE_NOEXCEPT + { + return 4294967295; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t totNumReportsEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t totNumReports() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture27 &totNumReports(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityUpdateActionMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityUpdateActionId() SBE_NOEXCEPT + { + return 980; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityUpdateActionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityUpdateActionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 5; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityUpdateAction::Value securityUpdateAction() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 5, sizeof(char)); + return SecurityUpdateAction::get((val)); + } + + MDInstrumentDefinitionFuture27 &securityUpdateAction(const SecurityUpdateAction::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 5, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * LastUpdateTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastUpdateTimeId() SBE_NOEXCEPT + { + return 779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastUpdateTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastUpdateTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastUpdateTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingOffset() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t lastUpdateTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 6, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + MDInstrumentDefinitionFuture27 &lastUpdateTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 6, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDSecurityTradingStatusMetaAttribute(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 mDSecurityTradingStatusId() SBE_NOEXCEPT + { + return 1682; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDSecurityTradingStatusSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDSecurityTradingStatusInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mDSecurityTradingStatusSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingOffset() SBE_NOEXCEPT + { + return 14; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityTradingStatus::Value mDSecurityTradingStatus() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 14, sizeof(std::uint8_t)); + return SecurityTradingStatus::get((val)); + } + + MDInstrumentDefinitionFuture27 &mDSecurityTradingStatus(const SecurityTradingStatus::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 14, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * ApplIDMetaAttribute(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 applIDId() SBE_NOEXCEPT + { + return 1180; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t applIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool applIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= applIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t applIDEncodingOffset() SBE_NOEXCEPT + { + return 15; + } + + static SBE_CONSTEXPR std::int16_t applIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT16; + } + + static SBE_CONSTEXPR std::int16_t applIDMinValue() SBE_NOEXCEPT + { + return (std::int16_t)-32767; + } + + static SBE_CONSTEXPR std::int16_t applIDMaxValue() SBE_NOEXCEPT + { + return (std::int16_t)32767; + } + + static SBE_CONSTEXPR std::size_t applIDEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::int16_t applID() const SBE_NOEXCEPT + { + std::int16_t val; + std::memcpy(&val, m_buffer + m_offset + 15, sizeof(std::int16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionFuture27 &applID(const std::int16_t value) SBE_NOEXCEPT + { + std::int16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 15, &val, sizeof(std::int16_t)); + return *this; + } + + SBE_NODISCARD static const char * MarketSegmentIDMetaAttribute(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 marketSegmentIDId() SBE_NOEXCEPT + { + return 1300; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketSegmentIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketSegmentIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= marketSegmentIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingOffset() SBE_NOEXCEPT + { + return 17; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t marketSegmentID() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 17, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionFuture27 &marketSegmentID(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 17, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnderlyingProductMetaAttribute(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 underlyingProductId() SBE_NOEXCEPT + { + return 462; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingProductSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingProductInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= underlyingProductSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingProductEncodingOffset() SBE_NOEXCEPT + { + return 18; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t underlyingProductEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t underlyingProduct() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 18, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionFuture27 &underlyingProduct(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 18, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityExchangeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Exchange"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityExchangeId() SBE_NOEXCEPT + { + return 207; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityExchangeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityExchangeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityExchangeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityExchangeEncodingOffset() SBE_NOEXCEPT + { + return 19; + } + + static SBE_CONSTEXPR char securityExchangeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityExchangeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityExchangeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityExchangeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint64_t securityExchangeLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD const char *securityExchange() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char *securityExchange() SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char securityExchange(const std::uint64_t index) const + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 19 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture27 &securityExchange(const std::uint64_t index, const char value) + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 19 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityExchange(char *const dst, const std::uint64_t length) const + { + if (length > 4) + { + throw std::runtime_error("length too large for getSecurityExchange [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 19, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture27 &putSecurityExchange(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 19, src, sizeof(char) * 4); + return *this; + } + + MDInstrumentDefinitionFuture27 &putSecurityExchange( + const char value0, + const char value1, + const char value2, + const char value3) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 19, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 20, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 21, &val2, sizeof(char)); + char val3 = (value3); + std::memcpy(m_buffer + m_offset + 22, &val3, sizeof(char)); + + return *this; + } + + std::string getSecurityExchangeAsString() const + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityExchangeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityExchangeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityExchangeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture27 &putSecurityExchange(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.data(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture27 &putSecurityExchange(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.c_str(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityGroupMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityGroupId() SBE_NOEXCEPT + { + return 1151; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityGroupSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityGroupInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityGroupSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityGroupEncodingOffset() SBE_NOEXCEPT + { + return 23; + } + + static SBE_CONSTEXPR char securityGroupNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityGroupMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityGroupMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityGroupEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityGroupLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityGroup() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char *securityGroup() SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char securityGroup(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 23 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture27 &securityGroup(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 23 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityGroup(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityGroup [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 23, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture27 &putSecurityGroup(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 23, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityGroupAsString() const + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityGroupAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityGroupAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityGroupAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture27 &putSecurityGroup(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture27 &putSecurityGroup(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * AssetMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t assetId() SBE_NOEXCEPT + { + return 6937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t assetSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool assetInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= assetSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t assetEncodingOffset() SBE_NOEXCEPT + { + return 29; + } + + static SBE_CONSTEXPR char assetNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char assetMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char assetMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t assetEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t assetLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *asset() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char *asset() SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char asset(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 29 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture27 &asset(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 29 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getAsset(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getAsset [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 29, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture27 &putAsset(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 29, src, sizeof(char) * 6); + return *this; + } + + std::string getAssetAsString() const + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getAssetAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getAssetAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getAssetAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture27 &putAsset(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture27 &putAsset(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SymbolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t symbolId() SBE_NOEXCEPT + { + return 55; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t symbolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool symbolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= symbolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t symbolEncodingOffset() SBE_NOEXCEPT + { + return 35; + } + + static SBE_CONSTEXPR char symbolNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char symbolMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char symbolMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t symbolEncodingLength() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t symbolLength() SBE_NOEXCEPT + { + return 20; + } + + SBE_NODISCARD const char *symbol() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char *symbol() SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char symbol(const std::uint64_t index) const + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 35 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture27 &symbol(const std::uint64_t index, const char value) + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 35 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSymbol(char *const dst, const std::uint64_t length) const + { + if (length > 20) + { + throw std::runtime_error("length too large for getSymbol [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 35, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture27 &putSymbol(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 35, src, sizeof(char) * 20); + return *this; + } + + std::string getSymbolAsString() const + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSymbolAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSymbolAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSymbolAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture27 &putSymbol(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.data(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture27 &putSymbol(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.c_str(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 55; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 55, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture27 &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 55, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityIDSourceId() SBE_NOEXCEPT + { + return 22; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDSourceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSourceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t securityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *securityIDSource() const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (const char *)securityIDSourceValues; + } + + SBE_NODISCARD char securityIDSource(const std::uint64_t index) const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (char)securityIDSourceValues[index]; + } + + std::uint64_t getSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t securityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(securityIDSourceValues) ? length : sizeof(securityIDSourceValues); + + std::memcpy(dst, securityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getSecurityIDSourceAsString() const + { + static const std::uint8_t SecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)SecurityIDSourceValues, 1); + } + + std::string getSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * SecurityTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityTypeId() SBE_NOEXCEPT + { + return 167; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityTypeEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityTypeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityTypeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char *securityType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char securityType(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 59 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture27 &securityType(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 59 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityType(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 59, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture27 &putSecurityType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 59, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture27 &putSecurityType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture27 &putSecurityType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * CFICodeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t cFICodeId() SBE_NOEXCEPT + { + return 461; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t cFICodeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool cFICodeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= cFICodeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t cFICodeEncodingOffset() SBE_NOEXCEPT + { + return 65; + } + + static SBE_CONSTEXPR char cFICodeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char cFICodeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char cFICodeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t cFICodeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t cFICodeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *cFICode() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char *cFICode() SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char cFICode(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 65 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture27 &cFICode(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 65 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCFICode(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getCFICode [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 65, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture27 &putCFICode(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 65, src, sizeof(char) * 6); + return *this; + } + + std::string getCFICodeAsString() const + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCFICodeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCFICodeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCFICodeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture27 &putCFICode(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture27 &putCFICode(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MaturityMonthYearMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MonthYear"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maturityMonthYearId() SBE_NOEXCEPT + { + return 200; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maturityMonthYearSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maturityMonthYearInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maturityMonthYearSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maturityMonthYearEncodingOffset() SBE_NOEXCEPT + { + return 71; + } + +private: + MaturityMonthYear m_maturityMonthYear; + +public: + SBE_NODISCARD MaturityMonthYear &maturityMonthYear() + { + m_maturityMonthYear.wrap(m_buffer, m_offset + 71, m_actingVersion, m_bufferLength); + return m_maturityMonthYear; + } + + SBE_NODISCARD static const char * CurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t currencyId() SBE_NOEXCEPT + { + return 15; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t currencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool currencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= currencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t currencyEncodingOffset() SBE_NOEXCEPT + { + return 76; + } + + static SBE_CONSTEXPR char currencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char currencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char currencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t currencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t currencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *currency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 76; + } + + SBE_NODISCARD char *currency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 76; + } + + SBE_NODISCARD char currency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 76 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture27 ¤cy(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 76 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 76, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture27 &putCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 76, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionFuture27 &putCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 76, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 77, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 78, &val2, sizeof(char)); + + return *this; + } + + std::string getCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 76; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 76; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture27 &putCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 76, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 76 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture27 &putCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 76, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 76 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SettlCurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlCurrencyId() SBE_NOEXCEPT + { + return 120; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlCurrencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlCurrencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= settlCurrencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlCurrencyEncodingOffset() SBE_NOEXCEPT + { + return 79; + } + + static SBE_CONSTEXPR char settlCurrencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char settlCurrencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char settlCurrencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t settlCurrencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t settlCurrencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *settlCurrency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 79; + } + + SBE_NODISCARD char *settlCurrency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 79; + } + + SBE_NODISCARD char settlCurrency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for settlCurrency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 79 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture27 &settlCurrency(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for settlCurrency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 79 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSettlCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getSettlCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 79, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture27 &putSettlCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 79, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionFuture27 &putSettlCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 79, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 80, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 81, &val2, sizeof(char)); + + return *this; + } + + std::string getSettlCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 79; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSettlCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSettlCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSettlCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 79; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture27 &putSettlCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putSettlCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 79, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 79 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture27 &putSettlCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putSettlCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 79, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 79 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MatchAlgorithmMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchAlgorithmId() SBE_NOEXCEPT + { + return 1142; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchAlgorithmSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchAlgorithmInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchAlgorithmSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingOffset() SBE_NOEXCEPT + { + return 82; + } + + static SBE_CONSTEXPR char matchAlgorithmNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char matchAlgorithmMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char matchAlgorithmMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char matchAlgorithm() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 82, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture27 &matchAlgorithm(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 82, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * MinTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minTradeVolId() SBE_NOEXCEPT + { + return 562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 83; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t minTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t minTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 83, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture27 &minTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 83, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MaxTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maxTradeVolId() SBE_NOEXCEPT + { + return 1140; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maxTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 87; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t maxTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t maxTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 87, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture27 &maxTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 87, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MinPriceIncrementMetaAttribute(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 minPriceIncrementId() SBE_NOEXCEPT + { + return 969; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minPriceIncrementSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minPriceIncrementInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minPriceIncrementSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minPriceIncrementEncodingOffset() SBE_NOEXCEPT + { + return 91; + } + +private: + PRICE m_minPriceIncrement; + +public: + SBE_NODISCARD PRICE &minPriceIncrement() + { + m_minPriceIncrement.wrap(m_buffer, m_offset + 91, m_actingVersion, m_bufferLength); + return m_minPriceIncrement; + } + + SBE_NODISCARD static const char * DisplayFactorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "float"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t displayFactorId() SBE_NOEXCEPT + { + return 9787; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t displayFactorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool displayFactorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= displayFactorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t displayFactorEncodingOffset() SBE_NOEXCEPT + { + return 99; + } + +private: + FLOAT m_displayFactor; + +public: + SBE_NODISCARD FLOAT &displayFactor() + { + m_displayFactor.wrap(m_buffer, m_offset + 99, m_actingVersion, m_bufferLength); + return m_displayFactor; + } + + SBE_NODISCARD static const char * MainFractionMetaAttribute(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 mainFractionId() SBE_NOEXCEPT + { + return 37702; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mainFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mainFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mainFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mainFractionEncodingOffset() SBE_NOEXCEPT + { + return 107; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t mainFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t mainFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 107, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionFuture27 &mainFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 107, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SubFractionMetaAttribute(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 subFractionId() SBE_NOEXCEPT + { + return 37703; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t subFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool subFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= subFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t subFractionEncodingOffset() SBE_NOEXCEPT + { + return 108; + } + + static SBE_CONSTEXPR std::uint8_t subFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t subFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t subFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 108, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionFuture27 &subFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 108, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * PriceDisplayFormatMetaAttribute(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 priceDisplayFormatId() SBE_NOEXCEPT + { + return 9800; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priceDisplayFormatSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool priceDisplayFormatInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priceDisplayFormatSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingOffset() SBE_NOEXCEPT + { + return 109; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priceDisplayFormat() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 109, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionFuture27 &priceDisplayFormat(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 109, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnitOfMeasureMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t unitOfMeasureId() SBE_NOEXCEPT + { + return 996; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t unitOfMeasureSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool unitOfMeasureInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= unitOfMeasureSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingOffset() SBE_NOEXCEPT + { + return 110; + } + + static SBE_CONSTEXPR char unitOfMeasureNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char unitOfMeasureMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char unitOfMeasureMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingLength() SBE_NOEXCEPT + { + return 30; + } + + static SBE_CONSTEXPR std::uint64_t unitOfMeasureLength() SBE_NOEXCEPT + { + return 30; + } + + SBE_NODISCARD const char *unitOfMeasure() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 110; + } + + SBE_NODISCARD char *unitOfMeasure() SBE_NOEXCEPT + { + return m_buffer + m_offset + 110; + } + + SBE_NODISCARD char unitOfMeasure(const std::uint64_t index) const + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 110 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture27 &unitOfMeasure(const std::uint64_t index, const char value) + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 110 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getUnitOfMeasure(char *const dst, const std::uint64_t length) const + { + if (length > 30) + { + throw std::runtime_error("length too large for getUnitOfMeasure [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 110, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture27 &putUnitOfMeasure(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 110, src, sizeof(char) * 30); + return *this; + } + + std::string getUnitOfMeasureAsString() const + { + const char *buffer = m_buffer + m_offset + 110; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getUnitOfMeasureAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getUnitOfMeasureAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getUnitOfMeasureAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 110; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture27 &putUnitOfMeasure(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 110, str.data(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 110 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture27 &putUnitOfMeasure(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 110, str.c_str(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 110 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * UnitOfMeasureQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t unitOfMeasureQtyId() SBE_NOEXCEPT + { + return 1147; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t unitOfMeasureQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool unitOfMeasureQtyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= unitOfMeasureQtySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t unitOfMeasureQtyEncodingOffset() SBE_NOEXCEPT + { + return 140; + } + +private: + PRICENULL m_unitOfMeasureQty; + +public: + SBE_NODISCARD PRICENULL &unitOfMeasureQty() + { + m_unitOfMeasureQty.wrap(m_buffer, m_offset + 140, m_actingVersion, m_bufferLength); + return m_unitOfMeasureQty; + } + + SBE_NODISCARD static const char * TradingReferencePriceMetaAttribute(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 tradingReferencePriceId() SBE_NOEXCEPT + { + return 1150; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferencePriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradingReferencePriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferencePriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferencePriceEncodingOffset() SBE_NOEXCEPT + { + return 148; + } + +private: + PRICENULL m_tradingReferencePrice; + +public: + SBE_NODISCARD PRICENULL &tradingReferencePrice() + { + m_tradingReferencePrice.wrap(m_buffer, m_offset + 148, m_actingVersion, m_bufferLength); + return m_tradingReferencePrice; + } + + SBE_NODISCARD static const char * SettlPriceTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlPriceTypeId() SBE_NOEXCEPT + { + return 731; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlPriceTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlPriceTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= settlPriceTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingOffset() SBE_NOEXCEPT + { + return 156; + } + +private: + SettlPriceType m_settlPriceType; + +public: + SBE_NODISCARD SettlPriceType &settlPriceType() + { + m_settlPriceType.wrap(m_buffer, m_offset + 156, m_actingVersion, m_bufferLength); + return m_settlPriceType; + } + + static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * OpenInterestQtyMetaAttribute(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 openInterestQtyId() SBE_NOEXCEPT + { + return 5792; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t openInterestQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool openInterestQtyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= openInterestQtySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openInterestQtyEncodingOffset() SBE_NOEXCEPT + { + return 157; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t openInterestQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t openInterestQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 157, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture27 &openInterestQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 157, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * ClearedVolumeMetaAttribute(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 clearedVolumeId() SBE_NOEXCEPT + { + return 5791; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t clearedVolumeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool clearedVolumeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= clearedVolumeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t clearedVolumeEncodingOffset() SBE_NOEXCEPT + { + return 161; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t clearedVolumeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t clearedVolume() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 161, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture27 &clearedVolume(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 161, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * HighLimitPriceMetaAttribute(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 highLimitPriceId() SBE_NOEXCEPT + { + return 1149; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t highLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool highLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= highLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t highLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 165; + } + +private: + PRICENULL m_highLimitPrice; + +public: + SBE_NODISCARD PRICENULL &highLimitPrice() + { + m_highLimitPrice.wrap(m_buffer, m_offset + 165, m_actingVersion, m_bufferLength); + return m_highLimitPrice; + } + + SBE_NODISCARD static const char * LowLimitPriceMetaAttribute(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 lowLimitPriceId() SBE_NOEXCEPT + { + return 1148; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lowLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lowLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lowLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lowLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 173; + } + +private: + PRICENULL m_lowLimitPrice; + +public: + SBE_NODISCARD PRICENULL &lowLimitPrice() + { + m_lowLimitPrice.wrap(m_buffer, m_offset + 173, m_actingVersion, m_bufferLength); + return m_lowLimitPrice; + } + + SBE_NODISCARD static const char * MaxPriceVariationMetaAttribute(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 maxPriceVariationId() SBE_NOEXCEPT + { + return 1143; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxPriceVariationSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maxPriceVariationInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxPriceVariationSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxPriceVariationEncodingOffset() SBE_NOEXCEPT + { + return 181; + } + +private: + PRICENULL m_maxPriceVariation; + +public: + SBE_NODISCARD PRICENULL &maxPriceVariation() + { + m_maxPriceVariation.wrap(m_buffer, m_offset + 181, m_actingVersion, m_bufferLength); + return m_maxPriceVariation; + } + + SBE_NODISCARD static const char * DecayQuantityMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t decayQuantityId() SBE_NOEXCEPT + { + return 5818; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t decayQuantitySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool decayQuantityInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= decayQuantitySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t decayQuantityEncodingOffset() SBE_NOEXCEPT + { + return 189; + } + + static SBE_CONSTEXPR std::int32_t decayQuantityNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t decayQuantityMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t decayQuantityMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t decayQuantityEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t decayQuantity() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 189, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture27 &decayQuantity(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 189, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * DecayStartDateMetaAttribute(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 decayStartDateId() SBE_NOEXCEPT + { + return 5819; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t decayStartDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool decayStartDateInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= decayStartDateSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t decayStartDateEncodingOffset() SBE_NOEXCEPT + { + return 193; + } + + static SBE_CONSTEXPR std::uint16_t decayStartDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t decayStartDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t decayStartDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t decayStartDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t decayStartDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 193, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionFuture27 &decayStartDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 193, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char * OriginalContractSizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t originalContractSizeId() SBE_NOEXCEPT + { + return 5849; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t originalContractSizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool originalContractSizeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= originalContractSizeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t originalContractSizeEncodingOffset() SBE_NOEXCEPT + { + return 195; + } + + static SBE_CONSTEXPR std::int32_t originalContractSizeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t originalContractSizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t originalContractSizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t originalContractSizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t originalContractSize() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 195, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture27 &originalContractSize(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 195, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * ContractMultiplierMetaAttribute(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 contractMultiplierId() SBE_NOEXCEPT + { + return 231; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t contractMultiplierSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool contractMultiplierInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= contractMultiplierSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t contractMultiplierEncodingOffset() SBE_NOEXCEPT + { + return 199; + } + + static SBE_CONSTEXPR std::int32_t contractMultiplierNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t contractMultiplierMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t contractMultiplierMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t contractMultiplierEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t contractMultiplier() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 199, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture27 &contractMultiplier(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 199, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * ContractMultiplierUnitMetaAttribute(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 contractMultiplierUnitId() SBE_NOEXCEPT + { + return 1435; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t contractMultiplierUnitSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool contractMultiplierUnitInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= contractMultiplierUnitSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t contractMultiplierUnitEncodingOffset() SBE_NOEXCEPT + { + return 203; + } + + static SBE_CONSTEXPR std::int8_t contractMultiplierUnitNullValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::int8_t contractMultiplierUnitMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t contractMultiplierUnitMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t contractMultiplierUnitEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t contractMultiplierUnit() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 203, sizeof(std::int8_t)); + return (val); + } + + MDInstrumentDefinitionFuture27 &contractMultiplierUnit(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 203, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * FlowScheduleTypeMetaAttribute(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 flowScheduleTypeId() SBE_NOEXCEPT + { + return 1439; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t flowScheduleTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool flowScheduleTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= flowScheduleTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t flowScheduleTypeEncodingOffset() SBE_NOEXCEPT + { + return 204; + } + + static SBE_CONSTEXPR std::int8_t flowScheduleTypeNullValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::int8_t flowScheduleTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t flowScheduleTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t flowScheduleTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t flowScheduleType() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 204, sizeof(std::int8_t)); + return (val); + } + + MDInstrumentDefinitionFuture27 &flowScheduleType(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 204, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * MinPriceIncrementAmountMetaAttribute(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 minPriceIncrementAmountId() SBE_NOEXCEPT + { + return 1146; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minPriceIncrementAmountSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minPriceIncrementAmountInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minPriceIncrementAmountSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minPriceIncrementAmountEncodingOffset() SBE_NOEXCEPT + { + return 205; + } + +private: + PRICENULL m_minPriceIncrementAmount; + +public: + SBE_NODISCARD PRICENULL &minPriceIncrementAmount() + { + m_minPriceIncrementAmount.wrap(m_buffer, m_offset + 205, m_actingVersion, m_bufferLength); + return m_minPriceIncrementAmount; + } + + SBE_NODISCARD static const char * UserDefinedInstrumentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t userDefinedInstrumentId() SBE_NOEXCEPT + { + return 9779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t userDefinedInstrumentSinceVersion() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD bool userDefinedInstrumentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= userDefinedInstrumentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingOffset() SBE_NOEXCEPT + { + return 213; + } + + static SBE_CONSTEXPR char userDefinedInstrumentNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char userDefinedInstrument() const SBE_NOEXCEPT + { + if (m_actingVersion < 3) + { + return (char)0; + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 213, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture27 &userDefinedInstrument(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 213, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * TradingReferenceDateMetaAttribute(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 tradingReferenceDateId() SBE_NOEXCEPT + { + return 5796; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferenceDateSinceVersion() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD bool tradingReferenceDateInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferenceDateSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingOffset() SBE_NOEXCEPT + { + return 214; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradingReferenceDate() const SBE_NOEXCEPT + { + if (m_actingVersion < 6) + { + return (std::uint16_t)65535; + } + + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 214, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionFuture27 &tradingReferenceDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 214, &val, sizeof(std::uint16_t)); + return *this; + } + + class NoEvents + { + 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((std::uint16_t)9); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 9; + 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 9; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoEvents &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * EventTypeMetaAttribute(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 eventTypeId() SBE_NOEXCEPT + { + return 865; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD EventType::Value eventType() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint8_t)); + return EventType::get((val)); + } + + NoEvents &eventType(const EventType::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * EventTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t eventTimeId() SBE_NOEXCEPT + { + return 1145; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTimeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTimeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTimeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t eventTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t eventTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoEvents &eventTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint64_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoEvents writer) + { + builder << '{'; + builder << R"("EventType": )"; + builder << '"' << writer.eventType() << '"'; + + builder << ", "; + builder << R"("EventTime": )"; + builder << +writer.eventTime(); + + builder << '}'; + + return builder; + } + }; + +private: + NoEvents m_noEvents; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoEventsId() SBE_NOEXCEPT + { + return 864; + } + + SBE_NODISCARD inline NoEvents &noEvents() + { + m_noEvents.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + NoEvents &noEventsCount(const std::uint8_t count) + { + m_noEvents.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noEventsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noEventsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noEventsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoMDFeedTypes + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoMDFeedTypes &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDFeedTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDFeedTypeId() SBE_NOEXCEPT + { + return 1022; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDFeedTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDFeedTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDFeedTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR char mDFeedTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDFeedTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDFeedTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t mDFeedTypeLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *mDFeedType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char *mDFeedType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char mDFeedType(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 0 + (index * 1), sizeof(char)); + return (val); + } + + NoMDFeedTypes &mDFeedType(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 0 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getMDFeedType(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getMDFeedType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 0, sizeof(char) * static_cast(length)); + return length; + } + + NoMDFeedTypes &putMDFeedType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 0, src, sizeof(char) * 3); + return *this; + } + + NoMDFeedTypes &putMDFeedType( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 0, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 1, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 2, &val2, sizeof(char)); + + return *this; + } + + std::string getMDFeedTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getMDFeedTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDFeedTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getMDFeedTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + NoMDFeedTypes &putMDFeedType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #else + NoMDFeedTypes &putMDFeedType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MarketDepthMetaAttribute(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 marketDepthId() SBE_NOEXCEPT + { + return 264; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketDepthSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketDepthInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= marketDepthSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketDepthEncodingOffset() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::int8_t marketDepthNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t marketDepthEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t marketDepth() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 3, sizeof(std::int8_t)); + return (val); + } + + NoMDFeedTypes &marketDepth(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 3, &val, sizeof(std::int8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDFeedTypes writer) + { + builder << '{'; + builder << R"("MDFeedType": )"; + builder << '"' << + writer.getMDFeedTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MarketDepth": )"; + builder << +writer.marketDepth(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDFeedTypes m_noMDFeedTypes; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDFeedTypesId() SBE_NOEXCEPT + { + return 1141; + } + + SBE_NODISCARD inline NoMDFeedTypes &noMDFeedTypes() + { + m_noMDFeedTypes.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + NoMDFeedTypes &noMDFeedTypesCount(const std::uint8_t count) + { + m_noMDFeedTypes.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDFeedTypesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDFeedTypesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDFeedTypesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoInstAttrib + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoInstAttrib &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * InstAttribTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribTypeId() SBE_NOEXCEPT + { + return 871; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t instAttribTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t instAttribType() SBE_NOEXCEPT + { + return (std::int8_t)24; + } + + SBE_NODISCARD static const char * InstAttribValueMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribValueId() SBE_NOEXCEPT + { + return 872; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribValueSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribValueInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribValueSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribValueEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + private: + InstAttribValue m_instAttribValue; + + public: + SBE_NODISCARD InstAttribValue &instAttribValue() + { + m_instAttribValue.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_instAttribValue; + } + + static SBE_CONSTEXPR std::size_t instAttribValueEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoInstAttrib writer) + { + builder << '{'; + builder << R"("InstAttribValue": )"; + builder << writer.instAttribValue(); + + builder << '}'; + + return builder; + } + }; + +private: + NoInstAttrib m_noInstAttrib; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoInstAttribId() SBE_NOEXCEPT + { + return 870; + } + + SBE_NODISCARD inline NoInstAttrib &noInstAttrib() + { + m_noInstAttrib.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + NoInstAttrib &noInstAttribCount(const std::uint8_t count) + { + m_noInstAttrib.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noInstAttribSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noInstAttribInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noInstAttribSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoLotTypeRules + { + 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((std::uint16_t)5); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 5; + 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 5; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoLotTypeRules &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * LotTypeMetaAttribute(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 lotTypeId() SBE_NOEXCEPT + { + return 1093; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lotTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lotTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= lotTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lotTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t lotTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t lotTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t lotType() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int8_t)); + return (val); + } + + NoLotTypeRules &lotType(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * MinLotSizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minLotSizeId() SBE_NOEXCEPT + { + return 1231; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minLotSizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minLotSizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= minLotSizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minLotSizeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + +private: + DecimalQty m_minLotSize; + +public: + SBE_NODISCARD DecimalQty &minLotSize() + { + m_minLotSize.wrap(m_buffer, m_offset + 1, m_actingVersion, m_bufferLength); + return m_minLotSize; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoLotTypeRules writer) + { + builder << '{'; + builder << R"("LotType": )"; + builder << +writer.lotType(); + + builder << ", "; + builder << R"("MinLotSize": )"; + builder << writer.minLotSize(); + + builder << '}'; + + return builder; + } + }; + +private: + NoLotTypeRules m_noLotTypeRules; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoLotTypeRulesId() SBE_NOEXCEPT + { + return 1234; + } + + SBE_NODISCARD inline NoLotTypeRules &noLotTypeRules() + { + m_noLotTypeRules.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + NoLotTypeRules &noLotTypeRulesCount(const std::uint8_t count) + { + m_noLotTypeRules.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noLotTypeRulesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noLotTypeRulesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noLotTypeRulesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDInstrumentDefinitionFuture27 _writer) + { + MDInstrumentDefinitionFuture27 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDInstrumentDefinitionFuture27", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + builder << R"("TotNumReports": )"; + builder << +writer.totNumReports(); + + builder << ", "; + builder << R"("SecurityUpdateAction": )"; + builder << '"' << writer.securityUpdateAction() << '"'; + + builder << ", "; + builder << R"("LastUpdateTime": )"; + builder << +writer.lastUpdateTime(); + + builder << ", "; + builder << R"("MDSecurityTradingStatus": )"; + builder << '"' << writer.mDSecurityTradingStatus() << '"'; + + builder << ", "; + builder << R"("ApplID": )"; + builder << +writer.applID(); + + builder << ", "; + builder << R"("MarketSegmentID": )"; + builder << +writer.marketSegmentID(); + + builder << ", "; + builder << R"("UnderlyingProduct": )"; + builder << +writer.underlyingProduct(); + + builder << ", "; + builder << R"("SecurityExchange": )"; + builder << '"' << + writer.getSecurityExchangeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityGroup": )"; + builder << '"' << + writer.getSecurityGroupAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Asset": )"; + builder << '"' << + writer.getAssetAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Symbol": )"; + builder << '"' << + writer.getSymbolAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("SecurityType": )"; + builder << '"' << + writer.getSecurityTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("CFICode": )"; + builder << '"' << + writer.getCFICodeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MaturityMonthYear": )"; + builder << writer.maturityMonthYear(); + + builder << ", "; + builder << R"("Currency": )"; + builder << '"' << + writer.getCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SettlCurrency": )"; + builder << '"' << + writer.getSettlCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MatchAlgorithm": )"; + if (std::isprint(writer.matchAlgorithm())) + { + builder << '"' << (char)writer.matchAlgorithm() << '"'; + } + else + { + builder << (int)writer.matchAlgorithm(); + } + + builder << ", "; + builder << R"("MinTradeVol": )"; + builder << +writer.minTradeVol(); + + builder << ", "; + builder << R"("MaxTradeVol": )"; + builder << +writer.maxTradeVol(); + + builder << ", "; + builder << R"("MinPriceIncrement": )"; + builder << writer.minPriceIncrement(); + + builder << ", "; + builder << R"("DisplayFactor": )"; + builder << writer.displayFactor(); + + builder << ", "; + builder << R"("MainFraction": )"; + builder << +writer.mainFraction(); + + builder << ", "; + builder << R"("SubFraction": )"; + builder << +writer.subFraction(); + + builder << ", "; + builder << R"("PriceDisplayFormat": )"; + builder << +writer.priceDisplayFormat(); + + builder << ", "; + builder << R"("UnitOfMeasure": )"; + builder << '"' << + writer.getUnitOfMeasureAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("UnitOfMeasureQty": )"; + builder << writer.unitOfMeasureQty(); + + builder << ", "; + builder << R"("TradingReferencePrice": )"; + builder << writer.tradingReferencePrice(); + + builder << ", "; + builder << R"("SettlPriceType": )"; + builder << writer.settlPriceType(); + + builder << ", "; + builder << R"("OpenInterestQty": )"; + builder << +writer.openInterestQty(); + + builder << ", "; + builder << R"("ClearedVolume": )"; + builder << +writer.clearedVolume(); + + builder << ", "; + builder << R"("HighLimitPrice": )"; + builder << writer.highLimitPrice(); + + builder << ", "; + builder << R"("LowLimitPrice": )"; + builder << writer.lowLimitPrice(); + + builder << ", "; + builder << R"("MaxPriceVariation": )"; + builder << writer.maxPriceVariation(); + + builder << ", "; + builder << R"("DecayQuantity": )"; + builder << +writer.decayQuantity(); + + builder << ", "; + builder << R"("DecayStartDate": )"; + builder << +writer.decayStartDate(); + + builder << ", "; + builder << R"("OriginalContractSize": )"; + builder << +writer.originalContractSize(); + + builder << ", "; + builder << R"("ContractMultiplier": )"; + builder << +writer.contractMultiplier(); + + builder << ", "; + builder << R"("ContractMultiplierUnit": )"; + builder << +writer.contractMultiplierUnit(); + + builder << ", "; + builder << R"("FlowScheduleType": )"; + builder << +writer.flowScheduleType(); + + builder << ", "; + builder << R"("MinPriceIncrementAmount": )"; + builder << writer.minPriceIncrementAmount(); + + builder << ", "; + builder << R"("UserDefinedInstrument": )"; + if (std::isprint(writer.userDefinedInstrument())) + { + builder << '"' << (char)writer.userDefinedInstrument() << '"'; + } + else + { + builder << (int)writer.userDefinedInstrument(); + } + + builder << ", "; + builder << R"("TradingReferenceDate": )"; + builder << +writer.tradingReferenceDate(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoEvents": [)"; + writer.noEvents().forEach([&](NoEvents& noEvents) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noEvents; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDFeedTypes": [)"; + writer.noMDFeedTypes().forEach([&](NoMDFeedTypes& noMDFeedTypes) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDFeedTypes; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoInstAttrib": [)"; + writer.noInstAttrib().forEach([&](NoInstAttrib& noInstAttrib) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noInstAttrib; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoLotTypeRules": [)"; + writer.noLotTypeRules().forEach([&](NoLotTypeRules& noLotTypeRules) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLotTypeRules; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionFuture54.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionFuture54.h new file mode 100644 index 000000000..65ca771c5 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionFuture54.h @@ -0,0 +1,6294 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINSTRUMENTDEFINITIONFUTURE54_H_ +#define _MKTDATA_MDINSTRUMENTDEFINITIONFUTURE54_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDInstrumentDefinitionFuture54 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDInstrumentDefinitionFuture54() = default; + + MDInstrumentDefinitionFuture54( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDInstrumentDefinitionFuture54(char *buffer, const std::uint64_t bufferLength) : + MDInstrumentDefinitionFuture54(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDInstrumentDefinitionFuture54( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDInstrumentDefinitionFuture54(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)216; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)54; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "d"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDInstrumentDefinitionFuture54 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionFuture54(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDInstrumentDefinitionFuture54 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDInstrumentDefinitionFuture54( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDInstrumentDefinitionFuture54 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionFuture54(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * TotNumReportsMetaAttribute(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 totNumReportsId() SBE_NOEXCEPT + { + return 911; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t totNumReportsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool totNumReportsInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= totNumReportsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t totNumReportsEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsNullValue() SBE_NOEXCEPT + { + return 4294967295; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t totNumReportsEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t totNumReports() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture54 &totNumReports(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityUpdateActionMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityUpdateActionId() SBE_NOEXCEPT + { + return 980; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityUpdateActionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityUpdateActionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 5; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityUpdateAction::Value securityUpdateAction() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 5, sizeof(char)); + return SecurityUpdateAction::get((val)); + } + + MDInstrumentDefinitionFuture54 &securityUpdateAction(const SecurityUpdateAction::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 5, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * LastUpdateTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastUpdateTimeId() SBE_NOEXCEPT + { + return 779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastUpdateTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastUpdateTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastUpdateTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingOffset() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t lastUpdateTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 6, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + MDInstrumentDefinitionFuture54 &lastUpdateTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 6, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDSecurityTradingStatusMetaAttribute(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 mDSecurityTradingStatusId() SBE_NOEXCEPT + { + return 1682; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDSecurityTradingStatusSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDSecurityTradingStatusInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mDSecurityTradingStatusSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingOffset() SBE_NOEXCEPT + { + return 14; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityTradingStatus::Value mDSecurityTradingStatus() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 14, sizeof(std::uint8_t)); + return SecurityTradingStatus::get((val)); + } + + MDInstrumentDefinitionFuture54 &mDSecurityTradingStatus(const SecurityTradingStatus::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 14, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * ApplIDMetaAttribute(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 applIDId() SBE_NOEXCEPT + { + return 1180; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t applIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool applIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= applIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t applIDEncodingOffset() SBE_NOEXCEPT + { + return 15; + } + + static SBE_CONSTEXPR std::int16_t applIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT16; + } + + static SBE_CONSTEXPR std::int16_t applIDMinValue() SBE_NOEXCEPT + { + return (std::int16_t)-32767; + } + + static SBE_CONSTEXPR std::int16_t applIDMaxValue() SBE_NOEXCEPT + { + return (std::int16_t)32767; + } + + static SBE_CONSTEXPR std::size_t applIDEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::int16_t applID() const SBE_NOEXCEPT + { + std::int16_t val; + std::memcpy(&val, m_buffer + m_offset + 15, sizeof(std::int16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionFuture54 &applID(const std::int16_t value) SBE_NOEXCEPT + { + std::int16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 15, &val, sizeof(std::int16_t)); + return *this; + } + + SBE_NODISCARD static const char * MarketSegmentIDMetaAttribute(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 marketSegmentIDId() SBE_NOEXCEPT + { + return 1300; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketSegmentIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketSegmentIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= marketSegmentIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingOffset() SBE_NOEXCEPT + { + return 17; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t marketSegmentID() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 17, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionFuture54 &marketSegmentID(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 17, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnderlyingProductMetaAttribute(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 underlyingProductId() SBE_NOEXCEPT + { + return 462; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingProductSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingProductInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= underlyingProductSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingProductEncodingOffset() SBE_NOEXCEPT + { + return 18; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t underlyingProductEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t underlyingProduct() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 18, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionFuture54 &underlyingProduct(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 18, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityExchangeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Exchange"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityExchangeId() SBE_NOEXCEPT + { + return 207; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityExchangeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityExchangeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityExchangeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityExchangeEncodingOffset() SBE_NOEXCEPT + { + return 19; + } + + static SBE_CONSTEXPR char securityExchangeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityExchangeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityExchangeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityExchangeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint64_t securityExchangeLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD const char *securityExchange() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char *securityExchange() SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char securityExchange(const std::uint64_t index) const + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 19 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture54 &securityExchange(const std::uint64_t index, const char value) + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 19 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityExchange(char *const dst, const std::uint64_t length) const + { + if (length > 4) + { + throw std::runtime_error("length too large for getSecurityExchange [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 19, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture54 &putSecurityExchange(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 19, src, sizeof(char) * 4); + return *this; + } + + MDInstrumentDefinitionFuture54 &putSecurityExchange( + const char value0, + const char value1, + const char value2, + const char value3) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 19, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 20, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 21, &val2, sizeof(char)); + char val3 = (value3); + std::memcpy(m_buffer + m_offset + 22, &val3, sizeof(char)); + + return *this; + } + + std::string getSecurityExchangeAsString() const + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityExchangeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityExchangeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityExchangeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture54 &putSecurityExchange(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.data(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture54 &putSecurityExchange(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.c_str(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityGroupMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityGroupId() SBE_NOEXCEPT + { + return 1151; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityGroupSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityGroupInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityGroupSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityGroupEncodingOffset() SBE_NOEXCEPT + { + return 23; + } + + static SBE_CONSTEXPR char securityGroupNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityGroupMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityGroupMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityGroupEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityGroupLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityGroup() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char *securityGroup() SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char securityGroup(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 23 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture54 &securityGroup(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 23 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityGroup(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityGroup [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 23, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture54 &putSecurityGroup(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 23, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityGroupAsString() const + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityGroupAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityGroupAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityGroupAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture54 &putSecurityGroup(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture54 &putSecurityGroup(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * AssetMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t assetId() SBE_NOEXCEPT + { + return 6937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t assetSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool assetInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= assetSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t assetEncodingOffset() SBE_NOEXCEPT + { + return 29; + } + + static SBE_CONSTEXPR char assetNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char assetMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char assetMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t assetEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t assetLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *asset() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char *asset() SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char asset(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 29 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture54 &asset(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 29 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getAsset(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getAsset [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 29, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture54 &putAsset(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 29, src, sizeof(char) * 6); + return *this; + } + + std::string getAssetAsString() const + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getAssetAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getAssetAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getAssetAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture54 &putAsset(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture54 &putAsset(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SymbolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t symbolId() SBE_NOEXCEPT + { + return 55; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t symbolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool symbolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= symbolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t symbolEncodingOffset() SBE_NOEXCEPT + { + return 35; + } + + static SBE_CONSTEXPR char symbolNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char symbolMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char symbolMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t symbolEncodingLength() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t symbolLength() SBE_NOEXCEPT + { + return 20; + } + + SBE_NODISCARD const char *symbol() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char *symbol() SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char symbol(const std::uint64_t index) const + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 35 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture54 &symbol(const std::uint64_t index, const char value) + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 35 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSymbol(char *const dst, const std::uint64_t length) const + { + if (length > 20) + { + throw std::runtime_error("length too large for getSymbol [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 35, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture54 &putSymbol(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 35, src, sizeof(char) * 20); + return *this; + } + + std::string getSymbolAsString() const + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSymbolAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSymbolAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSymbolAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture54 &putSymbol(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.data(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture54 &putSymbol(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.c_str(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 55; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 55, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture54 &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 55, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityIDSourceId() SBE_NOEXCEPT + { + return 22; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDSourceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSourceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t securityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *securityIDSource() const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (const char *)securityIDSourceValues; + } + + SBE_NODISCARD char securityIDSource(const std::uint64_t index) const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (char)securityIDSourceValues[index]; + } + + std::uint64_t getSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t securityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(securityIDSourceValues) ? length : sizeof(securityIDSourceValues); + + std::memcpy(dst, securityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getSecurityIDSourceAsString() const + { + static const std::uint8_t SecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)SecurityIDSourceValues, 1); + } + + std::string getSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * SecurityTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityTypeId() SBE_NOEXCEPT + { + return 167; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityTypeEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityTypeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityTypeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char *securityType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char securityType(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 59 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture54 &securityType(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 59 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityType(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 59, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture54 &putSecurityType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 59, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture54 &putSecurityType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture54 &putSecurityType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * CFICodeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t cFICodeId() SBE_NOEXCEPT + { + return 461; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t cFICodeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool cFICodeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= cFICodeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t cFICodeEncodingOffset() SBE_NOEXCEPT + { + return 65; + } + + static SBE_CONSTEXPR char cFICodeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char cFICodeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char cFICodeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t cFICodeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t cFICodeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *cFICode() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char *cFICode() SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char cFICode(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 65 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture54 &cFICode(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 65 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCFICode(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getCFICode [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 65, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture54 &putCFICode(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 65, src, sizeof(char) * 6); + return *this; + } + + std::string getCFICodeAsString() const + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCFICodeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCFICodeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCFICodeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture54 &putCFICode(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture54 &putCFICode(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MaturityMonthYearMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MonthYear"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maturityMonthYearId() SBE_NOEXCEPT + { + return 200; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maturityMonthYearSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maturityMonthYearInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maturityMonthYearSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maturityMonthYearEncodingOffset() SBE_NOEXCEPT + { + return 71; + } + +private: + MaturityMonthYear m_maturityMonthYear; + +public: + SBE_NODISCARD MaturityMonthYear &maturityMonthYear() + { + m_maturityMonthYear.wrap(m_buffer, m_offset + 71, m_actingVersion, m_bufferLength); + return m_maturityMonthYear; + } + + SBE_NODISCARD static const char * CurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t currencyId() SBE_NOEXCEPT + { + return 15; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t currencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool currencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= currencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t currencyEncodingOffset() SBE_NOEXCEPT + { + return 76; + } + + static SBE_CONSTEXPR char currencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char currencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char currencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t currencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t currencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *currency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 76; + } + + SBE_NODISCARD char *currency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 76; + } + + SBE_NODISCARD char currency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 76 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture54 ¤cy(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 76 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 76, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture54 &putCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 76, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionFuture54 &putCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 76, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 77, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 78, &val2, sizeof(char)); + + return *this; + } + + std::string getCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 76; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 76; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture54 &putCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 76, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 76 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture54 &putCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 76, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 76 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SettlCurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlCurrencyId() SBE_NOEXCEPT + { + return 120; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlCurrencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlCurrencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= settlCurrencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlCurrencyEncodingOffset() SBE_NOEXCEPT + { + return 79; + } + + static SBE_CONSTEXPR char settlCurrencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char settlCurrencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char settlCurrencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t settlCurrencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t settlCurrencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *settlCurrency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 79; + } + + SBE_NODISCARD char *settlCurrency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 79; + } + + SBE_NODISCARD char settlCurrency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for settlCurrency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 79 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture54 &settlCurrency(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for settlCurrency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 79 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSettlCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getSettlCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 79, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture54 &putSettlCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 79, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionFuture54 &putSettlCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 79, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 80, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 81, &val2, sizeof(char)); + + return *this; + } + + std::string getSettlCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 79; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSettlCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSettlCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSettlCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 79; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture54 &putSettlCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putSettlCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 79, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 79 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture54 &putSettlCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putSettlCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 79, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 79 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MatchAlgorithmMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchAlgorithmId() SBE_NOEXCEPT + { + return 1142; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchAlgorithmSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchAlgorithmInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchAlgorithmSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingOffset() SBE_NOEXCEPT + { + return 82; + } + + static SBE_CONSTEXPR char matchAlgorithmNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char matchAlgorithmMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char matchAlgorithmMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char matchAlgorithm() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 82, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture54 &matchAlgorithm(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 82, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * MinTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minTradeVolId() SBE_NOEXCEPT + { + return 562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 83; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t minTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t minTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 83, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture54 &minTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 83, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MaxTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maxTradeVolId() SBE_NOEXCEPT + { + return 1140; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maxTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 87; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t maxTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t maxTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 87, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture54 &maxTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 87, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MinPriceIncrementMetaAttribute(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 minPriceIncrementId() SBE_NOEXCEPT + { + return 969; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minPriceIncrementSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool minPriceIncrementInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minPriceIncrementSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minPriceIncrementEncodingOffset() SBE_NOEXCEPT + { + return 91; + } + +private: + PRICE9 m_minPriceIncrement; + +public: + SBE_NODISCARD PRICE9 &minPriceIncrement() + { + m_minPriceIncrement.wrap(m_buffer, m_offset + 91, m_actingVersion, m_bufferLength); + return m_minPriceIncrement; + } + + SBE_NODISCARD static const char * DisplayFactorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "float"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t displayFactorId() SBE_NOEXCEPT + { + return 9787; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t displayFactorSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool displayFactorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= displayFactorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t displayFactorEncodingOffset() SBE_NOEXCEPT + { + return 99; + } + +private: + Decimal9 m_displayFactor; + +public: + SBE_NODISCARD Decimal9 &displayFactor() + { + m_displayFactor.wrap(m_buffer, m_offset + 99, m_actingVersion, m_bufferLength); + return m_displayFactor; + } + + SBE_NODISCARD static const char * MainFractionMetaAttribute(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 mainFractionId() SBE_NOEXCEPT + { + return 37702; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mainFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mainFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mainFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mainFractionEncodingOffset() SBE_NOEXCEPT + { + return 107; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t mainFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t mainFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 107, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionFuture54 &mainFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 107, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SubFractionMetaAttribute(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 subFractionId() SBE_NOEXCEPT + { + return 37703; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t subFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool subFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= subFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t subFractionEncodingOffset() SBE_NOEXCEPT + { + return 108; + } + + static SBE_CONSTEXPR std::uint8_t subFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t subFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t subFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 108, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionFuture54 &subFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 108, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * PriceDisplayFormatMetaAttribute(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 priceDisplayFormatId() SBE_NOEXCEPT + { + return 9800; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priceDisplayFormatSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool priceDisplayFormatInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priceDisplayFormatSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingOffset() SBE_NOEXCEPT + { + return 109; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priceDisplayFormat() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 109, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionFuture54 &priceDisplayFormat(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 109, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnitOfMeasureMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t unitOfMeasureId() SBE_NOEXCEPT + { + return 996; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t unitOfMeasureSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool unitOfMeasureInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= unitOfMeasureSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingOffset() SBE_NOEXCEPT + { + return 110; + } + + static SBE_CONSTEXPR char unitOfMeasureNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char unitOfMeasureMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char unitOfMeasureMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingLength() SBE_NOEXCEPT + { + return 30; + } + + static SBE_CONSTEXPR std::uint64_t unitOfMeasureLength() SBE_NOEXCEPT + { + return 30; + } + + SBE_NODISCARD const char *unitOfMeasure() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 110; + } + + SBE_NODISCARD char *unitOfMeasure() SBE_NOEXCEPT + { + return m_buffer + m_offset + 110; + } + + SBE_NODISCARD char unitOfMeasure(const std::uint64_t index) const + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 110 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture54 &unitOfMeasure(const std::uint64_t index, const char value) + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 110 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getUnitOfMeasure(char *const dst, const std::uint64_t length) const + { + if (length > 30) + { + throw std::runtime_error("length too large for getUnitOfMeasure [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 110, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionFuture54 &putUnitOfMeasure(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 110, src, sizeof(char) * 30); + return *this; + } + + std::string getUnitOfMeasureAsString() const + { + const char *buffer = m_buffer + m_offset + 110; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getUnitOfMeasureAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getUnitOfMeasureAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getUnitOfMeasureAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 110; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionFuture54 &putUnitOfMeasure(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 110, str.data(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 110 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionFuture54 &putUnitOfMeasure(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 110, str.c_str(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 110 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * UnitOfMeasureQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t unitOfMeasureQtyId() SBE_NOEXCEPT + { + return 1147; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t unitOfMeasureQtySinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool unitOfMeasureQtyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= unitOfMeasureQtySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t unitOfMeasureQtyEncodingOffset() SBE_NOEXCEPT + { + return 140; + } + +private: + Decimal9NULL m_unitOfMeasureQty; + +public: + SBE_NODISCARD Decimal9NULL &unitOfMeasureQty() + { + m_unitOfMeasureQty.wrap(m_buffer, m_offset + 140, m_actingVersion, m_bufferLength); + return m_unitOfMeasureQty; + } + + SBE_NODISCARD static const char * TradingReferencePriceMetaAttribute(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 tradingReferencePriceId() SBE_NOEXCEPT + { + return 1150; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferencePriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool tradingReferencePriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferencePriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferencePriceEncodingOffset() SBE_NOEXCEPT + { + return 148; + } + +private: + PRICENULL9 m_tradingReferencePrice; + +public: + SBE_NODISCARD PRICENULL9 &tradingReferencePrice() + { + m_tradingReferencePrice.wrap(m_buffer, m_offset + 148, m_actingVersion, m_bufferLength); + return m_tradingReferencePrice; + } + + SBE_NODISCARD static const char * SettlPriceTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlPriceTypeId() SBE_NOEXCEPT + { + return 731; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlPriceTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlPriceTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= settlPriceTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingOffset() SBE_NOEXCEPT + { + return 156; + } + +private: + SettlPriceType m_settlPriceType; + +public: + SBE_NODISCARD SettlPriceType &settlPriceType() + { + m_settlPriceType.wrap(m_buffer, m_offset + 156, m_actingVersion, m_bufferLength); + return m_settlPriceType; + } + + static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * OpenInterestQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t openInterestQtyId() SBE_NOEXCEPT + { + return 5792; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t openInterestQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool openInterestQtyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= openInterestQtySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openInterestQtyEncodingOffset() SBE_NOEXCEPT + { + return 157; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t openInterestQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t openInterestQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 157, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture54 &openInterestQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 157, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * ClearedVolumeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t clearedVolumeId() SBE_NOEXCEPT + { + return 5791; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t clearedVolumeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool clearedVolumeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= clearedVolumeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t clearedVolumeEncodingOffset() SBE_NOEXCEPT + { + return 161; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t clearedVolumeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t clearedVolume() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 161, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture54 &clearedVolume(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 161, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * HighLimitPriceMetaAttribute(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 highLimitPriceId() SBE_NOEXCEPT + { + return 1149; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t highLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool highLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= highLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t highLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 165; + } + +private: + PRICENULL9 m_highLimitPrice; + +public: + SBE_NODISCARD PRICENULL9 &highLimitPrice() + { + m_highLimitPrice.wrap(m_buffer, m_offset + 165, m_actingVersion, m_bufferLength); + return m_highLimitPrice; + } + + SBE_NODISCARD static const char * LowLimitPriceMetaAttribute(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 lowLimitPriceId() SBE_NOEXCEPT + { + return 1148; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lowLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool lowLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lowLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lowLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 173; + } + +private: + PRICENULL9 m_lowLimitPrice; + +public: + SBE_NODISCARD PRICENULL9 &lowLimitPrice() + { + m_lowLimitPrice.wrap(m_buffer, m_offset + 173, m_actingVersion, m_bufferLength); + return m_lowLimitPrice; + } + + SBE_NODISCARD static const char * MaxPriceVariationMetaAttribute(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 maxPriceVariationId() SBE_NOEXCEPT + { + return 1143; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxPriceVariationSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool maxPriceVariationInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxPriceVariationSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxPriceVariationEncodingOffset() SBE_NOEXCEPT + { + return 181; + } + +private: + PRICENULL9 m_maxPriceVariation; + +public: + SBE_NODISCARD PRICENULL9 &maxPriceVariation() + { + m_maxPriceVariation.wrap(m_buffer, m_offset + 181, m_actingVersion, m_bufferLength); + return m_maxPriceVariation; + } + + SBE_NODISCARD static const char * DecayQuantityMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t decayQuantityId() SBE_NOEXCEPT + { + return 5818; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t decayQuantitySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool decayQuantityInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= decayQuantitySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t decayQuantityEncodingOffset() SBE_NOEXCEPT + { + return 189; + } + + static SBE_CONSTEXPR std::int32_t decayQuantityNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t decayQuantityMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t decayQuantityMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t decayQuantityEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t decayQuantity() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 189, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture54 &decayQuantity(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 189, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * DecayStartDateMetaAttribute(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 decayStartDateId() SBE_NOEXCEPT + { + return 5819; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t decayStartDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool decayStartDateInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= decayStartDateSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t decayStartDateEncodingOffset() SBE_NOEXCEPT + { + return 193; + } + + static SBE_CONSTEXPR std::uint16_t decayStartDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t decayStartDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t decayStartDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t decayStartDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t decayStartDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 193, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionFuture54 &decayStartDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 193, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char * OriginalContractSizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t originalContractSizeId() SBE_NOEXCEPT + { + return 5849; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t originalContractSizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool originalContractSizeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= originalContractSizeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t originalContractSizeEncodingOffset() SBE_NOEXCEPT + { + return 195; + } + + static SBE_CONSTEXPR std::int32_t originalContractSizeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t originalContractSizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t originalContractSizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t originalContractSizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t originalContractSize() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 195, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture54 &originalContractSize(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 195, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * ContractMultiplierMetaAttribute(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 contractMultiplierId() SBE_NOEXCEPT + { + return 231; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t contractMultiplierSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool contractMultiplierInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= contractMultiplierSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t contractMultiplierEncodingOffset() SBE_NOEXCEPT + { + return 199; + } + + static SBE_CONSTEXPR std::int32_t contractMultiplierNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t contractMultiplierMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t contractMultiplierMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t contractMultiplierEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t contractMultiplier() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 199, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionFuture54 &contractMultiplier(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 199, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * ContractMultiplierUnitMetaAttribute(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 contractMultiplierUnitId() SBE_NOEXCEPT + { + return 1435; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t contractMultiplierUnitSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool contractMultiplierUnitInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= contractMultiplierUnitSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t contractMultiplierUnitEncodingOffset() SBE_NOEXCEPT + { + return 203; + } + + static SBE_CONSTEXPR std::int8_t contractMultiplierUnitNullValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::int8_t contractMultiplierUnitMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t contractMultiplierUnitMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t contractMultiplierUnitEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t contractMultiplierUnit() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 203, sizeof(std::int8_t)); + return (val); + } + + MDInstrumentDefinitionFuture54 &contractMultiplierUnit(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 203, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * FlowScheduleTypeMetaAttribute(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 flowScheduleTypeId() SBE_NOEXCEPT + { + return 1439; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t flowScheduleTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool flowScheduleTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= flowScheduleTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t flowScheduleTypeEncodingOffset() SBE_NOEXCEPT + { + return 204; + } + + static SBE_CONSTEXPR std::int8_t flowScheduleTypeNullValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::int8_t flowScheduleTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t flowScheduleTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t flowScheduleTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t flowScheduleType() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 204, sizeof(std::int8_t)); + return (val); + } + + MDInstrumentDefinitionFuture54 &flowScheduleType(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 204, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * MinPriceIncrementAmountMetaAttribute(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 minPriceIncrementAmountId() SBE_NOEXCEPT + { + return 1146; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minPriceIncrementAmountSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool minPriceIncrementAmountInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minPriceIncrementAmountSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minPriceIncrementAmountEncodingOffset() SBE_NOEXCEPT + { + return 205; + } + +private: + PRICENULL9 m_minPriceIncrementAmount; + +public: + SBE_NODISCARD PRICENULL9 &minPriceIncrementAmount() + { + m_minPriceIncrementAmount.wrap(m_buffer, m_offset + 205, m_actingVersion, m_bufferLength); + return m_minPriceIncrementAmount; + } + + SBE_NODISCARD static const char * UserDefinedInstrumentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t userDefinedInstrumentId() SBE_NOEXCEPT + { + return 9779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t userDefinedInstrumentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool userDefinedInstrumentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= userDefinedInstrumentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingOffset() SBE_NOEXCEPT + { + return 213; + } + + static SBE_CONSTEXPR char userDefinedInstrumentNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char userDefinedInstrument() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 213, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionFuture54 &userDefinedInstrument(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 213, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * TradingReferenceDateMetaAttribute(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 tradingReferenceDateId() SBE_NOEXCEPT + { + return 5796; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferenceDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradingReferenceDateInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferenceDateSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingOffset() SBE_NOEXCEPT + { + return 214; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradingReferenceDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 214, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionFuture54 &tradingReferenceDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 214, &val, sizeof(std::uint16_t)); + return *this; + } + + class NoEvents + { + 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((std::uint16_t)9); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 9; + 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 9; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoEvents &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * EventTypeMetaAttribute(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 eventTypeId() SBE_NOEXCEPT + { + return 865; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD EventType::Value eventType() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint8_t)); + return EventType::get((val)); + } + + NoEvents &eventType(const EventType::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * EventTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t eventTimeId() SBE_NOEXCEPT + { + return 1145; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTimeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTimeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTimeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t eventTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t eventTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoEvents &eventTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint64_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoEvents writer) + { + builder << '{'; + builder << R"("EventType": )"; + builder << '"' << writer.eventType() << '"'; + + builder << ", "; + builder << R"("EventTime": )"; + builder << +writer.eventTime(); + + builder << '}'; + + return builder; + } + }; + +private: + NoEvents m_noEvents; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoEventsId() SBE_NOEXCEPT + { + return 864; + } + + SBE_NODISCARD inline NoEvents &noEvents() + { + m_noEvents.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + NoEvents &noEventsCount(const std::uint8_t count) + { + m_noEvents.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noEventsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noEventsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noEventsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoMDFeedTypes + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoMDFeedTypes &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDFeedTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDFeedTypeId() SBE_NOEXCEPT + { + return 1022; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDFeedTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDFeedTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDFeedTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR char mDFeedTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDFeedTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDFeedTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t mDFeedTypeLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *mDFeedType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char *mDFeedType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char mDFeedType(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 0 + (index * 1), sizeof(char)); + return (val); + } + + NoMDFeedTypes &mDFeedType(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 0 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getMDFeedType(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getMDFeedType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 0, sizeof(char) * static_cast(length)); + return length; + } + + NoMDFeedTypes &putMDFeedType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 0, src, sizeof(char) * 3); + return *this; + } + + NoMDFeedTypes &putMDFeedType( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 0, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 1, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 2, &val2, sizeof(char)); + + return *this; + } + + std::string getMDFeedTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getMDFeedTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDFeedTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getMDFeedTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + NoMDFeedTypes &putMDFeedType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #else + NoMDFeedTypes &putMDFeedType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MarketDepthMetaAttribute(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 marketDepthId() SBE_NOEXCEPT + { + return 264; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketDepthSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketDepthInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= marketDepthSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketDepthEncodingOffset() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::int8_t marketDepthNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t marketDepthEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t marketDepth() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 3, sizeof(std::int8_t)); + return (val); + } + + NoMDFeedTypes &marketDepth(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 3, &val, sizeof(std::int8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDFeedTypes writer) + { + builder << '{'; + builder << R"("MDFeedType": )"; + builder << '"' << + writer.getMDFeedTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MarketDepth": )"; + builder << +writer.marketDepth(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDFeedTypes m_noMDFeedTypes; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDFeedTypesId() SBE_NOEXCEPT + { + return 1141; + } + + SBE_NODISCARD inline NoMDFeedTypes &noMDFeedTypes() + { + m_noMDFeedTypes.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + NoMDFeedTypes &noMDFeedTypesCount(const std::uint8_t count) + { + m_noMDFeedTypes.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDFeedTypesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDFeedTypesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDFeedTypesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoInstAttrib + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoInstAttrib &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * InstAttribTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribTypeId() SBE_NOEXCEPT + { + return 871; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t instAttribTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t instAttribType() SBE_NOEXCEPT + { + return (std::int8_t)24; + } + + SBE_NODISCARD static const char * InstAttribValueMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribValueId() SBE_NOEXCEPT + { + return 872; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribValueSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribValueInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribValueSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribValueEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + private: + InstAttribValue m_instAttribValue; + + public: + SBE_NODISCARD InstAttribValue &instAttribValue() + { + m_instAttribValue.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_instAttribValue; + } + + static SBE_CONSTEXPR std::size_t instAttribValueEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoInstAttrib writer) + { + builder << '{'; + builder << R"("InstAttribValue": )"; + builder << writer.instAttribValue(); + + builder << '}'; + + return builder; + } + }; + +private: + NoInstAttrib m_noInstAttrib; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoInstAttribId() SBE_NOEXCEPT + { + return 870; + } + + SBE_NODISCARD inline NoInstAttrib &noInstAttrib() + { + m_noInstAttrib.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + NoInstAttrib &noInstAttribCount(const std::uint8_t count) + { + m_noInstAttrib.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noInstAttribSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noInstAttribInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noInstAttribSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoLotTypeRules + { + 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((std::uint16_t)5); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 5; + 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 5; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoLotTypeRules &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * LotTypeMetaAttribute(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 lotTypeId() SBE_NOEXCEPT + { + return 1093; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lotTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lotTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= lotTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lotTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t lotTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t lotTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t lotType() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int8_t)); + return (val); + } + + NoLotTypeRules &lotType(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * MinLotSizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minLotSizeId() SBE_NOEXCEPT + { + return 1231; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minLotSizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minLotSizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= minLotSizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minLotSizeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + +private: + DecimalQty m_minLotSize; + +public: + SBE_NODISCARD DecimalQty &minLotSize() + { + m_minLotSize.wrap(m_buffer, m_offset + 1, m_actingVersion, m_bufferLength); + return m_minLotSize; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoLotTypeRules writer) + { + builder << '{'; + builder << R"("LotType": )"; + builder << +writer.lotType(); + + builder << ", "; + builder << R"("MinLotSize": )"; + builder << writer.minLotSize(); + + builder << '}'; + + return builder; + } + }; + +private: + NoLotTypeRules m_noLotTypeRules; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoLotTypeRulesId() SBE_NOEXCEPT + { + return 1234; + } + + SBE_NODISCARD inline NoLotTypeRules &noLotTypeRules() + { + m_noLotTypeRules.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + NoLotTypeRules &noLotTypeRulesCount(const std::uint8_t count) + { + m_noLotTypeRules.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noLotTypeRulesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noLotTypeRulesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noLotTypeRulesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDInstrumentDefinitionFuture54 _writer) + { + MDInstrumentDefinitionFuture54 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDInstrumentDefinitionFuture54", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + builder << R"("TotNumReports": )"; + builder << +writer.totNumReports(); + + builder << ", "; + builder << R"("SecurityUpdateAction": )"; + builder << '"' << writer.securityUpdateAction() << '"'; + + builder << ", "; + builder << R"("LastUpdateTime": )"; + builder << +writer.lastUpdateTime(); + + builder << ", "; + builder << R"("MDSecurityTradingStatus": )"; + builder << '"' << writer.mDSecurityTradingStatus() << '"'; + + builder << ", "; + builder << R"("ApplID": )"; + builder << +writer.applID(); + + builder << ", "; + builder << R"("MarketSegmentID": )"; + builder << +writer.marketSegmentID(); + + builder << ", "; + builder << R"("UnderlyingProduct": )"; + builder << +writer.underlyingProduct(); + + builder << ", "; + builder << R"("SecurityExchange": )"; + builder << '"' << + writer.getSecurityExchangeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityGroup": )"; + builder << '"' << + writer.getSecurityGroupAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Asset": )"; + builder << '"' << + writer.getAssetAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Symbol": )"; + builder << '"' << + writer.getSymbolAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("SecurityType": )"; + builder << '"' << + writer.getSecurityTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("CFICode": )"; + builder << '"' << + writer.getCFICodeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MaturityMonthYear": )"; + builder << writer.maturityMonthYear(); + + builder << ", "; + builder << R"("Currency": )"; + builder << '"' << + writer.getCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SettlCurrency": )"; + builder << '"' << + writer.getSettlCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MatchAlgorithm": )"; + if (std::isprint(writer.matchAlgorithm())) + { + builder << '"' << (char)writer.matchAlgorithm() << '"'; + } + else + { + builder << (int)writer.matchAlgorithm(); + } + + builder << ", "; + builder << R"("MinTradeVol": )"; + builder << +writer.minTradeVol(); + + builder << ", "; + builder << R"("MaxTradeVol": )"; + builder << +writer.maxTradeVol(); + + builder << ", "; + builder << R"("MinPriceIncrement": )"; + builder << writer.minPriceIncrement(); + + builder << ", "; + builder << R"("DisplayFactor": )"; + builder << writer.displayFactor(); + + builder << ", "; + builder << R"("MainFraction": )"; + builder << +writer.mainFraction(); + + builder << ", "; + builder << R"("SubFraction": )"; + builder << +writer.subFraction(); + + builder << ", "; + builder << R"("PriceDisplayFormat": )"; + builder << +writer.priceDisplayFormat(); + + builder << ", "; + builder << R"("UnitOfMeasure": )"; + builder << '"' << + writer.getUnitOfMeasureAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("UnitOfMeasureQty": )"; + builder << writer.unitOfMeasureQty(); + + builder << ", "; + builder << R"("TradingReferencePrice": )"; + builder << writer.tradingReferencePrice(); + + builder << ", "; + builder << R"("SettlPriceType": )"; + builder << writer.settlPriceType(); + + builder << ", "; + builder << R"("OpenInterestQty": )"; + builder << +writer.openInterestQty(); + + builder << ", "; + builder << R"("ClearedVolume": )"; + builder << +writer.clearedVolume(); + + builder << ", "; + builder << R"("HighLimitPrice": )"; + builder << writer.highLimitPrice(); + + builder << ", "; + builder << R"("LowLimitPrice": )"; + builder << writer.lowLimitPrice(); + + builder << ", "; + builder << R"("MaxPriceVariation": )"; + builder << writer.maxPriceVariation(); + + builder << ", "; + builder << R"("DecayQuantity": )"; + builder << +writer.decayQuantity(); + + builder << ", "; + builder << R"("DecayStartDate": )"; + builder << +writer.decayStartDate(); + + builder << ", "; + builder << R"("OriginalContractSize": )"; + builder << +writer.originalContractSize(); + + builder << ", "; + builder << R"("ContractMultiplier": )"; + builder << +writer.contractMultiplier(); + + builder << ", "; + builder << R"("ContractMultiplierUnit": )"; + builder << +writer.contractMultiplierUnit(); + + builder << ", "; + builder << R"("FlowScheduleType": )"; + builder << +writer.flowScheduleType(); + + builder << ", "; + builder << R"("MinPriceIncrementAmount": )"; + builder << writer.minPriceIncrementAmount(); + + builder << ", "; + builder << R"("UserDefinedInstrument": )"; + if (std::isprint(writer.userDefinedInstrument())) + { + builder << '"' << (char)writer.userDefinedInstrument() << '"'; + } + else + { + builder << (int)writer.userDefinedInstrument(); + } + + builder << ", "; + builder << R"("TradingReferenceDate": )"; + builder << +writer.tradingReferenceDate(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoEvents": [)"; + writer.noEvents().forEach([&](NoEvents& noEvents) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noEvents; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDFeedTypes": [)"; + writer.noMDFeedTypes().forEach([&](NoMDFeedTypes& noMDFeedTypes) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDFeedTypes; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoInstAttrib": [)"; + writer.noInstAttrib().forEach([&](NoInstAttrib& noInstAttrib) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noInstAttrib; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoLotTypeRules": [)"; + writer.noLotTypeRules().forEach([&](NoLotTypeRules& noLotTypeRules) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLotTypeRules; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionOption41.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionOption41.h new file mode 100644 index 000000000..e5700c3f4 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionOption41.h @@ -0,0 +1,7526 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINSTRUMENTDEFINITIONOPTION41_H_ +#define _MKTDATA_MDINSTRUMENTDEFINITIONOPTION41_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDInstrumentDefinitionOption41 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDInstrumentDefinitionOption41() = default; + + MDInstrumentDefinitionOption41( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDInstrumentDefinitionOption41(char *buffer, const std::uint64_t bufferLength) : + MDInstrumentDefinitionOption41(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDInstrumentDefinitionOption41( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDInstrumentDefinitionOption41(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)213; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)41; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "d"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDInstrumentDefinitionOption41 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionOption41(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDInstrumentDefinitionOption41 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDInstrumentDefinitionOption41( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDInstrumentDefinitionOption41 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionOption41(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * TotNumReportsMetaAttribute(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 totNumReportsId() SBE_NOEXCEPT + { + return 911; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t totNumReportsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool totNumReportsInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= totNumReportsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t totNumReportsEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsNullValue() SBE_NOEXCEPT + { + return 4294967295; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t totNumReportsEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t totNumReports() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption41 &totNumReports(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityUpdateActionMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityUpdateActionId() SBE_NOEXCEPT + { + return 980; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityUpdateActionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityUpdateActionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 5; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityUpdateAction::Value securityUpdateAction() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 5, sizeof(char)); + return SecurityUpdateAction::get((val)); + } + + MDInstrumentDefinitionOption41 &securityUpdateAction(const SecurityUpdateAction::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 5, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * LastUpdateTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastUpdateTimeId() SBE_NOEXCEPT + { + return 779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastUpdateTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastUpdateTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastUpdateTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingOffset() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t lastUpdateTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 6, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + MDInstrumentDefinitionOption41 &lastUpdateTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 6, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDSecurityTradingStatusMetaAttribute(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 mDSecurityTradingStatusId() SBE_NOEXCEPT + { + return 1682; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDSecurityTradingStatusSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDSecurityTradingStatusInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mDSecurityTradingStatusSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingOffset() SBE_NOEXCEPT + { + return 14; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityTradingStatus::Value mDSecurityTradingStatus() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 14, sizeof(std::uint8_t)); + return SecurityTradingStatus::get((val)); + } + + MDInstrumentDefinitionOption41 &mDSecurityTradingStatus(const SecurityTradingStatus::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 14, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * ApplIDMetaAttribute(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 applIDId() SBE_NOEXCEPT + { + return 1180; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t applIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool applIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= applIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t applIDEncodingOffset() SBE_NOEXCEPT + { + return 15; + } + + static SBE_CONSTEXPR std::int16_t applIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT16; + } + + static SBE_CONSTEXPR std::int16_t applIDMinValue() SBE_NOEXCEPT + { + return (std::int16_t)-32767; + } + + static SBE_CONSTEXPR std::int16_t applIDMaxValue() SBE_NOEXCEPT + { + return (std::int16_t)32767; + } + + static SBE_CONSTEXPR std::size_t applIDEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::int16_t applID() const SBE_NOEXCEPT + { + std::int16_t val; + std::memcpy(&val, m_buffer + m_offset + 15, sizeof(std::int16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionOption41 &applID(const std::int16_t value) SBE_NOEXCEPT + { + std::int16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 15, &val, sizeof(std::int16_t)); + return *this; + } + + SBE_NODISCARD static const char * MarketSegmentIDMetaAttribute(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 marketSegmentIDId() SBE_NOEXCEPT + { + return 1300; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketSegmentIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketSegmentIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= marketSegmentIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingOffset() SBE_NOEXCEPT + { + return 17; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t marketSegmentID() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 17, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionOption41 &marketSegmentID(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 17, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnderlyingProductMetaAttribute(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 underlyingProductId() SBE_NOEXCEPT + { + return 462; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingProductSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingProductInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= underlyingProductSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingProductEncodingOffset() SBE_NOEXCEPT + { + return 18; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t underlyingProductEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t underlyingProduct() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 18, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionOption41 &underlyingProduct(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 18, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityExchangeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Exchange"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityExchangeId() SBE_NOEXCEPT + { + return 207; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityExchangeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityExchangeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityExchangeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityExchangeEncodingOffset() SBE_NOEXCEPT + { + return 19; + } + + static SBE_CONSTEXPR char securityExchangeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityExchangeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityExchangeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityExchangeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint64_t securityExchangeLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD const char *securityExchange() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char *securityExchange() SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char securityExchange(const std::uint64_t index) const + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 19 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 &securityExchange(const std::uint64_t index, const char value) + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 19 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityExchange(char *const dst, const std::uint64_t length) const + { + if (length > 4) + { + throw std::runtime_error("length too large for getSecurityExchange [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 19, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption41 &putSecurityExchange(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 19, src, sizeof(char) * 4); + return *this; + } + + MDInstrumentDefinitionOption41 &putSecurityExchange( + const char value0, + const char value1, + const char value2, + const char value3) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 19, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 20, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 21, &val2, sizeof(char)); + char val3 = (value3); + std::memcpy(m_buffer + m_offset + 22, &val3, sizeof(char)); + + return *this; + } + + std::string getSecurityExchangeAsString() const + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityExchangeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityExchangeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityExchangeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption41 &putSecurityExchange(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.data(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption41 &putSecurityExchange(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.c_str(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityGroupMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityGroupId() SBE_NOEXCEPT + { + return 1151; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityGroupSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityGroupInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityGroupSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityGroupEncodingOffset() SBE_NOEXCEPT + { + return 23; + } + + static SBE_CONSTEXPR char securityGroupNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityGroupMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityGroupMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityGroupEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityGroupLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityGroup() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char *securityGroup() SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char securityGroup(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 23 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 &securityGroup(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 23 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityGroup(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityGroup [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 23, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption41 &putSecurityGroup(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 23, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityGroupAsString() const + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityGroupAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityGroupAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityGroupAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption41 &putSecurityGroup(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption41 &putSecurityGroup(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * AssetMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t assetId() SBE_NOEXCEPT + { + return 6937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t assetSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool assetInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= assetSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t assetEncodingOffset() SBE_NOEXCEPT + { + return 29; + } + + static SBE_CONSTEXPR char assetNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char assetMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char assetMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t assetEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t assetLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *asset() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char *asset() SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char asset(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 29 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 &asset(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 29 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getAsset(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getAsset [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 29, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption41 &putAsset(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 29, src, sizeof(char) * 6); + return *this; + } + + std::string getAssetAsString() const + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getAssetAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getAssetAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getAssetAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption41 &putAsset(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption41 &putAsset(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SymbolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t symbolId() SBE_NOEXCEPT + { + return 55; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t symbolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool symbolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= symbolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t symbolEncodingOffset() SBE_NOEXCEPT + { + return 35; + } + + static SBE_CONSTEXPR char symbolNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char symbolMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char symbolMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t symbolEncodingLength() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t symbolLength() SBE_NOEXCEPT + { + return 20; + } + + SBE_NODISCARD const char *symbol() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char *symbol() SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char symbol(const std::uint64_t index) const + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 35 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 &symbol(const std::uint64_t index, const char value) + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 35 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSymbol(char *const dst, const std::uint64_t length) const + { + if (length > 20) + { + throw std::runtime_error("length too large for getSymbol [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 35, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption41 &putSymbol(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 35, src, sizeof(char) * 20); + return *this; + } + + std::string getSymbolAsString() const + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSymbolAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSymbolAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSymbolAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption41 &putSymbol(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.data(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption41 &putSymbol(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.c_str(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 55; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 55, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption41 &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 55, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityIDSourceId() SBE_NOEXCEPT + { + return 22; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDSourceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSourceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t securityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *securityIDSource() const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (const char *)securityIDSourceValues; + } + + SBE_NODISCARD char securityIDSource(const std::uint64_t index) const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (char)securityIDSourceValues[index]; + } + + std::uint64_t getSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t securityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(securityIDSourceValues) ? length : sizeof(securityIDSourceValues); + + std::memcpy(dst, securityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getSecurityIDSourceAsString() const + { + static const std::uint8_t SecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)SecurityIDSourceValues, 1); + } + + std::string getSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * SecurityTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityTypeId() SBE_NOEXCEPT + { + return 167; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityTypeEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityTypeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityTypeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char *securityType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char securityType(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 59 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 &securityType(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 59 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityType(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 59, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption41 &putSecurityType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 59, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption41 &putSecurityType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption41 &putSecurityType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * CFICodeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t cFICodeId() SBE_NOEXCEPT + { + return 461; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t cFICodeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool cFICodeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= cFICodeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t cFICodeEncodingOffset() SBE_NOEXCEPT + { + return 65; + } + + static SBE_CONSTEXPR char cFICodeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char cFICodeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char cFICodeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t cFICodeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t cFICodeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *cFICode() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char *cFICode() SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char cFICode(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 65 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 &cFICode(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 65 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCFICode(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getCFICode [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 65, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption41 &putCFICode(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 65, src, sizeof(char) * 6); + return *this; + } + + std::string getCFICodeAsString() const + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCFICodeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCFICodeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCFICodeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption41 &putCFICode(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption41 &putCFICode(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * PutOrCallMetaAttribute(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 putOrCallId() SBE_NOEXCEPT + { + return 201; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t putOrCallSinceVersion() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD bool putOrCallInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= putOrCallSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t putOrCallEncodingOffset() SBE_NOEXCEPT + { + return 71; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t putOrCallEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD PutOrCall::Value putOrCall() const SBE_NOEXCEPT + { + if (m_actingVersion < 3) + { + return PutOrCall::NULL_VALUE; + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 71, sizeof(std::uint8_t)); + return PutOrCall::get((val)); + } + + MDInstrumentDefinitionOption41 &putOrCall(const PutOrCall::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 71, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MaturityMonthYearMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MonthYear"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maturityMonthYearId() SBE_NOEXCEPT + { + return 200; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maturityMonthYearSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maturityMonthYearInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maturityMonthYearSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maturityMonthYearEncodingOffset() SBE_NOEXCEPT + { + return 72; + } + +private: + MaturityMonthYear m_maturityMonthYear; + +public: + SBE_NODISCARD MaturityMonthYear &maturityMonthYear() + { + m_maturityMonthYear.wrap(m_buffer, m_offset + 72, m_actingVersion, m_bufferLength); + return m_maturityMonthYear; + } + + SBE_NODISCARD static const char * CurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t currencyId() SBE_NOEXCEPT + { + return 15; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t currencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool currencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= currencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t currencyEncodingOffset() SBE_NOEXCEPT + { + return 77; + } + + static SBE_CONSTEXPR char currencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char currencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char currencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t currencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t currencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *currency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 77; + } + + SBE_NODISCARD char *currency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 77; + } + + SBE_NODISCARD char currency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 77 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 ¤cy(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 77 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 77, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption41 &putCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 77, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionOption41 &putCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 77, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 78, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 79, &val2, sizeof(char)); + + return *this; + } + + std::string getCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 77; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 77; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption41 &putCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 77, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 77 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption41 &putCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 77, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 77 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * StrikePriceMetaAttribute(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 strikePriceId() SBE_NOEXCEPT + { + return 202; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t strikePriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool strikePriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= strikePriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t strikePriceEncodingOffset() SBE_NOEXCEPT + { + return 80; + } + +private: + PRICENULL m_strikePrice; + +public: + SBE_NODISCARD PRICENULL &strikePrice() + { + m_strikePrice.wrap(m_buffer, m_offset + 80, m_actingVersion, m_bufferLength); + return m_strikePrice; + } + + SBE_NODISCARD static const char * StrikeCurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t strikeCurrencyId() SBE_NOEXCEPT + { + return 947; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t strikeCurrencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool strikeCurrencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= strikeCurrencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t strikeCurrencyEncodingOffset() SBE_NOEXCEPT + { + return 88; + } + + static SBE_CONSTEXPR char strikeCurrencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char strikeCurrencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char strikeCurrencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t strikeCurrencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t strikeCurrencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *strikeCurrency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 88; + } + + SBE_NODISCARD char *strikeCurrency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 88; + } + + SBE_NODISCARD char strikeCurrency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for strikeCurrency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 88 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 &strikeCurrency(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for strikeCurrency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 88 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getStrikeCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getStrikeCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 88, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption41 &putStrikeCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 88, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionOption41 &putStrikeCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 88, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 89, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 90, &val2, sizeof(char)); + + return *this; + } + + std::string getStrikeCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 88; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getStrikeCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getStrikeCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getStrikeCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 88; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption41 &putStrikeCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putStrikeCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 88, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 88 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption41 &putStrikeCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putStrikeCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 88, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 88 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SettlCurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlCurrencyId() SBE_NOEXCEPT + { + return 120; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlCurrencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlCurrencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= settlCurrencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlCurrencyEncodingOffset() SBE_NOEXCEPT + { + return 91; + } + + static SBE_CONSTEXPR char settlCurrencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char settlCurrencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char settlCurrencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t settlCurrencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t settlCurrencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *settlCurrency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 91; + } + + SBE_NODISCARD char *settlCurrency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 91; + } + + SBE_NODISCARD char settlCurrency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for settlCurrency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 91 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 &settlCurrency(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for settlCurrency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 91 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSettlCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getSettlCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 91, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption41 &putSettlCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 91, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionOption41 &putSettlCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 91, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 92, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 93, &val2, sizeof(char)); + + return *this; + } + + std::string getSettlCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 91; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSettlCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSettlCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSettlCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 91; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption41 &putSettlCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putSettlCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 91, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 91 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption41 &putSettlCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putSettlCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 91, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 91 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MinCabPriceMetaAttribute(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 minCabPriceId() SBE_NOEXCEPT + { + return 9850; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minCabPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minCabPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minCabPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minCabPriceEncodingOffset() SBE_NOEXCEPT + { + return 94; + } + +private: + PRICENULL m_minCabPrice; + +public: + SBE_NODISCARD PRICENULL &minCabPrice() + { + m_minCabPrice.wrap(m_buffer, m_offset + 94, m_actingVersion, m_bufferLength); + return m_minCabPrice; + } + + SBE_NODISCARD static const char * MatchAlgorithmMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchAlgorithmId() SBE_NOEXCEPT + { + return 1142; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchAlgorithmSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchAlgorithmInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchAlgorithmSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingOffset() SBE_NOEXCEPT + { + return 102; + } + + static SBE_CONSTEXPR char matchAlgorithmNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char matchAlgorithmMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char matchAlgorithmMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char matchAlgorithm() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 102, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 &matchAlgorithm(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 102, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * MinTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minTradeVolId() SBE_NOEXCEPT + { + return 562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 103; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t minTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t minTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 103, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption41 &minTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 103, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MaxTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maxTradeVolId() SBE_NOEXCEPT + { + return 1140; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maxTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 107; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t maxTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t maxTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 107, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption41 &maxTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 107, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MinPriceIncrementMetaAttribute(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 minPriceIncrementId() SBE_NOEXCEPT + { + return 969; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minPriceIncrementSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minPriceIncrementInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minPriceIncrementSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minPriceIncrementEncodingOffset() SBE_NOEXCEPT + { + return 111; + } + +private: + PRICENULL m_minPriceIncrement; + +public: + SBE_NODISCARD PRICENULL &minPriceIncrement() + { + m_minPriceIncrement.wrap(m_buffer, m_offset + 111, m_actingVersion, m_bufferLength); + return m_minPriceIncrement; + } + + SBE_NODISCARD static const char * MinPriceIncrementAmountMetaAttribute(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 minPriceIncrementAmountId() SBE_NOEXCEPT + { + return 1146; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minPriceIncrementAmountSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minPriceIncrementAmountInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minPriceIncrementAmountSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minPriceIncrementAmountEncodingOffset() SBE_NOEXCEPT + { + return 119; + } + +private: + PRICENULL m_minPriceIncrementAmount; + +public: + SBE_NODISCARD PRICENULL &minPriceIncrementAmount() + { + m_minPriceIncrementAmount.wrap(m_buffer, m_offset + 119, m_actingVersion, m_bufferLength); + return m_minPriceIncrementAmount; + } + + SBE_NODISCARD static const char * DisplayFactorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "float"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t displayFactorId() SBE_NOEXCEPT + { + return 9787; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t displayFactorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool displayFactorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= displayFactorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t displayFactorEncodingOffset() SBE_NOEXCEPT + { + return 127; + } + +private: + FLOAT m_displayFactor; + +public: + SBE_NODISCARD FLOAT &displayFactor() + { + m_displayFactor.wrap(m_buffer, m_offset + 127, m_actingVersion, m_bufferLength); + return m_displayFactor; + } + + SBE_NODISCARD static const char * TickRuleMetaAttribute(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 tickRuleId() SBE_NOEXCEPT + { + return 6350; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tickRuleSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tickRuleInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tickRuleSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tickRuleEncodingOffset() SBE_NOEXCEPT + { + return 135; + } + + static SBE_CONSTEXPR std::int8_t tickRuleNullValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::int8_t tickRuleMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t tickRuleMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t tickRuleEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t tickRule() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 135, sizeof(std::int8_t)); + return (val); + } + + MDInstrumentDefinitionOption41 &tickRule(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 135, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * MainFractionMetaAttribute(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 mainFractionId() SBE_NOEXCEPT + { + return 37702; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mainFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mainFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mainFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mainFractionEncodingOffset() SBE_NOEXCEPT + { + return 136; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t mainFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t mainFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 136, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionOption41 &mainFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 136, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SubFractionMetaAttribute(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 subFractionId() SBE_NOEXCEPT + { + return 37703; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t subFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool subFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= subFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t subFractionEncodingOffset() SBE_NOEXCEPT + { + return 137; + } + + static SBE_CONSTEXPR std::uint8_t subFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t subFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t subFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 137, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionOption41 &subFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 137, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * PriceDisplayFormatMetaAttribute(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 priceDisplayFormatId() SBE_NOEXCEPT + { + return 9800; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priceDisplayFormatSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool priceDisplayFormatInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priceDisplayFormatSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingOffset() SBE_NOEXCEPT + { + return 138; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priceDisplayFormat() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 138, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionOption41 &priceDisplayFormat(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 138, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnitOfMeasureMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t unitOfMeasureId() SBE_NOEXCEPT + { + return 996; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t unitOfMeasureSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool unitOfMeasureInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= unitOfMeasureSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingOffset() SBE_NOEXCEPT + { + return 139; + } + + static SBE_CONSTEXPR char unitOfMeasureNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char unitOfMeasureMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char unitOfMeasureMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingLength() SBE_NOEXCEPT + { + return 30; + } + + static SBE_CONSTEXPR std::uint64_t unitOfMeasureLength() SBE_NOEXCEPT + { + return 30; + } + + SBE_NODISCARD const char *unitOfMeasure() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 139; + } + + SBE_NODISCARD char *unitOfMeasure() SBE_NOEXCEPT + { + return m_buffer + m_offset + 139; + } + + SBE_NODISCARD char unitOfMeasure(const std::uint64_t index) const + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 139 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 &unitOfMeasure(const std::uint64_t index, const char value) + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 139 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getUnitOfMeasure(char *const dst, const std::uint64_t length) const + { + if (length > 30) + { + throw std::runtime_error("length too large for getUnitOfMeasure [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 139, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption41 &putUnitOfMeasure(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 139, src, sizeof(char) * 30); + return *this; + } + + std::string getUnitOfMeasureAsString() const + { + const char *buffer = m_buffer + m_offset + 139; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getUnitOfMeasureAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getUnitOfMeasureAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getUnitOfMeasureAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 139; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption41 &putUnitOfMeasure(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 139, str.data(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 139 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption41 &putUnitOfMeasure(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 139, str.c_str(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 139 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * UnitOfMeasureQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t unitOfMeasureQtyId() SBE_NOEXCEPT + { + return 1147; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t unitOfMeasureQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool unitOfMeasureQtyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= unitOfMeasureQtySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t unitOfMeasureQtyEncodingOffset() SBE_NOEXCEPT + { + return 169; + } + +private: + PRICENULL m_unitOfMeasureQty; + +public: + SBE_NODISCARD PRICENULL &unitOfMeasureQty() + { + m_unitOfMeasureQty.wrap(m_buffer, m_offset + 169, m_actingVersion, m_bufferLength); + return m_unitOfMeasureQty; + } + + SBE_NODISCARD static const char * TradingReferencePriceMetaAttribute(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 tradingReferencePriceId() SBE_NOEXCEPT + { + return 1150; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferencePriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradingReferencePriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferencePriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferencePriceEncodingOffset() SBE_NOEXCEPT + { + return 177; + } + +private: + PRICENULL m_tradingReferencePrice; + +public: + SBE_NODISCARD PRICENULL &tradingReferencePrice() + { + m_tradingReferencePrice.wrap(m_buffer, m_offset + 177, m_actingVersion, m_bufferLength); + return m_tradingReferencePrice; + } + + SBE_NODISCARD static const char * SettlPriceTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlPriceTypeId() SBE_NOEXCEPT + { + return 731; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlPriceTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlPriceTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= settlPriceTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingOffset() SBE_NOEXCEPT + { + return 185; + } + +private: + SettlPriceType m_settlPriceType; + +public: + SBE_NODISCARD SettlPriceType &settlPriceType() + { + m_settlPriceType.wrap(m_buffer, m_offset + 185, m_actingVersion, m_bufferLength); + return m_settlPriceType; + } + + static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * ClearedVolumeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t clearedVolumeId() SBE_NOEXCEPT + { + return 5791; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t clearedVolumeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool clearedVolumeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= clearedVolumeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t clearedVolumeEncodingOffset() SBE_NOEXCEPT + { + return 186; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t clearedVolumeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t clearedVolume() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 186, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption41 &clearedVolume(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 186, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * OpenInterestQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t openInterestQtyId() SBE_NOEXCEPT + { + return 5792; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t openInterestQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool openInterestQtyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= openInterestQtySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openInterestQtyEncodingOffset() SBE_NOEXCEPT + { + return 190; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t openInterestQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t openInterestQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 190, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption41 &openInterestQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 190, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * LowLimitPriceMetaAttribute(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 lowLimitPriceId() SBE_NOEXCEPT + { + return 1148; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lowLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lowLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lowLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lowLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 194; + } + +private: + PRICENULL m_lowLimitPrice; + +public: + SBE_NODISCARD PRICENULL &lowLimitPrice() + { + m_lowLimitPrice.wrap(m_buffer, m_offset + 194, m_actingVersion, m_bufferLength); + return m_lowLimitPrice; + } + + SBE_NODISCARD static const char * HighLimitPriceMetaAttribute(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 highLimitPriceId() SBE_NOEXCEPT + { + return 1149; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t highLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool highLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= highLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t highLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 202; + } + +private: + PRICENULL m_highLimitPrice; + +public: + SBE_NODISCARD PRICENULL &highLimitPrice() + { + m_highLimitPrice.wrap(m_buffer, m_offset + 202, m_actingVersion, m_bufferLength); + return m_highLimitPrice; + } + + SBE_NODISCARD static const char * UserDefinedInstrumentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t userDefinedInstrumentId() SBE_NOEXCEPT + { + return 9779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t userDefinedInstrumentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool userDefinedInstrumentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= userDefinedInstrumentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingOffset() SBE_NOEXCEPT + { + return 210; + } + + static SBE_CONSTEXPR char userDefinedInstrumentNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char userDefinedInstrument() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 210, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption41 &userDefinedInstrument(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 210, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * TradingReferenceDateMetaAttribute(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 tradingReferenceDateId() SBE_NOEXCEPT + { + return 5796; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferenceDateSinceVersion() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD bool tradingReferenceDateInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferenceDateSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingOffset() SBE_NOEXCEPT + { + return 211; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradingReferenceDate() const SBE_NOEXCEPT + { + if (m_actingVersion < 6) + { + return (std::uint16_t)65535; + } + + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 211, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionOption41 &tradingReferenceDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 211, &val, sizeof(std::uint16_t)); + return *this; + } + + class NoEvents + { + 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((std::uint16_t)9); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 9; + 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 9; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoEvents &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * EventTypeMetaAttribute(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 eventTypeId() SBE_NOEXCEPT + { + return 865; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD EventType::Value eventType() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint8_t)); + return EventType::get((val)); + } + + NoEvents &eventType(const EventType::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * EventTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t eventTimeId() SBE_NOEXCEPT + { + return 1145; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTimeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTimeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTimeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t eventTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t eventTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoEvents &eventTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint64_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoEvents writer) + { + builder << '{'; + builder << R"("EventType": )"; + builder << '"' << writer.eventType() << '"'; + + builder << ", "; + builder << R"("EventTime": )"; + builder << +writer.eventTime(); + + builder << '}'; + + return builder; + } + }; + +private: + NoEvents m_noEvents; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoEventsId() SBE_NOEXCEPT + { + return 864; + } + + SBE_NODISCARD inline NoEvents &noEvents() + { + m_noEvents.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + NoEvents &noEventsCount(const std::uint8_t count) + { + m_noEvents.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noEventsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noEventsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noEventsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoMDFeedTypes + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoMDFeedTypes &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDFeedTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDFeedTypeId() SBE_NOEXCEPT + { + return 1022; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDFeedTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDFeedTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDFeedTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR char mDFeedTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDFeedTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDFeedTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t mDFeedTypeLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *mDFeedType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char *mDFeedType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char mDFeedType(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 0 + (index * 1), sizeof(char)); + return (val); + } + + NoMDFeedTypes &mDFeedType(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 0 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getMDFeedType(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getMDFeedType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 0, sizeof(char) * static_cast(length)); + return length; + } + + NoMDFeedTypes &putMDFeedType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 0, src, sizeof(char) * 3); + return *this; + } + + NoMDFeedTypes &putMDFeedType( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 0, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 1, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 2, &val2, sizeof(char)); + + return *this; + } + + std::string getMDFeedTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getMDFeedTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDFeedTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getMDFeedTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + NoMDFeedTypes &putMDFeedType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #else + NoMDFeedTypes &putMDFeedType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MarketDepthMetaAttribute(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 marketDepthId() SBE_NOEXCEPT + { + return 264; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketDepthSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketDepthInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= marketDepthSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketDepthEncodingOffset() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::int8_t marketDepthNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t marketDepthEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t marketDepth() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 3, sizeof(std::int8_t)); + return (val); + } + + NoMDFeedTypes &marketDepth(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 3, &val, sizeof(std::int8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDFeedTypes writer) + { + builder << '{'; + builder << R"("MDFeedType": )"; + builder << '"' << + writer.getMDFeedTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MarketDepth": )"; + builder << +writer.marketDepth(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDFeedTypes m_noMDFeedTypes; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDFeedTypesId() SBE_NOEXCEPT + { + return 1141; + } + + SBE_NODISCARD inline NoMDFeedTypes &noMDFeedTypes() + { + m_noMDFeedTypes.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + NoMDFeedTypes &noMDFeedTypesCount(const std::uint8_t count) + { + m_noMDFeedTypes.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDFeedTypesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDFeedTypesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDFeedTypesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoInstAttrib + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoInstAttrib &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * InstAttribTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribTypeId() SBE_NOEXCEPT + { + return 871; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t instAttribTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t instAttribType() SBE_NOEXCEPT + { + return (std::int8_t)24; + } + + SBE_NODISCARD static const char * InstAttribValueMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribValueId() SBE_NOEXCEPT + { + return 872; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribValueSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribValueInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribValueSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribValueEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + private: + InstAttribValue m_instAttribValue; + + public: + SBE_NODISCARD InstAttribValue &instAttribValue() + { + m_instAttribValue.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_instAttribValue; + } + + static SBE_CONSTEXPR std::size_t instAttribValueEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoInstAttrib writer) + { + builder << '{'; + builder << R"("InstAttribValue": )"; + builder << writer.instAttribValue(); + + builder << '}'; + + return builder; + } + }; + +private: + NoInstAttrib m_noInstAttrib; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoInstAttribId() SBE_NOEXCEPT + { + return 870; + } + + SBE_NODISCARD inline NoInstAttrib &noInstAttrib() + { + m_noInstAttrib.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + NoInstAttrib &noInstAttribCount(const std::uint8_t count) + { + m_noInstAttrib.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noInstAttribSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noInstAttribInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noInstAttribSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoLotTypeRules + { + 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((std::uint16_t)5); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 5; + 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 5; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoLotTypeRules &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * LotTypeMetaAttribute(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 lotTypeId() SBE_NOEXCEPT + { + return 1093; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lotTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lotTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= lotTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lotTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t lotTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t lotTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t lotType() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int8_t)); + return (val); + } + + NoLotTypeRules &lotType(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * MinLotSizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minLotSizeId() SBE_NOEXCEPT + { + return 1231; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minLotSizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minLotSizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= minLotSizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minLotSizeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + +private: + DecimalQty m_minLotSize; + +public: + SBE_NODISCARD DecimalQty &minLotSize() + { + m_minLotSize.wrap(m_buffer, m_offset + 1, m_actingVersion, m_bufferLength); + return m_minLotSize; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoLotTypeRules writer) + { + builder << '{'; + builder << R"("LotType": )"; + builder << +writer.lotType(); + + builder << ", "; + builder << R"("MinLotSize": )"; + builder << writer.minLotSize(); + + builder << '}'; + + return builder; + } + }; + +private: + NoLotTypeRules m_noLotTypeRules; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoLotTypeRulesId() SBE_NOEXCEPT + { + return 1234; + } + + SBE_NODISCARD inline NoLotTypeRules &noLotTypeRules() + { + m_noLotTypeRules.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + NoLotTypeRules &noLotTypeRulesCount(const std::uint8_t count) + { + m_noLotTypeRules.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noLotTypeRulesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noLotTypeRulesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noLotTypeRulesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoUnderlyings + { + 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((std::uint16_t)24); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 24; + 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 24; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoUnderlyings &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * UnderlyingSecurityIDMetaAttribute(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 underlyingSecurityIDId() SBE_NOEXCEPT + { + return 309; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingSecurityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingSecurityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= underlyingSecurityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingSecurityIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int32_t underlyingSecurityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t underlyingSecurityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t underlyingSecurityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t underlyingSecurityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t underlyingSecurityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoUnderlyings &underlyingSecurityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * UnderlyingSecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t underlyingSecurityIDSourceId() SBE_NOEXCEPT + { + return 305; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingSecurityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingSecurityIDSourceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= underlyingSecurityIDSourceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingSecurityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR char underlyingSecurityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char underlyingSecurityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char underlyingSecurityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t underlyingSecurityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t underlyingSecurityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *underlyingSecurityIDSource() const + { + static const std::uint8_t underlyingSecurityIDSourceValues[] = { 56 }; + + return (const char *)underlyingSecurityIDSourceValues; + } + + SBE_NODISCARD char underlyingSecurityIDSource(const std::uint64_t index) const + { + static const std::uint8_t underlyingSecurityIDSourceValues[] = { 56 }; + + return (char)underlyingSecurityIDSourceValues[index]; + } + + std::uint64_t getUnderlyingSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t underlyingSecurityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(underlyingSecurityIDSourceValues) ? length : sizeof(underlyingSecurityIDSourceValues); + + std::memcpy(dst, underlyingSecurityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getUnderlyingSecurityIDSourceAsString() const + { + static const std::uint8_t UnderlyingSecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)UnderlyingSecurityIDSourceValues, 1); + } + + std::string getUnderlyingSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getUnderlyingSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * UnderlyingSymbolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t underlyingSymbolId() SBE_NOEXCEPT + { + return 311; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingSymbolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingSymbolInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= underlyingSymbolSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingSymbolEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR char underlyingSymbolNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char underlyingSymbolMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char underlyingSymbolMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t underlyingSymbolEncodingLength() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t underlyingSymbolLength() SBE_NOEXCEPT + { + return 20; + } + + SBE_NODISCARD const char *underlyingSymbol() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 4; + } + + SBE_NODISCARD char *underlyingSymbol() SBE_NOEXCEPT + { + return m_buffer + m_offset + 4; + } + + SBE_NODISCARD char underlyingSymbol(const std::uint64_t index) const + { + if (index >= 20) + { + throw std::runtime_error("index out of range for underlyingSymbol [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 4 + (index * 1), sizeof(char)); + return (val); + } + + NoUnderlyings &underlyingSymbol(const std::uint64_t index, const char value) + { + if (index >= 20) + { + throw std::runtime_error("index out of range for underlyingSymbol [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 4 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getUnderlyingSymbol(char *const dst, const std::uint64_t length) const + { + if (length > 20) + { + throw std::runtime_error("length too large for getUnderlyingSymbol [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 4, sizeof(char) * static_cast(length)); + return length; + } + + NoUnderlyings &putUnderlyingSymbol(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 4, src, sizeof(char) * 20); + return *this; + } + + std::string getUnderlyingSymbolAsString() const + { + const char *buffer = m_buffer + m_offset + 4; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getUnderlyingSymbolAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getUnderlyingSymbolAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getUnderlyingSymbolAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 4; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + NoUnderlyings &putUnderlyingSymbol(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putUnderlyingSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 4, str.data(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 4 + start] = 0; + } + + return *this; + } + #else + NoUnderlyings &putUnderlyingSymbol(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putUnderlyingSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 4, str.c_str(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 4 + start] = 0; + } + + return *this; + } + #endif + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoUnderlyings writer) + { + builder << '{'; + builder << R"("UnderlyingSecurityID": )"; + builder << +writer.underlyingSecurityID(); + + builder << ", "; + builder << R"("UnderlyingSymbol": )"; + builder << '"' << + writer.getUnderlyingSymbolAsJsonEscapedString().c_str() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoUnderlyings m_noUnderlyings; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoUnderlyingsId() SBE_NOEXCEPT + { + return 711; + } + + SBE_NODISCARD inline NoUnderlyings &noUnderlyings() + { + m_noUnderlyings.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noUnderlyings; + } + + NoUnderlyings &noUnderlyingsCount(const std::uint8_t count) + { + m_noUnderlyings.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noUnderlyings; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noUnderlyingsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noUnderlyingsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noUnderlyingsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoRelatedInstruments + { + 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((std::uint16_t)24); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 24; + 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 24; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoRelatedInstruments &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * RelatedSecurityIDMetaAttribute(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 relatedSecurityIDId() SBE_NOEXCEPT + { + return 1650; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t relatedSecurityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool relatedSecurityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= relatedSecurityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t relatedSecurityIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int32_t relatedSecurityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t relatedSecurityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t relatedSecurityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t relatedSecurityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t relatedSecurityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoRelatedInstruments &relatedSecurityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * RelatedSecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t relatedSecurityIDSourceId() SBE_NOEXCEPT + { + return 1651; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t relatedSecurityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool relatedSecurityIDSourceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= relatedSecurityIDSourceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t relatedSecurityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR char relatedSecurityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char relatedSecurityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char relatedSecurityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t relatedSecurityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t relatedSecurityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *relatedSecurityIDSource() const + { + static const std::uint8_t relatedSecurityIDSourceValues[] = { 56 }; + + return (const char *)relatedSecurityIDSourceValues; + } + + SBE_NODISCARD char relatedSecurityIDSource(const std::uint64_t index) const + { + static const std::uint8_t relatedSecurityIDSourceValues[] = { 56 }; + + return (char)relatedSecurityIDSourceValues[index]; + } + + std::uint64_t getRelatedSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t relatedSecurityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(relatedSecurityIDSourceValues) ? length : sizeof(relatedSecurityIDSourceValues); + + std::memcpy(dst, relatedSecurityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getRelatedSecurityIDSourceAsString() const + { + static const std::uint8_t RelatedSecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)RelatedSecurityIDSourceValues, 1); + } + + std::string getRelatedSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getRelatedSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * RelatedSymbolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t relatedSymbolId() SBE_NOEXCEPT + { + return 1649; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t relatedSymbolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool relatedSymbolInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= relatedSymbolSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t relatedSymbolEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR char relatedSymbolNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char relatedSymbolMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char relatedSymbolMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t relatedSymbolEncodingLength() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t relatedSymbolLength() SBE_NOEXCEPT + { + return 20; + } + + SBE_NODISCARD const char *relatedSymbol() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 4; + } + + SBE_NODISCARD char *relatedSymbol() SBE_NOEXCEPT + { + return m_buffer + m_offset + 4; + } + + SBE_NODISCARD char relatedSymbol(const std::uint64_t index) const + { + if (index >= 20) + { + throw std::runtime_error("index out of range for relatedSymbol [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 4 + (index * 1), sizeof(char)); + return (val); + } + + NoRelatedInstruments &relatedSymbol(const std::uint64_t index, const char value) + { + if (index >= 20) + { + throw std::runtime_error("index out of range for relatedSymbol [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 4 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getRelatedSymbol(char *const dst, const std::uint64_t length) const + { + if (length > 20) + { + throw std::runtime_error("length too large for getRelatedSymbol [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 4, sizeof(char) * static_cast(length)); + return length; + } + + NoRelatedInstruments &putRelatedSymbol(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 4, src, sizeof(char) * 20); + return *this; + } + + std::string getRelatedSymbolAsString() const + { + const char *buffer = m_buffer + m_offset + 4; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getRelatedSymbolAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getRelatedSymbolAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getRelatedSymbolAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 4; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + NoRelatedInstruments &putRelatedSymbol(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putRelatedSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 4, str.data(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 4 + start] = 0; + } + + return *this; + } + #else + NoRelatedInstruments &putRelatedSymbol(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putRelatedSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 4, str.c_str(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 4 + start] = 0; + } + + return *this; + } + #endif + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoRelatedInstruments writer) + { + builder << '{'; + builder << R"("RelatedSecurityID": )"; + builder << +writer.relatedSecurityID(); + + builder << ", "; + builder << R"("RelatedSymbol": )"; + builder << '"' << + writer.getRelatedSymbolAsJsonEscapedString().c_str() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoRelatedInstruments m_noRelatedInstruments; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoRelatedInstrumentsId() SBE_NOEXCEPT + { + return 1647; + } + + SBE_NODISCARD inline NoRelatedInstruments &noRelatedInstruments() + { + m_noRelatedInstruments.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noRelatedInstruments; + } + + NoRelatedInstruments &noRelatedInstrumentsCount(const std::uint8_t count) + { + m_noRelatedInstruments.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noRelatedInstruments; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noRelatedInstrumentsSinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool noRelatedInstrumentsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noRelatedInstrumentsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDInstrumentDefinitionOption41 _writer) + { + MDInstrumentDefinitionOption41 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDInstrumentDefinitionOption41", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + builder << R"("TotNumReports": )"; + builder << +writer.totNumReports(); + + builder << ", "; + builder << R"("SecurityUpdateAction": )"; + builder << '"' << writer.securityUpdateAction() << '"'; + + builder << ", "; + builder << R"("LastUpdateTime": )"; + builder << +writer.lastUpdateTime(); + + builder << ", "; + builder << R"("MDSecurityTradingStatus": )"; + builder << '"' << writer.mDSecurityTradingStatus() << '"'; + + builder << ", "; + builder << R"("ApplID": )"; + builder << +writer.applID(); + + builder << ", "; + builder << R"("MarketSegmentID": )"; + builder << +writer.marketSegmentID(); + + builder << ", "; + builder << R"("UnderlyingProduct": )"; + builder << +writer.underlyingProduct(); + + builder << ", "; + builder << R"("SecurityExchange": )"; + builder << '"' << + writer.getSecurityExchangeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityGroup": )"; + builder << '"' << + writer.getSecurityGroupAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Asset": )"; + builder << '"' << + writer.getAssetAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Symbol": )"; + builder << '"' << + writer.getSymbolAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("SecurityType": )"; + builder << '"' << + writer.getSecurityTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("CFICode": )"; + builder << '"' << + writer.getCFICodeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("PutOrCall": )"; + builder << '"' << writer.putOrCall() << '"'; + + builder << ", "; + builder << R"("MaturityMonthYear": )"; + builder << writer.maturityMonthYear(); + + builder << ", "; + builder << R"("Currency": )"; + builder << '"' << + writer.getCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("StrikePrice": )"; + builder << writer.strikePrice(); + + builder << ", "; + builder << R"("StrikeCurrency": )"; + builder << '"' << + writer.getStrikeCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SettlCurrency": )"; + builder << '"' << + writer.getSettlCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MinCabPrice": )"; + builder << writer.minCabPrice(); + + builder << ", "; + builder << R"("MatchAlgorithm": )"; + if (std::isprint(writer.matchAlgorithm())) + { + builder << '"' << (char)writer.matchAlgorithm() << '"'; + } + else + { + builder << (int)writer.matchAlgorithm(); + } + + builder << ", "; + builder << R"("MinTradeVol": )"; + builder << +writer.minTradeVol(); + + builder << ", "; + builder << R"("MaxTradeVol": )"; + builder << +writer.maxTradeVol(); + + builder << ", "; + builder << R"("MinPriceIncrement": )"; + builder << writer.minPriceIncrement(); + + builder << ", "; + builder << R"("MinPriceIncrementAmount": )"; + builder << writer.minPriceIncrementAmount(); + + builder << ", "; + builder << R"("DisplayFactor": )"; + builder << writer.displayFactor(); + + builder << ", "; + builder << R"("TickRule": )"; + builder << +writer.tickRule(); + + builder << ", "; + builder << R"("MainFraction": )"; + builder << +writer.mainFraction(); + + builder << ", "; + builder << R"("SubFraction": )"; + builder << +writer.subFraction(); + + builder << ", "; + builder << R"("PriceDisplayFormat": )"; + builder << +writer.priceDisplayFormat(); + + builder << ", "; + builder << R"("UnitOfMeasure": )"; + builder << '"' << + writer.getUnitOfMeasureAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("UnitOfMeasureQty": )"; + builder << writer.unitOfMeasureQty(); + + builder << ", "; + builder << R"("TradingReferencePrice": )"; + builder << writer.tradingReferencePrice(); + + builder << ", "; + builder << R"("SettlPriceType": )"; + builder << writer.settlPriceType(); + + builder << ", "; + builder << R"("ClearedVolume": )"; + builder << +writer.clearedVolume(); + + builder << ", "; + builder << R"("OpenInterestQty": )"; + builder << +writer.openInterestQty(); + + builder << ", "; + builder << R"("LowLimitPrice": )"; + builder << writer.lowLimitPrice(); + + builder << ", "; + builder << R"("HighLimitPrice": )"; + builder << writer.highLimitPrice(); + + builder << ", "; + builder << R"("UserDefinedInstrument": )"; + if (std::isprint(writer.userDefinedInstrument())) + { + builder << '"' << (char)writer.userDefinedInstrument() << '"'; + } + else + { + builder << (int)writer.userDefinedInstrument(); + } + + builder << ", "; + builder << R"("TradingReferenceDate": )"; + builder << +writer.tradingReferenceDate(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoEvents": [)"; + writer.noEvents().forEach([&](NoEvents& noEvents) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noEvents; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDFeedTypes": [)"; + writer.noMDFeedTypes().forEach([&](NoMDFeedTypes& noMDFeedTypes) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDFeedTypes; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoInstAttrib": [)"; + writer.noInstAttrib().forEach([&](NoInstAttrib& noInstAttrib) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noInstAttrib; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoLotTypeRules": [)"; + writer.noLotTypeRules().forEach([&](NoLotTypeRules& noLotTypeRules) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLotTypeRules; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoUnderlyings": [)"; + writer.noUnderlyings().forEach([&](NoUnderlyings& noUnderlyings) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noUnderlyings; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoRelatedInstruments": [)"; + writer.noRelatedInstruments().forEach([&](NoRelatedInstruments& noRelatedInstruments) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noRelatedInstruments; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionOption55.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionOption55.h new file mode 100644 index 000000000..74626fabe --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionOption55.h @@ -0,0 +1,7521 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINSTRUMENTDEFINITIONOPTION55_H_ +#define _MKTDATA_MDINSTRUMENTDEFINITIONOPTION55_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDInstrumentDefinitionOption55 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDInstrumentDefinitionOption55() = default; + + MDInstrumentDefinitionOption55( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDInstrumentDefinitionOption55(char *buffer, const std::uint64_t bufferLength) : + MDInstrumentDefinitionOption55(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDInstrumentDefinitionOption55( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDInstrumentDefinitionOption55(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)213; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)55; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "d"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDInstrumentDefinitionOption55 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionOption55(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDInstrumentDefinitionOption55 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDInstrumentDefinitionOption55( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDInstrumentDefinitionOption55 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionOption55(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * TotNumReportsMetaAttribute(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 totNumReportsId() SBE_NOEXCEPT + { + return 911; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t totNumReportsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool totNumReportsInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= totNumReportsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t totNumReportsEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsNullValue() SBE_NOEXCEPT + { + return 4294967295; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t totNumReportsEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t totNumReports() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption55 &totNumReports(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityUpdateActionMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityUpdateActionId() SBE_NOEXCEPT + { + return 980; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityUpdateActionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityUpdateActionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 5; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityUpdateAction::Value securityUpdateAction() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 5, sizeof(char)); + return SecurityUpdateAction::get((val)); + } + + MDInstrumentDefinitionOption55 &securityUpdateAction(const SecurityUpdateAction::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 5, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * LastUpdateTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastUpdateTimeId() SBE_NOEXCEPT + { + return 779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastUpdateTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastUpdateTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastUpdateTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingOffset() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t lastUpdateTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 6, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + MDInstrumentDefinitionOption55 &lastUpdateTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 6, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDSecurityTradingStatusMetaAttribute(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 mDSecurityTradingStatusId() SBE_NOEXCEPT + { + return 1682; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDSecurityTradingStatusSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDSecurityTradingStatusInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mDSecurityTradingStatusSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingOffset() SBE_NOEXCEPT + { + return 14; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityTradingStatus::Value mDSecurityTradingStatus() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 14, sizeof(std::uint8_t)); + return SecurityTradingStatus::get((val)); + } + + MDInstrumentDefinitionOption55 &mDSecurityTradingStatus(const SecurityTradingStatus::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 14, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * ApplIDMetaAttribute(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 applIDId() SBE_NOEXCEPT + { + return 1180; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t applIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool applIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= applIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t applIDEncodingOffset() SBE_NOEXCEPT + { + return 15; + } + + static SBE_CONSTEXPR std::int16_t applIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT16; + } + + static SBE_CONSTEXPR std::int16_t applIDMinValue() SBE_NOEXCEPT + { + return (std::int16_t)-32767; + } + + static SBE_CONSTEXPR std::int16_t applIDMaxValue() SBE_NOEXCEPT + { + return (std::int16_t)32767; + } + + static SBE_CONSTEXPR std::size_t applIDEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::int16_t applID() const SBE_NOEXCEPT + { + std::int16_t val; + std::memcpy(&val, m_buffer + m_offset + 15, sizeof(std::int16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionOption55 &applID(const std::int16_t value) SBE_NOEXCEPT + { + std::int16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 15, &val, sizeof(std::int16_t)); + return *this; + } + + SBE_NODISCARD static const char * MarketSegmentIDMetaAttribute(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 marketSegmentIDId() SBE_NOEXCEPT + { + return 1300; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketSegmentIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketSegmentIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= marketSegmentIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingOffset() SBE_NOEXCEPT + { + return 17; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t marketSegmentID() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 17, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionOption55 &marketSegmentID(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 17, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnderlyingProductMetaAttribute(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 underlyingProductId() SBE_NOEXCEPT + { + return 462; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingProductSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingProductInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= underlyingProductSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingProductEncodingOffset() SBE_NOEXCEPT + { + return 18; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t underlyingProductEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t underlyingProduct() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 18, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionOption55 &underlyingProduct(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 18, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityExchangeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Exchange"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityExchangeId() SBE_NOEXCEPT + { + return 207; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityExchangeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityExchangeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityExchangeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityExchangeEncodingOffset() SBE_NOEXCEPT + { + return 19; + } + + static SBE_CONSTEXPR char securityExchangeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityExchangeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityExchangeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityExchangeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint64_t securityExchangeLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD const char *securityExchange() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char *securityExchange() SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char securityExchange(const std::uint64_t index) const + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 19 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 &securityExchange(const std::uint64_t index, const char value) + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 19 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityExchange(char *const dst, const std::uint64_t length) const + { + if (length > 4) + { + throw std::runtime_error("length too large for getSecurityExchange [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 19, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption55 &putSecurityExchange(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 19, src, sizeof(char) * 4); + return *this; + } + + MDInstrumentDefinitionOption55 &putSecurityExchange( + const char value0, + const char value1, + const char value2, + const char value3) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 19, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 20, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 21, &val2, sizeof(char)); + char val3 = (value3); + std::memcpy(m_buffer + m_offset + 22, &val3, sizeof(char)); + + return *this; + } + + std::string getSecurityExchangeAsString() const + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityExchangeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityExchangeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityExchangeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption55 &putSecurityExchange(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.data(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption55 &putSecurityExchange(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.c_str(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityGroupMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityGroupId() SBE_NOEXCEPT + { + return 1151; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityGroupSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityGroupInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityGroupSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityGroupEncodingOffset() SBE_NOEXCEPT + { + return 23; + } + + static SBE_CONSTEXPR char securityGroupNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityGroupMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityGroupMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityGroupEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityGroupLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityGroup() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char *securityGroup() SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char securityGroup(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 23 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 &securityGroup(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 23 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityGroup(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityGroup [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 23, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption55 &putSecurityGroup(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 23, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityGroupAsString() const + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityGroupAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityGroupAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityGroupAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption55 &putSecurityGroup(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption55 &putSecurityGroup(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * AssetMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t assetId() SBE_NOEXCEPT + { + return 6937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t assetSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool assetInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= assetSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t assetEncodingOffset() SBE_NOEXCEPT + { + return 29; + } + + static SBE_CONSTEXPR char assetNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char assetMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char assetMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t assetEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t assetLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *asset() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char *asset() SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char asset(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 29 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 &asset(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 29 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getAsset(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getAsset [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 29, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption55 &putAsset(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 29, src, sizeof(char) * 6); + return *this; + } + + std::string getAssetAsString() const + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getAssetAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getAssetAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getAssetAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption55 &putAsset(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption55 &putAsset(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SymbolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t symbolId() SBE_NOEXCEPT + { + return 55; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t symbolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool symbolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= symbolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t symbolEncodingOffset() SBE_NOEXCEPT + { + return 35; + } + + static SBE_CONSTEXPR char symbolNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char symbolMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char symbolMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t symbolEncodingLength() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t symbolLength() SBE_NOEXCEPT + { + return 20; + } + + SBE_NODISCARD const char *symbol() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char *symbol() SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char symbol(const std::uint64_t index) const + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 35 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 &symbol(const std::uint64_t index, const char value) + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 35 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSymbol(char *const dst, const std::uint64_t length) const + { + if (length > 20) + { + throw std::runtime_error("length too large for getSymbol [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 35, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption55 &putSymbol(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 35, src, sizeof(char) * 20); + return *this; + } + + std::string getSymbolAsString() const + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSymbolAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSymbolAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSymbolAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption55 &putSymbol(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.data(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption55 &putSymbol(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.c_str(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 55; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 55, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption55 &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 55, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityIDSourceId() SBE_NOEXCEPT + { + return 22; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDSourceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSourceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t securityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *securityIDSource() const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (const char *)securityIDSourceValues; + } + + SBE_NODISCARD char securityIDSource(const std::uint64_t index) const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (char)securityIDSourceValues[index]; + } + + std::uint64_t getSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t securityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(securityIDSourceValues) ? length : sizeof(securityIDSourceValues); + + std::memcpy(dst, securityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getSecurityIDSourceAsString() const + { + static const std::uint8_t SecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)SecurityIDSourceValues, 1); + } + + std::string getSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * SecurityTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityTypeId() SBE_NOEXCEPT + { + return 167; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityTypeEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityTypeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityTypeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char *securityType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char securityType(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 59 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 &securityType(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 59 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityType(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 59, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption55 &putSecurityType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 59, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption55 &putSecurityType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption55 &putSecurityType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * CFICodeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t cFICodeId() SBE_NOEXCEPT + { + return 461; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t cFICodeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool cFICodeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= cFICodeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t cFICodeEncodingOffset() SBE_NOEXCEPT + { + return 65; + } + + static SBE_CONSTEXPR char cFICodeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char cFICodeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char cFICodeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t cFICodeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t cFICodeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *cFICode() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char *cFICode() SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char cFICode(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 65 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 &cFICode(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 65 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCFICode(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getCFICode [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 65, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption55 &putCFICode(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 65, src, sizeof(char) * 6); + return *this; + } + + std::string getCFICodeAsString() const + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCFICodeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCFICodeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCFICodeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption55 &putCFICode(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption55 &putCFICode(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * PutOrCallMetaAttribute(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 putOrCallId() SBE_NOEXCEPT + { + return 201; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t putOrCallSinceVersion() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD bool putOrCallInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= putOrCallSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t putOrCallEncodingOffset() SBE_NOEXCEPT + { + return 71; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t putOrCallEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD PutOrCall::Value putOrCall() const SBE_NOEXCEPT + { + if (m_actingVersion < 3) + { + return PutOrCall::NULL_VALUE; + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 71, sizeof(std::uint8_t)); + return PutOrCall::get((val)); + } + + MDInstrumentDefinitionOption55 &putOrCall(const PutOrCall::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 71, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * MaturityMonthYearMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MonthYear"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maturityMonthYearId() SBE_NOEXCEPT + { + return 200; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maturityMonthYearSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maturityMonthYearInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maturityMonthYearSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maturityMonthYearEncodingOffset() SBE_NOEXCEPT + { + return 72; + } + +private: + MaturityMonthYear m_maturityMonthYear; + +public: + SBE_NODISCARD MaturityMonthYear &maturityMonthYear() + { + m_maturityMonthYear.wrap(m_buffer, m_offset + 72, m_actingVersion, m_bufferLength); + return m_maturityMonthYear; + } + + SBE_NODISCARD static const char * CurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t currencyId() SBE_NOEXCEPT + { + return 15; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t currencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool currencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= currencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t currencyEncodingOffset() SBE_NOEXCEPT + { + return 77; + } + + static SBE_CONSTEXPR char currencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char currencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char currencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t currencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t currencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *currency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 77; + } + + SBE_NODISCARD char *currency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 77; + } + + SBE_NODISCARD char currency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 77 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 ¤cy(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 77 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 77, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption55 &putCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 77, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionOption55 &putCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 77, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 78, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 79, &val2, sizeof(char)); + + return *this; + } + + std::string getCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 77; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 77; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption55 &putCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 77, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 77 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption55 &putCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 77, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 77 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * StrikePriceMetaAttribute(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 strikePriceId() SBE_NOEXCEPT + { + return 202; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t strikePriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool strikePriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= strikePriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t strikePriceEncodingOffset() SBE_NOEXCEPT + { + return 80; + } + +private: + PRICENULL9 m_strikePrice; + +public: + SBE_NODISCARD PRICENULL9 &strikePrice() + { + m_strikePrice.wrap(m_buffer, m_offset + 80, m_actingVersion, m_bufferLength); + return m_strikePrice; + } + + SBE_NODISCARD static const char * StrikeCurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t strikeCurrencyId() SBE_NOEXCEPT + { + return 947; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t strikeCurrencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool strikeCurrencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= strikeCurrencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t strikeCurrencyEncodingOffset() SBE_NOEXCEPT + { + return 88; + } + + static SBE_CONSTEXPR char strikeCurrencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char strikeCurrencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char strikeCurrencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t strikeCurrencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t strikeCurrencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *strikeCurrency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 88; + } + + SBE_NODISCARD char *strikeCurrency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 88; + } + + SBE_NODISCARD char strikeCurrency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for strikeCurrency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 88 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 &strikeCurrency(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for strikeCurrency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 88 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getStrikeCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getStrikeCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 88, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption55 &putStrikeCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 88, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionOption55 &putStrikeCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 88, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 89, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 90, &val2, sizeof(char)); + + return *this; + } + + std::string getStrikeCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 88; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getStrikeCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getStrikeCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getStrikeCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 88; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption55 &putStrikeCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putStrikeCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 88, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 88 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption55 &putStrikeCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putStrikeCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 88, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 88 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SettlCurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlCurrencyId() SBE_NOEXCEPT + { + return 120; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlCurrencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlCurrencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= settlCurrencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlCurrencyEncodingOffset() SBE_NOEXCEPT + { + return 91; + } + + static SBE_CONSTEXPR char settlCurrencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char settlCurrencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char settlCurrencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t settlCurrencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t settlCurrencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *settlCurrency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 91; + } + + SBE_NODISCARD char *settlCurrency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 91; + } + + SBE_NODISCARD char settlCurrency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for settlCurrency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 91 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 &settlCurrency(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for settlCurrency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 91 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSettlCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getSettlCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 91, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption55 &putSettlCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 91, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionOption55 &putSettlCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 91, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 92, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 93, &val2, sizeof(char)); + + return *this; + } + + std::string getSettlCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 91; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSettlCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSettlCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSettlCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 91; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption55 &putSettlCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putSettlCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 91, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 91 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption55 &putSettlCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putSettlCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 91, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 91 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MinCabPriceMetaAttribute(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 minCabPriceId() SBE_NOEXCEPT + { + return 9850; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minCabPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool minCabPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minCabPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minCabPriceEncodingOffset() SBE_NOEXCEPT + { + return 94; + } + +private: + PRICENULL9 m_minCabPrice; + +public: + SBE_NODISCARD PRICENULL9 &minCabPrice() + { + m_minCabPrice.wrap(m_buffer, m_offset + 94, m_actingVersion, m_bufferLength); + return m_minCabPrice; + } + + SBE_NODISCARD static const char * MatchAlgorithmMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchAlgorithmId() SBE_NOEXCEPT + { + return 1142; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchAlgorithmSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchAlgorithmInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchAlgorithmSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingOffset() SBE_NOEXCEPT + { + return 102; + } + + static SBE_CONSTEXPR char matchAlgorithmNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char matchAlgorithmMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char matchAlgorithmMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char matchAlgorithm() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 102, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 &matchAlgorithm(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 102, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * MinTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minTradeVolId() SBE_NOEXCEPT + { + return 562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 103; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t minTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t minTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 103, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption55 &minTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 103, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MaxTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maxTradeVolId() SBE_NOEXCEPT + { + return 1140; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maxTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 107; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t maxTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t maxTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 107, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption55 &maxTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 107, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MinPriceIncrementMetaAttribute(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 minPriceIncrementId() SBE_NOEXCEPT + { + return 969; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minPriceIncrementSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool minPriceIncrementInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minPriceIncrementSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minPriceIncrementEncodingOffset() SBE_NOEXCEPT + { + return 111; + } + +private: + PRICENULL9 m_minPriceIncrement; + +public: + SBE_NODISCARD PRICENULL9 &minPriceIncrement() + { + m_minPriceIncrement.wrap(m_buffer, m_offset + 111, m_actingVersion, m_bufferLength); + return m_minPriceIncrement; + } + + SBE_NODISCARD static const char * MinPriceIncrementAmountMetaAttribute(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 minPriceIncrementAmountId() SBE_NOEXCEPT + { + return 1146; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minPriceIncrementAmountSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool minPriceIncrementAmountInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minPriceIncrementAmountSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minPriceIncrementAmountEncodingOffset() SBE_NOEXCEPT + { + return 119; + } + +private: + PRICENULL9 m_minPriceIncrementAmount; + +public: + SBE_NODISCARD PRICENULL9 &minPriceIncrementAmount() + { + m_minPriceIncrementAmount.wrap(m_buffer, m_offset + 119, m_actingVersion, m_bufferLength); + return m_minPriceIncrementAmount; + } + + SBE_NODISCARD static const char * DisplayFactorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "float"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t displayFactorId() SBE_NOEXCEPT + { + return 9787; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t displayFactorSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool displayFactorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= displayFactorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t displayFactorEncodingOffset() SBE_NOEXCEPT + { + return 127; + } + +private: + Decimal9 m_displayFactor; + +public: + SBE_NODISCARD Decimal9 &displayFactor() + { + m_displayFactor.wrap(m_buffer, m_offset + 127, m_actingVersion, m_bufferLength); + return m_displayFactor; + } + + SBE_NODISCARD static const char * TickRuleMetaAttribute(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 tickRuleId() SBE_NOEXCEPT + { + return 6350; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tickRuleSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tickRuleInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tickRuleSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tickRuleEncodingOffset() SBE_NOEXCEPT + { + return 135; + } + + static SBE_CONSTEXPR std::int8_t tickRuleNullValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::int8_t tickRuleMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t tickRuleMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t tickRuleEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t tickRule() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 135, sizeof(std::int8_t)); + return (val); + } + + MDInstrumentDefinitionOption55 &tickRule(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 135, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * MainFractionMetaAttribute(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 mainFractionId() SBE_NOEXCEPT + { + return 37702; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mainFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mainFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mainFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mainFractionEncodingOffset() SBE_NOEXCEPT + { + return 136; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t mainFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t mainFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 136, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionOption55 &mainFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 136, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SubFractionMetaAttribute(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 subFractionId() SBE_NOEXCEPT + { + return 37703; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t subFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool subFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= subFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t subFractionEncodingOffset() SBE_NOEXCEPT + { + return 137; + } + + static SBE_CONSTEXPR std::uint8_t subFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t subFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t subFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 137, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionOption55 &subFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 137, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * PriceDisplayFormatMetaAttribute(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 priceDisplayFormatId() SBE_NOEXCEPT + { + return 9800; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priceDisplayFormatSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool priceDisplayFormatInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priceDisplayFormatSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingOffset() SBE_NOEXCEPT + { + return 138; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priceDisplayFormat() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 138, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionOption55 &priceDisplayFormat(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 138, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnitOfMeasureMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t unitOfMeasureId() SBE_NOEXCEPT + { + return 996; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t unitOfMeasureSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool unitOfMeasureInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= unitOfMeasureSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingOffset() SBE_NOEXCEPT + { + return 139; + } + + static SBE_CONSTEXPR char unitOfMeasureNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char unitOfMeasureMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char unitOfMeasureMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingLength() SBE_NOEXCEPT + { + return 30; + } + + static SBE_CONSTEXPR std::uint64_t unitOfMeasureLength() SBE_NOEXCEPT + { + return 30; + } + + SBE_NODISCARD const char *unitOfMeasure() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 139; + } + + SBE_NODISCARD char *unitOfMeasure() SBE_NOEXCEPT + { + return m_buffer + m_offset + 139; + } + + SBE_NODISCARD char unitOfMeasure(const std::uint64_t index) const + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 139 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 &unitOfMeasure(const std::uint64_t index, const char value) + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 139 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getUnitOfMeasure(char *const dst, const std::uint64_t length) const + { + if (length > 30) + { + throw std::runtime_error("length too large for getUnitOfMeasure [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 139, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionOption55 &putUnitOfMeasure(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 139, src, sizeof(char) * 30); + return *this; + } + + std::string getUnitOfMeasureAsString() const + { + const char *buffer = m_buffer + m_offset + 139; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getUnitOfMeasureAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getUnitOfMeasureAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getUnitOfMeasureAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 139; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionOption55 &putUnitOfMeasure(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 139, str.data(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 139 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionOption55 &putUnitOfMeasure(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 139, str.c_str(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 139 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * UnitOfMeasureQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t unitOfMeasureQtyId() SBE_NOEXCEPT + { + return 1147; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t unitOfMeasureQtySinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool unitOfMeasureQtyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= unitOfMeasureQtySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t unitOfMeasureQtyEncodingOffset() SBE_NOEXCEPT + { + return 169; + } + +private: + Decimal9NULL m_unitOfMeasureQty; + +public: + SBE_NODISCARD Decimal9NULL &unitOfMeasureQty() + { + m_unitOfMeasureQty.wrap(m_buffer, m_offset + 169, m_actingVersion, m_bufferLength); + return m_unitOfMeasureQty; + } + + SBE_NODISCARD static const char * TradingReferencePriceMetaAttribute(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 tradingReferencePriceId() SBE_NOEXCEPT + { + return 1150; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferencePriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool tradingReferencePriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferencePriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferencePriceEncodingOffset() SBE_NOEXCEPT + { + return 177; + } + +private: + PRICENULL9 m_tradingReferencePrice; + +public: + SBE_NODISCARD PRICENULL9 &tradingReferencePrice() + { + m_tradingReferencePrice.wrap(m_buffer, m_offset + 177, m_actingVersion, m_bufferLength); + return m_tradingReferencePrice; + } + + SBE_NODISCARD static const char * SettlPriceTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlPriceTypeId() SBE_NOEXCEPT + { + return 731; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlPriceTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlPriceTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= settlPriceTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingOffset() SBE_NOEXCEPT + { + return 185; + } + +private: + SettlPriceType m_settlPriceType; + +public: + SBE_NODISCARD SettlPriceType &settlPriceType() + { + m_settlPriceType.wrap(m_buffer, m_offset + 185, m_actingVersion, m_bufferLength); + return m_settlPriceType; + } + + static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * ClearedVolumeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t clearedVolumeId() SBE_NOEXCEPT + { + return 5791; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t clearedVolumeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool clearedVolumeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= clearedVolumeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t clearedVolumeEncodingOffset() SBE_NOEXCEPT + { + return 186; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t clearedVolumeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t clearedVolume() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 186, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption55 &clearedVolume(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 186, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * OpenInterestQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t openInterestQtyId() SBE_NOEXCEPT + { + return 5792; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t openInterestQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool openInterestQtyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= openInterestQtySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openInterestQtyEncodingOffset() SBE_NOEXCEPT + { + return 190; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t openInterestQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t openInterestQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 190, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionOption55 &openInterestQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 190, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * LowLimitPriceMetaAttribute(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 lowLimitPriceId() SBE_NOEXCEPT + { + return 1148; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lowLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool lowLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lowLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lowLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 194; + } + +private: + PRICENULL9 m_lowLimitPrice; + +public: + SBE_NODISCARD PRICENULL9 &lowLimitPrice() + { + m_lowLimitPrice.wrap(m_buffer, m_offset + 194, m_actingVersion, m_bufferLength); + return m_lowLimitPrice; + } + + SBE_NODISCARD static const char * HighLimitPriceMetaAttribute(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 highLimitPriceId() SBE_NOEXCEPT + { + return 1149; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t highLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool highLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= highLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t highLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 202; + } + +private: + PRICENULL9 m_highLimitPrice; + +public: + SBE_NODISCARD PRICENULL9 &highLimitPrice() + { + m_highLimitPrice.wrap(m_buffer, m_offset + 202, m_actingVersion, m_bufferLength); + return m_highLimitPrice; + } + + SBE_NODISCARD static const char * UserDefinedInstrumentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t userDefinedInstrumentId() SBE_NOEXCEPT + { + return 9779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t userDefinedInstrumentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool userDefinedInstrumentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= userDefinedInstrumentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingOffset() SBE_NOEXCEPT + { + return 210; + } + + static SBE_CONSTEXPR char userDefinedInstrumentNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char userDefinedInstrument() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 210, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionOption55 &userDefinedInstrument(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 210, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * TradingReferenceDateMetaAttribute(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 tradingReferenceDateId() SBE_NOEXCEPT + { + return 5796; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferenceDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradingReferenceDateInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferenceDateSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingOffset() SBE_NOEXCEPT + { + return 211; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradingReferenceDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 211, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionOption55 &tradingReferenceDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 211, &val, sizeof(std::uint16_t)); + return *this; + } + + class NoEvents + { + 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((std::uint16_t)9); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 9; + 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 9; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoEvents &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * EventTypeMetaAttribute(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 eventTypeId() SBE_NOEXCEPT + { + return 865; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD EventType::Value eventType() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint8_t)); + return EventType::get((val)); + } + + NoEvents &eventType(const EventType::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * EventTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t eventTimeId() SBE_NOEXCEPT + { + return 1145; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTimeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTimeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTimeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t eventTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t eventTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoEvents &eventTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint64_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoEvents writer) + { + builder << '{'; + builder << R"("EventType": )"; + builder << '"' << writer.eventType() << '"'; + + builder << ", "; + builder << R"("EventTime": )"; + builder << +writer.eventTime(); + + builder << '}'; + + return builder; + } + }; + +private: + NoEvents m_noEvents; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoEventsId() SBE_NOEXCEPT + { + return 864; + } + + SBE_NODISCARD inline NoEvents &noEvents() + { + m_noEvents.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + NoEvents &noEventsCount(const std::uint8_t count) + { + m_noEvents.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noEventsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noEventsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noEventsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoMDFeedTypes + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoMDFeedTypes &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDFeedTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDFeedTypeId() SBE_NOEXCEPT + { + return 1022; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDFeedTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDFeedTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDFeedTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR char mDFeedTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDFeedTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDFeedTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t mDFeedTypeLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *mDFeedType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char *mDFeedType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char mDFeedType(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 0 + (index * 1), sizeof(char)); + return (val); + } + + NoMDFeedTypes &mDFeedType(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 0 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getMDFeedType(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getMDFeedType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 0, sizeof(char) * static_cast(length)); + return length; + } + + NoMDFeedTypes &putMDFeedType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 0, src, sizeof(char) * 3); + return *this; + } + + NoMDFeedTypes &putMDFeedType( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 0, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 1, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 2, &val2, sizeof(char)); + + return *this; + } + + std::string getMDFeedTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getMDFeedTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDFeedTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getMDFeedTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + NoMDFeedTypes &putMDFeedType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #else + NoMDFeedTypes &putMDFeedType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MarketDepthMetaAttribute(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 marketDepthId() SBE_NOEXCEPT + { + return 264; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketDepthSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketDepthInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= marketDepthSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketDepthEncodingOffset() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::int8_t marketDepthNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t marketDepthEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t marketDepth() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 3, sizeof(std::int8_t)); + return (val); + } + + NoMDFeedTypes &marketDepth(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 3, &val, sizeof(std::int8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDFeedTypes writer) + { + builder << '{'; + builder << R"("MDFeedType": )"; + builder << '"' << + writer.getMDFeedTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MarketDepth": )"; + builder << +writer.marketDepth(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDFeedTypes m_noMDFeedTypes; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDFeedTypesId() SBE_NOEXCEPT + { + return 1141; + } + + SBE_NODISCARD inline NoMDFeedTypes &noMDFeedTypes() + { + m_noMDFeedTypes.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + NoMDFeedTypes &noMDFeedTypesCount(const std::uint8_t count) + { + m_noMDFeedTypes.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDFeedTypesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDFeedTypesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDFeedTypesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoInstAttrib + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoInstAttrib &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * InstAttribTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribTypeId() SBE_NOEXCEPT + { + return 871; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t instAttribTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t instAttribType() SBE_NOEXCEPT + { + return (std::int8_t)24; + } + + SBE_NODISCARD static const char * InstAttribValueMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribValueId() SBE_NOEXCEPT + { + return 872; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribValueSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribValueInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribValueSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribValueEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + private: + InstAttribValue m_instAttribValue; + + public: + SBE_NODISCARD InstAttribValue &instAttribValue() + { + m_instAttribValue.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_instAttribValue; + } + + static SBE_CONSTEXPR std::size_t instAttribValueEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoInstAttrib writer) + { + builder << '{'; + builder << R"("InstAttribValue": )"; + builder << writer.instAttribValue(); + + builder << '}'; + + return builder; + } + }; + +private: + NoInstAttrib m_noInstAttrib; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoInstAttribId() SBE_NOEXCEPT + { + return 870; + } + + SBE_NODISCARD inline NoInstAttrib &noInstAttrib() + { + m_noInstAttrib.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + NoInstAttrib &noInstAttribCount(const std::uint8_t count) + { + m_noInstAttrib.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noInstAttribSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noInstAttribInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noInstAttribSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoLotTypeRules + { + 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((std::uint16_t)5); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 5; + 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 5; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoLotTypeRules &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * LotTypeMetaAttribute(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 lotTypeId() SBE_NOEXCEPT + { + return 1093; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lotTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lotTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= lotTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lotTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t lotTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t lotTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t lotType() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int8_t)); + return (val); + } + + NoLotTypeRules &lotType(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * MinLotSizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minLotSizeId() SBE_NOEXCEPT + { + return 1231; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minLotSizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minLotSizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= minLotSizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minLotSizeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + +private: + DecimalQty m_minLotSize; + +public: + SBE_NODISCARD DecimalQty &minLotSize() + { + m_minLotSize.wrap(m_buffer, m_offset + 1, m_actingVersion, m_bufferLength); + return m_minLotSize; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoLotTypeRules writer) + { + builder << '{'; + builder << R"("LotType": )"; + builder << +writer.lotType(); + + builder << ", "; + builder << R"("MinLotSize": )"; + builder << writer.minLotSize(); + + builder << '}'; + + return builder; + } + }; + +private: + NoLotTypeRules m_noLotTypeRules; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoLotTypeRulesId() SBE_NOEXCEPT + { + return 1234; + } + + SBE_NODISCARD inline NoLotTypeRules &noLotTypeRules() + { + m_noLotTypeRules.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + NoLotTypeRules &noLotTypeRulesCount(const std::uint8_t count) + { + m_noLotTypeRules.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noLotTypeRulesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noLotTypeRulesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noLotTypeRulesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoUnderlyings + { + 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((std::uint16_t)24); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 24; + 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 24; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoUnderlyings &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * UnderlyingSecurityIDMetaAttribute(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 underlyingSecurityIDId() SBE_NOEXCEPT + { + return 309; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingSecurityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingSecurityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= underlyingSecurityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingSecurityIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int32_t underlyingSecurityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t underlyingSecurityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t underlyingSecurityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t underlyingSecurityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t underlyingSecurityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoUnderlyings &underlyingSecurityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * UnderlyingSecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t underlyingSecurityIDSourceId() SBE_NOEXCEPT + { + return 305; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingSecurityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingSecurityIDSourceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= underlyingSecurityIDSourceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingSecurityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR char underlyingSecurityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char underlyingSecurityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char underlyingSecurityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t underlyingSecurityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t underlyingSecurityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *underlyingSecurityIDSource() const + { + static const std::uint8_t underlyingSecurityIDSourceValues[] = { 56 }; + + return (const char *)underlyingSecurityIDSourceValues; + } + + SBE_NODISCARD char underlyingSecurityIDSource(const std::uint64_t index) const + { + static const std::uint8_t underlyingSecurityIDSourceValues[] = { 56 }; + + return (char)underlyingSecurityIDSourceValues[index]; + } + + std::uint64_t getUnderlyingSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t underlyingSecurityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(underlyingSecurityIDSourceValues) ? length : sizeof(underlyingSecurityIDSourceValues); + + std::memcpy(dst, underlyingSecurityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getUnderlyingSecurityIDSourceAsString() const + { + static const std::uint8_t UnderlyingSecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)UnderlyingSecurityIDSourceValues, 1); + } + + std::string getUnderlyingSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getUnderlyingSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * UnderlyingSymbolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t underlyingSymbolId() SBE_NOEXCEPT + { + return 311; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingSymbolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingSymbolInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= underlyingSymbolSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingSymbolEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR char underlyingSymbolNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char underlyingSymbolMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char underlyingSymbolMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t underlyingSymbolEncodingLength() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t underlyingSymbolLength() SBE_NOEXCEPT + { + return 20; + } + + SBE_NODISCARD const char *underlyingSymbol() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 4; + } + + SBE_NODISCARD char *underlyingSymbol() SBE_NOEXCEPT + { + return m_buffer + m_offset + 4; + } + + SBE_NODISCARD char underlyingSymbol(const std::uint64_t index) const + { + if (index >= 20) + { + throw std::runtime_error("index out of range for underlyingSymbol [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 4 + (index * 1), sizeof(char)); + return (val); + } + + NoUnderlyings &underlyingSymbol(const std::uint64_t index, const char value) + { + if (index >= 20) + { + throw std::runtime_error("index out of range for underlyingSymbol [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 4 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getUnderlyingSymbol(char *const dst, const std::uint64_t length) const + { + if (length > 20) + { + throw std::runtime_error("length too large for getUnderlyingSymbol [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 4, sizeof(char) * static_cast(length)); + return length; + } + + NoUnderlyings &putUnderlyingSymbol(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 4, src, sizeof(char) * 20); + return *this; + } + + std::string getUnderlyingSymbolAsString() const + { + const char *buffer = m_buffer + m_offset + 4; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getUnderlyingSymbolAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getUnderlyingSymbolAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getUnderlyingSymbolAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 4; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + NoUnderlyings &putUnderlyingSymbol(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putUnderlyingSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 4, str.data(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 4 + start] = 0; + } + + return *this; + } + #else + NoUnderlyings &putUnderlyingSymbol(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putUnderlyingSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 4, str.c_str(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 4 + start] = 0; + } + + return *this; + } + #endif + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoUnderlyings writer) + { + builder << '{'; + builder << R"("UnderlyingSecurityID": )"; + builder << +writer.underlyingSecurityID(); + + builder << ", "; + builder << R"("UnderlyingSymbol": )"; + builder << '"' << + writer.getUnderlyingSymbolAsJsonEscapedString().c_str() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoUnderlyings m_noUnderlyings; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoUnderlyingsId() SBE_NOEXCEPT + { + return 711; + } + + SBE_NODISCARD inline NoUnderlyings &noUnderlyings() + { + m_noUnderlyings.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noUnderlyings; + } + + NoUnderlyings &noUnderlyingsCount(const std::uint8_t count) + { + m_noUnderlyings.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noUnderlyings; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noUnderlyingsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noUnderlyingsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noUnderlyingsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoRelatedInstruments + { + 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((std::uint16_t)24); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 24; + 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 24; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoRelatedInstruments &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * RelatedSecurityIDMetaAttribute(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 relatedSecurityIDId() SBE_NOEXCEPT + { + return 1650; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t relatedSecurityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool relatedSecurityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= relatedSecurityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t relatedSecurityIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int32_t relatedSecurityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t relatedSecurityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t relatedSecurityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t relatedSecurityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t relatedSecurityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoRelatedInstruments &relatedSecurityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * RelatedSecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t relatedSecurityIDSourceId() SBE_NOEXCEPT + { + return 1651; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t relatedSecurityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool relatedSecurityIDSourceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= relatedSecurityIDSourceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t relatedSecurityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR char relatedSecurityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char relatedSecurityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char relatedSecurityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t relatedSecurityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t relatedSecurityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *relatedSecurityIDSource() const + { + static const std::uint8_t relatedSecurityIDSourceValues[] = { 56 }; + + return (const char *)relatedSecurityIDSourceValues; + } + + SBE_NODISCARD char relatedSecurityIDSource(const std::uint64_t index) const + { + static const std::uint8_t relatedSecurityIDSourceValues[] = { 56 }; + + return (char)relatedSecurityIDSourceValues[index]; + } + + std::uint64_t getRelatedSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t relatedSecurityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(relatedSecurityIDSourceValues) ? length : sizeof(relatedSecurityIDSourceValues); + + std::memcpy(dst, relatedSecurityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getRelatedSecurityIDSourceAsString() const + { + static const std::uint8_t RelatedSecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)RelatedSecurityIDSourceValues, 1); + } + + std::string getRelatedSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getRelatedSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * RelatedSymbolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t relatedSymbolId() SBE_NOEXCEPT + { + return 1649; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t relatedSymbolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool relatedSymbolInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= relatedSymbolSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t relatedSymbolEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR char relatedSymbolNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char relatedSymbolMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char relatedSymbolMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t relatedSymbolEncodingLength() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t relatedSymbolLength() SBE_NOEXCEPT + { + return 20; + } + + SBE_NODISCARD const char *relatedSymbol() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 4; + } + + SBE_NODISCARD char *relatedSymbol() SBE_NOEXCEPT + { + return m_buffer + m_offset + 4; + } + + SBE_NODISCARD char relatedSymbol(const std::uint64_t index) const + { + if (index >= 20) + { + throw std::runtime_error("index out of range for relatedSymbol [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 4 + (index * 1), sizeof(char)); + return (val); + } + + NoRelatedInstruments &relatedSymbol(const std::uint64_t index, const char value) + { + if (index >= 20) + { + throw std::runtime_error("index out of range for relatedSymbol [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 4 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getRelatedSymbol(char *const dst, const std::uint64_t length) const + { + if (length > 20) + { + throw std::runtime_error("length too large for getRelatedSymbol [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 4, sizeof(char) * static_cast(length)); + return length; + } + + NoRelatedInstruments &putRelatedSymbol(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 4, src, sizeof(char) * 20); + return *this; + } + + std::string getRelatedSymbolAsString() const + { + const char *buffer = m_buffer + m_offset + 4; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getRelatedSymbolAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getRelatedSymbolAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getRelatedSymbolAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 4; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + NoRelatedInstruments &putRelatedSymbol(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putRelatedSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 4, str.data(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 4 + start] = 0; + } + + return *this; + } + #else + NoRelatedInstruments &putRelatedSymbol(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putRelatedSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 4, str.c_str(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 4 + start] = 0; + } + + return *this; + } + #endif + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoRelatedInstruments writer) + { + builder << '{'; + builder << R"("RelatedSecurityID": )"; + builder << +writer.relatedSecurityID(); + + builder << ", "; + builder << R"("RelatedSymbol": )"; + builder << '"' << + writer.getRelatedSymbolAsJsonEscapedString().c_str() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoRelatedInstruments m_noRelatedInstruments; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoRelatedInstrumentsId() SBE_NOEXCEPT + { + return 1647; + } + + SBE_NODISCARD inline NoRelatedInstruments &noRelatedInstruments() + { + m_noRelatedInstruments.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noRelatedInstruments; + } + + NoRelatedInstruments &noRelatedInstrumentsCount(const std::uint8_t count) + { + m_noRelatedInstruments.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noRelatedInstruments; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noRelatedInstrumentsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noRelatedInstrumentsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noRelatedInstrumentsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDInstrumentDefinitionOption55 _writer) + { + MDInstrumentDefinitionOption55 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDInstrumentDefinitionOption55", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + builder << R"("TotNumReports": )"; + builder << +writer.totNumReports(); + + builder << ", "; + builder << R"("SecurityUpdateAction": )"; + builder << '"' << writer.securityUpdateAction() << '"'; + + builder << ", "; + builder << R"("LastUpdateTime": )"; + builder << +writer.lastUpdateTime(); + + builder << ", "; + builder << R"("MDSecurityTradingStatus": )"; + builder << '"' << writer.mDSecurityTradingStatus() << '"'; + + builder << ", "; + builder << R"("ApplID": )"; + builder << +writer.applID(); + + builder << ", "; + builder << R"("MarketSegmentID": )"; + builder << +writer.marketSegmentID(); + + builder << ", "; + builder << R"("UnderlyingProduct": )"; + builder << +writer.underlyingProduct(); + + builder << ", "; + builder << R"("SecurityExchange": )"; + builder << '"' << + writer.getSecurityExchangeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityGroup": )"; + builder << '"' << + writer.getSecurityGroupAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Asset": )"; + builder << '"' << + writer.getAssetAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Symbol": )"; + builder << '"' << + writer.getSymbolAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("SecurityType": )"; + builder << '"' << + writer.getSecurityTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("CFICode": )"; + builder << '"' << + writer.getCFICodeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("PutOrCall": )"; + builder << '"' << writer.putOrCall() << '"'; + + builder << ", "; + builder << R"("MaturityMonthYear": )"; + builder << writer.maturityMonthYear(); + + builder << ", "; + builder << R"("Currency": )"; + builder << '"' << + writer.getCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("StrikePrice": )"; + builder << writer.strikePrice(); + + builder << ", "; + builder << R"("StrikeCurrency": )"; + builder << '"' << + writer.getStrikeCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SettlCurrency": )"; + builder << '"' << + writer.getSettlCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MinCabPrice": )"; + builder << writer.minCabPrice(); + + builder << ", "; + builder << R"("MatchAlgorithm": )"; + if (std::isprint(writer.matchAlgorithm())) + { + builder << '"' << (char)writer.matchAlgorithm() << '"'; + } + else + { + builder << (int)writer.matchAlgorithm(); + } + + builder << ", "; + builder << R"("MinTradeVol": )"; + builder << +writer.minTradeVol(); + + builder << ", "; + builder << R"("MaxTradeVol": )"; + builder << +writer.maxTradeVol(); + + builder << ", "; + builder << R"("MinPriceIncrement": )"; + builder << writer.minPriceIncrement(); + + builder << ", "; + builder << R"("MinPriceIncrementAmount": )"; + builder << writer.minPriceIncrementAmount(); + + builder << ", "; + builder << R"("DisplayFactor": )"; + builder << writer.displayFactor(); + + builder << ", "; + builder << R"("TickRule": )"; + builder << +writer.tickRule(); + + builder << ", "; + builder << R"("MainFraction": )"; + builder << +writer.mainFraction(); + + builder << ", "; + builder << R"("SubFraction": )"; + builder << +writer.subFraction(); + + builder << ", "; + builder << R"("PriceDisplayFormat": )"; + builder << +writer.priceDisplayFormat(); + + builder << ", "; + builder << R"("UnitOfMeasure": )"; + builder << '"' << + writer.getUnitOfMeasureAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("UnitOfMeasureQty": )"; + builder << writer.unitOfMeasureQty(); + + builder << ", "; + builder << R"("TradingReferencePrice": )"; + builder << writer.tradingReferencePrice(); + + builder << ", "; + builder << R"("SettlPriceType": )"; + builder << writer.settlPriceType(); + + builder << ", "; + builder << R"("ClearedVolume": )"; + builder << +writer.clearedVolume(); + + builder << ", "; + builder << R"("OpenInterestQty": )"; + builder << +writer.openInterestQty(); + + builder << ", "; + builder << R"("LowLimitPrice": )"; + builder << writer.lowLimitPrice(); + + builder << ", "; + builder << R"("HighLimitPrice": )"; + builder << writer.highLimitPrice(); + + builder << ", "; + builder << R"("UserDefinedInstrument": )"; + if (std::isprint(writer.userDefinedInstrument())) + { + builder << '"' << (char)writer.userDefinedInstrument() << '"'; + } + else + { + builder << (int)writer.userDefinedInstrument(); + } + + builder << ", "; + builder << R"("TradingReferenceDate": )"; + builder << +writer.tradingReferenceDate(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoEvents": [)"; + writer.noEvents().forEach([&](NoEvents& noEvents) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noEvents; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDFeedTypes": [)"; + writer.noMDFeedTypes().forEach([&](NoMDFeedTypes& noMDFeedTypes) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDFeedTypes; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoInstAttrib": [)"; + writer.noInstAttrib().forEach([&](NoInstAttrib& noInstAttrib) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noInstAttrib; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoLotTypeRules": [)"; + writer.noLotTypeRules().forEach([&](NoLotTypeRules& noLotTypeRules) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLotTypeRules; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoUnderlyings": [)"; + writer.noUnderlyings().forEach([&](NoUnderlyings& noUnderlyings) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noUnderlyings; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoRelatedInstruments": [)"; + writer.noRelatedInstruments().forEach([&](NoRelatedInstruments& noRelatedInstruments) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noRelatedInstruments; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionSpread29.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionSpread29.h new file mode 100644 index 000000000..a516de785 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionSpread29.h @@ -0,0 +1,6514 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINSTRUMENTDEFINITIONSPREAD29_H_ +#define _MKTDATA_MDINSTRUMENTDEFINITIONSPREAD29_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDInstrumentDefinitionSpread29 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDInstrumentDefinitionSpread29() = default; + + MDInstrumentDefinitionSpread29( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDInstrumentDefinitionSpread29(char *buffer, const std::uint64_t bufferLength) : + MDInstrumentDefinitionSpread29(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDInstrumentDefinitionSpread29( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDInstrumentDefinitionSpread29(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)195; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)29; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "d"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDInstrumentDefinitionSpread29 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionSpread29(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDInstrumentDefinitionSpread29 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDInstrumentDefinitionSpread29( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDInstrumentDefinitionSpread29 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionSpread29(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * TotNumReportsMetaAttribute(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 totNumReportsId() SBE_NOEXCEPT + { + return 911; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t totNumReportsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool totNumReportsInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= totNumReportsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t totNumReportsEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsNullValue() SBE_NOEXCEPT + { + return 4294967295; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t totNumReportsEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t totNumReports() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread29 &totNumReports(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityUpdateActionMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityUpdateActionId() SBE_NOEXCEPT + { + return 980; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityUpdateActionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityUpdateActionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 5; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityUpdateAction::Value securityUpdateAction() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 5, sizeof(char)); + return SecurityUpdateAction::get((val)); + } + + MDInstrumentDefinitionSpread29 &securityUpdateAction(const SecurityUpdateAction::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 5, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * LastUpdateTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastUpdateTimeId() SBE_NOEXCEPT + { + return 779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastUpdateTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastUpdateTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastUpdateTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingOffset() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t lastUpdateTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 6, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + MDInstrumentDefinitionSpread29 &lastUpdateTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 6, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDSecurityTradingStatusMetaAttribute(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 mDSecurityTradingStatusId() SBE_NOEXCEPT + { + return 1682; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDSecurityTradingStatusSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDSecurityTradingStatusInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mDSecurityTradingStatusSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingOffset() SBE_NOEXCEPT + { + return 14; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityTradingStatus::Value mDSecurityTradingStatus() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 14, sizeof(std::uint8_t)); + return SecurityTradingStatus::get((val)); + } + + MDInstrumentDefinitionSpread29 &mDSecurityTradingStatus(const SecurityTradingStatus::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 14, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * ApplIDMetaAttribute(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 applIDId() SBE_NOEXCEPT + { + return 1180; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t applIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool applIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= applIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t applIDEncodingOffset() SBE_NOEXCEPT + { + return 15; + } + + static SBE_CONSTEXPR std::int16_t applIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT16; + } + + static SBE_CONSTEXPR std::int16_t applIDMinValue() SBE_NOEXCEPT + { + return (std::int16_t)-32767; + } + + static SBE_CONSTEXPR std::int16_t applIDMaxValue() SBE_NOEXCEPT + { + return (std::int16_t)32767; + } + + static SBE_CONSTEXPR std::size_t applIDEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::int16_t applID() const SBE_NOEXCEPT + { + std::int16_t val; + std::memcpy(&val, m_buffer + m_offset + 15, sizeof(std::int16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionSpread29 &applID(const std::int16_t value) SBE_NOEXCEPT + { + std::int16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 15, &val, sizeof(std::int16_t)); + return *this; + } + + SBE_NODISCARD static const char * MarketSegmentIDMetaAttribute(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 marketSegmentIDId() SBE_NOEXCEPT + { + return 1300; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketSegmentIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketSegmentIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= marketSegmentIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingOffset() SBE_NOEXCEPT + { + return 17; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t marketSegmentID() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 17, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionSpread29 &marketSegmentID(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 17, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnderlyingProductMetaAttribute(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 underlyingProductId() SBE_NOEXCEPT + { + return 462; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingProductSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingProductInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= underlyingProductSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingProductEncodingOffset() SBE_NOEXCEPT + { + return 18; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t underlyingProductEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t underlyingProduct() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 18, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionSpread29 &underlyingProduct(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 18, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityExchangeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Exchange"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityExchangeId() SBE_NOEXCEPT + { + return 207; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityExchangeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityExchangeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityExchangeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityExchangeEncodingOffset() SBE_NOEXCEPT + { + return 19; + } + + static SBE_CONSTEXPR char securityExchangeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityExchangeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityExchangeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityExchangeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint64_t securityExchangeLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD const char *securityExchange() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char *securityExchange() SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char securityExchange(const std::uint64_t index) const + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 19 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread29 &securityExchange(const std::uint64_t index, const char value) + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 19 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityExchange(char *const dst, const std::uint64_t length) const + { + if (length > 4) + { + throw std::runtime_error("length too large for getSecurityExchange [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 19, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread29 &putSecurityExchange(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 19, src, sizeof(char) * 4); + return *this; + } + + MDInstrumentDefinitionSpread29 &putSecurityExchange( + const char value0, + const char value1, + const char value2, + const char value3) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 19, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 20, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 21, &val2, sizeof(char)); + char val3 = (value3); + std::memcpy(m_buffer + m_offset + 22, &val3, sizeof(char)); + + return *this; + } + + std::string getSecurityExchangeAsString() const + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityExchangeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityExchangeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityExchangeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread29 &putSecurityExchange(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.data(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread29 &putSecurityExchange(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.c_str(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityGroupMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityGroupId() SBE_NOEXCEPT + { + return 1151; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityGroupSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityGroupInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityGroupSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityGroupEncodingOffset() SBE_NOEXCEPT + { + return 23; + } + + static SBE_CONSTEXPR char securityGroupNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityGroupMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityGroupMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityGroupEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityGroupLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityGroup() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char *securityGroup() SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char securityGroup(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 23 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread29 &securityGroup(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 23 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityGroup(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityGroup [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 23, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread29 &putSecurityGroup(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 23, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityGroupAsString() const + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityGroupAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityGroupAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityGroupAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread29 &putSecurityGroup(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread29 &putSecurityGroup(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * AssetMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t assetId() SBE_NOEXCEPT + { + return 6937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t assetSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool assetInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= assetSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t assetEncodingOffset() SBE_NOEXCEPT + { + return 29; + } + + static SBE_CONSTEXPR char assetNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char assetMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char assetMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t assetEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t assetLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *asset() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char *asset() SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char asset(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 29 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread29 &asset(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 29 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getAsset(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getAsset [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 29, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread29 &putAsset(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 29, src, sizeof(char) * 6); + return *this; + } + + std::string getAssetAsString() const + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getAssetAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getAssetAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getAssetAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread29 &putAsset(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread29 &putAsset(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SymbolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t symbolId() SBE_NOEXCEPT + { + return 55; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t symbolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool symbolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= symbolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t symbolEncodingOffset() SBE_NOEXCEPT + { + return 35; + } + + static SBE_CONSTEXPR char symbolNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char symbolMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char symbolMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t symbolEncodingLength() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t symbolLength() SBE_NOEXCEPT + { + return 20; + } + + SBE_NODISCARD const char *symbol() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char *symbol() SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char symbol(const std::uint64_t index) const + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 35 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread29 &symbol(const std::uint64_t index, const char value) + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 35 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSymbol(char *const dst, const std::uint64_t length) const + { + if (length > 20) + { + throw std::runtime_error("length too large for getSymbol [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 35, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread29 &putSymbol(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 35, src, sizeof(char) * 20); + return *this; + } + + std::string getSymbolAsString() const + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSymbolAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSymbolAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSymbolAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread29 &putSymbol(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.data(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread29 &putSymbol(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.c_str(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 55; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 55, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread29 &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 55, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityIDSourceId() SBE_NOEXCEPT + { + return 22; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDSourceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSourceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t securityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *securityIDSource() const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (const char *)securityIDSourceValues; + } + + SBE_NODISCARD char securityIDSource(const std::uint64_t index) const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (char)securityIDSourceValues[index]; + } + + std::uint64_t getSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t securityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(securityIDSourceValues) ? length : sizeof(securityIDSourceValues); + + std::memcpy(dst, securityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getSecurityIDSourceAsString() const + { + static const std::uint8_t SecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)SecurityIDSourceValues, 1); + } + + std::string getSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * SecurityTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityTypeId() SBE_NOEXCEPT + { + return 167; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityTypeEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityTypeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityTypeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char *securityType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char securityType(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 59 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread29 &securityType(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 59 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityType(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 59, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread29 &putSecurityType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 59, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread29 &putSecurityType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread29 &putSecurityType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * CFICodeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t cFICodeId() SBE_NOEXCEPT + { + return 461; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t cFICodeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool cFICodeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= cFICodeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t cFICodeEncodingOffset() SBE_NOEXCEPT + { + return 65; + } + + static SBE_CONSTEXPR char cFICodeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char cFICodeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char cFICodeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t cFICodeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t cFICodeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *cFICode() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char *cFICode() SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char cFICode(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 65 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread29 &cFICode(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 65 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCFICode(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getCFICode [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 65, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread29 &putCFICode(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 65, src, sizeof(char) * 6); + return *this; + } + + std::string getCFICodeAsString() const + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCFICodeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCFICodeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCFICodeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread29 &putCFICode(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread29 &putCFICode(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MaturityMonthYearMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MonthYear"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maturityMonthYearId() SBE_NOEXCEPT + { + return 200; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maturityMonthYearSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maturityMonthYearInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maturityMonthYearSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maturityMonthYearEncodingOffset() SBE_NOEXCEPT + { + return 71; + } + +private: + MaturityMonthYear m_maturityMonthYear; + +public: + SBE_NODISCARD MaturityMonthYear &maturityMonthYear() + { + m_maturityMonthYear.wrap(m_buffer, m_offset + 71, m_actingVersion, m_bufferLength); + return m_maturityMonthYear; + } + + SBE_NODISCARD static const char * CurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t currencyId() SBE_NOEXCEPT + { + return 15; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t currencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool currencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= currencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t currencyEncodingOffset() SBE_NOEXCEPT + { + return 76; + } + + static SBE_CONSTEXPR char currencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char currencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char currencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t currencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t currencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *currency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 76; + } + + SBE_NODISCARD char *currency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 76; + } + + SBE_NODISCARD char currency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 76 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread29 ¤cy(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 76 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 76, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread29 &putCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 76, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionSpread29 &putCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 76, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 77, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 78, &val2, sizeof(char)); + + return *this; + } + + std::string getCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 76; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 76; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread29 &putCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 76, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 76 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread29 &putCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 76, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 76 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecuritySubTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securitySubTypeId() SBE_NOEXCEPT + { + return 762; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securitySubTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securitySubTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securitySubTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securitySubTypeEncodingOffset() SBE_NOEXCEPT + { + return 79; + } + + static SBE_CONSTEXPR char securitySubTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securitySubTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securitySubTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securitySubTypeEncodingLength() SBE_NOEXCEPT + { + return 5; + } + + static SBE_CONSTEXPR std::uint64_t securitySubTypeLength() SBE_NOEXCEPT + { + return 5; + } + + SBE_NODISCARD const char *securitySubType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 79; + } + + SBE_NODISCARD char *securitySubType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 79; + } + + SBE_NODISCARD char securitySubType(const std::uint64_t index) const + { + if (index >= 5) + { + throw std::runtime_error("index out of range for securitySubType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 79 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread29 &securitySubType(const std::uint64_t index, const char value) + { + if (index >= 5) + { + throw std::runtime_error("index out of range for securitySubType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 79 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecuritySubType(char *const dst, const std::uint64_t length) const + { + if (length > 5) + { + throw std::runtime_error("length too large for getSecuritySubType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 79, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread29 &putSecuritySubType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 79, src, sizeof(char) * 5); + return *this; + } + + std::string getSecuritySubTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 79; + size_t length = 0; + + for (; length < 5 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecuritySubTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecuritySubTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecuritySubTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 79; + size_t length = 0; + + for (; length < 5 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread29 &putSecuritySubType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 5) + { + throw std::runtime_error("string too large for putSecuritySubType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 79, str.data(), srcLength); + for (size_t start = srcLength; start < 5; ++start) + { + m_buffer[m_offset + 79 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread29 &putSecuritySubType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 5) + { + throw std::runtime_error("string too large for putSecuritySubType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 79, str.c_str(), srcLength); + for (size_t start = srcLength; start < 5; ++start) + { + m_buffer[m_offset + 79 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * UserDefinedInstrumentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t userDefinedInstrumentId() SBE_NOEXCEPT + { + return 9779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t userDefinedInstrumentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool userDefinedInstrumentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= userDefinedInstrumentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingOffset() SBE_NOEXCEPT + { + return 84; + } + + static SBE_CONSTEXPR char userDefinedInstrumentNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char userDefinedInstrument() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 84, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread29 &userDefinedInstrument(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 84, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * MatchAlgorithmMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchAlgorithmId() SBE_NOEXCEPT + { + return 1142; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchAlgorithmSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchAlgorithmInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchAlgorithmSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingOffset() SBE_NOEXCEPT + { + return 85; + } + + static SBE_CONSTEXPR char matchAlgorithmNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char matchAlgorithmMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char matchAlgorithmMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char matchAlgorithm() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 85, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread29 &matchAlgorithm(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 85, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * MinTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minTradeVolId() SBE_NOEXCEPT + { + return 562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 86; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t minTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t minTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 86, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread29 &minTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 86, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MaxTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maxTradeVolId() SBE_NOEXCEPT + { + return 1140; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maxTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 90; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t maxTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t maxTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 90, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread29 &maxTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 90, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MinPriceIncrementMetaAttribute(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 minPriceIncrementId() SBE_NOEXCEPT + { + return 969; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minPriceIncrementSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minPriceIncrementInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minPriceIncrementSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minPriceIncrementEncodingOffset() SBE_NOEXCEPT + { + return 94; + } + +private: + PRICE m_minPriceIncrement; + +public: + SBE_NODISCARD PRICE &minPriceIncrement() + { + m_minPriceIncrement.wrap(m_buffer, m_offset + 94, m_actingVersion, m_bufferLength); + return m_minPriceIncrement; + } + + SBE_NODISCARD static const char * DisplayFactorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "float"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t displayFactorId() SBE_NOEXCEPT + { + return 9787; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t displayFactorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool displayFactorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= displayFactorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t displayFactorEncodingOffset() SBE_NOEXCEPT + { + return 102; + } + +private: + FLOAT m_displayFactor; + +public: + SBE_NODISCARD FLOAT &displayFactor() + { + m_displayFactor.wrap(m_buffer, m_offset + 102, m_actingVersion, m_bufferLength); + return m_displayFactor; + } + + SBE_NODISCARD static const char * PriceDisplayFormatMetaAttribute(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 priceDisplayFormatId() SBE_NOEXCEPT + { + return 9800; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priceDisplayFormatSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool priceDisplayFormatInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priceDisplayFormatSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingOffset() SBE_NOEXCEPT + { + return 110; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priceDisplayFormat() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 110, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionSpread29 &priceDisplayFormat(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 110, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * PriceRatioMetaAttribute(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 priceRatioId() SBE_NOEXCEPT + { + return 5770; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priceRatioSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool priceRatioInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priceRatioSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priceRatioEncodingOffset() SBE_NOEXCEPT + { + return 111; + } + +private: + PRICENULL m_priceRatio; + +public: + SBE_NODISCARD PRICENULL &priceRatio() + { + m_priceRatio.wrap(m_buffer, m_offset + 111, m_actingVersion, m_bufferLength); + return m_priceRatio; + } + + SBE_NODISCARD static const char * TickRuleMetaAttribute(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 tickRuleId() SBE_NOEXCEPT + { + return 6350; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tickRuleSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tickRuleInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tickRuleSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tickRuleEncodingOffset() SBE_NOEXCEPT + { + return 119; + } + + static SBE_CONSTEXPR std::int8_t tickRuleNullValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::int8_t tickRuleMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t tickRuleMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t tickRuleEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t tickRule() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 119, sizeof(std::int8_t)); + return (val); + } + + MDInstrumentDefinitionSpread29 &tickRule(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 119, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnitOfMeasureMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t unitOfMeasureId() SBE_NOEXCEPT + { + return 996; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t unitOfMeasureSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool unitOfMeasureInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= unitOfMeasureSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingOffset() SBE_NOEXCEPT + { + return 120; + } + + static SBE_CONSTEXPR char unitOfMeasureNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char unitOfMeasureMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char unitOfMeasureMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingLength() SBE_NOEXCEPT + { + return 30; + } + + static SBE_CONSTEXPR std::uint64_t unitOfMeasureLength() SBE_NOEXCEPT + { + return 30; + } + + SBE_NODISCARD const char *unitOfMeasure() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 120; + } + + SBE_NODISCARD char *unitOfMeasure() SBE_NOEXCEPT + { + return m_buffer + m_offset + 120; + } + + SBE_NODISCARD char unitOfMeasure(const std::uint64_t index) const + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 120 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread29 &unitOfMeasure(const std::uint64_t index, const char value) + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 120 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getUnitOfMeasure(char *const dst, const std::uint64_t length) const + { + if (length > 30) + { + throw std::runtime_error("length too large for getUnitOfMeasure [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 120, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread29 &putUnitOfMeasure(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 120, src, sizeof(char) * 30); + return *this; + } + + std::string getUnitOfMeasureAsString() const + { + const char *buffer = m_buffer + m_offset + 120; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getUnitOfMeasureAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getUnitOfMeasureAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getUnitOfMeasureAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 120; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread29 &putUnitOfMeasure(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 120, str.data(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 120 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread29 &putUnitOfMeasure(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 120, str.c_str(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 120 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * TradingReferencePriceMetaAttribute(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 tradingReferencePriceId() SBE_NOEXCEPT + { + return 1150; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferencePriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradingReferencePriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferencePriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferencePriceEncodingOffset() SBE_NOEXCEPT + { + return 150; + } + +private: + PRICENULL m_tradingReferencePrice; + +public: + SBE_NODISCARD PRICENULL &tradingReferencePrice() + { + m_tradingReferencePrice.wrap(m_buffer, m_offset + 150, m_actingVersion, m_bufferLength); + return m_tradingReferencePrice; + } + + SBE_NODISCARD static const char * SettlPriceTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlPriceTypeId() SBE_NOEXCEPT + { + return 731; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlPriceTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlPriceTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= settlPriceTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingOffset() SBE_NOEXCEPT + { + return 158; + } + +private: + SettlPriceType m_settlPriceType; + +public: + SBE_NODISCARD SettlPriceType &settlPriceType() + { + m_settlPriceType.wrap(m_buffer, m_offset + 158, m_actingVersion, m_bufferLength); + return m_settlPriceType; + } + + static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * OpenInterestQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t openInterestQtyId() SBE_NOEXCEPT + { + return 5792; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t openInterestQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool openInterestQtyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= openInterestQtySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openInterestQtyEncodingOffset() SBE_NOEXCEPT + { + return 159; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t openInterestQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t openInterestQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 159, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread29 &openInterestQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 159, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * ClearedVolumeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t clearedVolumeId() SBE_NOEXCEPT + { + return 5791; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t clearedVolumeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool clearedVolumeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= clearedVolumeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t clearedVolumeEncodingOffset() SBE_NOEXCEPT + { + return 163; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t clearedVolumeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t clearedVolume() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 163, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread29 &clearedVolume(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 163, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * HighLimitPriceMetaAttribute(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 highLimitPriceId() SBE_NOEXCEPT + { + return 1149; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t highLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool highLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= highLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t highLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 167; + } + +private: + PRICENULL m_highLimitPrice; + +public: + SBE_NODISCARD PRICENULL &highLimitPrice() + { + m_highLimitPrice.wrap(m_buffer, m_offset + 167, m_actingVersion, m_bufferLength); + return m_highLimitPrice; + } + + SBE_NODISCARD static const char * LowLimitPriceMetaAttribute(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 lowLimitPriceId() SBE_NOEXCEPT + { + return 1148; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lowLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lowLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lowLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lowLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 175; + } + +private: + PRICENULL m_lowLimitPrice; + +public: + SBE_NODISCARD PRICENULL &lowLimitPrice() + { + m_lowLimitPrice.wrap(m_buffer, m_offset + 175, m_actingVersion, m_bufferLength); + return m_lowLimitPrice; + } + + SBE_NODISCARD static const char * MaxPriceVariationMetaAttribute(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 maxPriceVariationId() SBE_NOEXCEPT + { + return 1143; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxPriceVariationSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maxPriceVariationInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxPriceVariationSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxPriceVariationEncodingOffset() SBE_NOEXCEPT + { + return 183; + } + +private: + PRICENULL m_maxPriceVariation; + +public: + SBE_NODISCARD PRICENULL &maxPriceVariation() + { + m_maxPriceVariation.wrap(m_buffer, m_offset + 183, m_actingVersion, m_bufferLength); + return m_maxPriceVariation; + } + + SBE_NODISCARD static const char * MainFractionMetaAttribute(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 mainFractionId() SBE_NOEXCEPT + { + return 37702; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mainFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mainFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mainFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mainFractionEncodingOffset() SBE_NOEXCEPT + { + return 191; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t mainFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t mainFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 191, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionSpread29 &mainFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 191, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SubFractionMetaAttribute(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 subFractionId() SBE_NOEXCEPT + { + return 37703; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t subFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool subFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= subFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t subFractionEncodingOffset() SBE_NOEXCEPT + { + return 192; + } + + static SBE_CONSTEXPR std::uint8_t subFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t subFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t subFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 192, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionSpread29 &subFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 192, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * TradingReferenceDateMetaAttribute(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 tradingReferenceDateId() SBE_NOEXCEPT + { + return 5796; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferenceDateSinceVersion() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD bool tradingReferenceDateInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferenceDateSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingOffset() SBE_NOEXCEPT + { + return 193; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradingReferenceDate() const SBE_NOEXCEPT + { + if (m_actingVersion < 6) + { + return (std::uint16_t)65535; + } + + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 193, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionSpread29 &tradingReferenceDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 193, &val, sizeof(std::uint16_t)); + return *this; + } + + class NoEvents + { + 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((std::uint16_t)9); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 9; + 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 9; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoEvents &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * EventTypeMetaAttribute(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 eventTypeId() SBE_NOEXCEPT + { + return 865; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD EventType::Value eventType() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint8_t)); + return EventType::get((val)); + } + + NoEvents &eventType(const EventType::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * EventTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t eventTimeId() SBE_NOEXCEPT + { + return 1145; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTimeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTimeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTimeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t eventTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t eventTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoEvents &eventTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint64_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoEvents writer) + { + builder << '{'; + builder << R"("EventType": )"; + builder << '"' << writer.eventType() << '"'; + + builder << ", "; + builder << R"("EventTime": )"; + builder << +writer.eventTime(); + + builder << '}'; + + return builder; + } + }; + +private: + NoEvents m_noEvents; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoEventsId() SBE_NOEXCEPT + { + return 864; + } + + SBE_NODISCARD inline NoEvents &noEvents() + { + m_noEvents.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + NoEvents &noEventsCount(const std::uint8_t count) + { + m_noEvents.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noEventsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noEventsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noEventsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoMDFeedTypes + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoMDFeedTypes &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDFeedTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDFeedTypeId() SBE_NOEXCEPT + { + return 1022; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDFeedTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDFeedTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDFeedTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR char mDFeedTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDFeedTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDFeedTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t mDFeedTypeLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *mDFeedType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char *mDFeedType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char mDFeedType(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 0 + (index * 1), sizeof(char)); + return (val); + } + + NoMDFeedTypes &mDFeedType(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 0 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getMDFeedType(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getMDFeedType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 0, sizeof(char) * static_cast(length)); + return length; + } + + NoMDFeedTypes &putMDFeedType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 0, src, sizeof(char) * 3); + return *this; + } + + NoMDFeedTypes &putMDFeedType( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 0, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 1, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 2, &val2, sizeof(char)); + + return *this; + } + + std::string getMDFeedTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getMDFeedTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDFeedTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getMDFeedTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + NoMDFeedTypes &putMDFeedType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #else + NoMDFeedTypes &putMDFeedType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MarketDepthMetaAttribute(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 marketDepthId() SBE_NOEXCEPT + { + return 264; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketDepthSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketDepthInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= marketDepthSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketDepthEncodingOffset() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::int8_t marketDepthNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t marketDepthEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t marketDepth() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 3, sizeof(std::int8_t)); + return (val); + } + + NoMDFeedTypes &marketDepth(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 3, &val, sizeof(std::int8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDFeedTypes writer) + { + builder << '{'; + builder << R"("MDFeedType": )"; + builder << '"' << + writer.getMDFeedTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MarketDepth": )"; + builder << +writer.marketDepth(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDFeedTypes m_noMDFeedTypes; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDFeedTypesId() SBE_NOEXCEPT + { + return 1141; + } + + SBE_NODISCARD inline NoMDFeedTypes &noMDFeedTypes() + { + m_noMDFeedTypes.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + NoMDFeedTypes &noMDFeedTypesCount(const std::uint8_t count) + { + m_noMDFeedTypes.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDFeedTypesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDFeedTypesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDFeedTypesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoInstAttrib + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoInstAttrib &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * InstAttribTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribTypeId() SBE_NOEXCEPT + { + return 871; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t instAttribTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t instAttribType() SBE_NOEXCEPT + { + return (std::int8_t)24; + } + + SBE_NODISCARD static const char * InstAttribValueMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribValueId() SBE_NOEXCEPT + { + return 872; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribValueSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribValueInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribValueSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribValueEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + private: + InstAttribValue m_instAttribValue; + + public: + SBE_NODISCARD InstAttribValue &instAttribValue() + { + m_instAttribValue.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_instAttribValue; + } + + static SBE_CONSTEXPR std::size_t instAttribValueEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoInstAttrib writer) + { + builder << '{'; + builder << R"("InstAttribValue": )"; + builder << writer.instAttribValue(); + + builder << '}'; + + return builder; + } + }; + +private: + NoInstAttrib m_noInstAttrib; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoInstAttribId() SBE_NOEXCEPT + { + return 870; + } + + SBE_NODISCARD inline NoInstAttrib &noInstAttrib() + { + m_noInstAttrib.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + NoInstAttrib &noInstAttribCount(const std::uint8_t count) + { + m_noInstAttrib.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noInstAttribSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noInstAttribInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noInstAttribSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoLotTypeRules + { + 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((std::uint16_t)5); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 5; + 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 5; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoLotTypeRules &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * LotTypeMetaAttribute(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 lotTypeId() SBE_NOEXCEPT + { + return 1093; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lotTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lotTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= lotTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lotTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t lotTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t lotTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t lotType() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int8_t)); + return (val); + } + + NoLotTypeRules &lotType(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * MinLotSizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minLotSizeId() SBE_NOEXCEPT + { + return 1231; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minLotSizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minLotSizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= minLotSizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minLotSizeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + +private: + DecimalQty m_minLotSize; + +public: + SBE_NODISCARD DecimalQty &minLotSize() + { + m_minLotSize.wrap(m_buffer, m_offset + 1, m_actingVersion, m_bufferLength); + return m_minLotSize; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoLotTypeRules writer) + { + builder << '{'; + builder << R"("LotType": )"; + builder << +writer.lotType(); + + builder << ", "; + builder << R"("MinLotSize": )"; + builder << writer.minLotSize(); + + builder << '}'; + + return builder; + } + }; + +private: + NoLotTypeRules m_noLotTypeRules; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoLotTypeRulesId() SBE_NOEXCEPT + { + return 1234; + } + + SBE_NODISCARD inline NoLotTypeRules &noLotTypeRules() + { + m_noLotTypeRules.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + NoLotTypeRules &noLotTypeRulesCount(const std::uint8_t count) + { + m_noLotTypeRules.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noLotTypeRulesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noLotTypeRulesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noLotTypeRulesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoLegs + { + 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((std::uint16_t)18); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 18; + 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 18; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoLegs &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * LegSecurityIDMetaAttribute(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 legSecurityIDId() SBE_NOEXCEPT + { + return 602; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legSecurityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool legSecurityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legSecurityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legSecurityIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int32_t legSecurityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t legSecurityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t legSecurityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t legSecurityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t legSecurityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoLegs &legSecurityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * LegSecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t legSecurityIDSourceId() SBE_NOEXCEPT + { + return 603; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legSecurityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool legSecurityIDSourceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legSecurityIDSourceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legSecurityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR char legSecurityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char legSecurityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char legSecurityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t legSecurityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t legSecurityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *legSecurityIDSource() const + { + static const std::uint8_t legSecurityIDSourceValues[] = { 56 }; + + return (const char *)legSecurityIDSourceValues; + } + + SBE_NODISCARD char legSecurityIDSource(const std::uint64_t index) const + { + static const std::uint8_t legSecurityIDSourceValues[] = { 56 }; + + return (char)legSecurityIDSourceValues[index]; + } + + std::uint64_t getLegSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t legSecurityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(legSecurityIDSourceValues) ? length : sizeof(legSecurityIDSourceValues); + + std::memcpy(dst, legSecurityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getLegSecurityIDSourceAsString() const + { + static const std::uint8_t LegSecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)LegSecurityIDSourceValues, 1); + } + + std::string getLegSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getLegSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * LegSideMetaAttribute(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 legSideId() SBE_NOEXCEPT + { + return 624; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legSideSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool legSideInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legSideSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legSideEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legSideEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD LegSide::Value legSide() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 4, sizeof(std::uint8_t)); + return LegSide::get((val)); + } + + NoLegs &legSide(const LegSide::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 4, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * LegRatioQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t legRatioQtyId() SBE_NOEXCEPT + { + return 623; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legRatioQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool legRatioQtyInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legRatioQtySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legRatioQtyEncodingOffset() SBE_NOEXCEPT + { + return 5; + } + + static SBE_CONSTEXPR std::int8_t legRatioQtyNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t legRatioQtyMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t legRatioQtyMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t legRatioQtyEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t legRatioQty() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 5, sizeof(std::int8_t)); + return (val); + } + + NoLegs &legRatioQty(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 5, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * LegPriceMetaAttribute(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 legPriceId() SBE_NOEXCEPT + { + return 566; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool legPriceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legPriceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legPriceEncodingOffset() SBE_NOEXCEPT + { + return 6; + } + +private: + PRICENULL m_legPrice; + +public: + SBE_NODISCARD PRICENULL &legPrice() + { + m_legPrice.wrap(m_buffer, m_offset + 6, m_actingVersion, m_bufferLength); + return m_legPrice; + } + + SBE_NODISCARD static const char * LegOptionDeltaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t legOptionDeltaId() SBE_NOEXCEPT + { + return 1017; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legOptionDeltaSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool legOptionDeltaInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legOptionDeltaSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legOptionDeltaEncodingOffset() SBE_NOEXCEPT + { + return 14; + } + +private: + DecimalQty m_legOptionDelta; + +public: + SBE_NODISCARD DecimalQty &legOptionDelta() + { + m_legOptionDelta.wrap(m_buffer, m_offset + 14, m_actingVersion, m_bufferLength); + return m_legOptionDelta; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoLegs writer) + { + builder << '{'; + builder << R"("LegSecurityID": )"; + builder << +writer.legSecurityID(); + + builder << ", "; + builder << R"("LegSide": )"; + builder << '"' << writer.legSide() << '"'; + + builder << ", "; + builder << R"("LegRatioQty": )"; + builder << +writer.legRatioQty(); + + builder << ", "; + builder << R"("LegPrice": )"; + builder << writer.legPrice(); + + builder << ", "; + builder << R"("LegOptionDelta": )"; + builder << writer.legOptionDelta(); + + builder << '}'; + + return builder; + } + }; + +private: + NoLegs m_noLegs; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoLegsId() SBE_NOEXCEPT + { + return 555; + } + + SBE_NODISCARD inline NoLegs &noLegs() + { + m_noLegs.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLegs; + } + + NoLegs &noLegsCount(const std::uint8_t count) + { + m_noLegs.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLegs; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noLegsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noLegsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noLegsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDInstrumentDefinitionSpread29 _writer) + { + MDInstrumentDefinitionSpread29 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDInstrumentDefinitionSpread29", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + builder << R"("TotNumReports": )"; + builder << +writer.totNumReports(); + + builder << ", "; + builder << R"("SecurityUpdateAction": )"; + builder << '"' << writer.securityUpdateAction() << '"'; + + builder << ", "; + builder << R"("LastUpdateTime": )"; + builder << +writer.lastUpdateTime(); + + builder << ", "; + builder << R"("MDSecurityTradingStatus": )"; + builder << '"' << writer.mDSecurityTradingStatus() << '"'; + + builder << ", "; + builder << R"("ApplID": )"; + builder << +writer.applID(); + + builder << ", "; + builder << R"("MarketSegmentID": )"; + builder << +writer.marketSegmentID(); + + builder << ", "; + builder << R"("UnderlyingProduct": )"; + builder << +writer.underlyingProduct(); + + builder << ", "; + builder << R"("SecurityExchange": )"; + builder << '"' << + writer.getSecurityExchangeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityGroup": )"; + builder << '"' << + writer.getSecurityGroupAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Asset": )"; + builder << '"' << + writer.getAssetAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Symbol": )"; + builder << '"' << + writer.getSymbolAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("SecurityType": )"; + builder << '"' << + writer.getSecurityTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("CFICode": )"; + builder << '"' << + writer.getCFICodeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MaturityMonthYear": )"; + builder << writer.maturityMonthYear(); + + builder << ", "; + builder << R"("Currency": )"; + builder << '"' << + writer.getCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecuritySubType": )"; + builder << '"' << + writer.getSecuritySubTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("UserDefinedInstrument": )"; + if (std::isprint(writer.userDefinedInstrument())) + { + builder << '"' << (char)writer.userDefinedInstrument() << '"'; + } + else + { + builder << (int)writer.userDefinedInstrument(); + } + + builder << ", "; + builder << R"("MatchAlgorithm": )"; + if (std::isprint(writer.matchAlgorithm())) + { + builder << '"' << (char)writer.matchAlgorithm() << '"'; + } + else + { + builder << (int)writer.matchAlgorithm(); + } + + builder << ", "; + builder << R"("MinTradeVol": )"; + builder << +writer.minTradeVol(); + + builder << ", "; + builder << R"("MaxTradeVol": )"; + builder << +writer.maxTradeVol(); + + builder << ", "; + builder << R"("MinPriceIncrement": )"; + builder << writer.minPriceIncrement(); + + builder << ", "; + builder << R"("DisplayFactor": )"; + builder << writer.displayFactor(); + + builder << ", "; + builder << R"("PriceDisplayFormat": )"; + builder << +writer.priceDisplayFormat(); + + builder << ", "; + builder << R"("PriceRatio": )"; + builder << writer.priceRatio(); + + builder << ", "; + builder << R"("TickRule": )"; + builder << +writer.tickRule(); + + builder << ", "; + builder << R"("UnitOfMeasure": )"; + builder << '"' << + writer.getUnitOfMeasureAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("TradingReferencePrice": )"; + builder << writer.tradingReferencePrice(); + + builder << ", "; + builder << R"("SettlPriceType": )"; + builder << writer.settlPriceType(); + + builder << ", "; + builder << R"("OpenInterestQty": )"; + builder << +writer.openInterestQty(); + + builder << ", "; + builder << R"("ClearedVolume": )"; + builder << +writer.clearedVolume(); + + builder << ", "; + builder << R"("HighLimitPrice": )"; + builder << writer.highLimitPrice(); + + builder << ", "; + builder << R"("LowLimitPrice": )"; + builder << writer.lowLimitPrice(); + + builder << ", "; + builder << R"("MaxPriceVariation": )"; + builder << writer.maxPriceVariation(); + + builder << ", "; + builder << R"("MainFraction": )"; + builder << +writer.mainFraction(); + + builder << ", "; + builder << R"("SubFraction": )"; + builder << +writer.subFraction(); + + builder << ", "; + builder << R"("TradingReferenceDate": )"; + builder << +writer.tradingReferenceDate(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoEvents": [)"; + writer.noEvents().forEach([&](NoEvents& noEvents) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noEvents; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDFeedTypes": [)"; + writer.noMDFeedTypes().forEach([&](NoMDFeedTypes& noMDFeedTypes) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDFeedTypes; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoInstAttrib": [)"; + writer.noInstAttrib().forEach([&](NoInstAttrib& noInstAttrib) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noInstAttrib; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoLotTypeRules": [)"; + writer.noLotTypeRules().forEach([&](NoLotTypeRules& noLotTypeRules) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLotTypeRules; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoLegs": [)"; + writer.noLegs().forEach([&](NoLegs& noLegs) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLegs; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionSpread56.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionSpread56.h new file mode 100644 index 000000000..671ab828b --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDInstrumentDefinitionSpread56.h @@ -0,0 +1,6509 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDINSTRUMENTDEFINITIONSPREAD56_H_ +#define _MKTDATA_MDINSTRUMENTDEFINITIONSPREAD56_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class MDInstrumentDefinitionSpread56 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MDInstrumentDefinitionSpread56() = default; + + MDInstrumentDefinitionSpread56( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + MDInstrumentDefinitionSpread56(char *buffer, const std::uint64_t bufferLength) : + MDInstrumentDefinitionSpread56(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + MDInstrumentDefinitionSpread56( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + MDInstrumentDefinitionSpread56(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)195; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)56; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "d"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + MDInstrumentDefinitionSpread56 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionSpread56(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + MDInstrumentDefinitionSpread56 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = MDInstrumentDefinitionSpread56( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + MDInstrumentDefinitionSpread56 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MDInstrumentDefinitionSpread56(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * TotNumReportsMetaAttribute(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 totNumReportsId() SBE_NOEXCEPT + { + return 911; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t totNumReportsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool totNumReportsInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= totNumReportsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t totNumReportsEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsNullValue() SBE_NOEXCEPT + { + return 4294967295; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t totNumReportsEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t totNumReports() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread56 &totNumReports(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityUpdateActionMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityUpdateActionId() SBE_NOEXCEPT + { + return 980; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityUpdateActionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityUpdateActionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityUpdateActionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingOffset() SBE_NOEXCEPT + { + return 5; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityUpdateActionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityUpdateAction::Value securityUpdateAction() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 5, sizeof(char)); + return SecurityUpdateAction::get((val)); + } + + MDInstrumentDefinitionSpread56 &securityUpdateAction(const SecurityUpdateAction::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 5, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * LastUpdateTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastUpdateTimeId() SBE_NOEXCEPT + { + return 779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastUpdateTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastUpdateTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastUpdateTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingOffset() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t lastUpdateTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 6, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + MDInstrumentDefinitionSpread56 &lastUpdateTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 6, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDSecurityTradingStatusMetaAttribute(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 mDSecurityTradingStatusId() SBE_NOEXCEPT + { + return 1682; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDSecurityTradingStatusSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDSecurityTradingStatusInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mDSecurityTradingStatusSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingOffset() SBE_NOEXCEPT + { + return 14; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityTradingStatus::Value mDSecurityTradingStatus() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 14, sizeof(std::uint8_t)); + return SecurityTradingStatus::get((val)); + } + + MDInstrumentDefinitionSpread56 &mDSecurityTradingStatus(const SecurityTradingStatus::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 14, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * ApplIDMetaAttribute(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 applIDId() SBE_NOEXCEPT + { + return 1180; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t applIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool applIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= applIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t applIDEncodingOffset() SBE_NOEXCEPT + { + return 15; + } + + static SBE_CONSTEXPR std::int16_t applIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT16; + } + + static SBE_CONSTEXPR std::int16_t applIDMinValue() SBE_NOEXCEPT + { + return (std::int16_t)-32767; + } + + static SBE_CONSTEXPR std::int16_t applIDMaxValue() SBE_NOEXCEPT + { + return (std::int16_t)32767; + } + + static SBE_CONSTEXPR std::size_t applIDEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::int16_t applID() const SBE_NOEXCEPT + { + std::int16_t val; + std::memcpy(&val, m_buffer + m_offset + 15, sizeof(std::int16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionSpread56 &applID(const std::int16_t value) SBE_NOEXCEPT + { + std::int16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 15, &val, sizeof(std::int16_t)); + return *this; + } + + SBE_NODISCARD static const char * MarketSegmentIDMetaAttribute(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 marketSegmentIDId() SBE_NOEXCEPT + { + return 1300; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketSegmentIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketSegmentIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= marketSegmentIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingOffset() SBE_NOEXCEPT + { + return 17; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT8; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t marketSegmentIDMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t marketSegmentIDEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t marketSegmentID() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 17, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionSpread56 &marketSegmentID(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 17, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnderlyingProductMetaAttribute(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 underlyingProductId() SBE_NOEXCEPT + { + return 462; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t underlyingProductSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool underlyingProductInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= underlyingProductSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t underlyingProductEncodingOffset() SBE_NOEXCEPT + { + return 18; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t underlyingProductMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t underlyingProductEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t underlyingProduct() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 18, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionSpread56 &underlyingProduct(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 18, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityExchangeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Exchange"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityExchangeId() SBE_NOEXCEPT + { + return 207; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityExchangeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityExchangeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityExchangeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityExchangeEncodingOffset() SBE_NOEXCEPT + { + return 19; + } + + static SBE_CONSTEXPR char securityExchangeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityExchangeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityExchangeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityExchangeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint64_t securityExchangeLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD const char *securityExchange() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char *securityExchange() SBE_NOEXCEPT + { + return m_buffer + m_offset + 19; + } + + SBE_NODISCARD char securityExchange(const std::uint64_t index) const + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 19 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread56 &securityExchange(const std::uint64_t index, const char value) + { + if (index >= 4) + { + throw std::runtime_error("index out of range for securityExchange [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 19 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityExchange(char *const dst, const std::uint64_t length) const + { + if (length > 4) + { + throw std::runtime_error("length too large for getSecurityExchange [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 19, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread56 &putSecurityExchange(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 19, src, sizeof(char) * 4); + return *this; + } + + MDInstrumentDefinitionSpread56 &putSecurityExchange( + const char value0, + const char value1, + const char value2, + const char value3) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 19, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 20, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 21, &val2, sizeof(char)); + char val3 = (value3); + std::memcpy(m_buffer + m_offset + 22, &val3, sizeof(char)); + + return *this; + } + + std::string getSecurityExchangeAsString() const + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityExchangeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityExchangeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityExchangeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 19; + size_t length = 0; + + for (; length < 4 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread56 &putSecurityExchange(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.data(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread56 &putSecurityExchange(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 4) + { + throw std::runtime_error("string too large for putSecurityExchange [E106]"); + } + + std::memcpy(m_buffer + m_offset + 19, str.c_str(), srcLength); + for (size_t start = srcLength; start < 4; ++start) + { + m_buffer[m_offset + 19 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityGroupMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityGroupId() SBE_NOEXCEPT + { + return 1151; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityGroupSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityGroupInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityGroupSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityGroupEncodingOffset() SBE_NOEXCEPT + { + return 23; + } + + static SBE_CONSTEXPR char securityGroupNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityGroupMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityGroupMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityGroupEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityGroupLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityGroup() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char *securityGroup() SBE_NOEXCEPT + { + return m_buffer + m_offset + 23; + } + + SBE_NODISCARD char securityGroup(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 23 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread56 &securityGroup(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 23 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityGroup(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityGroup [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 23, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread56 &putSecurityGroup(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 23, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityGroupAsString() const + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityGroupAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityGroupAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityGroupAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 23; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread56 &putSecurityGroup(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread56 &putSecurityGroup(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 23, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 23 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * AssetMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t assetId() SBE_NOEXCEPT + { + return 6937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t assetSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool assetInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= assetSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t assetEncodingOffset() SBE_NOEXCEPT + { + return 29; + } + + static SBE_CONSTEXPR char assetNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char assetMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char assetMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t assetEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t assetLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *asset() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char *asset() SBE_NOEXCEPT + { + return m_buffer + m_offset + 29; + } + + SBE_NODISCARD char asset(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 29 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread56 &asset(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 29 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getAsset(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getAsset [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 29, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread56 &putAsset(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 29, src, sizeof(char) * 6); + return *this; + } + + std::string getAssetAsString() const + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getAssetAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getAssetAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getAssetAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 29; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread56 &putAsset(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread56 &putAsset(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 29, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 29 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SymbolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t symbolId() SBE_NOEXCEPT + { + return 55; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t symbolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool symbolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= symbolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t symbolEncodingOffset() SBE_NOEXCEPT + { + return 35; + } + + static SBE_CONSTEXPR char symbolNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char symbolMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char symbolMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t symbolEncodingLength() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t symbolLength() SBE_NOEXCEPT + { + return 20; + } + + SBE_NODISCARD const char *symbol() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char *symbol() SBE_NOEXCEPT + { + return m_buffer + m_offset + 35; + } + + SBE_NODISCARD char symbol(const std::uint64_t index) const + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 35 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread56 &symbol(const std::uint64_t index, const char value) + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 35 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSymbol(char *const dst, const std::uint64_t length) const + { + if (length > 20) + { + throw std::runtime_error("length too large for getSymbol [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 35, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread56 &putSymbol(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 35, src, sizeof(char) * 20); + return *this; + } + + std::string getSymbolAsString() const + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSymbolAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSymbolAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSymbolAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 35; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread56 &putSymbol(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.data(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread56 &putSymbol(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 35, str.c_str(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 35 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 55; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 55, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread56 &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 55, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityIDSourceId() SBE_NOEXCEPT + { + return 22; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDSourceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSourceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t securityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *securityIDSource() const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (const char *)securityIDSourceValues; + } + + SBE_NODISCARD char securityIDSource(const std::uint64_t index) const + { + static const std::uint8_t securityIDSourceValues[] = { 56 }; + + return (char)securityIDSourceValues[index]; + } + + std::uint64_t getSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t securityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(securityIDSourceValues) ? length : sizeof(securityIDSourceValues); + + std::memcpy(dst, securityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getSecurityIDSourceAsString() const + { + static const std::uint8_t SecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)SecurityIDSourceValues, 1); + } + + std::string getSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * SecurityTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityTypeId() SBE_NOEXCEPT + { + return 167; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityTypeEncodingOffset() SBE_NOEXCEPT + { + return 59; + } + + static SBE_CONSTEXPR char securityTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityTypeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityTypeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char *securityType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 59; + } + + SBE_NODISCARD char securityType(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 59 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread56 &securityType(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 59 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityType(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 59, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread56 &putSecurityType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 59, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 59; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread56 &putSecurityType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread56 &putSecurityType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 59, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 59 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * CFICodeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t cFICodeId() SBE_NOEXCEPT + { + return 461; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t cFICodeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool cFICodeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= cFICodeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t cFICodeEncodingOffset() SBE_NOEXCEPT + { + return 65; + } + + static SBE_CONSTEXPR char cFICodeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char cFICodeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char cFICodeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t cFICodeEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t cFICodeLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *cFICode() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char *cFICode() SBE_NOEXCEPT + { + return m_buffer + m_offset + 65; + } + + SBE_NODISCARD char cFICode(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 65 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread56 &cFICode(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for cFICode [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 65 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCFICode(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getCFICode [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 65, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread56 &putCFICode(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 65, src, sizeof(char) * 6); + return *this; + } + + std::string getCFICodeAsString() const + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCFICodeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCFICodeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCFICodeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 65; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread56 &putCFICode(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread56 &putCFICode(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putCFICode [E106]"); + } + + std::memcpy(m_buffer + m_offset + 65, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 65 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MaturityMonthYearMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MonthYear"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maturityMonthYearId() SBE_NOEXCEPT + { + return 200; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maturityMonthYearSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maturityMonthYearInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maturityMonthYearSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maturityMonthYearEncodingOffset() SBE_NOEXCEPT + { + return 71; + } + +private: + MaturityMonthYear m_maturityMonthYear; + +public: + SBE_NODISCARD MaturityMonthYear &maturityMonthYear() + { + m_maturityMonthYear.wrap(m_buffer, m_offset + 71, m_actingVersion, m_bufferLength); + return m_maturityMonthYear; + } + + SBE_NODISCARD static const char * CurrencyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Currency"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t currencyId() SBE_NOEXCEPT + { + return 15; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t currencySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool currencyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= currencySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t currencyEncodingOffset() SBE_NOEXCEPT + { + return 76; + } + + static SBE_CONSTEXPR char currencyNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char currencyMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char currencyMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t currencyEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t currencyLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *currency() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 76; + } + + SBE_NODISCARD char *currency() SBE_NOEXCEPT + { + return m_buffer + m_offset + 76; + } + + SBE_NODISCARD char currency(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 76 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread56 ¤cy(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for currency [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 76 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getCurrency(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getCurrency [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 76, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread56 &putCurrency(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 76, src, sizeof(char) * 3); + return *this; + } + + MDInstrumentDefinitionSpread56 &putCurrency( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 76, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 77, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 78, &val2, sizeof(char)); + + return *this; + } + + std::string getCurrencyAsString() const + { + const char *buffer = m_buffer + m_offset + 76; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getCurrencyAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getCurrencyAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getCurrencyAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 76; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread56 &putCurrency(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 76, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 76 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread56 &putCurrency(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putCurrency [E106]"); + } + + std::memcpy(m_buffer + m_offset + 76, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 76 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecuritySubTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securitySubTypeId() SBE_NOEXCEPT + { + return 762; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securitySubTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securitySubTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securitySubTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securitySubTypeEncodingOffset() SBE_NOEXCEPT + { + return 79; + } + + static SBE_CONSTEXPR char securitySubTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securitySubTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securitySubTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securitySubTypeEncodingLength() SBE_NOEXCEPT + { + return 5; + } + + static SBE_CONSTEXPR std::uint64_t securitySubTypeLength() SBE_NOEXCEPT + { + return 5; + } + + SBE_NODISCARD const char *securitySubType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 79; + } + + SBE_NODISCARD char *securitySubType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 79; + } + + SBE_NODISCARD char securitySubType(const std::uint64_t index) const + { + if (index >= 5) + { + throw std::runtime_error("index out of range for securitySubType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 79 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread56 &securitySubType(const std::uint64_t index, const char value) + { + if (index >= 5) + { + throw std::runtime_error("index out of range for securitySubType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 79 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecuritySubType(char *const dst, const std::uint64_t length) const + { + if (length > 5) + { + throw std::runtime_error("length too large for getSecuritySubType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 79, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread56 &putSecuritySubType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 79, src, sizeof(char) * 5); + return *this; + } + + std::string getSecuritySubTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 79; + size_t length = 0; + + for (; length < 5 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecuritySubTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecuritySubTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecuritySubTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 79; + size_t length = 0; + + for (; length < 5 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread56 &putSecuritySubType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 5) + { + throw std::runtime_error("string too large for putSecuritySubType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 79, str.data(), srcLength); + for (size_t start = srcLength; start < 5; ++start) + { + m_buffer[m_offset + 79 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread56 &putSecuritySubType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 5) + { + throw std::runtime_error("string too large for putSecuritySubType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 79, str.c_str(), srcLength); + for (size_t start = srcLength; start < 5; ++start) + { + m_buffer[m_offset + 79 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * UserDefinedInstrumentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t userDefinedInstrumentId() SBE_NOEXCEPT + { + return 9779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t userDefinedInstrumentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool userDefinedInstrumentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= userDefinedInstrumentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingOffset() SBE_NOEXCEPT + { + return 84; + } + + static SBE_CONSTEXPR char userDefinedInstrumentNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char userDefinedInstrumentMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t userDefinedInstrumentEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char userDefinedInstrument() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 84, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread56 &userDefinedInstrument(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 84, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * MatchAlgorithmMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchAlgorithmId() SBE_NOEXCEPT + { + return 1142; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchAlgorithmSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchAlgorithmInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchAlgorithmSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingOffset() SBE_NOEXCEPT + { + return 85; + } + + static SBE_CONSTEXPR char matchAlgorithmNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char matchAlgorithmMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char matchAlgorithmMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t matchAlgorithmEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD char matchAlgorithm() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 85, sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread56 &matchAlgorithm(const char value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 85, &val, sizeof(char)); + return *this; + } + + SBE_NODISCARD static const char * MinTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minTradeVolId() SBE_NOEXCEPT + { + return 562; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 86; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t minTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t minTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t minTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 86, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread56 &minTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 86, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MaxTradeVolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t maxTradeVolId() SBE_NOEXCEPT + { + return 1140; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxTradeVolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maxTradeVolInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxTradeVolSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxTradeVolEncodingOffset() SBE_NOEXCEPT + { + return 90; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t maxTradeVolMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t maxTradeVolEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t maxTradeVol() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 90, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread56 &maxTradeVol(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 90, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * MinPriceIncrementMetaAttribute(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 minPriceIncrementId() SBE_NOEXCEPT + { + return 969; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minPriceIncrementSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool minPriceIncrementInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= minPriceIncrementSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minPriceIncrementEncodingOffset() SBE_NOEXCEPT + { + return 94; + } + +private: + PRICENULL9 m_minPriceIncrement; + +public: + SBE_NODISCARD PRICENULL9 &minPriceIncrement() + { + m_minPriceIncrement.wrap(m_buffer, m_offset + 94, m_actingVersion, m_bufferLength); + return m_minPriceIncrement; + } + + SBE_NODISCARD static const char * DisplayFactorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "float"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t displayFactorId() SBE_NOEXCEPT + { + return 9787; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t displayFactorSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool displayFactorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= displayFactorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t displayFactorEncodingOffset() SBE_NOEXCEPT + { + return 102; + } + +private: + Decimal9 m_displayFactor; + +public: + SBE_NODISCARD Decimal9 &displayFactor() + { + m_displayFactor.wrap(m_buffer, m_offset + 102, m_actingVersion, m_bufferLength); + return m_displayFactor; + } + + SBE_NODISCARD static const char * PriceDisplayFormatMetaAttribute(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 priceDisplayFormatId() SBE_NOEXCEPT + { + return 9800; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priceDisplayFormatSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool priceDisplayFormatInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priceDisplayFormatSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingOffset() SBE_NOEXCEPT + { + return 110; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t priceDisplayFormatMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t priceDisplayFormatEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t priceDisplayFormat() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 110, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionSpread56 &priceDisplayFormat(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 110, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * PriceRatioMetaAttribute(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 priceRatioId() SBE_NOEXCEPT + { + return 5770; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t priceRatioSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool priceRatioInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= priceRatioSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t priceRatioEncodingOffset() SBE_NOEXCEPT + { + return 111; + } + +private: + PRICENULL9 m_priceRatio; + +public: + SBE_NODISCARD PRICENULL9 &priceRatio() + { + m_priceRatio.wrap(m_buffer, m_offset + 111, m_actingVersion, m_bufferLength); + return m_priceRatio; + } + + SBE_NODISCARD static const char * TickRuleMetaAttribute(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 tickRuleId() SBE_NOEXCEPT + { + return 6350; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tickRuleSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tickRuleInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tickRuleSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tickRuleEncodingOffset() SBE_NOEXCEPT + { + return 119; + } + + static SBE_CONSTEXPR std::int8_t tickRuleNullValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::int8_t tickRuleMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t tickRuleMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t tickRuleEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t tickRule() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 119, sizeof(std::int8_t)); + return (val); + } + + MDInstrumentDefinitionSpread56 &tickRule(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 119, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * UnitOfMeasureMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t unitOfMeasureId() SBE_NOEXCEPT + { + return 996; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t unitOfMeasureSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool unitOfMeasureInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= unitOfMeasureSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingOffset() SBE_NOEXCEPT + { + return 120; + } + + static SBE_CONSTEXPR char unitOfMeasureNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char unitOfMeasureMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char unitOfMeasureMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t unitOfMeasureEncodingLength() SBE_NOEXCEPT + { + return 30; + } + + static SBE_CONSTEXPR std::uint64_t unitOfMeasureLength() SBE_NOEXCEPT + { + return 30; + } + + SBE_NODISCARD const char *unitOfMeasure() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 120; + } + + SBE_NODISCARD char *unitOfMeasure() SBE_NOEXCEPT + { + return m_buffer + m_offset + 120; + } + + SBE_NODISCARD char unitOfMeasure(const std::uint64_t index) const + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 120 + (index * 1), sizeof(char)); + return (val); + } + + MDInstrumentDefinitionSpread56 &unitOfMeasure(const std::uint64_t index, const char value) + { + if (index >= 30) + { + throw std::runtime_error("index out of range for unitOfMeasure [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 120 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getUnitOfMeasure(char *const dst, const std::uint64_t length) const + { + if (length > 30) + { + throw std::runtime_error("length too large for getUnitOfMeasure [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 120, sizeof(char) * static_cast(length)); + return length; + } + + MDInstrumentDefinitionSpread56 &putUnitOfMeasure(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 120, src, sizeof(char) * 30); + return *this; + } + + std::string getUnitOfMeasureAsString() const + { + const char *buffer = m_buffer + m_offset + 120; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getUnitOfMeasureAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getUnitOfMeasureAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getUnitOfMeasureAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 120; + size_t length = 0; + + for (; length < 30 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + MDInstrumentDefinitionSpread56 &putUnitOfMeasure(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 120, str.data(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 120 + start] = 0; + } + + return *this; + } + #else + MDInstrumentDefinitionSpread56 &putUnitOfMeasure(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 30) + { + throw std::runtime_error("string too large for putUnitOfMeasure [E106]"); + } + + std::memcpy(m_buffer + m_offset + 120, str.c_str(), srcLength); + for (size_t start = srcLength; start < 30; ++start) + { + m_buffer[m_offset + 120 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * TradingReferencePriceMetaAttribute(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 tradingReferencePriceId() SBE_NOEXCEPT + { + return 1150; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferencePriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool tradingReferencePriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferencePriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferencePriceEncodingOffset() SBE_NOEXCEPT + { + return 150; + } + +private: + PRICENULL9 m_tradingReferencePrice; + +public: + SBE_NODISCARD PRICENULL9 &tradingReferencePrice() + { + m_tradingReferencePrice.wrap(m_buffer, m_offset + 150, m_actingVersion, m_bufferLength); + return m_tradingReferencePrice; + } + + SBE_NODISCARD static const char * SettlPriceTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlPriceTypeId() SBE_NOEXCEPT + { + return 731; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlPriceTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlPriceTypeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= settlPriceTypeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingOffset() SBE_NOEXCEPT + { + return 158; + } + +private: + SettlPriceType m_settlPriceType; + +public: + SBE_NODISCARD SettlPriceType &settlPriceType() + { + m_settlPriceType.wrap(m_buffer, m_offset + 158, m_actingVersion, m_bufferLength); + return m_settlPriceType; + } + + static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * OpenInterestQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t openInterestQtyId() SBE_NOEXCEPT + { + return 5792; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t openInterestQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool openInterestQtyInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= openInterestQtySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openInterestQtyEncodingOffset() SBE_NOEXCEPT + { + return 159; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t openInterestQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t openInterestQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t openInterestQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 159, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread56 &openInterestQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 159, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * ClearedVolumeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t clearedVolumeId() SBE_NOEXCEPT + { + return 5791; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t clearedVolumeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool clearedVolumeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= clearedVolumeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t clearedVolumeEncodingOffset() SBE_NOEXCEPT + { + return 163; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t clearedVolumeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t clearedVolumeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t clearedVolume() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 163, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + MDInstrumentDefinitionSpread56 &clearedVolume(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 163, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * HighLimitPriceMetaAttribute(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 highLimitPriceId() SBE_NOEXCEPT + { + return 1149; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t highLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool highLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= highLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t highLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 167; + } + +private: + PRICENULL9 m_highLimitPrice; + +public: + SBE_NODISCARD PRICENULL9 &highLimitPrice() + { + m_highLimitPrice.wrap(m_buffer, m_offset + 167, m_actingVersion, m_bufferLength); + return m_highLimitPrice; + } + + SBE_NODISCARD static const char * LowLimitPriceMetaAttribute(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 lowLimitPriceId() SBE_NOEXCEPT + { + return 1148; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lowLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool lowLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lowLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lowLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 175; + } + +private: + PRICENULL9 m_lowLimitPrice; + +public: + SBE_NODISCARD PRICENULL9 &lowLimitPrice() + { + m_lowLimitPrice.wrap(m_buffer, m_offset + 175, m_actingVersion, m_bufferLength); + return m_lowLimitPrice; + } + + SBE_NODISCARD static const char * MaxPriceVariationMetaAttribute(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 maxPriceVariationId() SBE_NOEXCEPT + { + return 1143; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxPriceVariationSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool maxPriceVariationInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxPriceVariationSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxPriceVariationEncodingOffset() SBE_NOEXCEPT + { + return 183; + } + +private: + PRICENULL9 m_maxPriceVariation; + +public: + SBE_NODISCARD PRICENULL9 &maxPriceVariation() + { + m_maxPriceVariation.wrap(m_buffer, m_offset + 183, m_actingVersion, m_bufferLength); + return m_maxPriceVariation; + } + + SBE_NODISCARD static const char * MainFractionMetaAttribute(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 mainFractionId() SBE_NOEXCEPT + { + return 37702; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mainFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mainFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mainFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mainFractionEncodingOffset() SBE_NOEXCEPT + { + return 191; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t mainFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t mainFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t mainFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 191, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionSpread56 &mainFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 191, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SubFractionMetaAttribute(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 subFractionId() SBE_NOEXCEPT + { + return 37703; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t subFractionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool subFractionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= subFractionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t subFractionEncodingOffset() SBE_NOEXCEPT + { + return 192; + } + + static SBE_CONSTEXPR std::uint8_t subFractionNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t subFractionMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t subFractionEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t subFraction() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 192, sizeof(std::uint8_t)); + return (val); + } + + MDInstrumentDefinitionSpread56 &subFraction(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 192, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * TradingReferenceDateMetaAttribute(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 tradingReferenceDateId() SBE_NOEXCEPT + { + return 5796; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferenceDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradingReferenceDateInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradingReferenceDateSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingOffset() SBE_NOEXCEPT + { + return 193; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradingReferenceDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 193, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MDInstrumentDefinitionSpread56 &tradingReferenceDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 193, &val, sizeof(std::uint16_t)); + return *this; + } + + class NoEvents + { + 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((std::uint16_t)9); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 9; + 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 9; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoEvents &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * EventTypeMetaAttribute(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 eventTypeId() SBE_NOEXCEPT + { + return 865; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD EventType::Value eventType() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint8_t)); + return EventType::get((val)); + } + + NoEvents &eventType(const EventType::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * EventTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t eventTimeId() SBE_NOEXCEPT + { + return 1145; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t eventTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool eventTimeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= eventTimeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t eventTimeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t eventTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t eventTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t eventTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 1, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoEvents &eventTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 1, &val, sizeof(std::uint64_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoEvents writer) + { + builder << '{'; + builder << R"("EventType": )"; + builder << '"' << writer.eventType() << '"'; + + builder << ", "; + builder << R"("EventTime": )"; + builder << +writer.eventTime(); + + builder << '}'; + + return builder; + } + }; + +private: + NoEvents m_noEvents; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoEventsId() SBE_NOEXCEPT + { + return 864; + } + + SBE_NODISCARD inline NoEvents &noEvents() + { + m_noEvents.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + NoEvents &noEventsCount(const std::uint8_t count) + { + m_noEvents.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noEvents; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noEventsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noEventsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noEventsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoMDFeedTypes + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoMDFeedTypes &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDFeedTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDFeedTypeId() SBE_NOEXCEPT + { + return 1022; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDFeedTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDFeedTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDFeedTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR char mDFeedTypeNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char mDFeedTypeMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char mDFeedTypeMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t mDFeedTypeEncodingLength() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint64_t mDFeedTypeLength() SBE_NOEXCEPT + { + return 3; + } + + SBE_NODISCARD const char *mDFeedType() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char *mDFeedType() SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char mDFeedType(const std::uint64_t index) const + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 0 + (index * 1), sizeof(char)); + return (val); + } + + NoMDFeedTypes &mDFeedType(const std::uint64_t index, const char value) + { + if (index >= 3) + { + throw std::runtime_error("index out of range for mDFeedType [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 0 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getMDFeedType(char *const dst, const std::uint64_t length) const + { + if (length > 3) + { + throw std::runtime_error("length too large for getMDFeedType [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 0, sizeof(char) * static_cast(length)); + return length; + } + + NoMDFeedTypes &putMDFeedType(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 0, src, sizeof(char) * 3); + return *this; + } + + NoMDFeedTypes &putMDFeedType( + const char value0, + const char value1, + const char value2) SBE_NOEXCEPT + { + char val0 = (value0); + std::memcpy(m_buffer + m_offset + 0, &val0, sizeof(char)); + char val1 = (value1); + std::memcpy(m_buffer + m_offset + 1, &val1, sizeof(char)); + char val2 = (value2); + std::memcpy(m_buffer + m_offset + 2, &val2, sizeof(char)); + + return *this; + } + + std::string getMDFeedTypeAsString() const + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getMDFeedTypeAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getMDFeedTypeAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getMDFeedTypeAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 3 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + NoMDFeedTypes &putMDFeedType(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.data(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #else + NoMDFeedTypes &putMDFeedType(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 3) + { + throw std::runtime_error("string too large for putMDFeedType [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.c_str(), srcLength); + for (size_t start = srcLength; start < 3; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MarketDepthMetaAttribute(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 marketDepthId() SBE_NOEXCEPT + { + return 264; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t marketDepthSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool marketDepthInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= marketDepthSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t marketDepthEncodingOffset() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::int8_t marketDepthNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t marketDepthMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t marketDepthEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t marketDepth() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 3, sizeof(std::int8_t)); + return (val); + } + + NoMDFeedTypes &marketDepth(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 3, &val, sizeof(std::int8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDFeedTypes writer) + { + builder << '{'; + builder << R"("MDFeedType": )"; + builder << '"' << + writer.getMDFeedTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MarketDepth": )"; + builder << +writer.marketDepth(); + + builder << '}'; + + return builder; + } + }; + +private: + NoMDFeedTypes m_noMDFeedTypes; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDFeedTypesId() SBE_NOEXCEPT + { + return 1141; + } + + SBE_NODISCARD inline NoMDFeedTypes &noMDFeedTypes() + { + m_noMDFeedTypes.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + NoMDFeedTypes &noMDFeedTypesCount(const std::uint8_t count) + { + m_noMDFeedTypes.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDFeedTypes; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDFeedTypesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDFeedTypesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDFeedTypesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoInstAttrib + { + 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((std::uint16_t)4); + dimensions.numInGroup((std::uint8_t)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 + { + return *m_positionPtr; + } + + 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 NoInstAttrib &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * InstAttribTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "int"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribTypeId() SBE_NOEXCEPT + { + return 871; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t instAttribTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t instAttribTypeEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t instAttribType() SBE_NOEXCEPT + { + return (std::int8_t)24; + } + + SBE_NODISCARD static const char * InstAttribValueMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t instAttribValueId() SBE_NOEXCEPT + { + return 872; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t instAttribValueSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool instAttribValueInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= instAttribValueSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t instAttribValueEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + private: + InstAttribValue m_instAttribValue; + + public: + SBE_NODISCARD InstAttribValue &instAttribValue() + { + m_instAttribValue.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_instAttribValue; + } + + static SBE_CONSTEXPR std::size_t instAttribValueEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoInstAttrib writer) + { + builder << '{'; + builder << R"("InstAttribValue": )"; + builder << writer.instAttribValue(); + + builder << '}'; + + return builder; + } + }; + +private: + NoInstAttrib m_noInstAttrib; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoInstAttribId() SBE_NOEXCEPT + { + return 870; + } + + SBE_NODISCARD inline NoInstAttrib &noInstAttrib() + { + m_noInstAttrib.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + NoInstAttrib &noInstAttribCount(const std::uint8_t count) + { + m_noInstAttrib.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noInstAttrib; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noInstAttribSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noInstAttribInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noInstAttribSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoLotTypeRules + { + 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((std::uint16_t)5); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 5; + 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 5; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoLotTypeRules &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * LotTypeMetaAttribute(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 lotTypeId() SBE_NOEXCEPT + { + return 1093; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lotTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lotTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= lotTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lotTypeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int8_t lotTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t lotTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t lotTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t lotType() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int8_t)); + return (val); + } + + NoLotTypeRules &lotType(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * MinLotSizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t minLotSizeId() SBE_NOEXCEPT + { + return 1231; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t minLotSizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool minLotSizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= minLotSizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t minLotSizeEncodingOffset() SBE_NOEXCEPT + { + return 1; + } + +private: + DecimalQty m_minLotSize; + +public: + SBE_NODISCARD DecimalQty &minLotSize() + { + m_minLotSize.wrap(m_buffer, m_offset + 1, m_actingVersion, m_bufferLength); + return m_minLotSize; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoLotTypeRules writer) + { + builder << '{'; + builder << R"("LotType": )"; + builder << +writer.lotType(); + + builder << ", "; + builder << R"("MinLotSize": )"; + builder << writer.minLotSize(); + + builder << '}'; + + return builder; + } + }; + +private: + NoLotTypeRules m_noLotTypeRules; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoLotTypeRulesId() SBE_NOEXCEPT + { + return 1234; + } + + SBE_NODISCARD inline NoLotTypeRules &noLotTypeRules() + { + m_noLotTypeRules.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + NoLotTypeRules &noLotTypeRulesCount(const std::uint8_t count) + { + m_noLotTypeRules.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLotTypeRules; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noLotTypeRulesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noLotTypeRulesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noLotTypeRulesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + class NoLegs + { + 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((std::uint16_t)18); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 18; + 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 18; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoLegs &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * LegSecurityIDMetaAttribute(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 legSecurityIDId() SBE_NOEXCEPT + { + return 602; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legSecurityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool legSecurityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legSecurityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legSecurityIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int32_t legSecurityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t legSecurityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t legSecurityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t legSecurityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t legSecurityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoLegs &legSecurityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * LegSecurityIDSourceMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t legSecurityIDSourceId() SBE_NOEXCEPT + { + return 603; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legSecurityIDSourceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool legSecurityIDSourceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legSecurityIDSourceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legSecurityIDSourceEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR char legSecurityIDSourceNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char legSecurityIDSourceMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char legSecurityIDSourceMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t legSecurityIDSourceEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t legSecurityIDSourceLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD const char *legSecurityIDSource() const + { + static const std::uint8_t legSecurityIDSourceValues[] = { 56 }; + + return (const char *)legSecurityIDSourceValues; + } + + SBE_NODISCARD char legSecurityIDSource(const std::uint64_t index) const + { + static const std::uint8_t legSecurityIDSourceValues[] = { 56 }; + + return (char)legSecurityIDSourceValues[index]; + } + + std::uint64_t getLegSecurityIDSource(char *dst, const std::uint64_t length) const + { + static std::uint8_t legSecurityIDSourceValues[] = { 56 }; + std::uint64_t bytesToCopy = length < sizeof(legSecurityIDSourceValues) ? length : sizeof(legSecurityIDSourceValues); + + std::memcpy(dst, legSecurityIDSourceValues, static_cast(bytesToCopy)); + return bytesToCopy; + } + + std::string getLegSecurityIDSourceAsString() const + { + static const std::uint8_t LegSecurityIDSourceValues[] = { 56 }; + + return std::string((const char *)LegSecurityIDSourceValues, 1); + } + + std::string getLegSecurityIDSourceAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getLegSecurityIDSourceAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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(); + } + + SBE_NODISCARD static const char * LegSideMetaAttribute(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 legSideId() SBE_NOEXCEPT + { + return 624; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legSideSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool legSideInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legSideSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legSideEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legSideEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD LegSide::Value legSide() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 4, sizeof(std::uint8_t)); + return LegSide::get((val)); + } + + NoLegs &legSide(const LegSide::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 4, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * LegRatioQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t legRatioQtyId() SBE_NOEXCEPT + { + return 623; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legRatioQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool legRatioQtyInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legRatioQtySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legRatioQtyEncodingOffset() SBE_NOEXCEPT + { + return 5; + } + + static SBE_CONSTEXPR std::int8_t legRatioQtyNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t legRatioQtyMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t legRatioQtyMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t legRatioQtyEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t legRatioQty() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 5, sizeof(std::int8_t)); + return (val); + } + + NoLegs &legRatioQty(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 5, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * LegPriceMetaAttribute(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 legPriceId() SBE_NOEXCEPT + { + return 566; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool legPriceInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legPriceSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legPriceEncodingOffset() SBE_NOEXCEPT + { + return 6; + } + +private: + PRICENULL9 m_legPrice; + +public: + SBE_NODISCARD PRICENULL9 &legPrice() + { + m_legPrice.wrap(m_buffer, m_offset + 6, m_actingVersion, m_bufferLength); + return m_legPrice; + } + + SBE_NODISCARD static const char * LegOptionDeltaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t legOptionDeltaId() SBE_NOEXCEPT + { + return 1017; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t legOptionDeltaSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool legOptionDeltaInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= legOptionDeltaSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t legOptionDeltaEncodingOffset() SBE_NOEXCEPT + { + return 14; + } + +private: + DecimalQty m_legOptionDelta; + +public: + SBE_NODISCARD DecimalQty &legOptionDelta() + { + m_legOptionDelta.wrap(m_buffer, m_offset + 14, m_actingVersion, m_bufferLength); + return m_legOptionDelta; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoLegs writer) + { + builder << '{'; + builder << R"("LegSecurityID": )"; + builder << +writer.legSecurityID(); + + builder << ", "; + builder << R"("LegSide": )"; + builder << '"' << writer.legSide() << '"'; + + builder << ", "; + builder << R"("LegRatioQty": )"; + builder << +writer.legRatioQty(); + + builder << ", "; + builder << R"("LegPrice": )"; + builder << writer.legPrice(); + + builder << ", "; + builder << R"("LegOptionDelta": )"; + builder << writer.legOptionDelta(); + + builder << '}'; + + return builder; + } + }; + +private: + NoLegs m_noLegs; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoLegsId() SBE_NOEXCEPT + { + return 555; + } + + SBE_NODISCARD inline NoLegs &noLegs() + { + m_noLegs.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLegs; + } + + NoLegs &noLegsCount(const std::uint8_t count) + { + m_noLegs.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noLegs; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noLegsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noLegsInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noLegsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MDInstrumentDefinitionSpread56 _writer) + { + MDInstrumentDefinitionSpread56 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "MDInstrumentDefinitionSpread56", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + builder << R"("TotNumReports": )"; + builder << +writer.totNumReports(); + + builder << ", "; + builder << R"("SecurityUpdateAction": )"; + builder << '"' << writer.securityUpdateAction() << '"'; + + builder << ", "; + builder << R"("LastUpdateTime": )"; + builder << +writer.lastUpdateTime(); + + builder << ", "; + builder << R"("MDSecurityTradingStatus": )"; + builder << '"' << writer.mDSecurityTradingStatus() << '"'; + + builder << ", "; + builder << R"("ApplID": )"; + builder << +writer.applID(); + + builder << ", "; + builder << R"("MarketSegmentID": )"; + builder << +writer.marketSegmentID(); + + builder << ", "; + builder << R"("UnderlyingProduct": )"; + builder << +writer.underlyingProduct(); + + builder << ", "; + builder << R"("SecurityExchange": )"; + builder << '"' << + writer.getSecurityExchangeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityGroup": )"; + builder << '"' << + writer.getSecurityGroupAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Asset": )"; + builder << '"' << + writer.getAssetAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Symbol": )"; + builder << '"' << + writer.getSymbolAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("SecurityType": )"; + builder << '"' << + writer.getSecurityTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("CFICode": )"; + builder << '"' << + writer.getCFICodeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MaturityMonthYear": )"; + builder << writer.maturityMonthYear(); + + builder << ", "; + builder << R"("Currency": )"; + builder << '"' << + writer.getCurrencyAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecuritySubType": )"; + builder << '"' << + writer.getSecuritySubTypeAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("UserDefinedInstrument": )"; + if (std::isprint(writer.userDefinedInstrument())) + { + builder << '"' << (char)writer.userDefinedInstrument() << '"'; + } + else + { + builder << (int)writer.userDefinedInstrument(); + } + + builder << ", "; + builder << R"("MatchAlgorithm": )"; + if (std::isprint(writer.matchAlgorithm())) + { + builder << '"' << (char)writer.matchAlgorithm() << '"'; + } + else + { + builder << (int)writer.matchAlgorithm(); + } + + builder << ", "; + builder << R"("MinTradeVol": )"; + builder << +writer.minTradeVol(); + + builder << ", "; + builder << R"("MaxTradeVol": )"; + builder << +writer.maxTradeVol(); + + builder << ", "; + builder << R"("MinPriceIncrement": )"; + builder << writer.minPriceIncrement(); + + builder << ", "; + builder << R"("DisplayFactor": )"; + builder << writer.displayFactor(); + + builder << ", "; + builder << R"("PriceDisplayFormat": )"; + builder << +writer.priceDisplayFormat(); + + builder << ", "; + builder << R"("PriceRatio": )"; + builder << writer.priceRatio(); + + builder << ", "; + builder << R"("TickRule": )"; + builder << +writer.tickRule(); + + builder << ", "; + builder << R"("UnitOfMeasure": )"; + builder << '"' << + writer.getUnitOfMeasureAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("TradingReferencePrice": )"; + builder << writer.tradingReferencePrice(); + + builder << ", "; + builder << R"("SettlPriceType": )"; + builder << writer.settlPriceType(); + + builder << ", "; + builder << R"("OpenInterestQty": )"; + builder << +writer.openInterestQty(); + + builder << ", "; + builder << R"("ClearedVolume": )"; + builder << +writer.clearedVolume(); + + builder << ", "; + builder << R"("HighLimitPrice": )"; + builder << writer.highLimitPrice(); + + builder << ", "; + builder << R"("LowLimitPrice": )"; + builder << writer.lowLimitPrice(); + + builder << ", "; + builder << R"("MaxPriceVariation": )"; + builder << writer.maxPriceVariation(); + + builder << ", "; + builder << R"("MainFraction": )"; + builder << +writer.mainFraction(); + + builder << ", "; + builder << R"("SubFraction": )"; + builder << +writer.subFraction(); + + builder << ", "; + builder << R"("TradingReferenceDate": )"; + builder << +writer.tradingReferenceDate(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoEvents": [)"; + writer.noEvents().forEach([&](NoEvents& noEvents) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noEvents; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDFeedTypes": [)"; + writer.noMDFeedTypes().forEach([&](NoMDFeedTypes& noMDFeedTypes) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDFeedTypes; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoInstAttrib": [)"; + writer.noInstAttrib().forEach([&](NoInstAttrib& noInstAttrib) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noInstAttrib; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoLotTypeRules": [)"; + writer.noLotTypeRules().forEach([&](NoLotTypeRules& noLotTypeRules) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLotTypeRules; + }); + builder << ']'; + } + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoLegs": [)"; + writer.noLegs().forEach([&](NoLegs& noLegs) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noLegs; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDUpdateAction.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDUpdateAction.h new file mode 100644 index 000000000..f4b15dcb1 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MDUpdateAction.h @@ -0,0 +1,150 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MDUPDATEACTION_H_ +#define _MKTDATA_MDUPDATEACTION_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class MDUpdateAction +{ +public: + enum Value + { + New = (std::uint8_t)0, + Change = (std::uint8_t)1, + Delete = (std::uint8_t)2, + DeleteThru = (std::uint8_t)3, + DeleteFrom = (std::uint8_t)4, + Overlay = (std::uint8_t)5, + NULL_VALUE = (std::uint8_t)255 + }; + + static MDUpdateAction::Value get(const std::uint8_t value) + { + switch (value) + { + case 0: return New; + case 1: return Change; + case 2: return Delete; + case 3: return DeleteThru; + case 4: return DeleteFrom; + case 5: return Overlay; + case 255: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum MDUpdateAction [E103]"); + } + + static const char* c_str(const MDUpdateAction::Value value) + { + switch (value) + { + case New: return "New"; + case Change: return "Change"; + case Delete: return "Delete"; + case DeleteThru: return "DeleteThru"; + case DeleteFrom: return "DeleteFrom"; + case Overlay: return "Overlay"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum MDUpdateAction [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, MDUpdateAction::Value m) + { + return os << MDUpdateAction::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MatchEventIndicator.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MatchEventIndicator.h new file mode 100644 index 000000000..e16dbb17d --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MatchEventIndicator.h @@ -0,0 +1,515 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MATCHEVENTINDICATOR_H_ +#define _MKTDATA_MATCHEVENTINDICATOR_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class MatchEventIndicator +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MatchEventIndicator() = default; + + MatchEventIndicator( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 1) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + MatchEventIndicator( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + MatchEventIndicator(buffer, 0, bufferLength, actingVersion) + { + } + + MatchEventIndicator( + char *buffer, + const std::uint64_t bufferLength) : + MatchEventIndicator(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + MatchEventIndicator &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MatchEventIndicator(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + MatchEventIndicator &clear() + { + std::uint8_t zero = 0; + std::memcpy(m_buffer + m_offset, &zero, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD bool isEmpty() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return 0 == val; + } + + SBE_NODISCARD std::uint8_t rawValue() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return val; + } + + MatchEventIndicator &rawValue(std::uint8_t value) + { + std::memcpy(m_buffer + m_offset, &value, sizeof(std::uint8_t)); + return *this; + } + + static bool lastTradeMsg(const std::uint8_t bits) + { + return (bits & (1u << 0u)) != 0; + } + + static std::uint8_t lastTradeMsg(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 0u)) : static_cast(bits & ~(1u << 0u)); + } + + SBE_NODISCARD bool lastTradeMsg() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 0u)) != 0; + } + + MatchEventIndicator &lastTradeMsg(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 0u)) : static_cast((bits) & ~(1u << 0u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool lastVolumeMsg(const std::uint8_t bits) + { + return (bits & (1u << 1u)) != 0; + } + + static std::uint8_t lastVolumeMsg(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 1u)) : static_cast(bits & ~(1u << 1u)); + } + + SBE_NODISCARD bool lastVolumeMsg() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 1u)) != 0; + } + + MatchEventIndicator &lastVolumeMsg(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 1u)) : static_cast((bits) & ~(1u << 1u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool lastQuoteMsg(const std::uint8_t bits) + { + return (bits & (1u << 2u)) != 0; + } + + static std::uint8_t lastQuoteMsg(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 2u)) : static_cast(bits & ~(1u << 2u)); + } + + SBE_NODISCARD bool lastQuoteMsg() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 2u)) != 0; + } + + MatchEventIndicator &lastQuoteMsg(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 2u)) : static_cast((bits) & ~(1u << 2u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool lastStatsMsg(const std::uint8_t bits) + { + return (bits & (1u << 3u)) != 0; + } + + static std::uint8_t lastStatsMsg(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 3u)) : static_cast(bits & ~(1u << 3u)); + } + + SBE_NODISCARD bool lastStatsMsg() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 3u)) != 0; + } + + MatchEventIndicator &lastStatsMsg(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 3u)) : static_cast((bits) & ~(1u << 3u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool lastImpliedMsg(const std::uint8_t bits) + { + return (bits & (1u << 4u)) != 0; + } + + static std::uint8_t lastImpliedMsg(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 4u)) : static_cast(bits & ~(1u << 4u)); + } + + SBE_NODISCARD bool lastImpliedMsg() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 4u)) != 0; + } + + MatchEventIndicator &lastImpliedMsg(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 4u)) : static_cast((bits) & ~(1u << 4u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool recoveryMsg(const std::uint8_t bits) + { + return (bits & (1u << 5u)) != 0; + } + + static std::uint8_t recoveryMsg(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 5u)) : static_cast(bits & ~(1u << 5u)); + } + + SBE_NODISCARD bool recoveryMsg() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 5u)) != 0; + } + + MatchEventIndicator &recoveryMsg(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 5u)) : static_cast((bits) & ~(1u << 5u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool reserved(const std::uint8_t bits) + { + return (bits & (1u << 6u)) != 0; + } + + static std::uint8_t reserved(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 6u)) : static_cast(bits & ~(1u << 6u)); + } + + SBE_NODISCARD bool reserved() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 6u)) != 0; + } + + MatchEventIndicator &reserved(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 6u)) : static_cast((bits) & ~(1u << 6u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool endOfEvent(const std::uint8_t bits) + { + return (bits & (1u << 7u)) != 0; + } + + static std::uint8_t endOfEvent(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 7u)) : static_cast(bits & ~(1u << 7u)); + } + + SBE_NODISCARD bool endOfEvent() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 7u)) != 0; + } + + MatchEventIndicator &endOfEvent(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 7u)) : static_cast((bits) & ~(1u << 7u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MatchEventIndicator writer) + { + builder << '['; + bool atLeastOne = false; + if (writer.lastTradeMsg()) + { + builder << R"("lastTradeMsg")"; + atLeastOne = true; + } + if (writer.lastVolumeMsg()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("lastVolumeMsg")"; + atLeastOne = true; + } + if (writer.lastQuoteMsg()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("lastQuoteMsg")"; + atLeastOne = true; + } + if (writer.lastStatsMsg()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("lastStatsMsg")"; + atLeastOne = true; + } + if (writer.lastImpliedMsg()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("lastImpliedMsg")"; + atLeastOne = true; + } + if (writer.recoveryMsg()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("recoveryMsg")"; + atLeastOne = true; + } + if (writer.reserved()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("reserved")"; + atLeastOne = true; + } + if (writer.endOfEvent()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("endOfEvent")"; + } + builder << ']'; + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MaturityMonthYear.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MaturityMonthYear.h new file mode 100644 index 000000000..cf9216ffc --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MaturityMonthYear.h @@ -0,0 +1,491 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MATURITYMONTHYEAR_H_ +#define _MKTDATA_MATURITYMONTHYEAR_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class MaturityMonthYear +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MaturityMonthYear() = default; + + MaturityMonthYear( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 5) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + MaturityMonthYear( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + MaturityMonthYear(buffer, 0, bufferLength, actingVersion) + { + } + + MaturityMonthYear( + char *buffer, + const std::uint64_t bufferLength) : + MaturityMonthYear(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + MaturityMonthYear &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MaturityMonthYear(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 5; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * yearMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t yearSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool yearInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= yearSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t yearEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint16_t yearNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t yearMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t yearMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t yearEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t year() 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); + } + + MaturityMonthYear &year(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 * monthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t monthSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool monthInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= monthSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t monthEncodingOffset() SBE_NOEXCEPT + { + return 2; + } + + static SBE_CONSTEXPR std::uint8_t monthNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t monthMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t monthMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t monthEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t month() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 2, sizeof(std::uint8_t)); + return (val); + } + + MaturityMonthYear &month(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 2, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * dayMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t daySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool dayInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= daySinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t dayEncodingOffset() SBE_NOEXCEPT + { + return 3; + } + + static SBE_CONSTEXPR std::uint8_t dayNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t dayMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t dayMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t dayEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t day() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 3, sizeof(std::uint8_t)); + return (val); + } + + MaturityMonthYear &day(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 3, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * weekMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t weekSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool weekInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= weekSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t weekEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint8_t weekNullValue() SBE_NOEXCEPT + { + return (std::uint8_t)255; + } + + static SBE_CONSTEXPR std::uint8_t weekMinValue() SBE_NOEXCEPT + { + return (std::uint8_t)0; + } + + static SBE_CONSTEXPR std::uint8_t weekMaxValue() SBE_NOEXCEPT + { + return (std::uint8_t)254; + } + + static SBE_CONSTEXPR std::size_t weekEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint8_t week() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 4, sizeof(std::uint8_t)); + return (val); + } + + MaturityMonthYear &week(const std::uint8_t value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 4, &val, sizeof(std::uint8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MaturityMonthYear writer) + { + builder << '{'; + builder << R"("year": )"; + builder << +writer.year(); + + builder << ", "; + builder << R"("month": )"; + builder << +writer.month(); + + builder << ", "; + builder << R"("day": )"; + builder << +writer.day(); + + builder << ", "; + builder << R"("week": )"; + builder << +writer.week(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/MessageHeader.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MessageHeader.h new file mode 100644 index 000000000..5c1c9ea95 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/MessageHeader.h @@ -0,0 +1,491 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_MESSAGEHEADER_H_ +#define _MKTDATA_MESSAGEHEADER_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class MessageHeader +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + MessageHeader() = default; + + MessageHeader( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 8) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + MessageHeader( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + MessageHeader(buffer, 0, bufferLength, actingVersion) + { + } + + MessageHeader( + char *buffer, + const std::uint64_t bufferLength) : + MessageHeader(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + MessageHeader &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = MessageHeader(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * blockLengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t blockLengthSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool blockLengthInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= blockLengthSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t blockLengthEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint16_t blockLengthNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT16; + } + + static SBE_CONSTEXPR std::uint16_t blockLengthMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t blockLengthMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t blockLengthEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t blockLength() 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); + } + + MessageHeader &blockLength(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 * templateIdMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t templateIdSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool templateIdInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= templateIdSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t templateIdEncodingOffset() SBE_NOEXCEPT + { + return 2; + } + + static SBE_CONSTEXPR std::uint16_t templateIdNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT16; + } + + static SBE_CONSTEXPR std::uint16_t templateIdMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t templateIdMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t templateIdEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t templateId() 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); + } + + MessageHeader &templateId(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; + } + + SBE_NODISCARD static const char * schemaIdMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t schemaIdSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool schemaIdInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= schemaIdSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t schemaIdEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint16_t schemaIdNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT16; + } + + static SBE_CONSTEXPR std::uint16_t schemaIdMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t schemaIdMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t schemaIdEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t schemaId() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 4, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MessageHeader &schemaId(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 4, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char * versionMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t versionSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool versionInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= versionSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t versionEncodingOffset() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint16_t versionNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT16; + } + + static SBE_CONSTEXPR std::uint16_t versionMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t versionMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t versionEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t version() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 6, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + MessageHeader &version(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 6, &val, sizeof(std::uint16_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, MessageHeader writer) + { + builder << '{'; + builder << R"("blockLength": )"; + builder << +writer.blockLength(); + + builder << ", "; + builder << R"("templateId": )"; + builder << +writer.templateId(); + + builder << ", "; + builder << R"("schemaId": )"; + builder << +writer.schemaId(); + + builder << ", "; + builder << R"("version": )"; + builder << +writer.version(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/OpenCloseSettlFlag.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/OpenCloseSettlFlag.h new file mode 100644 index 000000000..1382ee7e6 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/OpenCloseSettlFlag.h @@ -0,0 +1,138 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_OPENCLOSESETTLFLAG_H_ +#define _MKTDATA_OPENCLOSESETTLFLAG_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class OpenCloseSettlFlag +{ +public: + enum Value + { + DailyOpenPrice = (std::uint8_t)0, + IndicativeOpeningPrice = (std::uint8_t)5, + NULL_VALUE = (std::uint8_t)255 + }; + + static OpenCloseSettlFlag::Value get(const std::uint8_t value) + { + switch (value) + { + case 0: return DailyOpenPrice; + case 5: return IndicativeOpeningPrice; + case 255: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum OpenCloseSettlFlag [E103]"); + } + + static const char* c_str(const OpenCloseSettlFlag::Value value) + { + switch (value) + { + case DailyOpenPrice: return "DailyOpenPrice"; + case IndicativeOpeningPrice: return "IndicativeOpeningPrice"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum OpenCloseSettlFlag [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, OpenCloseSettlFlag::Value m) + { + return os << OpenCloseSettlFlag::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/OrderUpdateAction.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/OrderUpdateAction.h new file mode 100644 index 000000000..e78e4b2e3 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/OrderUpdateAction.h @@ -0,0 +1,141 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_ORDERUPDATEACTION_H_ +#define _MKTDATA_ORDERUPDATEACTION_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class OrderUpdateAction +{ +public: + enum Value + { + New = (std::uint8_t)0, + Update = (std::uint8_t)1, + Delete = (std::uint8_t)2, + NULL_VALUE = (std::uint8_t)255 + }; + + static OrderUpdateAction::Value get(const std::uint8_t value) + { + switch (value) + { + case 0: return New; + case 1: return Update; + case 2: return Delete; + case 255: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum OrderUpdateAction [E103]"); + } + + static const char* c_str(const OrderUpdateAction::Value value) + { + switch (value) + { + case New: return "New"; + case Update: return "Update"; + case Delete: return "Delete"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum OrderUpdateAction [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, OrderUpdateAction::Value m) + { + return os << OrderUpdateAction::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICE.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICE.h new file mode 100644 index 000000000..ed6476491 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICE.h @@ -0,0 +1,340 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_PRICE_H_ +#define _MKTDATA_PRICE_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class PRICE +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + PRICE() = default; + + PRICE( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 8) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + PRICE( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + PRICE(buffer, 0, bufferLength, actingVersion) + { + } + + PRICE( + char *buffer, + const std::uint64_t bufferLength) : + PRICE(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + PRICE &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = PRICE(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mantissaSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mantissaEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int64_t mantissaNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT64; + } + + static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT + { + return -9223372036854775807L; + } + + static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT + { + return 9223372036854775807L; + } + + static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::int64_t mantissa() const SBE_NOEXCEPT + { + std::int64_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + PRICE &mantissa(const std::int64_t value) SBE_NOEXCEPT + { + std::int64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int64_t)); + return *this; + } + + SBE_NODISCARD static const char * exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= exponentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t exponentEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t exponent() SBE_NOEXCEPT + { + return (std::int8_t)-7; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, PRICE writer) + { + builder << '{'; + builder << R"("mantissa": )"; + builder << +writer.mantissa(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICE9.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICE9.h new file mode 100644 index 000000000..2eafe59f9 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICE9.h @@ -0,0 +1,340 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_PRICE9_H_ +#define _MKTDATA_PRICE9_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class PRICE9 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + PRICE9() = default; + + PRICE9( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 8) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + PRICE9( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + PRICE9(buffer, 0, bufferLength, actingVersion) + { + } + + PRICE9( + char *buffer, + const std::uint64_t bufferLength) : + PRICE9(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + PRICE9 &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = PRICE9(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mantissaSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mantissaEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int64_t mantissaNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT64; + } + + static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT + { + return -9223372036854775807L; + } + + static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT + { + return 9223372036854775807L; + } + + static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::int64_t mantissa() const SBE_NOEXCEPT + { + std::int64_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + PRICE9 &mantissa(const std::int64_t value) SBE_NOEXCEPT + { + std::int64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int64_t)); + return *this; + } + + SBE_NODISCARD static const char * exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= exponentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t exponentEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t exponent() SBE_NOEXCEPT + { + return (std::int8_t)-9; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, PRICE9 writer) + { + builder << '{'; + builder << R"("mantissa": )"; + builder << +writer.mantissa(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICENULL.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICENULL.h new file mode 100644 index 000000000..4f4136119 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICENULL.h @@ -0,0 +1,340 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_PRICENULL_H_ +#define _MKTDATA_PRICENULL_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class PRICENULL +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + PRICENULL() = default; + + PRICENULL( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 8) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + PRICENULL( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + PRICENULL(buffer, 0, bufferLength, actingVersion) + { + } + + PRICENULL( + char *buffer, + const std::uint64_t bufferLength) : + PRICENULL(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + PRICENULL &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = PRICENULL(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mantissaSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mantissaEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int64_t mantissaNullValue() SBE_NOEXCEPT + { + return 9223372036854775807L; + } + + static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT + { + return -9223372036854775807L; + } + + static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT + { + return 9223372036854775807L; + } + + static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::int64_t mantissa() const SBE_NOEXCEPT + { + std::int64_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + PRICENULL &mantissa(const std::int64_t value) SBE_NOEXCEPT + { + std::int64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int64_t)); + return *this; + } + + SBE_NODISCARD static const char * exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= exponentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t exponentEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t exponent() SBE_NOEXCEPT + { + return (std::int8_t)-7; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, PRICENULL writer) + { + builder << '{'; + builder << R"("mantissa": )"; + builder << +writer.mantissa(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICENULL9.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICENULL9.h new file mode 100644 index 000000000..9b1c05bed --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/PRICENULL9.h @@ -0,0 +1,340 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_PRICENULL9_H_ +#define _MKTDATA_PRICENULL9_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class PRICENULL9 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + PRICENULL9() = default; + + PRICENULL9( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 8) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + PRICENULL9( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + PRICENULL9(buffer, 0, bufferLength, actingVersion) + { + } + + PRICENULL9( + char *buffer, + const std::uint64_t bufferLength) : + PRICENULL9(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + PRICENULL9 &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = PRICENULL9(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static const char * mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mantissaSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mantissaEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::int64_t mantissaNullValue() SBE_NOEXCEPT + { + return 9223372036854775807L; + } + + static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT + { + return -9223372036854775807L; + } + + static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT + { + return 9223372036854775807L; + } + + static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::int64_t mantissa() const SBE_NOEXCEPT + { + std::int64_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + PRICENULL9 &mantissa(const std::int64_t value) SBE_NOEXCEPT + { + std::int64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::int64_t)); + return *this; + } + + SBE_NODISCARD static const char * exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::PRESENCE: return "constant"; + default: return ""; + } + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= exponentSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t exponentEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::int8_t exponent() SBE_NOEXCEPT + { + return (std::int8_t)-9; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, PRICENULL9 writer) + { + builder << '{'; + builder << R"("mantissa": )"; + builder << +writer.mantissa(); + + builder << '}'; + + return builder; + } + +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/PutOrCall.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/PutOrCall.h new file mode 100644 index 000000000..d6813eb0f --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/PutOrCall.h @@ -0,0 +1,138 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_PUTORCALL_H_ +#define _MKTDATA_PUTORCALL_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class PutOrCall +{ +public: + enum Value + { + Put = (std::uint8_t)0, + Call = (std::uint8_t)1, + NULL_VALUE = (std::uint8_t)255 + }; + + static PutOrCall::Value get(const std::uint8_t value) + { + switch (value) + { + case 0: return Put; + case 1: return Call; + case 255: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum PutOrCall [E103]"); + } + + static const char* c_str(const PutOrCall::Value value) + { + switch (value) + { + case Put: return "Put"; + case Call: return "Call"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum PutOrCall [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, PutOrCall::Value m) + { + return os << PutOrCall::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/QuoteRequest39.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/QuoteRequest39.h new file mode 100644 index 000000000..0f584e33c --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/QuoteRequest39.h @@ -0,0 +1,1383 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_QUOTEREQUEST39_H_ +#define _MKTDATA_QUOTEREQUEST39_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class QuoteRequest39 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + QuoteRequest39() = default; + + QuoteRequest39( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + QuoteRequest39(char *buffer, const std::uint64_t bufferLength) : + QuoteRequest39(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + QuoteRequest39( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + QuoteRequest39(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)35; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)39; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "R"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + QuoteRequest39 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = QuoteRequest39(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + QuoteRequest39 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = QuoteRequest39( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + QuoteRequest39 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = QuoteRequest39(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + QuoteRequest39 &transactTime(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 * QuoteReqIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t quoteReqIDId() SBE_NOEXCEPT + { + return 131; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t quoteReqIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool quoteReqIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= quoteReqIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t quoteReqIDEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR char quoteReqIDNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char quoteReqIDMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char quoteReqIDMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t quoteReqIDEncodingLength() SBE_NOEXCEPT + { + return 23; + } + + static SBE_CONSTEXPR std::uint64_t quoteReqIDLength() SBE_NOEXCEPT + { + return 23; + } + + SBE_NODISCARD const char *quoteReqID() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 8; + } + + SBE_NODISCARD char *quoteReqID() SBE_NOEXCEPT + { + return m_buffer + m_offset + 8; + } + + SBE_NODISCARD char quoteReqID(const std::uint64_t index) const + { + if (index >= 23) + { + throw std::runtime_error("index out of range for quoteReqID [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 8 + (index * 1), sizeof(char)); + return (val); + } + + QuoteRequest39 "eReqID(const std::uint64_t index, const char value) + { + if (index >= 23) + { + throw std::runtime_error("index out of range for quoteReqID [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 8 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getQuoteReqID(char *const dst, const std::uint64_t length) const + { + if (length > 23) + { + throw std::runtime_error("length too large for getQuoteReqID [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 8, sizeof(char) * static_cast(length)); + return length; + } + + QuoteRequest39 &putQuoteReqID(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 8, src, sizeof(char) * 23); + return *this; + } + + std::string getQuoteReqIDAsString() const + { + const char *buffer = m_buffer + m_offset + 8; + size_t length = 0; + + for (; length < 23 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getQuoteReqIDAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getQuoteReqIDAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getQuoteReqIDAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 8; + size_t length = 0; + + for (; length < 23 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + QuoteRequest39 &putQuoteReqID(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 23) + { + throw std::runtime_error("string too large for putQuoteReqID [E106]"); + } + + std::memcpy(m_buffer + m_offset + 8, str.data(), srcLength); + for (size_t start = srcLength; start < 23; ++start) + { + m_buffer[m_offset + 8 + start] = 0; + } + + return *this; + } + #else + QuoteRequest39 &putQuoteReqID(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 23) + { + throw std::runtime_error("string too large for putQuoteReqID [E106]"); + } + + std::memcpy(m_buffer + m_offset + 8, str.c_str(), srcLength); + for (size_t start = srcLength; start < 23; ++start) + { + m_buffer[m_offset + 8 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 31; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 31, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + class NoRelatedSym + { + 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((std::uint16_t)32); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 32; + 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 32; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoRelatedSym &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * SymbolMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t symbolId() SBE_NOEXCEPT + { + return 55; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t symbolSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool symbolInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= symbolSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t symbolEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR char symbolNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char symbolMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char symbolMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t symbolEncodingLength() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t symbolLength() SBE_NOEXCEPT + { + return 20; + } + + SBE_NODISCARD const char *symbol() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char *symbol() SBE_NOEXCEPT + { + return m_buffer + m_offset + 0; + } + + SBE_NODISCARD char symbol(const std::uint64_t index) const + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 0 + (index * 1), sizeof(char)); + return (val); + } + + NoRelatedSym &symbol(const std::uint64_t index, const char value) + { + if (index >= 20) + { + throw std::runtime_error("index out of range for symbol [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 0 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSymbol(char *const dst, const std::uint64_t length) const + { + if (length > 20) + { + throw std::runtime_error("length too large for getSymbol [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 0, sizeof(char) * static_cast(length)); + return length; + } + + NoRelatedSym &putSymbol(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 0, src, sizeof(char) * 20); + return *this; + } + + std::string getSymbolAsString() const + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSymbolAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSymbolAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSymbolAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 0; + size_t length = 0; + + for (; length < 20 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + NoRelatedSym &putSymbol(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.data(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #else + NoRelatedSym &putSymbol(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 20) + { + throw std::runtime_error("string too large for putSymbol [E106]"); + } + + std::memcpy(m_buffer + m_offset + 0, str.c_str(), srcLength); + for (size_t start = srcLength; start < 20; ++start) + { + m_buffer[m_offset + 0 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= securityIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoRelatedSym &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * OrderQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t orderQtyId() SBE_NOEXCEPT + { + return 38; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t orderQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool orderQtyInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= orderQtySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderQtyEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::int32_t orderQtyNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t orderQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t orderQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t orderQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t orderQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoRelatedSym &orderQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * QuoteTypeMetaAttribute(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 quoteTypeId() SBE_NOEXCEPT + { + return 537; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t quoteTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool quoteTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= quoteTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t quoteTypeEncodingOffset() SBE_NOEXCEPT + { + return 28; + } + + static SBE_CONSTEXPR std::int8_t quoteTypeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT8; + } + + static SBE_CONSTEXPR std::int8_t quoteTypeMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t quoteTypeMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t quoteTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t quoteType() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 28, sizeof(std::int8_t)); + return (val); + } + + NoRelatedSym "eType(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 28, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * SideMetaAttribute(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 sideId() SBE_NOEXCEPT + { + return 54; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t sideSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool sideInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= sideSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t sideEncodingOffset() SBE_NOEXCEPT + { + return 29; + } + + static SBE_CONSTEXPR std::int8_t sideNullValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::int8_t sideMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t sideMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t sideEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t side() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 29, sizeof(std::int8_t)); + return (val); + } + + NoRelatedSym &side(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 29, &val, sizeof(std::int8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoRelatedSym writer) + { + builder << '{'; + builder << R"("Symbol": )"; + builder << '"' << + writer.getSymbolAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("OrderQty": )"; + builder << +writer.orderQty(); + + builder << ", "; + builder << R"("QuoteType": )"; + builder << +writer.quoteType(); + + builder << ", "; + builder << R"("Side": )"; + builder << +writer.side(); + + builder << '}'; + + return builder; + } + }; + +private: + NoRelatedSym m_noRelatedSym; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoRelatedSymId() SBE_NOEXCEPT + { + return 146; + } + + SBE_NODISCARD inline NoRelatedSym &noRelatedSym() + { + m_noRelatedSym.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noRelatedSym; + } + + NoRelatedSym &noRelatedSymCount(const std::uint8_t count) + { + m_noRelatedSym.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noRelatedSym; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noRelatedSymSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noRelatedSymInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noRelatedSymSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, QuoteRequest39 _writer) + { + QuoteRequest39 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "QuoteRequest39", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("QuoteReqID": )"; + builder << '"' << + writer.getQuoteReqIDAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoRelatedSym": [)"; + writer.noRelatedSym().forEach([&](NoRelatedSym& noRelatedSym) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noRelatedSym; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityStatus30.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityStatus30.h new file mode 100644 index 000000000..8e4faca34 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityStatus30.h @@ -0,0 +1,1194 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_SECURITYSTATUS30_H_ +#define _MKTDATA_SECURITYSTATUS30_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class SecurityStatus30 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + SecurityStatus30() = default; + + SecurityStatus30( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + SecurityStatus30(char *buffer, const std::uint64_t bufferLength) : + SecurityStatus30(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + SecurityStatus30( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + SecurityStatus30(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)30; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)30; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "f"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SecurityStatus30 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = SecurityStatus30(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + SecurityStatus30 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = SecurityStatus30( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + SecurityStatus30 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = SecurityStatus30(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() 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); + } + + SecurityStatus30 &transactTime(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 * SecurityGroupMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityGroupId() SBE_NOEXCEPT + { + return 1151; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityGroupSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityGroupInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityGroupSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityGroupEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR char securityGroupNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char securityGroupMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char securityGroupMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t securityGroupEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t securityGroupLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *securityGroup() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 8; + } + + SBE_NODISCARD char *securityGroup() SBE_NOEXCEPT + { + return m_buffer + m_offset + 8; + } + + SBE_NODISCARD char securityGroup(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 8 + (index * 1), sizeof(char)); + return (val); + } + + SecurityStatus30 &securityGroup(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for securityGroup [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 8 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getSecurityGroup(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getSecurityGroup [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 8, sizeof(char) * static_cast(length)); + return length; + } + + SecurityStatus30 &putSecurityGroup(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 8, src, sizeof(char) * 6); + return *this; + } + + std::string getSecurityGroupAsString() const + { + const char *buffer = m_buffer + m_offset + 8; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getSecurityGroupAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getSecurityGroupAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getSecurityGroupAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 8; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + SecurityStatus30 &putSecurityGroup(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 8, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 8 + start] = 0; + } + + return *this; + } + #else + SecurityStatus30 &putSecurityGroup(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putSecurityGroup [E106]"); + } + + std::memcpy(m_buffer + m_offset + 8, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 8 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * AssetMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t assetId() SBE_NOEXCEPT + { + return 6937; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t assetSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool assetInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= assetSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t assetEncodingOffset() SBE_NOEXCEPT + { + return 14; + } + + static SBE_CONSTEXPR char assetNullValue() SBE_NOEXCEPT + { + return (char)0; + } + + static SBE_CONSTEXPR char assetMinValue() SBE_NOEXCEPT + { + return (char)32; + } + + static SBE_CONSTEXPR char assetMaxValue() SBE_NOEXCEPT + { + return (char)126; + } + + static SBE_CONSTEXPR std::size_t assetEncodingLength() SBE_NOEXCEPT + { + return 6; + } + + static SBE_CONSTEXPR std::uint64_t assetLength() SBE_NOEXCEPT + { + return 6; + } + + SBE_NODISCARD const char *asset() const SBE_NOEXCEPT + { + return m_buffer + m_offset + 14; + } + + SBE_NODISCARD char *asset() SBE_NOEXCEPT + { + return m_buffer + m_offset + 14; + } + + SBE_NODISCARD char asset(const std::uint64_t index) const + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E104]"); + } + + char val; + std::memcpy(&val, m_buffer + m_offset + 14 + (index * 1), sizeof(char)); + return (val); + } + + SecurityStatus30 &asset(const std::uint64_t index, const char value) + { + if (index >= 6) + { + throw std::runtime_error("index out of range for asset [E105]"); + } + + char val = (value); + std::memcpy(m_buffer + m_offset + 14 + (index * 1), &val, sizeof(char)); + return *this; + } + + std::uint64_t getAsset(char *const dst, const std::uint64_t length) const + { + if (length > 6) + { + throw std::runtime_error("length too large for getAsset [E106]"); + } + + std::memcpy(dst, m_buffer + m_offset + 14, sizeof(char) * static_cast(length)); + return length; + } + + SecurityStatus30 &putAsset(const char *const src) SBE_NOEXCEPT + { + std::memcpy(m_buffer + m_offset + 14, src, sizeof(char) * 6); + return *this; + } + + std::string getAssetAsString() const + { + const char *buffer = m_buffer + m_offset + 14; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string result(buffer, length); + + return result; + } + + std::string getAssetAsJsonEscapedString() + { + std::ostringstream oss; + std::string s = getAssetAsString(); + + for (auto c = s.cbegin(); c != s.cend(); c++) + { + 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 + std::string_view getAssetAsStringView() const SBE_NOEXCEPT + { + const char *buffer = m_buffer + m_offset + 14; + size_t length = 0; + + for (; length < 6 && *(buffer + length) != '\0'; ++length); + std::string_view result(buffer, length); + + return result; + } + #endif + + #if __cplusplus >= 201703L + SecurityStatus30 &putAsset(const std::string_view str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 14, str.data(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 14 + start] = 0; + } + + return *this; + } + #else + SecurityStatus30 &putAsset(const std::string& str) + { + const size_t srcLength = str.length(); + if (srcLength > 6) + { + throw std::runtime_error("string too large for putAsset [E106]"); + } + + std::memcpy(m_buffer + m_offset + 14, str.c_str(), srcLength); + for (size_t start = srcLength; start < 6; ++start) + { + m_buffer[m_offset + 14 + start] = 0; + } + + return *this; + } + #endif + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SecurityStatus30 &securityID(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * TradeDateMetaAttribute(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 tradeDateId() SBE_NOEXCEPT + { + return 75; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradeDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradeDateInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradeDateSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradeDateEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::uint16_t tradeDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradeDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradeDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradeDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradeDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + SecurityStatus30 &tradeDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char * MatchEventIndicatorMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t matchEventIndicatorId() SBE_NOEXCEPT + { + return 5799; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t matchEventIndicatorSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool matchEventIndicatorInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= matchEventIndicatorSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingOffset() SBE_NOEXCEPT + { + return 26; + } + +private: + MatchEventIndicator m_matchEventIndicator; + +public: + SBE_NODISCARD MatchEventIndicator &matchEventIndicator() + { + m_matchEventIndicator.wrap(m_buffer, m_offset + 26, m_actingVersion, m_bufferLength); + return m_matchEventIndicator; + } + + static SBE_CONSTEXPR std::size_t matchEventIndicatorEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * SecurityTradingStatusMetaAttribute(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 securityTradingStatusId() SBE_NOEXCEPT + { + return 326; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityTradingStatusSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityTradingStatusInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityTradingStatusSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityTradingStatusEncodingOffset() SBE_NOEXCEPT + { + return 27; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityTradingStatusEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityTradingStatus::Value securityTradingStatus() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 27, sizeof(std::uint8_t)); + return SecurityTradingStatus::get((val)); + } + + SecurityStatus30 &securityTradingStatus(const SecurityTradingStatus::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 27, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * HaltReasonMetaAttribute(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 haltReasonId() SBE_NOEXCEPT + { + return 327; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t haltReasonSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool haltReasonInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= haltReasonSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t haltReasonEncodingOffset() SBE_NOEXCEPT + { + return 28; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t haltReasonEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD HaltReason::Value haltReason() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 28, sizeof(std::uint8_t)); + return HaltReason::get((val)); + } + + SecurityStatus30 &haltReason(const HaltReason::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 28, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityTradingEventMetaAttribute(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 securityTradingEventId() SBE_NOEXCEPT + { + return 1174; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityTradingEventSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityTradingEventInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityTradingEventSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityTradingEventEncodingOffset() SBE_NOEXCEPT + { + return 29; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityTradingEventEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityTradingEvent::Value securityTradingEvent() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 29, sizeof(std::uint8_t)); + return SecurityTradingEvent::get((val)); + } + + SecurityStatus30 &securityTradingEvent(const SecurityTradingEvent::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 29, &val, sizeof(std::uint8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, SecurityStatus30 _writer) + { + SecurityStatus30 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "SecurityStatus30", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("SecurityGroup": )"; + builder << '"' << + writer.getSecurityGroupAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("Asset": )"; + builder << '"' << + writer.getAssetAsJsonEscapedString().c_str() << '"'; + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("TradeDate": )"; + builder << +writer.tradeDate(); + + builder << ", "; + builder << R"("MatchEventIndicator": )"; + builder << writer.matchEventIndicator(); + + builder << ", "; + builder << R"("SecurityTradingStatus": )"; + builder << '"' << writer.securityTradingStatus() << '"'; + + builder << ", "; + builder << R"("HaltReason": )"; + builder << '"' << writer.haltReason() << '"'; + + builder << ", "; + builder << R"("SecurityTradingEvent": )"; + builder << '"' << writer.securityTradingEvent() << '"'; + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityTradingEvent.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityTradingEvent.h new file mode 100644 index 000000000..a6875f73f --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityTradingEvent.h @@ -0,0 +1,147 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_SECURITYTRADINGEVENT_H_ +#define _MKTDATA_SECURITYTRADINGEVENT_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class SecurityTradingEvent +{ +public: + enum Value + { + NoEvent = (std::uint8_t)0, + NoCancel = (std::uint8_t)1, + ResetStatistics = (std::uint8_t)4, + ImpliedMatchingON = (std::uint8_t)5, + ImpliedMatchingOFF = (std::uint8_t)6, + NULL_VALUE = (std::uint8_t)255 + }; + + static SecurityTradingEvent::Value get(const std::uint8_t value) + { + switch (value) + { + case 0: return NoEvent; + case 1: return NoCancel; + case 4: return ResetStatistics; + case 5: return ImpliedMatchingON; + case 6: return ImpliedMatchingOFF; + case 255: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum SecurityTradingEvent [E103]"); + } + + static const char* c_str(const SecurityTradingEvent::Value value) + { + switch (value) + { + case NoEvent: return "NoEvent"; + case NoCancel: return "NoCancel"; + case ResetStatistics: return "ResetStatistics"; + case ImpliedMatchingON: return "ImpliedMatchingON"; + case ImpliedMatchingOFF: return "ImpliedMatchingOFF"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum SecurityTradingEvent [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, SecurityTradingEvent::Value m) + { + return os << SecurityTradingEvent::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityTradingStatus.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityTradingStatus.h new file mode 100644 index 000000000..60f95df13 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityTradingStatus.h @@ -0,0 +1,165 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_SECURITYTRADINGSTATUS_H_ +#define _MKTDATA_SECURITYTRADINGSTATUS_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class SecurityTradingStatus +{ +public: + enum Value + { + TradingHalt = (std::uint8_t)2, + Close = (std::uint8_t)4, + NewPriceIndication = (std::uint8_t)15, + ReadyToTrade = (std::uint8_t)17, + NotAvailableForTrading = (std::uint8_t)18, + UnknownorInvalid = (std::uint8_t)20, + PreOpen = (std::uint8_t)21, + PreCross = (std::uint8_t)24, + Cross = (std::uint8_t)25, + PostClose = (std::uint8_t)26, + NoChange = (std::uint8_t)103, + NULL_VALUE = (std::uint8_t)255 + }; + + static SecurityTradingStatus::Value get(const std::uint8_t value) + { + switch (value) + { + case 2: return TradingHalt; + case 4: return Close; + case 15: return NewPriceIndication; + case 17: return ReadyToTrade; + case 18: return NotAvailableForTrading; + case 20: return UnknownorInvalid; + case 21: return PreOpen; + case 24: return PreCross; + case 25: return Cross; + case 26: return PostClose; + case 103: return NoChange; + case 255: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum SecurityTradingStatus [E103]"); + } + + static const char* c_str(const SecurityTradingStatus::Value value) + { + switch (value) + { + case TradingHalt: return "TradingHalt"; + case Close: return "Close"; + case NewPriceIndication: return "NewPriceIndication"; + case ReadyToTrade: return "ReadyToTrade"; + case NotAvailableForTrading: return "NotAvailableForTrading"; + case UnknownorInvalid: return "UnknownorInvalid"; + case PreOpen: return "PreOpen"; + case PreCross: return "PreCross"; + case Cross: return "Cross"; + case PostClose: return "PostClose"; + case NoChange: return "NoChange"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum SecurityTradingStatus [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, SecurityTradingStatus::Value m) + { + return os << SecurityTradingStatus::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityUpdateAction.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityUpdateAction.h new file mode 100644 index 000000000..ee7c0a182 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SecurityUpdateAction.h @@ -0,0 +1,141 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_SECURITYUPDATEACTION_H_ +#define _MKTDATA_SECURITYUPDATEACTION_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class SecurityUpdateAction +{ +public: + enum Value + { + Add = (char)65, + Delete = (char)68, + Modify = (char)77, + NULL_VALUE = (char)0 + }; + + static SecurityUpdateAction::Value get(const char value) + { + switch (value) + { + case 65: return Add; + case 68: return Delete; + case 77: return Modify; + case 0: return NULL_VALUE; + } + + throw std::runtime_error("unknown value for enum SecurityUpdateAction [E103]"); + } + + static const char* c_str(const SecurityUpdateAction::Value value) + { + switch (value) + { + case Add: return "Add"; + case Delete: return "Delete"; + case Modify: return "Modify"; + case NULL_VALUE: return "NULL_VALUE"; + } + + throw std::runtime_error("unknown value for enum SecurityUpdateAction [E103]:"); + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& os, SecurityUpdateAction::Value m) + { + return os << SecurityUpdateAction::c_str(m); + } +}; + +} + +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/SettlPriceType.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SettlPriceType.h new file mode 100644 index 000000000..dac4d431e --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SettlPriceType.h @@ -0,0 +1,450 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_SETTLPRICETYPE_H_ +#define _MKTDATA_SETTLPRICETYPE_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +namespace mktdata { + +class SettlPriceType +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_actingVersion = 0; + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + SettlPriceType() = default; + + SettlPriceType( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_actingVersion(actingVersion) + { + if (SBE_BOUNDS_CHECK_EXPECT(((m_offset + 1) > m_bufferLength), false)) + { + throw std::runtime_error("buffer too short for flyweight [E107]"); + } + } + + SettlPriceType( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingVersion) : + SettlPriceType(buffer, 0, bufferLength, actingVersion) + { + } + + SettlPriceType( + char *buffer, + const std::uint64_t bufferLength) : + SettlPriceType(buffer, 0, bufferLength, sbeSchemaVersion()) + { + } + + SettlPriceType &wrap( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = SettlPriceType(buffer, offset, bufferLength, actingVersion); + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SettlPriceType &clear() + { + std::uint8_t zero = 0; + std::memcpy(m_buffer + m_offset, &zero, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD bool isEmpty() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return 0 == val; + } + + SBE_NODISCARD std::uint8_t rawValue() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return val; + } + + SettlPriceType &rawValue(std::uint8_t value) + { + std::memcpy(m_buffer + m_offset, &value, sizeof(std::uint8_t)); + return *this; + } + + static bool finalDaily(const std::uint8_t bits) + { + return (bits & (1u << 0u)) != 0; + } + + static std::uint8_t finalDaily(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 0u)) : static_cast(bits & ~(1u << 0u)); + } + + SBE_NODISCARD bool finalDaily() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 0u)) != 0; + } + + SettlPriceType &finalDaily(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 0u)) : static_cast((bits) & ~(1u << 0u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool actual(const std::uint8_t bits) + { + return (bits & (1u << 1u)) != 0; + } + + static std::uint8_t actual(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 1u)) : static_cast(bits & ~(1u << 1u)); + } + + SBE_NODISCARD bool actual() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 1u)) != 0; + } + + SettlPriceType &actual(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 1u)) : static_cast((bits) & ~(1u << 1u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool rounded(const std::uint8_t bits) + { + return (bits & (1u << 2u)) != 0; + } + + static std::uint8_t rounded(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 2u)) : static_cast(bits & ~(1u << 2u)); + } + + SBE_NODISCARD bool rounded() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 2u)) != 0; + } + + SettlPriceType &rounded(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 2u)) : static_cast((bits) & ~(1u << 2u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool intraday(const std::uint8_t bits) + { + return (bits & (1u << 3u)) != 0; + } + + static std::uint8_t intraday(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 3u)) : static_cast(bits & ~(1u << 3u)); + } + + SBE_NODISCARD bool intraday() const + { + if (m_actingVersion < 4) + { + return false; + } + + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 3u)) != 0; + } + + SettlPriceType &intraday(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 3u)) : static_cast((bits) & ~(1u << 3u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool reservedBits(const std::uint8_t bits) + { + return (bits & (1u << 4u)) != 0; + } + + static std::uint8_t reservedBits(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 4u)) : static_cast(bits & ~(1u << 4u)); + } + + SBE_NODISCARD bool reservedBits() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 4u)) != 0; + } + + SettlPriceType &reservedBits(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 4u)) : static_cast((bits) & ~(1u << 4u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + static bool nullValue(const std::uint8_t bits) + { + return (bits & (1u << 7u)) != 0; + } + + static std::uint8_t nullValue(const std::uint8_t bits, const bool value) + { + return value ? static_cast(bits | (1u << 7u)) : static_cast(bits & ~(1u << 7u)); + } + + SBE_NODISCARD bool nullValue() const + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t)); + return ((val) & (1u << 7u)) != 0; + } + + SettlPriceType &nullValue(const bool value) + { + std::uint8_t bits; + std::memcpy(&bits, m_buffer + m_offset, sizeof(std::uint8_t)); + bits = (value ? static_cast((bits) | (1u << 7u)) : static_cast((bits) & ~(1u << 7u))); + std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, SettlPriceType writer) + { + builder << '['; + bool atLeastOne = false; + if (writer.finalDaily()) + { + builder << R"("finalDaily")"; + atLeastOne = true; + } + if (writer.actual()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("actual")"; + atLeastOne = true; + } + if (writer.rounded()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("rounded")"; + atLeastOne = true; + } + if (writer.intraday()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("intraday")"; + atLeastOne = true; + } + if (writer.reservedBits()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("reservedBits")"; + atLeastOne = true; + } + if (writer.nullValue()) + { + if (atLeastOne) + { + builder << ","; + } + builder << R"("nullValue")"; + } + builder << ']'; + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefresh38.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefresh38.h new file mode 100644 index 000000000..20251d3c4 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefresh38.h @@ -0,0 +1,1795 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_SNAPSHOTFULLREFRESH38_H_ +#define _MKTDATA_SNAPSHOTFULLREFRESH38_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class SnapshotFullRefresh38 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + SnapshotFullRefresh38() = default; + + SnapshotFullRefresh38( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + SnapshotFullRefresh38(char *buffer, const std::uint64_t bufferLength) : + SnapshotFullRefresh38(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + SnapshotFullRefresh38( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + SnapshotFullRefresh38(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)59; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)38; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "W"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SnapshotFullRefresh38 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = SnapshotFullRefresh38(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + SnapshotFullRefresh38 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = SnapshotFullRefresh38( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + SnapshotFullRefresh38 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = SnapshotFullRefresh38(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * LastMsgSeqNumProcessedMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "SeqNum"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastMsgSeqNumProcessedId() SBE_NOEXCEPT + { + return 369; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastMsgSeqNumProcessedSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastMsgSeqNumProcessedInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastMsgSeqNumProcessedSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastMsgSeqNumProcessedEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t lastMsgSeqNumProcessedEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t lastMsgSeqNumProcessed() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefresh38 &lastMsgSeqNumProcessed(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * TotNumReportsMetaAttribute(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 totNumReportsId() SBE_NOEXCEPT + { + return 911; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t totNumReportsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool totNumReportsInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= totNumReportsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t totNumReportsEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t totNumReportsEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t totNumReports() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 4, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefresh38 &totNumReports(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 4, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() 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); + } + + SnapshotFullRefresh38 &securityID(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 * RptSeqMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "SeqNum"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= rptSeqSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefresh38 &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + SnapshotFullRefresh38 &transactTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * LastUpdateTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastUpdateTimeId() SBE_NOEXCEPT + { + return 779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastUpdateTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastUpdateTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastUpdateTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t lastUpdateTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + SnapshotFullRefresh38 &lastUpdateTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * TradeDateMetaAttribute(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 tradeDateId() SBE_NOEXCEPT + { + return 75; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradeDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradeDateInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradeDateSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradeDateEncodingOffset() SBE_NOEXCEPT + { + return 32; + } + + static SBE_CONSTEXPR std::uint16_t tradeDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradeDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradeDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradeDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradeDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 32, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + SnapshotFullRefresh38 &tradeDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 32, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char * MDSecurityTradingStatusMetaAttribute(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 mDSecurityTradingStatusId() SBE_NOEXCEPT + { + return 1682; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDSecurityTradingStatusSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDSecurityTradingStatusInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mDSecurityTradingStatusSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingOffset() SBE_NOEXCEPT + { + return 34; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityTradingStatus::Value mDSecurityTradingStatus() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 34, sizeof(std::uint8_t)); + return SecurityTradingStatus::get((val)); + } + + SnapshotFullRefresh38 &mDSecurityTradingStatus(const SecurityTradingStatus::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 34, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * HighLimitPriceMetaAttribute(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 highLimitPriceId() SBE_NOEXCEPT + { + return 1149; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t highLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool highLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= highLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t highLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 35; + } + +private: + PRICENULL m_highLimitPrice; + +public: + SBE_NODISCARD PRICENULL &highLimitPrice() + { + m_highLimitPrice.wrap(m_buffer, m_offset + 35, m_actingVersion, m_bufferLength); + return m_highLimitPrice; + } + + SBE_NODISCARD static const char * LowLimitPriceMetaAttribute(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 lowLimitPriceId() SBE_NOEXCEPT + { + return 1148; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lowLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lowLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lowLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lowLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 43; + } + +private: + PRICENULL m_lowLimitPrice; + +public: + SBE_NODISCARD PRICENULL &lowLimitPrice() + { + m_lowLimitPrice.wrap(m_buffer, m_offset + 43, m_actingVersion, m_bufferLength); + return m_lowLimitPrice; + } + + SBE_NODISCARD static const char * MaxPriceVariationMetaAttribute(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 maxPriceVariationId() SBE_NOEXCEPT + { + return 1143; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxPriceVariationSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool maxPriceVariationInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxPriceVariationSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxPriceVariationEncodingOffset() SBE_NOEXCEPT + { + return 51; + } + +private: + PRICENULL m_maxPriceVariation; + +public: + SBE_NODISCARD PRICENULL &maxPriceVariation() + { + m_maxPriceVariation.wrap(m_buffer, m_offset + 51, m_actingVersion, m_bufferLength); + return m_maxPriceVariation; + } + + class NoMDEntries + { + 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((std::uint16_t)22); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 22; + 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 22; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICENULL m_mDEntryPx; + +public: + SBE_NODISCARD PRICENULL &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDEntrySizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntrySizeId() SBE_NOEXCEPT + { + return 271; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntrySizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntrySizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntrySizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDEntrySize() 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); + } + + NoMDEntries &mDEntrySize(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 * NumberOfOrdersMetaAttribute(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 numberOfOrdersId() SBE_NOEXCEPT + { + return 346; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t numberOfOrdersSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool numberOfOrdersInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= numberOfOrdersSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t numberOfOrders() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &numberOfOrders(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * MDPriceLevelMetaAttribute(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 mDPriceLevelId() SBE_NOEXCEPT + { + return 1023; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDPriceLevelSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDPriceLevelInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDPriceLevelSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDPriceLevelEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::int8_t mDPriceLevelNullValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::int8_t mDPriceLevelMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t mDPriceLevelMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t mDPriceLevelEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t mDPriceLevel() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::int8_t)); + return (val); + } + + NoMDEntries &mDPriceLevel(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * TradingReferenceDateMetaAttribute(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 tradingReferenceDateId() SBE_NOEXCEPT + { + return 5796; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferenceDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradingReferenceDateInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= tradingReferenceDateSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingOffset() SBE_NOEXCEPT + { + return 17; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradingReferenceDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 17, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + NoMDEntries &tradingReferenceDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 17, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char * OpenCloseSettlFlagMetaAttribute(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 openCloseSettlFlagId() SBE_NOEXCEPT + { + return 286; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t openCloseSettlFlagSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool openCloseSettlFlagInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= openCloseSettlFlagSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openCloseSettlFlagEncodingOffset() SBE_NOEXCEPT + { + return 19; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openCloseSettlFlagEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD OpenCloseSettlFlag::Value openCloseSettlFlag() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 19, sizeof(std::uint8_t)); + return OpenCloseSettlFlag::get((val)); + } + + NoMDEntries &openCloseSettlFlag(const OpenCloseSettlFlag::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 19, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SettlPriceTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlPriceTypeId() SBE_NOEXCEPT + { + return 731; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlPriceTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlPriceTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= settlPriceTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + private: + SettlPriceType m_settlPriceType; + + public: + SBE_NODISCARD SettlPriceType &settlPriceType() + { + m_settlPriceType.wrap(m_buffer, m_offset + 20, m_actingVersion, m_bufferLength); + return m_settlPriceType; + } + + static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 21; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryType::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 21, sizeof(char)); + return MDEntryType::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryType::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 21, &val, sizeof(char)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDEntrySize": )"; + builder << +writer.mDEntrySize(); + + builder << ", "; + builder << R"("NumberOfOrders": )"; + builder << +writer.numberOfOrders(); + + builder << ", "; + builder << R"("MDPriceLevel": )"; + builder << +writer.mDPriceLevel(); + + builder << ", "; + builder << R"("TradingReferenceDate": )"; + builder << +writer.tradingReferenceDate(); + + builder << ", "; + builder << R"("OpenCloseSettlFlag": )"; + builder << '"' << writer.openCloseSettlFlag() << '"'; + + builder << ", "; + builder << R"("SettlPriceType": )"; + builder << writer.settlPriceType(); + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, SnapshotFullRefresh38 _writer) + { + SnapshotFullRefresh38 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "SnapshotFullRefresh38", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("LastMsgSeqNumProcessed": )"; + builder << +writer.lastMsgSeqNumProcessed(); + + builder << ", "; + builder << R"("TotNumReports": )"; + builder << +writer.totNumReports(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << ", "; + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("LastUpdateTime": )"; + builder << +writer.lastUpdateTime(); + + builder << ", "; + builder << R"("TradeDate": )"; + builder << +writer.tradeDate(); + + builder << ", "; + builder << R"("MDSecurityTradingStatus": )"; + builder << '"' << writer.mDSecurityTradingStatus() << '"'; + + builder << ", "; + builder << R"("HighLimitPrice": )"; + builder << writer.highLimitPrice(); + + builder << ", "; + builder << R"("LowLimitPrice": )"; + builder << writer.lowLimitPrice(); + + builder << ", "; + builder << R"("MaxPriceVariation": )"; + builder << writer.maxPriceVariation(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefresh52.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefresh52.h new file mode 100644 index 000000000..e51e98977 --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefresh52.h @@ -0,0 +1,1795 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_SNAPSHOTFULLREFRESH52_H_ +#define _MKTDATA_SNAPSHOTFULLREFRESH52_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class SnapshotFullRefresh52 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + SnapshotFullRefresh52() = default; + + SnapshotFullRefresh52( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + SnapshotFullRefresh52(char *buffer, const std::uint64_t bufferLength) : + SnapshotFullRefresh52(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + SnapshotFullRefresh52( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + SnapshotFullRefresh52(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)59; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)52; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "W"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SnapshotFullRefresh52 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = SnapshotFullRefresh52(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + SnapshotFullRefresh52 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = SnapshotFullRefresh52( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + SnapshotFullRefresh52 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = SnapshotFullRefresh52(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * LastMsgSeqNumProcessedMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "SeqNum"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastMsgSeqNumProcessedId() SBE_NOEXCEPT + { + return 369; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastMsgSeqNumProcessedSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastMsgSeqNumProcessedInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastMsgSeqNumProcessedSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastMsgSeqNumProcessedEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t lastMsgSeqNumProcessedEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t lastMsgSeqNumProcessed() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefresh52 &lastMsgSeqNumProcessed(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * TotNumReportsMetaAttribute(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 totNumReportsId() SBE_NOEXCEPT + { + return 911; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t totNumReportsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool totNumReportsInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= totNumReportsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t totNumReportsEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t totNumReportsEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t totNumReports() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 4, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefresh52 &totNumReports(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 4, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() 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); + } + + SnapshotFullRefresh52 &securityID(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 * RptSeqMetaAttribute(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 rptSeqId() SBE_NOEXCEPT + { + return 83; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t rptSeqSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool rptSeqInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= rptSeqSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t rptSeqEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t rptSeqMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t rptSeqEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t rptSeq() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefresh52 &rptSeq(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + SnapshotFullRefresh52 &transactTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * LastUpdateTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastUpdateTimeId() SBE_NOEXCEPT + { + return 779; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastUpdateTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastUpdateTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastUpdateTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t lastUpdateTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t lastUpdateTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t lastUpdateTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + SnapshotFullRefresh52 &lastUpdateTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * TradeDateMetaAttribute(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 tradeDateId() SBE_NOEXCEPT + { + return 75; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradeDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradeDateInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= tradeDateSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradeDateEncodingOffset() SBE_NOEXCEPT + { + return 32; + } + + static SBE_CONSTEXPR std::uint16_t tradeDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradeDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradeDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradeDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradeDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 32, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + SnapshotFullRefresh52 &tradeDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 32, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char * MDSecurityTradingStatusMetaAttribute(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 mDSecurityTradingStatusId() SBE_NOEXCEPT + { + return 1682; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDSecurityTradingStatusSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDSecurityTradingStatusInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= mDSecurityTradingStatusSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingOffset() SBE_NOEXCEPT + { + return 34; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDSecurityTradingStatusEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD SecurityTradingStatus::Value mDSecurityTradingStatus() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 34, sizeof(std::uint8_t)); + return SecurityTradingStatus::get((val)); + } + + SnapshotFullRefresh52 &mDSecurityTradingStatus(const SecurityTradingStatus::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 34, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * HighLimitPriceMetaAttribute(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 highLimitPriceId() SBE_NOEXCEPT + { + return 1149; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t highLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool highLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= highLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t highLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 35; + } + +private: + PRICENULL9 m_highLimitPrice; + +public: + SBE_NODISCARD PRICENULL9 &highLimitPrice() + { + m_highLimitPrice.wrap(m_buffer, m_offset + 35, m_actingVersion, m_bufferLength); + return m_highLimitPrice; + } + + SBE_NODISCARD static const char * LowLimitPriceMetaAttribute(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 lowLimitPriceId() SBE_NOEXCEPT + { + return 1148; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lowLimitPriceSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool lowLimitPriceInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lowLimitPriceSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lowLimitPriceEncodingOffset() SBE_NOEXCEPT + { + return 43; + } + +private: + PRICENULL9 m_lowLimitPrice; + +public: + SBE_NODISCARD PRICENULL9 &lowLimitPrice() + { + m_lowLimitPrice.wrap(m_buffer, m_offset + 43, m_actingVersion, m_bufferLength); + return m_lowLimitPrice; + } + + SBE_NODISCARD static const char * MaxPriceVariationMetaAttribute(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 maxPriceVariationId() SBE_NOEXCEPT + { + return 1143; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t maxPriceVariationSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool maxPriceVariationInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= maxPriceVariationSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t maxPriceVariationEncodingOffset() SBE_NOEXCEPT + { + return 51; + } + +private: + PRICENULL9 m_maxPriceVariation; + +public: + SBE_NODISCARD PRICENULL9 &maxPriceVariation() + { + m_maxPriceVariation.wrap(m_buffer, m_offset + 51, m_actingVersion, m_bufferLength); + return m_maxPriceVariation; + } + + class NoMDEntries + { + 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((std::uint16_t)22); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 22; + 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 22; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + +private: + PRICENULL9 m_mDEntryPx; + +public: + SBE_NODISCARD PRICENULL9 &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 0, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDEntrySizeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "optional"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntrySizeId() SBE_NOEXCEPT + { + return 271; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntrySizeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntrySizeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntrySizeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDEntrySizeMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDEntrySizeEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDEntrySize() 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); + } + + NoMDEntries &mDEntrySize(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 * NumberOfOrdersMetaAttribute(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 numberOfOrdersId() SBE_NOEXCEPT + { + return 346; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t numberOfOrdersSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool numberOfOrdersInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= numberOfOrdersSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersNullValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t numberOfOrdersMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t numberOfOrdersEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t numberOfOrders() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &numberOfOrders(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * MDPriceLevelMetaAttribute(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 mDPriceLevelId() SBE_NOEXCEPT + { + return 1023; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDPriceLevelSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDPriceLevelInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDPriceLevelSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDPriceLevelEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::int8_t mDPriceLevelNullValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::int8_t mDPriceLevelMinValue() SBE_NOEXCEPT + { + return (std::int8_t)-127; + } + + static SBE_CONSTEXPR std::int8_t mDPriceLevelMaxValue() SBE_NOEXCEPT + { + return (std::int8_t)127; + } + + static SBE_CONSTEXPR std::size_t mDPriceLevelEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD std::int8_t mDPriceLevel() const SBE_NOEXCEPT + { + std::int8_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::int8_t)); + return (val); + } + + NoMDEntries &mDPriceLevel(const std::int8_t value) SBE_NOEXCEPT + { + std::int8_t val = (value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::int8_t)); + return *this; + } + + SBE_NODISCARD static const char * TradingReferenceDateMetaAttribute(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 tradingReferenceDateId() SBE_NOEXCEPT + { + return 5796; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t tradingReferenceDateSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool tradingReferenceDateInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= tradingReferenceDateSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingOffset() SBE_NOEXCEPT + { + return 17; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateNullValue() SBE_NOEXCEPT + { + return (std::uint16_t)65535; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMinValue() SBE_NOEXCEPT + { + return (std::uint16_t)0; + } + + static SBE_CONSTEXPR std::uint16_t tradingReferenceDateMaxValue() SBE_NOEXCEPT + { + return (std::uint16_t)65534; + } + + static SBE_CONSTEXPR std::size_t tradingReferenceDateEncodingLength() SBE_NOEXCEPT + { + return 2; + } + + SBE_NODISCARD std::uint16_t tradingReferenceDate() const SBE_NOEXCEPT + { + std::uint16_t val; + std::memcpy(&val, m_buffer + m_offset + 17, sizeof(std::uint16_t)); + return SBE_LITTLE_ENDIAN_ENCODE_16(val); + } + + NoMDEntries &tradingReferenceDate(const std::uint16_t value) SBE_NOEXCEPT + { + std::uint16_t val = SBE_LITTLE_ENDIAN_ENCODE_16(value); + std::memcpy(m_buffer + m_offset + 17, &val, sizeof(std::uint16_t)); + return *this; + } + + SBE_NODISCARD static const char * OpenCloseSettlFlagMetaAttribute(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 openCloseSettlFlagId() SBE_NOEXCEPT + { + return 286; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t openCloseSettlFlagSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool openCloseSettlFlagInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= openCloseSettlFlagSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openCloseSettlFlagEncodingOffset() SBE_NOEXCEPT + { + return 19; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t openCloseSettlFlagEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD OpenCloseSettlFlag::Value openCloseSettlFlag() const SBE_NOEXCEPT + { + std::uint8_t val; + std::memcpy(&val, m_buffer + m_offset + 19, sizeof(std::uint8_t)); + return OpenCloseSettlFlag::get((val)); + } + + NoMDEntries &openCloseSettlFlag(const OpenCloseSettlFlag::Value value) SBE_NOEXCEPT + { + std::uint8_t val = (value); + std::memcpy(m_buffer + m_offset + 19, &val, sizeof(std::uint8_t)); + return *this; + } + + SBE_NODISCARD static const char * SettlPriceTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "MultipleCharValue"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t settlPriceTypeId() SBE_NOEXCEPT + { + return 731; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t settlPriceTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool settlPriceTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= settlPriceTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + private: + SettlPriceType m_settlPriceType; + + public: + SBE_NODISCARD SettlPriceType &settlPriceType() + { + m_settlPriceType.wrap(m_buffer, m_offset + 20, m_actingVersion, m_bufferLength); + return m_settlPriceType; + } + + static SBE_CONSTEXPR std::size_t settlPriceTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 21; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryType::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 21, sizeof(char)); + return MDEntryType::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryType::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 21, &val, sizeof(char)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDEntrySize": )"; + builder << +writer.mDEntrySize(); + + builder << ", "; + builder << R"("NumberOfOrders": )"; + builder << +writer.numberOfOrders(); + + builder << ", "; + builder << R"("MDPriceLevel": )"; + builder << +writer.mDPriceLevel(); + + builder << ", "; + builder << R"("TradingReferenceDate": )"; + builder << +writer.tradingReferenceDate(); + + builder << ", "; + builder << R"("OpenCloseSettlFlag": )"; + builder << '"' << writer.openCloseSettlFlag() << '"'; + + builder << ", "; + builder << R"("SettlPriceType": )"; + builder << writer.settlPriceType(); + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, SnapshotFullRefresh52 _writer) + { + SnapshotFullRefresh52 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "SnapshotFullRefresh52", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("LastMsgSeqNumProcessed": )"; + builder << +writer.lastMsgSeqNumProcessed(); + + builder << ", "; + builder << R"("TotNumReports": )"; + builder << +writer.totNumReports(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("RptSeq": )"; + builder << +writer.rptSeq(); + + builder << ", "; + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + builder << R"("LastUpdateTime": )"; + builder << +writer.lastUpdateTime(); + + builder << ", "; + builder << R"("TradeDate": )"; + builder << +writer.tradeDate(); + + builder << ", "; + builder << R"("MDSecurityTradingStatus": )"; + builder << '"' << writer.mDSecurityTradingStatus() << '"'; + + builder << ", "; + builder << R"("HighLimitPrice": )"; + builder << writer.highLimitPrice(); + + builder << ", "; + builder << R"("LowLimitPrice": )"; + builder << writer.lowLimitPrice(); + + builder << ", "; + builder << R"("MaxPriceVariation": )"; + builder << writer.maxPriceVariation(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefreshOrderBook44.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefreshOrderBook44.h new file mode 100644 index 000000000..b3759f97b --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefreshOrderBook44.h @@ -0,0 +1,1321 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_SNAPSHOTFULLREFRESHORDERBOOK44_H_ +#define _MKTDATA_SNAPSHOTFULLREFRESHORDERBOOK44_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class SnapshotFullRefreshOrderBook44 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + SnapshotFullRefreshOrderBook44() = default; + + SnapshotFullRefreshOrderBook44( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + SnapshotFullRefreshOrderBook44(char *buffer, const std::uint64_t bufferLength) : + SnapshotFullRefreshOrderBook44(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + SnapshotFullRefreshOrderBook44( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + SnapshotFullRefreshOrderBook44(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)28; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)44; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "W"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SnapshotFullRefreshOrderBook44 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = SnapshotFullRefreshOrderBook44(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + SnapshotFullRefreshOrderBook44 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = SnapshotFullRefreshOrderBook44( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + SnapshotFullRefreshOrderBook44 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = SnapshotFullRefreshOrderBook44(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * LastMsgSeqNumProcessedMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "SeqNum"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastMsgSeqNumProcessedId() SBE_NOEXCEPT + { + return 369; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastMsgSeqNumProcessedSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastMsgSeqNumProcessedInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastMsgSeqNumProcessedSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastMsgSeqNumProcessedEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t lastMsgSeqNumProcessedEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t lastMsgSeqNumProcessed() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefreshOrderBook44 &lastMsgSeqNumProcessed(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * TotNumReportsMetaAttribute(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 totNumReportsId() SBE_NOEXCEPT + { + return 911; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t totNumReportsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool totNumReportsInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= totNumReportsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t totNumReportsEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t totNumReportsEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t totNumReports() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 4, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefreshOrderBook44 &totNumReports(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 4, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "String"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() 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); + } + + SnapshotFullRefreshOrderBook44 &securityID(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 * NoChunksMetaAttribute(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 noChunksId() SBE_NOEXCEPT + { + return 37709; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noChunksSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noChunksInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noChunksSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t noChunksEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::uint32_t noChunksNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t noChunksMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t noChunksMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t noChunksEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t noChunks() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefreshOrderBook44 &noChunks(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * CurrentChunkMetaAttribute(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 currentChunkId() SBE_NOEXCEPT + { + return 37710; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t currentChunkSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool currentChunkInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= currentChunkSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t currentChunkEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::uint32_t currentChunkNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t currentChunkMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t currentChunkMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t currentChunkEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t currentChunk() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefreshOrderBook44 ¤tChunk(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + SnapshotFullRefreshOrderBook44 &transactTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::uint64_t)); + return *this; + } + + class NoMDEntries + { + 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((std::uint16_t)29); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 29; + 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 29; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * OrderIDMetaAttribute(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 orderIDId() SBE_NOEXCEPT + { + return 37; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t orderIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool orderIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= orderIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t orderIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t orderIDEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t orderID() 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); + } + + NoMDEntries &orderID(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 * MDOrderPriorityMetaAttribute(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 mDOrderPriorityId() SBE_NOEXCEPT + { + return 37707; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDOrderPrioritySinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool mDOrderPriorityInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDOrderPrioritySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityNullValue() SBE_NOEXCEPT + { + return 0xffffffffffffffffL; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t mDOrderPriority() const SBE_NOEXCEPT + { + if (m_actingVersion < 7) + { + return 0xffffffffffffffffL; + } + + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 8, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoMDEntries &mDOrderPriority(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 8, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + +private: + PRICE m_mDEntryPx; + +public: + SBE_NODISCARD PRICE &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 16, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDDisplayQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDDisplayQtyId() SBE_NOEXCEPT + { + return 37706; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDDisplayQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDDisplayQtyInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDDisplayQtySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDDisplayQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &mDDisplayQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 28; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryTypeBook::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 28, sizeof(char)); + return MDEntryTypeBook::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryTypeBook::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 28, &val, sizeof(char)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("OrderID": )"; + builder << +writer.orderID(); + + builder << ", "; + builder << R"("MDOrderPriority": )"; + builder << +writer.mDOrderPriority(); + + builder << ", "; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDDisplayQty": )"; + builder << +writer.mDDisplayQty(); + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, SnapshotFullRefreshOrderBook44 _writer) + { + SnapshotFullRefreshOrderBook44 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "SnapshotFullRefreshOrderBook44", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("LastMsgSeqNumProcessed": )"; + builder << +writer.lastMsgSeqNumProcessed(); + + builder << ", "; + builder << R"("TotNumReports": )"; + builder << +writer.totNumReports(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("NoChunks": )"; + builder << +writer.noChunks(); + + builder << ", "; + builder << R"("CurrentChunk": )"; + builder << +writer.currentChunk(); + + builder << ", "; + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif diff --git a/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefreshOrderBook53.h b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefreshOrderBook53.h new file mode 100644 index 000000000..cdd70ce1d --- /dev/null +++ b/src/server/sparkd/cmds/spartan/md/mdp3_gen/SnapshotFullRefreshOrderBook53.h @@ -0,0 +1,1321 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +#ifndef _MKTDATA_SNAPSHOTFULLREFRESHORDERBOOK53_H_ +#define _MKTDATA_SNAPSHOTFULLREFRESHORDERBOOK53_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 +# include +# include +# include +#endif + +#if __cplusplus >= 201103L +# define SBE_CONSTEXPR constexpr +# define SBE_NOEXCEPT noexcept +#else +# define SBE_CONSTEXPR +# define SBE_NOEXCEPT +#endif + +#if __cplusplus >= 201703L +# 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 + +#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)() +#define SBE_NULLVALUE_INT32 (std::numeric_limits::min)() +#define SBE_NULLVALUE_INT64 (std::numeric_limits::min)() +#define SBE_NULLVALUE_UINT8 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT16 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT32 (std::numeric_limits::max)() +#define SBE_NULLVALUE_UINT64 (std::numeric_limits::max)() + + +#include "MDEntryTypeBook.h" +#include "OpenCloseSettlFlag.h" +#include "MatchEventIndicator.h" +#include "MaturityMonthYear.h" +#include "FLOAT.h" +#include "MDEntryTypeDailyStatistics.h" +#include "EventType.h" +#include "DecimalQty.h" +#include "MDUpdateAction.h" +#include "PRICENULL9.h" +#include "GroupSize8Byte.h" +#include "HaltReason.h" +#include "PRICE9.h" +#include "MDEntryType.h" +#include "PRICENULL.h" +#include "SecurityTradingStatus.h" +#include "LegSide.h" +#include "MessageHeader.h" +#include "PRICE.h" +#include "OrderUpdateAction.h" +#include "PutOrCall.h" +#include "SecurityUpdateAction.h" +#include "SecurityTradingEvent.h" +#include "Decimal9.h" +#include "MDEntryTypeStatistics.h" +#include "InstAttribValue.h" +#include "AggressorSide.h" +#include "GroupSize.h" +#include "SettlPriceType.h" +#include "Decimal9NULL.h" + +namespace mktdata { + +class SnapshotFullRefreshOrderBook53 +{ +private: + char *m_buffer = nullptr; + std::uint64_t m_bufferLength = 0; + std::uint64_t m_offset = 0; + std::uint64_t m_position = 0; + std::uint64_t m_actingVersion = 0; + + inline std::uint64_t *sbePositionPtr() SBE_NOEXCEPT + { + return &m_position; + } + +public: + enum MetaAttribute + { + EPOCH, TIME_UNIT, SEMANTIC_TYPE, PRESENCE + }; + + union sbe_float_as_uint_u + { + float fp_value; + std::uint32_t uint_value; + }; + + union sbe_double_as_uint_u + { + double fp_value; + std::uint64_t uint_value; + }; + + SnapshotFullRefreshOrderBook53() = default; + + SnapshotFullRefreshOrderBook53( + char *buffer, + const std::uint64_t offset, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + m_buffer(buffer), + m_bufferLength(bufferLength), + m_offset(offset), + m_position(sbeCheckPosition(offset + actingBlockLength)), + m_actingVersion(actingVersion) + { + } + + SnapshotFullRefreshOrderBook53(char *buffer, const std::uint64_t bufferLength) : + SnapshotFullRefreshOrderBook53(buffer, 0, bufferLength, sbeBlockLength(), sbeSchemaVersion()) + { + } + + SnapshotFullRefreshOrderBook53( + char *buffer, + const std::uint64_t bufferLength, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion) : + SnapshotFullRefreshOrderBook53(buffer, 0, bufferLength, actingBlockLength, actingVersion) + { + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeBlockLength() SBE_NOEXCEPT + { + return (std::uint16_t)28; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeTemplateId() SBE_NOEXCEPT + { + return (std::uint16_t)53; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT + { + return (std::uint16_t)1; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT + { + return (std::uint16_t)9; + } + + SBE_NODISCARD static SBE_CONSTEXPR const char * sbeSemanticType() SBE_NOEXCEPT + { + return "W"; + } + + SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT + { + return m_offset; + } + + SnapshotFullRefreshOrderBook53 &wrapForEncode(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + return *this = SnapshotFullRefreshOrderBook53(buffer, offset, bufferLength, sbeBlockLength(), sbeSchemaVersion()); + } + + SnapshotFullRefreshOrderBook53 &wrapAndApplyHeader(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength) + { + MessageHeader hdr(buffer, offset, bufferLength, sbeSchemaVersion()); + + hdr + .blockLength(sbeBlockLength()) + .templateId(sbeTemplateId()) + .schemaId(sbeSchemaId()) + .version(sbeSchemaVersion()); + + return *this = SnapshotFullRefreshOrderBook53( + buffer, + offset + MessageHeader::encodedLength(), + bufferLength, + sbeBlockLength(), + sbeSchemaVersion()); + } + + SnapshotFullRefreshOrderBook53 &wrapForDecode( + char *buffer, + const std::uint64_t offset, + const std::uint64_t actingBlockLength, + const std::uint64_t actingVersion, + const std::uint64_t bufferLength) + { + return *this = SnapshotFullRefreshOrderBook53(buffer, offset, bufferLength, actingBlockLength, actingVersion); + } + + SBE_NODISCARD std::uint64_t sbePosition() const SBE_NOEXCEPT + { + return m_position; + } + + 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_position = sbeCheckPosition(position); + } + + SBE_NODISCARD std::uint64_t encodedLength() const SBE_NOEXCEPT + { + return sbePosition() - m_offset; + } + + SBE_NODISCARD const char * buffer() const SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD char * buffer() SBE_NOEXCEPT + { + return m_buffer; + } + + SBE_NODISCARD std::uint64_t bufferLength() const SBE_NOEXCEPT + { + return m_bufferLength; + } + + SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT + { + return m_actingVersion; + } + + SBE_NODISCARD static const char * LastMsgSeqNumProcessedMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "SeqNum"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t lastMsgSeqNumProcessedId() SBE_NOEXCEPT + { + return 369; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lastMsgSeqNumProcessedSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool lastMsgSeqNumProcessedInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= lastMsgSeqNumProcessedSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t lastMsgSeqNumProcessedEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t lastMsgSeqNumProcessedMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t lastMsgSeqNumProcessedEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t lastMsgSeqNumProcessed() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefreshOrderBook53 &lastMsgSeqNumProcessed(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 0, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * TotNumReportsMetaAttribute(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 totNumReportsId() SBE_NOEXCEPT + { + return 911; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t totNumReportsSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool totNumReportsInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= totNumReportsSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t totNumReportsEncodingOffset() SBE_NOEXCEPT + { + return 4; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t totNumReportsMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t totNumReportsEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t totNumReports() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 4, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefreshOrderBook53 &totNumReports(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 4, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * SecurityIDMetaAttribute(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 securityIDId() SBE_NOEXCEPT + { + return 48; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t securityIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool securityIDInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= securityIDSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t securityIDEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::int32_t securityIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t securityIDMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t securityIDMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t securityIDEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t securityID() 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); + } + + SnapshotFullRefreshOrderBook53 &securityID(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 * NoChunksMetaAttribute(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 noChunksId() SBE_NOEXCEPT + { + return 37709; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noChunksSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noChunksInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noChunksSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t noChunksEncodingOffset() SBE_NOEXCEPT + { + return 12; + } + + static SBE_CONSTEXPR std::uint32_t noChunksNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t noChunksMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t noChunksMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t noChunksEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t noChunks() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 12, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefreshOrderBook53 &noChunks(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 12, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * CurrentChunkMetaAttribute(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 currentChunkId() SBE_NOEXCEPT + { + return 37710; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t currentChunkSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool currentChunkInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= currentChunkSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t currentChunkEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + + static SBE_CONSTEXPR std::uint32_t currentChunkNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT32; + } + + static SBE_CONSTEXPR std::uint32_t currentChunkMinValue() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint32_t currentChunkMaxValue() SBE_NOEXCEPT + { + return 4294967294; + } + + static SBE_CONSTEXPR std::size_t currentChunkEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::uint32_t currentChunk() const SBE_NOEXCEPT + { + std::uint32_t val; + std::memcpy(&val, m_buffer + m_offset + 16, sizeof(std::uint32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + SnapshotFullRefreshOrderBook53 ¤tChunk(const std::uint32_t value) SBE_NOEXCEPT + { + std::uint32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 16, &val, sizeof(std::uint32_t)); + return *this; + } + + SBE_NODISCARD static const char * TransactTimeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "UTCTimestamp"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t transactTimeId() SBE_NOEXCEPT + { + return 60; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t transactTimeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool transactTimeInActingVersion() SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= transactTimeSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t transactTimeEncodingOffset() SBE_NOEXCEPT + { + return 20; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t transactTimeMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t transactTimeEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t transactTime() const SBE_NOEXCEPT + { + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 20, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + SnapshotFullRefreshOrderBook53 &transactTime(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 20, &val, sizeof(std::uint64_t)); + return *this; + } + + class NoMDEntries + { + 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((std::uint16_t)29); + dimensions.numInGroup((std::uint8_t)count); + m_index = 0; + m_count = count; + m_blockLength = 29; + 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 29; + } + + SBE_NODISCARD std::uint64_t sbePosition() const + { + return *m_positionPtr; + } + + 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 NoMDEntries &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() SBE_NOEXCEPT + { + m_count = m_index; + GroupSize dimensions(m_buffer, m_initialPosition, m_bufferLength, m_actingVersion); + dimensions.numInGroup((std::uint8_t)m_count); + return m_count; + } + + #if __cplusplus < 201103L + template inline void forEach(Func& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #else + template inline void forEach(Func&& func) + { + while (hasNext()) + { + next(); + func(*this); + } + } + + #endif + + SBE_NODISCARD static const char * OrderIDMetaAttribute(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 orderIDId() SBE_NOEXCEPT + { + return 37; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t orderIDSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool orderIDInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= orderIDSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t orderIDEncodingOffset() SBE_NOEXCEPT + { + return 0; + } + + static SBE_CONSTEXPR std::uint64_t orderIDNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_UINT64; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t orderIDMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t orderIDEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t orderID() 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); + } + + NoMDEntries &orderID(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 * MDOrderPriorityMetaAttribute(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 mDOrderPriorityId() SBE_NOEXCEPT + { + return 37707; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDOrderPrioritySinceVersion() SBE_NOEXCEPT + { + return 7; + } + + SBE_NODISCARD bool mDOrderPriorityInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDOrderPrioritySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingOffset() SBE_NOEXCEPT + { + return 8; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityNullValue() SBE_NOEXCEPT + { + return 0xffffffffffffffffL; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMinValue() SBE_NOEXCEPT + { + return 0x0L; + } + + static SBE_CONSTEXPR std::uint64_t mDOrderPriorityMaxValue() SBE_NOEXCEPT + { + return 0xfffffffffffffffeL; + } + + static SBE_CONSTEXPR std::size_t mDOrderPriorityEncodingLength() SBE_NOEXCEPT + { + return 8; + } + + SBE_NODISCARD std::uint64_t mDOrderPriority() const SBE_NOEXCEPT + { + if (m_actingVersion < 7) + { + return 0xffffffffffffffffL; + } + + std::uint64_t val; + std::memcpy(&val, m_buffer + m_offset + 8, sizeof(std::uint64_t)); + return SBE_LITTLE_ENDIAN_ENCODE_64(val); + } + + NoMDEntries &mDOrderPriority(const std::uint64_t value) SBE_NOEXCEPT + { + std::uint64_t val = SBE_LITTLE_ENDIAN_ENCODE_64(value); + std::memcpy(m_buffer + m_offset + 8, &val, sizeof(std::uint64_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryPxMetaAttribute(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 mDEntryPxId() SBE_NOEXCEPT + { + return 270; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryPxSinceVersion() SBE_NOEXCEPT + { + return 9; + } + + SBE_NODISCARD bool mDEntryPxInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryPxSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryPxEncodingOffset() SBE_NOEXCEPT + { + return 16; + } + +private: + PRICE9 m_mDEntryPx; + +public: + SBE_NODISCARD PRICE9 &mDEntryPx() + { + m_mDEntryPx.wrap(m_buffer, m_offset + 16, m_actingVersion, m_bufferLength); + return m_mDEntryPx; + } + + SBE_NODISCARD static const char * MDDisplayQtyMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "Qty"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDDisplayQtyId() SBE_NOEXCEPT + { + return 37706; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDDisplayQtySinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDDisplayQtyInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDDisplayQtySinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingOffset() SBE_NOEXCEPT + { + return 24; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyNullValue() SBE_NOEXCEPT + { + return SBE_NULLVALUE_INT32; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMinValue() SBE_NOEXCEPT + { + return -2147483647; + } + + static SBE_CONSTEXPR std::int32_t mDDisplayQtyMaxValue() SBE_NOEXCEPT + { + return 2147483647; + } + + static SBE_CONSTEXPR std::size_t mDDisplayQtyEncodingLength() SBE_NOEXCEPT + { + return 4; + } + + SBE_NODISCARD std::int32_t mDDisplayQty() const SBE_NOEXCEPT + { + std::int32_t val; + std::memcpy(&val, m_buffer + m_offset + 24, sizeof(std::int32_t)); + return SBE_LITTLE_ENDIAN_ENCODE_32(val); + } + + NoMDEntries &mDDisplayQty(const std::int32_t value) SBE_NOEXCEPT + { + std::int32_t val = SBE_LITTLE_ENDIAN_ENCODE_32(value); + std::memcpy(m_buffer + m_offset + 24, &val, sizeof(std::int32_t)); + return *this; + } + + SBE_NODISCARD static const char * MDEntryTypeMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT + { + switch (metaAttribute) + { + case MetaAttribute::SEMANTIC_TYPE: return "char"; + case MetaAttribute::PRESENCE: return "required"; + default: return ""; + } + } + + static SBE_CONSTEXPR std::uint16_t mDEntryTypeId() SBE_NOEXCEPT + { + return 269; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mDEntryTypeSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool mDEntryTypeInActingVersion() SBE_NOEXCEPT + { + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + #endif + return m_actingVersion >= mDEntryTypeSinceVersion(); + #if defined(__clang__) + #pragma clang diagnostic pop + #endif + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingOffset() SBE_NOEXCEPT + { + return 28; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::size_t mDEntryTypeEncodingLength() SBE_NOEXCEPT + { + return 1; + } + + SBE_NODISCARD MDEntryTypeBook::Value mDEntryType() const SBE_NOEXCEPT + { + char val; + std::memcpy(&val, m_buffer + m_offset + 28, sizeof(char)); + return MDEntryTypeBook::get((val)); + } + + NoMDEntries &mDEntryType(const MDEntryTypeBook::Value value) SBE_NOEXCEPT + { + char val = (value); + std::memcpy(m_buffer + m_offset + 28, &val, sizeof(char)); + return *this; + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, NoMDEntries writer) + { + builder << '{'; + builder << R"("OrderID": )"; + builder << +writer.orderID(); + + builder << ", "; + builder << R"("MDOrderPriority": )"; + builder << +writer.mDOrderPriority(); + + builder << ", "; + builder << R"("MDEntryPx": )"; + builder << writer.mDEntryPx(); + + builder << ", "; + builder << R"("MDDisplayQty": )"; + builder << +writer.mDDisplayQty(); + + builder << ", "; + builder << R"("MDEntryType": )"; + builder << '"' << writer.mDEntryType() << '"'; + + builder << '}'; + + return builder; + } + }; + +private: + NoMDEntries m_noMDEntries; + +public: + SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t NoMDEntriesId() SBE_NOEXCEPT + { + return 268; + } + + SBE_NODISCARD inline NoMDEntries &noMDEntries() + { + m_noMDEntries.wrapForDecode(m_buffer, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + NoMDEntries &noMDEntriesCount(const std::uint8_t count) + { + m_noMDEntries.wrapForEncode(m_buffer, count, sbePositionPtr(), m_actingVersion, m_bufferLength); + return m_noMDEntries; + } + + SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t noMDEntriesSinceVersion() SBE_NOEXCEPT + { + return 0; + } + + SBE_NODISCARD bool noMDEntriesInActingVersion() const SBE_NOEXCEPT + { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#endif + return m_actingVersion >= noMDEntriesSinceVersion(); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } + + template + friend std::basic_ostream& operator<<( + std::basic_ostream& builder, SnapshotFullRefreshOrderBook53 _writer) + { + SnapshotFullRefreshOrderBook53 writer(_writer.m_buffer, _writer.m_offset, + _writer.m_bufferLength, _writer.sbeBlockLength(), _writer.m_actingVersion); + builder << '{'; + builder << R"("Name": "SnapshotFullRefreshOrderBook53", )"; + builder << R"("sbeTemplateId": )"; + builder << writer.sbeTemplateId(); + builder << ", "; + + builder << R"("LastMsgSeqNumProcessed": )"; + builder << +writer.lastMsgSeqNumProcessed(); + + builder << ", "; + builder << R"("TotNumReports": )"; + builder << +writer.totNumReports(); + + builder << ", "; + builder << R"("SecurityID": )"; + builder << +writer.securityID(); + + builder << ", "; + builder << R"("NoChunks": )"; + builder << +writer.noChunks(); + + builder << ", "; + builder << R"("CurrentChunk": )"; + builder << +writer.currentChunk(); + + builder << ", "; + builder << R"("TransactTime": )"; + builder << +writer.transactTime(); + + builder << ", "; + { + bool atLeastOne = false; + builder << R"("NoMDEntries": [)"; + writer.noMDEntries().forEach([&](NoMDEntries& noMDEntries) + { + if (atLeastOne) + { + builder << ", "; + } + atLeastOne = true; + builder << noMDEntries; + }); + builder << ']'; + } + + builder << '}'; + + return builder; + } +}; +} +#endif