Refactor.

This commit is contained in:
Pedro Pinto committed 2020-06-24 07:32:33 -04:00
1 parent bb259b128a
commit bc4fe19bdb
61 files changed
+77657

No files matched your search

@@ -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
@@ -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 <limits>
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<char, std::numeric_limits<uint16_t>::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 <class T, class C> 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::function<void(PacketHeader const&,spartan::MDP3Msg const &)>,
std::numeric_limits<uint16_t>::max()>
handlers;
};
template <class Handler, class MsgHead, class... MsgTail>
void bind(MDPParser &p, Handler &h) {
p.set_handler<MsgHead>(h);
bind<Handler, MsgTail...>(p, h);
}
template <class Handler> void bind(MDPParser &, Handler &) {}
template <class... M> struct Binder {
template <class Handler> Binder(MDPParser &p, Handler &h) {
bind<Handler, M...>(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<Binder>;
} // namespace spartan
} // namespace bts
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& 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
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& 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
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<size_t>(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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& 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
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, AggressorSide::Value m)
{
return os << AggressorSide::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<class Func> inline void forEach(Func& func)
{
while (hasNext())
{
next();
func(*this);
}
}
#else
template<class Func> 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<size_t>(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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& 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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& 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
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& builder, Decimal9 writer)
{
builder << '{';
builder << R"("mantissa": )";
builder << +writer.mantissa();
builder << '}';
return builder;
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& builder, Decimal9NULL writer)
{
builder << '{';
builder << R"("mantissa": )";
builder << +writer.mantissa();
builder << '}';
return builder;
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& builder, DecimalQty writer)
{
builder << '{';
builder << R"("mantissa": )";
builder << +writer.mantissa();
builder << '}';
return builder;
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, EventType::Value m)
{
return os << EventType::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& builder, FLOAT writer)
{
builder << '{';
builder << R"("mantissa": )";
builder << +writer.mantissa();
builder << '}';
return builder;
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& builder, GroupSize writer)
{
builder << '{';
builder << R"("blockLength": )";
builder << +writer.blockLength();
builder << ", ";
builder << R"("numInGroup": )";
builder << +writer.numInGroup();
builder << '}';
return builder;
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& builder, GroupSize8Byte writer)
{
builder << '{';
builder << R"("blockLength": )";
builder << +writer.blockLength();
builder << ", ";
builder << R"("numInGroup": )";
builder << +writer.numInGroup();
builder << '}';
return builder;
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, HaltReason::Value m)
{
return os << HaltReason::c_str(m);
}
};
}
#endif
File diff suppressed because it is too large. Load diff
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, LegSide::Value m)
{
return os << LegSide::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, MDEntryType::Value m)
{
return os << MDEntryType::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, MDEntryTypeBook::Value m)
{
return os << MDEntryTypeBook::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, MDEntryTypeDailyStatistics::Value m)
{
return os << MDEntryTypeDailyStatistics::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, MDEntryTypeStatistics::Value m)
{
return os << MDEntryTypeStatistics::c_str(m);
}
};
}
#endif
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, MDUpdateAction::Value m)
{
return os << MDUpdateAction::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<std::uint8_t>(bits | (1u << 0u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 0u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 1u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 1u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 2u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 2u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 3u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 3u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 4u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 4u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 5u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 5u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 6u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 6u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 7u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 7u)) : static_cast<std::uint8_t>((bits) & ~(1u << 7u)));
std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t));
return *this;
}
template<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& 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
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& 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
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& 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
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, OpenCloseSettlFlag::Value m)
{
return os << OpenCloseSettlFlag::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, OrderUpdateAction::Value m)
{
return os << OrderUpdateAction::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& builder, PRICE writer)
{
builder << '{';
builder << R"("mantissa": )";
builder << +writer.mantissa();
builder << '}';
return builder;
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& builder, PRICE9 writer)
{
builder << '{';
builder << R"("mantissa": )";
builder << +writer.mantissa();
builder << '}';
return builder;
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& builder, PRICENULL writer)
{
builder << '{';
builder << R"("mantissa": )";
builder << +writer.mantissa();
builder << '}';
return builder;
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& builder, PRICENULL9 writer)
{
builder << '{';
builder << R"("mantissa": )";
builder << +writer.mantissa();
builder << '}';
return builder;
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, PutOrCall::Value m)
{
return os << PutOrCall::c_str(m);
}
};
}
#endif
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, SecurityTradingEvent::Value m)
{
return os << SecurityTradingEvent::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, SecurityTradingStatus::Value m)
{
return os << SecurityTradingStatus::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, SecurityUpdateAction::Value m)
{
return os << SecurityUpdateAction::c_str(m);
}
};
}
#endif
@@ -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<double>::quiet_NaN() */
# include <cmath>
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
#else
/* math.h needed for NAN */
# include <math.h>
# define SBE_FLOAT_NAN NAN
# define SBE_DOUBLE_NAN NAN
#endif
#if __cplusplus >= 201103L
# include <cstdint>
# include <string>
# include <cstring>
#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 <cstdint>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <ostream>
#include <sstream>
#include <iomanip>
#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<std::int8_t>::min)()
#define SBE_NULLVALUE_INT16 (std::numeric_limits<std::int16_t>::min)()
#define SBE_NULLVALUE_INT32 (std::numeric_limits<std::int32_t>::min)()
#define SBE_NULLVALUE_INT64 (std::numeric_limits<std::int64_t>::min)()
#define SBE_NULLVALUE_UINT8 (std::numeric_limits<std::uint8_t>::max)()
#define SBE_NULLVALUE_UINT16 (std::numeric_limits<std::uint16_t>::max)()
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::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<std::uint8_t>(bits | (1u << 0u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 0u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 1u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 1u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 2u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 2u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 3u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 3u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 4u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 4u)) : static_cast<std::uint8_t>((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<std::uint8_t>(bits | (1u << 7u)) : static_cast<std::uint8_t>(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<std::uint8_t>((bits) | (1u << 7u)) : static_cast<std::uint8_t>((bits) & ~(1u << 7u)));
std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t));
return *this;
}
template<typename CharT, typename Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& 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
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff