CME Template 8
This commit is contained in:
1 parent
51c89fb8cc
commit
cfdca08cfe
125 files changed
+124104
-108912
No files matched your search
@@ -89,7 +89,7 @@ message JetFIX {
|
||||
optional uint32 window_duration_msecs = 345
|
||||
[ default = 1000 ]; // leave it alone
|
||||
|
||||
optional uint32 max_connection_attempts = 346 [ default = 10 ];
|
||||
optional uint32 max_connection_attempts = 346 [ default = 3 ];
|
||||
optional bool auto_fix_seq_num = 347 [ default = false ];
|
||||
optional bool use_ilink3 = 348 [ default = false ];
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
#include "lib/domain_model/Security.h"
|
||||
#include "lib/domain_model/common.h"
|
||||
#include "lib/orderman/orderman_utils/orderman_common.h"
|
||||
#include "lib/utils/PBUtils.h"
|
||||
|
||||
namespace bts::orderman {
|
||||
|
||||
@@ -17,4 +20,23 @@ struct CreateOrderMsg {
|
||||
api::orderman::RoutingRecord const *routing_record;
|
||||
};
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &out, CreateOrderMsg const &msg) {
|
||||
out << "key: " << msg.key.value() << " price: " << msg.price.value()
|
||||
<< " qty: " << msg.quantity.full_value() << " security: "
|
||||
<< (msg.security == nullptr ? "NULL"
|
||||
: utils::pb::to_string(*msg.security))
|
||||
<< " side: " << securities::side_name(msg.side)
|
||||
<< " display_qty: " << msg.display_quantity.full_value()
|
||||
<< " order_type: " << api::orderman::NativeOrderType_Name(msg.order_type)
|
||||
<< " time_in_force: "
|
||||
<< api::orderman::TimeInForce_Name(msg.time_in_force)
|
||||
<< " manual_order_indicator: "
|
||||
<< api::orderman::ManualOrderIndicator_Name(msg.manual_order_indicator)
|
||||
<< " routing_record: "
|
||||
<< (msg.routing_record == nullptr
|
||||
? "NULL"
|
||||
: utils::pb::to_string(*msg.routing_record));
|
||||
return out;
|
||||
}
|
||||
|
||||
} // namespace bts::orderman
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "IL3GeneratedFull.h"
|
||||
#include "IL3MessageFramer.h"
|
||||
#include "ILink3Utils.h"
|
||||
#include "lib/logging/logging.h"
|
||||
#include "lib/orderman/ilink3/generated/PartyDetailsDefinitionRequest518.h"
|
||||
#include "lib/orderman/orderman_utils/fix_order_codec.h"
|
||||
#include "lib/utils/SecureLogon.h"
|
||||
#include "lib/utils/bts_assert.h"
|
||||
@@ -46,10 +48,16 @@ IL3GW::IL3GW(
|
||||
_on_state_change([](auto) {}), _on_exe_report([](auto *) {}),
|
||||
_on_session_change([](auto) {}), _connection(con), _session(session),
|
||||
_msg_count(0), _time(), _pool(), _exe_parser(cfg, db), _retransmit() {
|
||||
LOG(OrderMan, Info,
|
||||
"IL3GW::IL3GW cme_session: {} uuid: {} to_cme: {} from_cme: {}",
|
||||
_config.cme_session, _session.uuid, _session.to_cme, _session.from_cme);
|
||||
_clorid_buffer.resize(clordid_sz());
|
||||
}
|
||||
|
||||
void IL3GW::connect() {
|
||||
LOG(OrderMan, Info,
|
||||
"IL3GW::connect cme_session: {} uuid: {} to_cme: {} from_cme: {}",
|
||||
_config.cme_session, _session.uuid, _session.to_cme, _session.from_cme);
|
||||
bts_assert(state() == State::INIT || state() == State::ERROR);
|
||||
set_state(State::CONNECTING);
|
||||
_connection.connect(*this); // -> on_connect_success
|
||||
@@ -57,6 +65,9 @@ void IL3GW::connect() {
|
||||
|
||||
// This determines the session uuid
|
||||
void IL3GW::send_negotiate() {
|
||||
LOG(OrderMan, Info,
|
||||
"IL3GW::send_negotiate cme_session: {} uuid: {} to_cme: {} from_cme: {}",
|
||||
_config.cme_session, _session.uuid, _session.to_cme, _session.from_cme);
|
||||
// add 2 bytes for the empty 'credentials' (39008) length which must be
|
||||
// present
|
||||
auto msg = _buffer.frame<iLinkBinary::Negotiate500>(
|
||||
@@ -89,6 +100,9 @@ void IL3GW::send_negotiate() {
|
||||
}
|
||||
|
||||
void IL3GW::send_establish() {
|
||||
LOG(OrderMan, Info,
|
||||
"IL3GW::send_establish cme_session: {} uuid: {} to_cme: {} from_cme: {}",
|
||||
_config.cme_session, _session.uuid, _session.to_cme, _session.from_cme);
|
||||
// add 2 bytes for the empty 'credentials' (39008) length which must be
|
||||
// present
|
||||
auto msg = _buffer.frame<iLinkBinary::Establish503>(2);
|
||||
@@ -158,6 +172,9 @@ void IL3GW::send_retransmit_request(
|
||||
log_out(msg, 0);
|
||||
}
|
||||
|
||||
// This is called on new order, cxl-replace and cxl
|
||||
// https://www.cmegroup.com/confluence/display/EPICSANDBOX/iLink+3+Party+Details+Definition+Request
|
||||
|
||||
uint64_t IL3GW::send_party_details(const api::orderman::RoutingRecord &route) {
|
||||
using namespace iLinkBinary;
|
||||
|
||||
@@ -183,9 +200,11 @@ uint64_t IL3GW::send_party_details(const api::orderman::RoutingRecord &route) {
|
||||
auto smp_id = std::atoi(route.smp_id().c_str());
|
||||
msg.selfMatchPreventionID(smp_id);
|
||||
}
|
||||
// Tag 9708
|
||||
msg.cmtaGiveupCD(CmtaGiveUpCD::NULL_VALUE);
|
||||
msg.custOrderCapacity(map_cust_cti(route.cti_code()));
|
||||
msg.clearingAccountType(map_customer_or_firm(route.customer_or_firm()));
|
||||
// Tag 8000
|
||||
msg.selfMatchPreventionInstruction(
|
||||
map_smp_instruction(route.smp_instruction()));
|
||||
msg.avgPxIndicator(AvgPxInd::NULL_VALUE);
|
||||
@@ -228,6 +247,8 @@ bool need_px(api::orderman::NativeOrderType order_type) {
|
||||
order_type != api::orderman::NativeOrderType::NATIVE_ORDER_TYPE_STOP;
|
||||
}
|
||||
|
||||
// All new orders go through here.
|
||||
// https://www.cmegroup.com/confluence/display/EPICSANDBOX/iLink+3+Execution+Report+-+New+Order
|
||||
void IL3GW::send_order(
|
||||
const CreateOrderMsg &create, trace::CorID const &corid) {
|
||||
_current_corid = corid;
|
||||
@@ -258,7 +279,29 @@ void IL3GW::send_order(
|
||||
encode_clorid(
|
||||
create.key, SecurityKey(create.security->id()), &_clorid_buffer);
|
||||
msg.putClOrdID(_clorid_buffer);
|
||||
msg.partyDetailsListReqID(party);
|
||||
// From the link above:
|
||||
// (we do not "pre-register", which would have been better, but send
|
||||
// "on-demand messages".
|
||||
|
||||
// The unique identifier of the Party Details Definition
|
||||
// Request Acknowledgment associated with this message; this is the value
|
||||
// submitted on the inbound message.
|
||||
|
||||
// For pre-registered messages:
|
||||
|
||||
// - Unique ID from Party Details Definition Request Acknowledgment message
|
||||
// - PartyDetailsListRequestID≠0.
|
||||
|
||||
// For on-demand messages:
|
||||
|
||||
// - If not registered beforehand through iLink then Party Details Definition
|
||||
// Request message will be sent along with the business message and will
|
||||
// immediately precede it
|
||||
// - PartyDetailsListRequestID=0.
|
||||
msg.partyDetailsListReqID(party); // party=0 (check send_party_details)
|
||||
// an incorrect party id results in:
|
||||
// Business Reject: 1 'Unknown ID (unknown PartyDetailsListReqID being
|
||||
// referenced in business message)'.
|
||||
msg.orderRequestID(++_msg_count);
|
||||
msg.sendingTimeEpoch(_time.now());
|
||||
if (needs_stop_px(create.order_type)) {
|
||||
@@ -288,7 +331,11 @@ void IL3GW::send_order(
|
||||
msg.liquidityFlag(iLinkBinary::BooleanNULL::NULL_VALUE);
|
||||
msg.managedOrder(iLinkBinary::BooleanNULL::NULL_VALUE);
|
||||
msg.shortSaleType(iLinkBinary::ShortSaleType::NULL_VALUE);
|
||||
// this writes it to the log file
|
||||
// ~/sparkdata/data/ilink3/<ilink_name>/<start_of_week>/log
|
||||
log_out(msg, msg.seqNum());
|
||||
// the message is written to the buffer not not sent yet, that happens when
|
||||
// flush is called (check GLBXiLink3ExecutionGateway::send_msgs)
|
||||
}
|
||||
|
||||
void IL3GW::send_cancel_replace(
|
||||
@@ -371,7 +418,11 @@ void IL3GW::send_cancel(
|
||||
}
|
||||
|
||||
void IL3GW::send_terminate(uint16_t code) {
|
||||
LOG(iLink3, Info, "Terminate");
|
||||
LOG(OrderMan, Info,
|
||||
"IL3GW::send_terminate cme_session: {} uuid: {} to_cme: {} "
|
||||
"from_cme: {} code: {}",
|
||||
_config.cme_session, _session.uuid, _session.to_cme, _session.from_cme,
|
||||
code);
|
||||
auto msg = _buffer.frame<iLinkBinary::Terminate507>();
|
||||
msg.uUID(_session.uuid);
|
||||
msg.requestTimestamp(_time.now());
|
||||
@@ -421,9 +472,13 @@ void IL3GW::set_state(State s) {
|
||||
// IConnectionHandler
|
||||
|
||||
void IL3GW::on_connect_success() {
|
||||
LOG(OrderMan, Info,
|
||||
"IL3GW::on_connect_success cme_session: {} uuid: {} to_cme: {} "
|
||||
"from_cme: {}",
|
||||
_config.cme_session, _session.uuid, _session.to_cme, _session.from_cme);
|
||||
if (!_session) {
|
||||
// If we have a 0 cme_seq this is a new session and we need to negotiate
|
||||
// it
|
||||
// it (this is the only time a negotiation is sent)
|
||||
LOG(iLink3, Info, "Negotiating new iLink session. {}", _session.uuid);
|
||||
set_state(State::NEGOTIATING);
|
||||
send_negotiate();
|
||||
|
||||
@@ -35,7 +35,10 @@ class IL3MessageFramer {
|
||||
// structure until flush() is called, at which point the currently
|
||||
// accumulatd buffers are forwarded to the IL3Connection and
|
||||
// accumulation restarts.
|
||||
template <class Msg> Msg frame(size_t extra = 0) {
|
||||
template <class Msg>
|
||||
Msg frame(size_t extra = 0) {
|
||||
// this is how the header is organized
|
||||
// https://www.cmegroup.com/confluence/display/EPICSANDBOX/iLink+3+Message+Header
|
||||
auto size = sizeof(FramingHeader) +
|
||||
iLinkBinary::MessageHeader::encodedLength() +
|
||||
Msg::sbeBlockLength() + extra;
|
||||
|
||||
@@ -162,9 +162,9 @@ map_cust_cti(api::orderman::CTICode code) {
|
||||
case CTI_CODE_CTI_CODE1:
|
||||
return CustOrderCapacity::Membertradingfortheirownaccount;
|
||||
case CTI_CODE_CTI_CODE2:
|
||||
return CustOrderCapacity::Clearingfirmtradingforitsproprietaryaccount;
|
||||
return CustOrderCapacity::Memberfirmtradingforitsproprietaryaccount;
|
||||
case CTI_CODE_CTI_CODE3:
|
||||
return CustOrderCapacity::Membertradingforanothermember;
|
||||
return CustOrderCapacity::Membertradingforanothermemberornonmember;
|
||||
case CTI_CODE_CTI_CODE4:
|
||||
return CustOrderCapacity::Allother;
|
||||
default:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "SessionStore.h"
|
||||
#include "lib/jetfix/store/session_name.h"
|
||||
#include "lib/logging/logging.h"
|
||||
#include "lib/orderman/ilink3/IL3GW.h"
|
||||
#include "lib/orderman/ilink3/IL3SecDB.h"
|
||||
#include "lib/orderman/orderman_utils/ExecutionReport.h"
|
||||
@@ -108,12 +109,14 @@ static void save_raw_msg(
|
||||
}
|
||||
|
||||
void save_session(std::string const &path, Session const &session) {
|
||||
LOG(OrderMan, Info, "SessionStore save_session (to file) path: {}", path);
|
||||
std::ofstream f(path);
|
||||
f << session.uuid << " " << session.to_cme << " " << session.from_cme
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
Session load_session(jetfix::SessionName const &sn, std::string const &path) {
|
||||
LOG(OrderMan, Info, "SessionStore load_session (from file) path: {}", path);
|
||||
auto result = Session{sn.as_uint64_t, 0, 0};
|
||||
if (boost::filesystem::exists(path)) {
|
||||
std::ifstream f(path);
|
||||
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_AVGPXIND_H_
|
||||
#define _ILINKBINARY_AVGPXIND_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,53 +25,51 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class AvgPxInd {
|
||||
public:
|
||||
enum Value {
|
||||
NoAveragePricing = (std::uint8_t)0,
|
||||
TradeispartofanAveragePriceGroupIdentifiedbytheAvgPxGrpID =
|
||||
(std::uint8_t)1,
|
||||
TradeispartofaNotionalValueAveragePriceGroup = (std::uint8_t)3,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class AvgPxInd
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
NoAveragePricing = static_cast<std::uint8_t>(0),
|
||||
TradeispartofanAveragePriceGroupIdentifiedbytheAvgPxGrpID = static_cast<std::uint8_t>(1),
|
||||
TradeispartofaNotionalValueAveragePriceGroup = static_cast<std::uint8_t>(3),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static AvgPxInd::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return NoAveragePricing;
|
||||
case 1:
|
||||
return TradeispartofanAveragePriceGroupIdentifiedbytheAvgPxGrpID;
|
||||
case 3:
|
||||
return TradeispartofaNotionalValueAveragePriceGroup;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static AvgPxInd::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return NoAveragePricing;
|
||||
case static_cast<std::uint8_t>(1): return TradeispartofanAveragePriceGroupIdentifiedbytheAvgPxGrpID;
|
||||
case static_cast<std::uint8_t>(3): return TradeispartofaNotionalValueAveragePriceGroup;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum AvgPxInd [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum AvgPxInd [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const AvgPxInd::Value value) {
|
||||
switch (value) {
|
||||
case NoAveragePricing:
|
||||
return "NoAveragePricing";
|
||||
case TradeispartofanAveragePriceGroupIdentifiedbytheAvgPxGrpID:
|
||||
return "TradeispartofanAveragePriceGroupIdentifiedbytheAvgPxGrpID";
|
||||
case TradeispartofaNotionalValueAveragePriceGroup:
|
||||
return "TradeispartofaNotionalValueAveragePriceGroup";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const AvgPxInd::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case NoAveragePricing: return "NoAveragePricing";
|
||||
case TradeispartofanAveragePriceGroupIdentifiedbytheAvgPxGrpID: return "TradeispartofanAveragePriceGroupIdentifiedbytheAvgPxGrpID";
|
||||
case TradeispartofaNotionalValueAveragePriceGroup: return "TradeispartofaNotionalValueAveragePriceGroup";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum AvgPxInd [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum AvgPxInd [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, AvgPxInd::Value m) {
|
||||
return os << AvgPxInd::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, AvgPxInd::Value m)
|
||||
{
|
||||
return os << AvgPxInd::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_BOOLEANFLAG_H_
|
||||
#define _ILINKBINARY_BOOLEANFLAG_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class BooleanFlag {
|
||||
public:
|
||||
enum Value {
|
||||
False = (std::uint8_t)0,
|
||||
True = (std::uint8_t)1,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class BooleanFlag
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
False = static_cast<std::uint8_t>(0),
|
||||
True = static_cast<std::uint8_t>(1),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static BooleanFlag::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return False;
|
||||
case 1:
|
||||
return True;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static BooleanFlag::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return False;
|
||||
case static_cast<std::uint8_t>(1): return True;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum BooleanFlag [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum BooleanFlag [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const BooleanFlag::Value value) {
|
||||
switch (value) {
|
||||
case False:
|
||||
return "False";
|
||||
case True:
|
||||
return "True";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const BooleanFlag::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case False: return "False";
|
||||
case True: return "True";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum BooleanFlag [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum BooleanFlag [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, BooleanFlag::Value m) {
|
||||
return os << BooleanFlag::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, BooleanFlag::Value m)
|
||||
{
|
||||
return os << BooleanFlag::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_BOOLEANNULL_H_
|
||||
#define _ILINKBINARY_BOOLEANNULL_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class BooleanNULL {
|
||||
public:
|
||||
enum Value {
|
||||
False = (std::uint8_t)0,
|
||||
True = (std::uint8_t)1,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class BooleanNULL
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
False = static_cast<std::uint8_t>(0),
|
||||
True = static_cast<std::uint8_t>(1),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static BooleanNULL::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return False;
|
||||
case 1:
|
||||
return True;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static BooleanNULL::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return False;
|
||||
case static_cast<std::uint8_t>(1): return True;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum BooleanNULL [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum BooleanNULL [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const BooleanNULL::Value value) {
|
||||
switch (value) {
|
||||
case False:
|
||||
return "False";
|
||||
case True:
|
||||
return "True";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const BooleanNULL::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case False: return "False";
|
||||
case True: return "True";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum BooleanNULL [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum BooleanNULL [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, BooleanNULL::Value m) {
|
||||
return os << BooleanNULL::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, BooleanNULL::Value m)
|
||||
{
|
||||
return os << BooleanNULL::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_CLEARINGACCTTYPE_H_
|
||||
#define _ILINKBINARY_CLEARINGACCTTYPE_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,49 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class ClearingAcctType {
|
||||
public:
|
||||
enum Value {
|
||||
Customer = (std::uint8_t)0,
|
||||
Firm = (std::uint8_t)1,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class ClearingAcctType
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Customer = static_cast<std::uint8_t>(0),
|
||||
Firm = static_cast<std::uint8_t>(1),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static ClearingAcctType::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return Customer;
|
||||
case 1:
|
||||
return Firm;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static ClearingAcctType::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return Customer;
|
||||
case static_cast<std::uint8_t>(1): return Firm;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum ClearingAcctType [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ClearingAcctType [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const ClearingAcctType::Value value) {
|
||||
switch (value) {
|
||||
case Customer:
|
||||
return "Customer";
|
||||
case Firm:
|
||||
return "Firm";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const ClearingAcctType::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Customer: return "Customer";
|
||||
case Firm: return "Firm";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum ClearingAcctType [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ClearingAcctType [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &operator<<(
|
||||
std::basic_ostream<CharT, Traits> &os, ClearingAcctType::Value m) {
|
||||
return os << ClearingAcctType::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, ClearingAcctType::Value m)
|
||||
{
|
||||
return os << ClearingAcctType::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_CMTAGIVEUPCD_H_
|
||||
#define _ILINKBINARY_CMTAGIVEUPCD_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,43 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class CmtaGiveUpCD {
|
||||
public:
|
||||
enum Value { GiveUp = (char)71, SGXoffset = (char)83, NULL_VALUE = (char)0 };
|
||||
class CmtaGiveUpCD
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
GiveUp = static_cast<char>(71),
|
||||
SGXoffset = static_cast<char>(83),
|
||||
NULL_VALUE = static_cast<char>(0x00)
|
||||
};
|
||||
|
||||
static CmtaGiveUpCD::Value get(const char value) {
|
||||
switch (value) {
|
||||
case 71:
|
||||
return GiveUp;
|
||||
case 83:
|
||||
return SGXoffset;
|
||||
case 0:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static CmtaGiveUpCD::Value get(const char value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<char>(71): return GiveUp;
|
||||
case static_cast<char>(83): return SGXoffset;
|
||||
case static_cast<char>(0x00): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum CmtaGiveUpCD [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum CmtaGiveUpCD [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const CmtaGiveUpCD::Value value) {
|
||||
switch (value) {
|
||||
case GiveUp:
|
||||
return "GiveUp";
|
||||
case SGXoffset:
|
||||
return "SGXoffset";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const CmtaGiveUpCD::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case GiveUp: return "GiveUp";
|
||||
case SGXoffset: return "SGXoffset";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum CmtaGiveUpCD [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum CmtaGiveUpCD [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, CmtaGiveUpCD::Value m) {
|
||||
return os << CmtaGiveUpCD::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, CmtaGiveUpCD::Value m)
|
||||
{
|
||||
return os << CmtaGiveUpCD::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_CUSTORDHANDLINST_H_
|
||||
#define _ILINKBINARY_CUSTORDHANDLINST_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,69 +25,60 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class CustOrdHandlInst {
|
||||
public:
|
||||
enum Value {
|
||||
FCMprovidedscreen = (char)67,
|
||||
Otherprovidedscreen = (char)68,
|
||||
FCMAPIorFIX = (char)71,
|
||||
AlgoEngine = (char)72,
|
||||
DeskElectronic = (char)87,
|
||||
ClientElectronic = (char)89,
|
||||
NULL_VALUE = (char)0
|
||||
};
|
||||
class CustOrdHandlInst
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
FCMprovidedscreen = static_cast<char>(67),
|
||||
Otherprovidedscreen = static_cast<char>(68),
|
||||
FCMAPIorFIX = static_cast<char>(71),
|
||||
AlgoEngine = static_cast<char>(72),
|
||||
DeskElectronic = static_cast<char>(87),
|
||||
ClientElectronic = static_cast<char>(89),
|
||||
NULL_VALUE = static_cast<char>(48)
|
||||
};
|
||||
|
||||
static CustOrdHandlInst::Value get(const char value) {
|
||||
switch (value) {
|
||||
case 67:
|
||||
return FCMprovidedscreen;
|
||||
case 68:
|
||||
return Otherprovidedscreen;
|
||||
case 71:
|
||||
return FCMAPIorFIX;
|
||||
case 72:
|
||||
return AlgoEngine;
|
||||
case 87:
|
||||
return DeskElectronic;
|
||||
case 89:
|
||||
return ClientElectronic;
|
||||
case 0:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static CustOrdHandlInst::Value get(const char value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<char>(67): return FCMprovidedscreen;
|
||||
case static_cast<char>(68): return Otherprovidedscreen;
|
||||
case static_cast<char>(71): return FCMAPIorFIX;
|
||||
case static_cast<char>(72): return AlgoEngine;
|
||||
case static_cast<char>(87): return DeskElectronic;
|
||||
case static_cast<char>(89): return ClientElectronic;
|
||||
case static_cast<char>(48): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum CustOrdHandlInst [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum CustOrdHandlInst [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const CustOrdHandlInst::Value value) {
|
||||
switch (value) {
|
||||
case FCMprovidedscreen:
|
||||
return "FCMprovidedscreen";
|
||||
case Otherprovidedscreen:
|
||||
return "Otherprovidedscreen";
|
||||
case FCMAPIorFIX:
|
||||
return "FCMAPIorFIX";
|
||||
case AlgoEngine:
|
||||
return "AlgoEngine";
|
||||
case DeskElectronic:
|
||||
return "DeskElectronic";
|
||||
case ClientElectronic:
|
||||
return "ClientElectronic";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const CustOrdHandlInst::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case FCMprovidedscreen: return "FCMprovidedscreen";
|
||||
case Otherprovidedscreen: return "Otherprovidedscreen";
|
||||
case FCMAPIorFIX: return "FCMAPIorFIX";
|
||||
case AlgoEngine: return "AlgoEngine";
|
||||
case DeskElectronic: return "DeskElectronic";
|
||||
case ClientElectronic: return "ClientElectronic";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum CustOrdHandlInst [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum CustOrdHandlInst [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &operator<<(
|
||||
std::basic_ostream<CharT, Traits> &os, CustOrdHandlInst::Value m) {
|
||||
return os << CustOrdHandlInst::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, CustOrdHandlInst::Value m)
|
||||
{
|
||||
return os << CustOrdHandlInst::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_CUSTORDERCAPACITY_H_
|
||||
#define _ILINKBINARY_CUSTORDERCAPACITY_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,59 +25,54 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class CustOrderCapacity {
|
||||
public:
|
||||
enum Value {
|
||||
Membertradingfortheirownaccount = (std::uint8_t)1,
|
||||
Clearingfirmtradingforitsproprietaryaccount = (std::uint8_t)2,
|
||||
Membertradingforanothermember = (std::uint8_t)3,
|
||||
Allother = (std::uint8_t)4,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class CustOrderCapacity
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Membertradingfortheirownaccount = static_cast<std::uint8_t>(1),
|
||||
Memberfirmtradingforitsproprietaryaccount = static_cast<std::uint8_t>(2),
|
||||
Membertradingforanothermemberornonmember = static_cast<std::uint8_t>(3),
|
||||
Allother = static_cast<std::uint8_t>(4),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static CustOrderCapacity::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return Membertradingfortheirownaccount;
|
||||
case 2:
|
||||
return Clearingfirmtradingforitsproprietaryaccount;
|
||||
case 3:
|
||||
return Membertradingforanothermember;
|
||||
case 4:
|
||||
return Allother;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static CustOrderCapacity::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(1): return Membertradingfortheirownaccount;
|
||||
case static_cast<std::uint8_t>(2): return Memberfirmtradingforitsproprietaryaccount;
|
||||
case static_cast<std::uint8_t>(3): return Membertradingforanothermemberornonmember;
|
||||
case static_cast<std::uint8_t>(4): return Allother;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum CustOrderCapacity [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum CustOrderCapacity [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const CustOrderCapacity::Value value) {
|
||||
switch (value) {
|
||||
case Membertradingfortheirownaccount:
|
||||
return "Membertradingfortheirownaccount";
|
||||
case Clearingfirmtradingforitsproprietaryaccount:
|
||||
return "Clearingfirmtradingforitsproprietaryaccount";
|
||||
case Membertradingforanothermember:
|
||||
return "Membertradingforanothermember";
|
||||
case Allother:
|
||||
return "Allother";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const CustOrderCapacity::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Membertradingfortheirownaccount: return "Membertradingfortheirownaccount";
|
||||
case Memberfirmtradingforitsproprietaryaccount: return "Memberfirmtradingforitsproprietaryaccount";
|
||||
case Membertradingforanothermemberornonmember: return "Membertradingforanothermemberornonmember";
|
||||
case Allother: return "Allother";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum CustOrderCapacity [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum CustOrderCapacity [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &operator<<(
|
||||
std::basic_ostream<CharT, Traits> &os, CustOrderCapacity::Value m) {
|
||||
return os << CustOrderCapacity::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, CustOrderCapacity::Value m)
|
||||
{
|
||||
return os << CustOrderCapacity::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,39 +4,33 @@
|
||||
|
||||
#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()
|
||||
# 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
|
||||
# include <math.h>
|
||||
# define SBE_FLOAT_NAN NAN
|
||||
# define SBE_DOUBLE_NAN NAN
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
# define SBE_CONSTEXPR constexpr
|
||||
# define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
# define SBE_CONSTEXPR
|
||||
# define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
# include <string_view>
|
||||
# define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
# define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
@@ -44,43 +38,43 @@
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
|
||||
#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)
|
||||
# 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)
|
||||
# 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)
|
||||
# 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."
|
||||
# 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)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false)
|
||||
#elif defined(_MSC_VER)
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
#else
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
#endif
|
||||
|
||||
#define SBE_NULLVALUE_INT8 (std::numeric_limits<std::int8_t>::min)()
|
||||
@@ -92,206 +86,258 @@
|
||||
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
|
||||
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::max)()
|
||||
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class DATA {
|
||||
private:
|
||||
char *m_buffer = nullptr;
|
||||
std::uint64_t m_bufferLength = 0;
|
||||
std::uint64_t m_offset = 0;
|
||||
std::uint64_t m_actingVersion = 0;
|
||||
class DATA
|
||||
{
|
||||
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 };
|
||||
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_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;
|
||||
};
|
||||
union sbe_double_as_uint_u
|
||||
{
|
||||
double fp_value;
|
||||
std::uint64_t uint_value;
|
||||
};
|
||||
|
||||
DATA() = default;
|
||||
DATA() = default;
|
||||
|
||||
DATA(
|
||||
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]");
|
||||
}
|
||||
}
|
||||
DATA(
|
||||
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]");
|
||||
}
|
||||
}
|
||||
|
||||
DATA(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength,
|
||||
const std::uint64_t actingVersion)
|
||||
: DATA(buffer, 0, bufferLength, actingVersion) {}
|
||||
DATA(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength,
|
||||
const std::uint64_t actingVersion) :
|
||||
DATA(buffer, 0, bufferLength, actingVersion)
|
||||
{
|
||||
}
|
||||
|
||||
DATA(char *buffer, const std::uint64_t bufferLength)
|
||||
: DATA(buffer, 0, bufferLength, sbeSchemaVersion()) {}
|
||||
DATA(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength) :
|
||||
DATA(buffer, 0, bufferLength, sbeSchemaVersion())
|
||||
{
|
||||
}
|
||||
|
||||
DATA &wrap(
|
||||
char *buffer,
|
||||
const std::uint64_t offset,
|
||||
const std::uint64_t actingVersion,
|
||||
const std::uint64_t bufferLength) {
|
||||
return *this = DATA(buffer, offset, bufferLength, actingVersion);
|
||||
}
|
||||
DATA &wrap(
|
||||
char *buffer,
|
||||
const std::uint64_t offset,
|
||||
const std::uint64_t actingVersion,
|
||||
const std::uint64_t bufferLength)
|
||||
{
|
||||
return *this = DATA(buffer, offset, bufferLength, actingVersion);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
encodedLength() SBE_NOEXCEPT {
|
||||
return -1;
|
||||
}
|
||||
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 std::uint64_t offset() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_offset;
|
||||
}
|
||||
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT { return m_buffer; }
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
SBE_NODISCARD char *buffer() 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 bufferLength() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_bufferLength;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT {
|
||||
return m_actingVersion;
|
||||
}
|
||||
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)8;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t
|
||||
sbeSchemaVersion() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)5;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static const char *
|
||||
lengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT {
|
||||
switch (metaAttribute) {
|
||||
case MetaAttribute::PRESENCE:
|
||||
return "required";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
SBE_NODISCARD static const char *lengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "required";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t lengthId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t lengthId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
lengthSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t lengthSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool lengthInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool lengthInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= lengthSinceVersion();
|
||||
return m_actingVersion >= lengthSinceVersion();
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::size_t
|
||||
lengthEncodingOffset() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::size_t lengthEncodingOffset() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t lengthNullValue() SBE_NOEXCEPT {
|
||||
return SBE_NULLVALUE_UINT16;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t lengthNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return SBE_NULLVALUE_UINT16;
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t lengthMinValue() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)0;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t lengthMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t lengthMaxValue() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)65534;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t lengthMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(65534);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t lengthEncodingLength() SBE_NOEXCEPT {
|
||||
return 2;
|
||||
}
|
||||
static SBE_CONSTEXPR std::size_t lengthEncodingLength() SBE_NOEXCEPT
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::uint16_t length() 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);
|
||||
}
|
||||
SBE_NODISCARD std::uint16_t length() 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);
|
||||
}
|
||||
|
||||
DATA &length(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;
|
||||
}
|
||||
DATA &length(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 *
|
||||
varDataMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT {
|
||||
switch (metaAttribute) {
|
||||
case MetaAttribute::PRESENCE:
|
||||
return "required";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
SBE_NODISCARD static const char *varDataMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "required";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t varDataId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t varDataId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
varDataSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t varDataSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool varDataInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool varDataInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= varDataSinceVersion();
|
||||
return m_actingVersion >= varDataSinceVersion();
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::size_t
|
||||
varDataEncodingOffset() SBE_NOEXCEPT {
|
||||
return 2;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::size_t varDataEncodingOffset() SBE_NOEXCEPT
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR char varDataNullValue() SBE_NOEXCEPT { return (char)0; }
|
||||
static SBE_CONSTEXPR char varDataNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<char>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR char varDataMinValue() SBE_NOEXCEPT { return (char)32; }
|
||||
static SBE_CONSTEXPR char varDataMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<char>(32);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR char varDataMaxValue() SBE_NOEXCEPT {
|
||||
return (char)126;
|
||||
}
|
||||
static SBE_CONSTEXPR char varDataMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<char>(126);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t varDataEncodingLength() SBE_NOEXCEPT {
|
||||
return -1;
|
||||
}
|
||||
static SBE_CONSTEXPR std::size_t varDataEncodingLength() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &builder, DATA writer) {
|
||||
builder << '{';
|
||||
builder << R"("length": )";
|
||||
builder << +writer.length();
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &builder, DATA writer)
|
||||
{
|
||||
builder << '{';
|
||||
builder << R"("length": )";
|
||||
builder << +writer.length();
|
||||
|
||||
builder << '}';
|
||||
builder << '}';
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_DKREASON_H_
|
||||
#define _ILINKBINARY_DKREASON_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,77 +25,66 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class DKReason {
|
||||
public:
|
||||
enum Value {
|
||||
UnknownSecurity = (char)65,
|
||||
WrongSide = (char)66,
|
||||
QuantityExceedsOrder = (char)67,
|
||||
NoMatchingOrder = (char)68,
|
||||
PriceExceedsLimit = (char)69,
|
||||
CalculationDifference = (char)70,
|
||||
NoMatchingExecutionReport = (char)71,
|
||||
Other = (char)90,
|
||||
NULL_VALUE = (char)0
|
||||
};
|
||||
class DKReason
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
UnknownSecurity = static_cast<char>(65),
|
||||
WrongSide = static_cast<char>(66),
|
||||
QuantityExceedsOrder = static_cast<char>(67),
|
||||
NoMatchingOrder = static_cast<char>(68),
|
||||
PriceExceedsLimit = static_cast<char>(69),
|
||||
CalculationDifference = static_cast<char>(70),
|
||||
NoMatchingExecutionReport = static_cast<char>(71),
|
||||
Other = static_cast<char>(90),
|
||||
NULL_VALUE = static_cast<char>(48)
|
||||
};
|
||||
|
||||
static DKReason::Value get(const char value) {
|
||||
switch (value) {
|
||||
case 65:
|
||||
return UnknownSecurity;
|
||||
case 66:
|
||||
return WrongSide;
|
||||
case 67:
|
||||
return QuantityExceedsOrder;
|
||||
case 68:
|
||||
return NoMatchingOrder;
|
||||
case 69:
|
||||
return PriceExceedsLimit;
|
||||
case 70:
|
||||
return CalculationDifference;
|
||||
case 71:
|
||||
return NoMatchingExecutionReport;
|
||||
case 90:
|
||||
return Other;
|
||||
case 0:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static DKReason::Value get(const char value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<char>(65): return UnknownSecurity;
|
||||
case static_cast<char>(66): return WrongSide;
|
||||
case static_cast<char>(67): return QuantityExceedsOrder;
|
||||
case static_cast<char>(68): return NoMatchingOrder;
|
||||
case static_cast<char>(69): return PriceExceedsLimit;
|
||||
case static_cast<char>(70): return CalculationDifference;
|
||||
case static_cast<char>(71): return NoMatchingExecutionReport;
|
||||
case static_cast<char>(90): return Other;
|
||||
case static_cast<char>(48): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum DKReason [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum DKReason [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const DKReason::Value value) {
|
||||
switch (value) {
|
||||
case UnknownSecurity:
|
||||
return "UnknownSecurity";
|
||||
case WrongSide:
|
||||
return "WrongSide";
|
||||
case QuantityExceedsOrder:
|
||||
return "QuantityExceedsOrder";
|
||||
case NoMatchingOrder:
|
||||
return "NoMatchingOrder";
|
||||
case PriceExceedsLimit:
|
||||
return "PriceExceedsLimit";
|
||||
case CalculationDifference:
|
||||
return "CalculationDifference";
|
||||
case NoMatchingExecutionReport:
|
||||
return "NoMatchingExecutionReport";
|
||||
case Other:
|
||||
return "Other";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const DKReason::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case UnknownSecurity: return "UnknownSecurity";
|
||||
case WrongSide: return "WrongSide";
|
||||
case QuantityExceedsOrder: return "QuantityExceedsOrder";
|
||||
case NoMatchingOrder: return "NoMatchingOrder";
|
||||
case PriceExceedsLimit: return "PriceExceedsLimit";
|
||||
case CalculationDifference: return "CalculationDifference";
|
||||
case NoMatchingExecutionReport: return "NoMatchingExecutionReport";
|
||||
case Other: return "Other";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum DKReason [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum DKReason [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, DKReason::Value m) {
|
||||
return os << DKReason::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, DKReason::Value m)
|
||||
{
|
||||
return os << DKReason::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,39 +4,33 @@
|
||||
|
||||
#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()
|
||||
# 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
|
||||
# include <math.h>
|
||||
# define SBE_FLOAT_NAN NAN
|
||||
# define SBE_DOUBLE_NAN NAN
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
# define SBE_CONSTEXPR constexpr
|
||||
# define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
# define SBE_CONSTEXPR
|
||||
# define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
# include <string_view>
|
||||
# define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
# define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
@@ -44,43 +38,43 @@
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
|
||||
#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)
|
||||
# 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)
|
||||
# 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)
|
||||
# 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."
|
||||
# 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)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false)
|
||||
#elif defined(_MSC_VER)
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
#else
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
#endif
|
||||
|
||||
#define SBE_NULLVALUE_INT8 (std::numeric_limits<std::int8_t>::min)()
|
||||
@@ -92,226 +86,276 @@
|
||||
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
|
||||
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::max)()
|
||||
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class Decimal32NULL {
|
||||
private:
|
||||
char *m_buffer = nullptr;
|
||||
std::uint64_t m_bufferLength = 0;
|
||||
std::uint64_t m_offset = 0;
|
||||
std::uint64_t m_actingVersion = 0;
|
||||
class Decimal32NULL
|
||||
{
|
||||
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 };
|
||||
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_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;
|
||||
};
|
||||
union sbe_double_as_uint_u
|
||||
{
|
||||
double fp_value;
|
||||
std::uint64_t uint_value;
|
||||
};
|
||||
|
||||
Decimal32NULL() = default;
|
||||
Decimal32NULL() = default;
|
||||
|
||||
Decimal32NULL(
|
||||
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]");
|
||||
}
|
||||
}
|
||||
Decimal32NULL(
|
||||
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]");
|
||||
}
|
||||
}
|
||||
|
||||
Decimal32NULL(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength,
|
||||
const std::uint64_t actingVersion)
|
||||
: Decimal32NULL(buffer, 0, bufferLength, actingVersion) {}
|
||||
Decimal32NULL(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength,
|
||||
const std::uint64_t actingVersion) :
|
||||
Decimal32NULL(buffer, 0, bufferLength, actingVersion)
|
||||
{
|
||||
}
|
||||
|
||||
Decimal32NULL(char *buffer, const std::uint64_t bufferLength)
|
||||
: Decimal32NULL(buffer, 0, bufferLength, sbeSchemaVersion()) {}
|
||||
Decimal32NULL(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength) :
|
||||
Decimal32NULL(buffer, 0, bufferLength, sbeSchemaVersion())
|
||||
{
|
||||
}
|
||||
|
||||
Decimal32NULL &wrap(
|
||||
char *buffer,
|
||||
const std::uint64_t offset,
|
||||
const std::uint64_t actingVersion,
|
||||
const std::uint64_t bufferLength) {
|
||||
return *this = Decimal32NULL(buffer, offset, bufferLength, actingVersion);
|
||||
}
|
||||
Decimal32NULL &wrap(
|
||||
char *buffer,
|
||||
const std::uint64_t offset,
|
||||
const std::uint64_t actingVersion,
|
||||
const std::uint64_t bufferLength)
|
||||
{
|
||||
return *this = Decimal32NULL(buffer, offset, bufferLength, actingVersion);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
encodedLength() SBE_NOEXCEPT {
|
||||
return 5;
|
||||
}
|
||||
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 std::uint64_t offset() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_offset;
|
||||
}
|
||||
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT { return m_buffer; }
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
SBE_NODISCARD char *buffer() 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 bufferLength() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_bufferLength;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT {
|
||||
return m_actingVersion;
|
||||
}
|
||||
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)8;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t
|
||||
sbeSchemaVersion() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)5;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static const char *
|
||||
mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT {
|
||||
switch (metaAttribute) {
|
||||
case MetaAttribute::PRESENCE:
|
||||
return "optional";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
SBE_NODISCARD static const char *mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "optional";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t mantissaId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t mantissaId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
mantissaSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= mantissaSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 mantissaNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return INT32_C(2147483647);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int32_t mantissaMinValue() SBE_NOEXCEPT {
|
||||
return -2147483647;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int32_t mantissaMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return INT32_C(-2147483647);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int32_t mantissaMaxValue() SBE_NOEXCEPT {
|
||||
return 2147483647;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int32_t mantissaMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return INT32_C(2147483647);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT {
|
||||
return 4;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
Decimal32NULL &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;
|
||||
}
|
||||
Decimal32NULL &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 "optional";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
SBE_NODISCARD static const char *exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "optional";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t exponentId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t exponentId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
exponentSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= exponentSinceVersion();
|
||||
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;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::size_t exponentEncodingOffset() SBE_NOEXCEPT
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT {
|
||||
return (std::int8_t)127;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::int8_t>(127);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT {
|
||||
return (std::int8_t)-127;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::int8_t>(-127);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT {
|
||||
return (std::int8_t)127;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::int8_t>(127);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT {
|
||||
return 1;
|
||||
}
|
||||
static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::int8_t exponent() const SBE_NOEXCEPT {
|
||||
std::int8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset + 4, sizeof(std::int8_t));
|
||||
return (val);
|
||||
}
|
||||
SBE_NODISCARD std::int8_t exponent() const SBE_NOEXCEPT
|
||||
{
|
||||
std::int8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset + 4, sizeof(std::int8_t));
|
||||
return (val);
|
||||
}
|
||||
|
||||
Decimal32NULL &exponent(const std::int8_t value) SBE_NOEXCEPT {
|
||||
std::int8_t val = (value);
|
||||
std::memcpy(m_buffer + m_offset + 4, &val, sizeof(std::int8_t));
|
||||
return *this;
|
||||
}
|
||||
Decimal32NULL &exponent(const std::int8_t value) SBE_NOEXCEPT
|
||||
{
|
||||
std::int8_t val = (value);
|
||||
std::memcpy(m_buffer + m_offset + 4, &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, Decimal32NULL writer) {
|
||||
builder << '{';
|
||||
builder << R"("mantissa": )";
|
||||
builder << +writer.mantissa();
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &builder, Decimal32NULL writer)
|
||||
{
|
||||
builder << '{';
|
||||
builder << R"("mantissa": )";
|
||||
builder << +writer.mantissa();
|
||||
|
||||
builder << ", ";
|
||||
builder << R"("exponent": )";
|
||||
builder << +writer.exponent();
|
||||
builder << ", ";
|
||||
builder << R"("exponent": )";
|
||||
builder << +writer.exponent();
|
||||
|
||||
builder << '}';
|
||||
builder << '}';
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,39 +4,33 @@
|
||||
|
||||
#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()
|
||||
# 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
|
||||
# include <math.h>
|
||||
# define SBE_FLOAT_NAN NAN
|
||||
# define SBE_DOUBLE_NAN NAN
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
# define SBE_CONSTEXPR constexpr
|
||||
# define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
# define SBE_CONSTEXPR
|
||||
# define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
# include <string_view>
|
||||
# define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
# define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
@@ -44,43 +38,43 @@
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
|
||||
#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)
|
||||
# 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)
|
||||
# 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)
|
||||
# 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."
|
||||
# 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)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false)
|
||||
#elif defined(_MSC_VER)
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
#else
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
#endif
|
||||
|
||||
#define SBE_NULLVALUE_INT8 (std::numeric_limits<std::int8_t>::min)()
|
||||
@@ -92,226 +86,286 @@
|
||||
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
|
||||
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::max)()
|
||||
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class Decimal64NULL {
|
||||
private:
|
||||
char *m_buffer = nullptr;
|
||||
std::uint64_t m_bufferLength = 0;
|
||||
std::uint64_t m_offset = 0;
|
||||
std::uint64_t m_actingVersion = 0;
|
||||
class Decimal64NULL
|
||||
{
|
||||
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 };
|
||||
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_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;
|
||||
};
|
||||
union sbe_double_as_uint_u
|
||||
{
|
||||
double fp_value;
|
||||
std::uint64_t uint_value;
|
||||
};
|
||||
|
||||
Decimal64NULL() = default;
|
||||
Decimal64NULL() = default;
|
||||
|
||||
Decimal64NULL(
|
||||
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 + 9) > m_bufferLength), false)) {
|
||||
throw std::runtime_error("buffer too short for flyweight [E107]");
|
||||
}
|
||||
}
|
||||
Decimal64NULL(
|
||||
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 + 9) > m_bufferLength), false))
|
||||
{
|
||||
throw std::runtime_error("buffer too short for flyweight [E107]");
|
||||
}
|
||||
}
|
||||
|
||||
Decimal64NULL(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength,
|
||||
const std::uint64_t actingVersion)
|
||||
: Decimal64NULL(buffer, 0, bufferLength, actingVersion) {}
|
||||
Decimal64NULL(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength,
|
||||
const std::uint64_t actingVersion) :
|
||||
Decimal64NULL(buffer, 0, bufferLength, actingVersion)
|
||||
{
|
||||
}
|
||||
|
||||
Decimal64NULL(char *buffer, const std::uint64_t bufferLength)
|
||||
: Decimal64NULL(buffer, 0, bufferLength, sbeSchemaVersion()) {}
|
||||
Decimal64NULL(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength) :
|
||||
Decimal64NULL(buffer, 0, bufferLength, sbeSchemaVersion())
|
||||
{
|
||||
}
|
||||
|
||||
Decimal64NULL &wrap(
|
||||
char *buffer,
|
||||
const std::uint64_t offset,
|
||||
const std::uint64_t actingVersion,
|
||||
const std::uint64_t bufferLength) {
|
||||
return *this = Decimal64NULL(buffer, offset, bufferLength, actingVersion);
|
||||
}
|
||||
Decimal64NULL &wrap(
|
||||
char *buffer,
|
||||
const std::uint64_t offset,
|
||||
const std::uint64_t actingVersion,
|
||||
const std::uint64_t bufferLength)
|
||||
{
|
||||
return *this = Decimal64NULL(buffer, offset, bufferLength, actingVersion);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
encodedLength() SBE_NOEXCEPT {
|
||||
return 9;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t encodedLength() SBE_NOEXCEPT
|
||||
{
|
||||
return 9;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::uint64_t offset() const SBE_NOEXCEPT { return m_offset; }
|
||||
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 const char *buffer() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
SBE_NODISCARD char *buffer() 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 bufferLength() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_bufferLength;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT {
|
||||
return m_actingVersion;
|
||||
}
|
||||
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)8;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t
|
||||
sbeSchemaVersion() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)5;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static const char *
|
||||
mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT {
|
||||
switch (metaAttribute) {
|
||||
case MetaAttribute::PRESENCE:
|
||||
return "optional";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
SBE_NODISCARD static const char *mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "optional";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t mantissaId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t mantissaId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
mantissaSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= mantissaSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 mantissaNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return INT64_C(9223372036854775807);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT {
|
||||
return -9223372036854775807L;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return INT64_C(-9223372036854775807);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT {
|
||||
return 9223372036854775807L;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return INT64_C(9223372036854775807);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT {
|
||||
return 8;
|
||||
}
|
||||
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);
|
||||
}
|
||||
SBE_NODISCARD std::int64_t mantissa() const SBE_NOEXCEPT
|
||||
{
|
||||
if (m_actingVersion < 6)
|
||||
{
|
||||
return INT64_C(9223372036854775807);
|
||||
}
|
||||
|
||||
Decimal64NULL &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;
|
||||
}
|
||||
std::int64_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset + 0, sizeof(std::int64_t));
|
||||
return SBE_LITTLE_ENDIAN_ENCODE_64(val);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static const char *
|
||||
exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT {
|
||||
switch (metaAttribute) {
|
||||
case MetaAttribute::PRESENCE:
|
||||
return "optional";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Decimal64NULL &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;
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t exponentId() SBE_NOEXCEPT { return -1; }
|
||||
SBE_NODISCARD static const char *exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "optional";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
exponentSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t exponentId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= exponentSinceVersion();
|
||||
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;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::size_t exponentEncodingOffset() SBE_NOEXCEPT
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT {
|
||||
return (std::int8_t)127;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int8_t exponentNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::int8_t>(127);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT {
|
||||
return (std::int8_t)-127;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int8_t exponentMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::int8_t>(-127);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT {
|
||||
return (std::int8_t)127;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::int8_t>(127);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT {
|
||||
return 1;
|
||||
}
|
||||
static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::int8_t exponent() const SBE_NOEXCEPT {
|
||||
std::int8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset + 8, sizeof(std::int8_t));
|
||||
return (val);
|
||||
}
|
||||
SBE_NODISCARD std::int8_t exponent() const SBE_NOEXCEPT
|
||||
{
|
||||
if (m_actingVersion < 6)
|
||||
{
|
||||
return static_cast<std::int8_t>(127);
|
||||
}
|
||||
|
||||
Decimal64NULL &exponent(const std::int8_t value) SBE_NOEXCEPT {
|
||||
std::int8_t val = (value);
|
||||
std::memcpy(m_buffer + m_offset + 8, &val, sizeof(std::int8_t));
|
||||
return *this;
|
||||
}
|
||||
std::int8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset + 8, sizeof(std::int8_t));
|
||||
return (val);
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &operator<<(
|
||||
std::basic_ostream<CharT, Traits> &builder, Decimal64NULL writer) {
|
||||
builder << '{';
|
||||
builder << R"("mantissa": )";
|
||||
builder << +writer.mantissa();
|
||||
Decimal64NULL &exponent(const std::int8_t value) SBE_NOEXCEPT
|
||||
{
|
||||
std::int8_t val = (value);
|
||||
std::memcpy(m_buffer + m_offset + 8, &val, sizeof(std::int8_t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
builder << ", ";
|
||||
builder << R"("exponent": )";
|
||||
builder << +writer.exponent();
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &builder, Decimal64NULL writer)
|
||||
{
|
||||
builder << '{';
|
||||
builder << R"("mantissa": )";
|
||||
builder << +writer.mantissa();
|
||||
|
||||
builder << '}';
|
||||
builder << ", ";
|
||||
builder << R"("exponent": )";
|
||||
builder << +writer.exponent();
|
||||
|
||||
builder << '}';
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#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
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_EXECACKSTATUS_H_
|
||||
#define _ILINKBINARY_EXECACKSTATUS_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class ExecAckStatus {
|
||||
public:
|
||||
enum Value {
|
||||
Accepted = (std::uint8_t)1,
|
||||
Rejected = (std::uint8_t)2,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class ExecAckStatus
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Accepted = static_cast<std::uint8_t>(1),
|
||||
Rejected = static_cast<std::uint8_t>(2),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static ExecAckStatus::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return Accepted;
|
||||
case 2:
|
||||
return Rejected;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static ExecAckStatus::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(1): return Accepted;
|
||||
case static_cast<std::uint8_t>(2): return Rejected;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ExecAckStatus [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ExecAckStatus [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const ExecAckStatus::Value value) {
|
||||
switch (value) {
|
||||
case Accepted:
|
||||
return "Accepted";
|
||||
case Rejected:
|
||||
return "Rejected";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const ExecAckStatus::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Accepted: return "Accepted";
|
||||
case Rejected: return "Rejected";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ExecAckStatus [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ExecAckStatus [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, ExecAckStatus::Value m) {
|
||||
return os << ExecAckStatus::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, ExecAckStatus::Value m)
|
||||
{
|
||||
return os << ExecAckStatus::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,39 +4,33 @@
|
||||
|
||||
#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()
|
||||
# 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
|
||||
# include <math.h>
|
||||
# define SBE_FLOAT_NAN NAN
|
||||
# define SBE_DOUBLE_NAN NAN
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
# define SBE_CONSTEXPR constexpr
|
||||
# define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
# define SBE_CONSTEXPR
|
||||
# define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
# include <string_view>
|
||||
# define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
# define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
@@ -44,43 +38,43 @@
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
|
||||
#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)
|
||||
# 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)
|
||||
# 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)
|
||||
# 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."
|
||||
# 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)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false)
|
||||
#elif defined(_MSC_VER)
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
#else
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
#endif
|
||||
|
||||
#define SBE_NULLVALUE_INT8 (std::numeric_limits<std::int8_t>::min)()
|
||||
@@ -92,364 +86,428 @@
|
||||
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
|
||||
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::max)()
|
||||
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class ExecInst {
|
||||
private:
|
||||
char *m_buffer = nullptr;
|
||||
std::uint64_t m_bufferLength = 0;
|
||||
std::uint64_t m_offset = 0;
|
||||
std::uint64_t m_actingVersion = 0;
|
||||
class ExecInst
|
||||
{
|
||||
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 };
|
||||
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_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;
|
||||
};
|
||||
union sbe_double_as_uint_u
|
||||
{
|
||||
double fp_value;
|
||||
std::uint64_t uint_value;
|
||||
};
|
||||
|
||||
ExecInst() = default;
|
||||
ExecInst() = default;
|
||||
|
||||
ExecInst(
|
||||
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]");
|
||||
}
|
||||
}
|
||||
ExecInst(
|
||||
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]");
|
||||
}
|
||||
}
|
||||
|
||||
ExecInst(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength,
|
||||
const std::uint64_t actingVersion)
|
||||
: ExecInst(buffer, 0, bufferLength, actingVersion) {}
|
||||
ExecInst(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength,
|
||||
const std::uint64_t actingVersion) :
|
||||
ExecInst(buffer, 0, bufferLength, actingVersion)
|
||||
{
|
||||
}
|
||||
|
||||
ExecInst(char *buffer, const std::uint64_t bufferLength)
|
||||
: ExecInst(buffer, 0, bufferLength, sbeSchemaVersion()) {}
|
||||
ExecInst(
|
||||
char *buffer,
|
||||
const std::uint64_t bufferLength) :
|
||||
ExecInst(buffer, 0, bufferLength, sbeSchemaVersion())
|
||||
{
|
||||
}
|
||||
|
||||
ExecInst &wrap(
|
||||
char *buffer,
|
||||
const std::uint64_t offset,
|
||||
const std::uint64_t actingVersion,
|
||||
const std::uint64_t bufferLength) {
|
||||
return *this = ExecInst(buffer, offset, bufferLength, actingVersion);
|
||||
}
|
||||
ExecInst &wrap(
|
||||
char *buffer,
|
||||
const std::uint64_t offset,
|
||||
const std::uint64_t actingVersion,
|
||||
const std::uint64_t bufferLength)
|
||||
{
|
||||
return *this = ExecInst(buffer, offset, bufferLength, actingVersion);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
encodedLength() SBE_NOEXCEPT {
|
||||
return 1;
|
||||
}
|
||||
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 std::uint64_t offset() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_offset;
|
||||
}
|
||||
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT { return m_buffer; }
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
SBE_NODISCARD char *buffer() 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 bufferLength() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_bufferLength;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT {
|
||||
return m_actingVersion;
|
||||
}
|
||||
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)8;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t
|
||||
sbeSchemaVersion() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)5;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
ExecInst &clear() {
|
||||
std::uint8_t zero = 0;
|
||||
std::memcpy(m_buffer + m_offset, &zero, sizeof(std::uint8_t));
|
||||
return *this;
|
||||
}
|
||||
ExecInst &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 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;
|
||||
}
|
||||
SBE_NODISCARD std::uint8_t rawValue() const
|
||||
{
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return val;
|
||||
}
|
||||
|
||||
ExecInst &rawValue(std::uint8_t value) {
|
||||
std::memcpy(m_buffer + m_offset, &value, sizeof(std::uint8_t));
|
||||
return *this;
|
||||
}
|
||||
ExecInst &rawValue(std::uint8_t value)
|
||||
{
|
||||
std::memcpy(m_buffer + m_offset, &value, sizeof(std::uint8_t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
static bool aON(const std::uint8_t bits) { return (bits & (1u << 0u)) != 0; }
|
||||
static bool aON(const std::uint8_t bits)
|
||||
{
|
||||
return (bits & (static_cast<std::uint8_t>(1) << 0u)) != 0;
|
||||
}
|
||||
|
||||
static std::uint8_t aON(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));
|
||||
}
|
||||
static std::uint8_t aON(const std::uint8_t bits, const bool value)
|
||||
{
|
||||
return value ? static_cast<std::uint8_t>(bits | (static_cast<std::uint8_t>(1) << 0u)) : static_cast<std::uint8_t>(bits & ~(static_cast<std::uint8_t>(1) << 0u));
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool aON() const {
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (1u << 0u)) != 0;
|
||||
}
|
||||
SBE_NODISCARD bool aON() const
|
||||
{
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (static_cast<std::uint8_t>(1) << 0u)) != 0;
|
||||
}
|
||||
|
||||
ExecInst &aON(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;
|
||||
}
|
||||
ExecInst &aON(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) | (static_cast<std::uint8_t>(1) << 0u)) : static_cast<std::uint8_t>((bits) & ~(static_cast<std::uint8_t>(1) << 0u)));
|
||||
std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
static bool oB(const std::uint8_t bits) { return (bits & (1u << 1u)) != 0; }
|
||||
static bool oB(const std::uint8_t bits)
|
||||
{
|
||||
return (bits & (static_cast<std::uint8_t>(1) << 1u)) != 0;
|
||||
}
|
||||
|
||||
static std::uint8_t oB(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));
|
||||
}
|
||||
static std::uint8_t oB(const std::uint8_t bits, const bool value)
|
||||
{
|
||||
return value ? static_cast<std::uint8_t>(bits | (static_cast<std::uint8_t>(1) << 1u)) : static_cast<std::uint8_t>(bits & ~(static_cast<std::uint8_t>(1) << 1u));
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool oB() const {
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (1u << 1u)) != 0;
|
||||
}
|
||||
SBE_NODISCARD bool oB() const
|
||||
{
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (static_cast<std::uint8_t>(1) << 1u)) != 0;
|
||||
}
|
||||
|
||||
ExecInst &oB(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;
|
||||
}
|
||||
ExecInst &oB(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) | (static_cast<std::uint8_t>(1) << 1u)) : static_cast<std::uint8_t>((bits) & ~(static_cast<std::uint8_t>(1) << 1u)));
|
||||
std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
static bool nH(const std::uint8_t bits) { return (bits & (1u << 2u)) != 0; }
|
||||
static bool nH(const std::uint8_t bits)
|
||||
{
|
||||
return (bits & (static_cast<std::uint8_t>(1) << 2u)) != 0;
|
||||
}
|
||||
|
||||
static std::uint8_t nH(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));
|
||||
}
|
||||
static std::uint8_t nH(const std::uint8_t bits, const bool value)
|
||||
{
|
||||
return value ? static_cast<std::uint8_t>(bits | (static_cast<std::uint8_t>(1) << 2u)) : static_cast<std::uint8_t>(bits & ~(static_cast<std::uint8_t>(1) << 2u));
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool nH() const {
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (1u << 2u)) != 0;
|
||||
}
|
||||
SBE_NODISCARD bool nH() const
|
||||
{
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (static_cast<std::uint8_t>(1) << 2u)) != 0;
|
||||
}
|
||||
|
||||
ExecInst &nH(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;
|
||||
}
|
||||
ExecInst &nH(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) | (static_cast<std::uint8_t>(1) << 2u)) : static_cast<std::uint8_t>((bits) & ~(static_cast<std::uint8_t>(1) << 2u)));
|
||||
std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
static bool reserved1(const std::uint8_t bits) {
|
||||
return (bits & (1u << 3u)) != 0;
|
||||
}
|
||||
static bool reserved1(const std::uint8_t bits)
|
||||
{
|
||||
return (bits & (static_cast<std::uint8_t>(1) << 3u)) != 0;
|
||||
}
|
||||
|
||||
static std::uint8_t reserved1(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));
|
||||
}
|
||||
static std::uint8_t reserved1(const std::uint8_t bits, const bool value)
|
||||
{
|
||||
return value ? static_cast<std::uint8_t>(bits | (static_cast<std::uint8_t>(1) << 3u)) : static_cast<std::uint8_t>(bits & ~(static_cast<std::uint8_t>(1) << 3u));
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool reserved1() const {
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (1u << 3u)) != 0;
|
||||
}
|
||||
SBE_NODISCARD bool reserved1() const
|
||||
{
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (static_cast<std::uint8_t>(1) << 3u)) != 0;
|
||||
}
|
||||
|
||||
ExecInst &reserved1(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;
|
||||
}
|
||||
ExecInst &reserved1(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) | (static_cast<std::uint8_t>(1) << 3u)) : static_cast<std::uint8_t>((bits) & ~(static_cast<std::uint8_t>(1) << 3u)));
|
||||
std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
static bool reserved2(const std::uint8_t bits) {
|
||||
return (bits & (1u << 4u)) != 0;
|
||||
}
|
||||
static bool reserved2(const std::uint8_t bits)
|
||||
{
|
||||
return (bits & (static_cast<std::uint8_t>(1) << 4u)) != 0;
|
||||
}
|
||||
|
||||
static std::uint8_t reserved2(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));
|
||||
}
|
||||
static std::uint8_t reserved2(const std::uint8_t bits, const bool value)
|
||||
{
|
||||
return value ? static_cast<std::uint8_t>(bits | (static_cast<std::uint8_t>(1) << 4u)) : static_cast<std::uint8_t>(bits & ~(static_cast<std::uint8_t>(1) << 4u));
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool reserved2() const {
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (1u << 4u)) != 0;
|
||||
}
|
||||
SBE_NODISCARD bool reserved2() const
|
||||
{
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (static_cast<std::uint8_t>(1) << 4u)) != 0;
|
||||
}
|
||||
|
||||
ExecInst &reserved2(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;
|
||||
}
|
||||
ExecInst &reserved2(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) | (static_cast<std::uint8_t>(1) << 4u)) : static_cast<std::uint8_t>((bits) & ~(static_cast<std::uint8_t>(1) << 4u)));
|
||||
std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
static bool reserved3(const std::uint8_t bits) {
|
||||
return (bits & (1u << 5u)) != 0;
|
||||
}
|
||||
static bool reserved3(const std::uint8_t bits)
|
||||
{
|
||||
return (bits & (static_cast<std::uint8_t>(1) << 5u)) != 0;
|
||||
}
|
||||
|
||||
static std::uint8_t reserved3(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));
|
||||
}
|
||||
static std::uint8_t reserved3(const std::uint8_t bits, const bool value)
|
||||
{
|
||||
return value ? static_cast<std::uint8_t>(bits | (static_cast<std::uint8_t>(1) << 5u)) : static_cast<std::uint8_t>(bits & ~(static_cast<std::uint8_t>(1) << 5u));
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool reserved3() const {
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (1u << 5u)) != 0;
|
||||
}
|
||||
SBE_NODISCARD bool reserved3() const
|
||||
{
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (static_cast<std::uint8_t>(1) << 5u)) != 0;
|
||||
}
|
||||
|
||||
ExecInst &reserved3(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;
|
||||
}
|
||||
ExecInst &reserved3(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) | (static_cast<std::uint8_t>(1) << 5u)) : static_cast<std::uint8_t>((bits) & ~(static_cast<std::uint8_t>(1) << 5u)));
|
||||
std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
static bool reserved4(const std::uint8_t bits) {
|
||||
return (bits & (1u << 6u)) != 0;
|
||||
}
|
||||
static bool reserved4(const std::uint8_t bits)
|
||||
{
|
||||
return (bits & (static_cast<std::uint8_t>(1) << 6u)) != 0;
|
||||
}
|
||||
|
||||
static std::uint8_t reserved4(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));
|
||||
}
|
||||
static std::uint8_t reserved4(const std::uint8_t bits, const bool value)
|
||||
{
|
||||
return value ? static_cast<std::uint8_t>(bits | (static_cast<std::uint8_t>(1) << 6u)) : static_cast<std::uint8_t>(bits & ~(static_cast<std::uint8_t>(1) << 6u));
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool reserved4() const {
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (1u << 6u)) != 0;
|
||||
}
|
||||
SBE_NODISCARD bool reserved4() const
|
||||
{
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (static_cast<std::uint8_t>(1) << 6u)) != 0;
|
||||
}
|
||||
|
||||
ExecInst &reserved4(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;
|
||||
}
|
||||
ExecInst &reserved4(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) | (static_cast<std::uint8_t>(1) << 6u)) : static_cast<std::uint8_t>((bits) & ~(static_cast<std::uint8_t>(1) << 6u)));
|
||||
std::memcpy(m_buffer + m_offset, &bits, sizeof(std::uint8_t));
|
||||
return *this;
|
||||
}
|
||||
|
||||
static bool reserved5(const std::uint8_t bits) {
|
||||
return (bits & (1u << 7u)) != 0;
|
||||
}
|
||||
static bool reserved5(const std::uint8_t bits)
|
||||
{
|
||||
return (bits & (static_cast<std::uint8_t>(1) << 7u)) != 0;
|
||||
}
|
||||
|
||||
static std::uint8_t reserved5(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));
|
||||
}
|
||||
static std::uint8_t reserved5(const std::uint8_t bits, const bool value)
|
||||
{
|
||||
return value ? static_cast<std::uint8_t>(bits | (static_cast<std::uint8_t>(1) << 7u)) : static_cast<std::uint8_t>(bits & ~(static_cast<std::uint8_t>(1) << 7u));
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool reserved5() const {
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (1u << 7u)) != 0;
|
||||
}
|
||||
SBE_NODISCARD bool reserved5() const
|
||||
{
|
||||
std::uint8_t val;
|
||||
std::memcpy(&val, m_buffer + m_offset, sizeof(std::uint8_t));
|
||||
return ((val) & (static_cast<std::uint8_t>(1) << 7u)) != 0;
|
||||
}
|
||||
|
||||
ExecInst &reserved5(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;
|
||||
}
|
||||
ExecInst &reserved5(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) | (static_cast<std::uint8_t>(1) << 7u)) : static_cast<std::uint8_t>((bits) & ~(static_cast<std::uint8_t>(1) << 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, ExecInst writer) {
|
||||
builder << '[';
|
||||
bool atLeastOne = false;
|
||||
if (writer.aON()) {
|
||||
builder << R"("aON")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.oB()) {
|
||||
if (atLeastOne) {
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("oB")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.nH()) {
|
||||
if (atLeastOne) {
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("nH")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.reserved1()) {
|
||||
if (atLeastOne) {
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("reserved1")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.reserved2()) {
|
||||
if (atLeastOne) {
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("reserved2")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.reserved3()) {
|
||||
if (atLeastOne) {
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("reserved3")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.reserved4()) {
|
||||
if (atLeastOne) {
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("reserved4")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.reserved5()) {
|
||||
if (atLeastOne) {
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("reserved5")";
|
||||
}
|
||||
builder << ']';
|
||||
return builder;
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &builder, ExecInst writer)
|
||||
{
|
||||
builder << '[';
|
||||
bool atLeastOne = false;
|
||||
if (writer.aON())
|
||||
{
|
||||
builder << R"("aON")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.oB())
|
||||
{
|
||||
if (atLeastOne)
|
||||
{
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("oB")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.nH())
|
||||
{
|
||||
if (atLeastOne)
|
||||
{
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("nH")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.reserved1())
|
||||
{
|
||||
if (atLeastOne)
|
||||
{
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("reserved1")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.reserved2())
|
||||
{
|
||||
if (atLeastOne)
|
||||
{
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("reserved2")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.reserved3())
|
||||
{
|
||||
if (atLeastOne)
|
||||
{
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("reserved3")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.reserved4())
|
||||
{
|
||||
if (atLeastOne)
|
||||
{
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("reserved4")";
|
||||
atLeastOne = true;
|
||||
}
|
||||
if (writer.reserved5())
|
||||
{
|
||||
if (atLeastOne)
|
||||
{
|
||||
builder << ",";
|
||||
}
|
||||
builder << R"("reserved5")";
|
||||
}
|
||||
builder << ']';
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_EXECMODE_H_
|
||||
#define _ILINKBINARY_EXECMODE_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class ExecMode {
|
||||
public:
|
||||
enum Value {
|
||||
Aggressive = (char)65,
|
||||
Passive = (char)80,
|
||||
NULL_VALUE = (char)0
|
||||
};
|
||||
class ExecMode
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Aggressive = static_cast<char>(65),
|
||||
Passive = static_cast<char>(80),
|
||||
NULL_VALUE = static_cast<char>(0x00)
|
||||
};
|
||||
|
||||
static ExecMode::Value get(const char value) {
|
||||
switch (value) {
|
||||
case 65:
|
||||
return Aggressive;
|
||||
case 80:
|
||||
return Passive;
|
||||
case 0:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static ExecMode::Value get(const char value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<char>(65): return Aggressive;
|
||||
case static_cast<char>(80): return Passive;
|
||||
case static_cast<char>(0x00): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ExecMode [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ExecMode [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const ExecMode::Value value) {
|
||||
switch (value) {
|
||||
case Aggressive:
|
||||
return "Aggressive";
|
||||
case Passive:
|
||||
return "Passive";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const ExecMode::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Aggressive: return "Aggressive";
|
||||
case Passive: return "Passive";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ExecMode [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ExecMode [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, ExecMode::Value m) {
|
||||
return os << ExecMode::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, ExecMode::Value m)
|
||||
{
|
||||
return os << ExecMode::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_EXECREASON_H_
|
||||
#define _ILINKBINARY_EXECREASON_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,83 +25,78 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class ExecReason {
|
||||
public:
|
||||
enum Value {
|
||||
MarketExchangeOption = (std::uint8_t)8,
|
||||
CancelledNotBest = (std::uint8_t)9,
|
||||
CancelOnDisconnect = (std::uint8_t)100,
|
||||
SelfMatchPreventionOldestOrderCancelled = (std::uint8_t)103,
|
||||
CancelOnGlobexCreditControlsViolation = (std::uint8_t)104,
|
||||
CancelFromFirmsoft = (std::uint8_t)105,
|
||||
CancelFromRiskManagementAPI = (std::uint8_t)106,
|
||||
SelfMatchPreventionNewestOrderCancelled = (std::uint8_t)107,
|
||||
Cancelduetovolquotedoptionorderrestedqtylessthanminordersize =
|
||||
(std::uint8_t)108,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class ExecReason
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
MarketExchangeOption = static_cast<std::uint8_t>(8),
|
||||
CancelledNotBest = static_cast<std::uint8_t>(9),
|
||||
CancelOnDisconnect = static_cast<std::uint8_t>(100),
|
||||
SelfMatchPreventionOldestOrderCancelled = static_cast<std::uint8_t>(103),
|
||||
CancelOnGlobexCreditControlsViolation = static_cast<std::uint8_t>(104),
|
||||
CancelFromFirmsoft = static_cast<std::uint8_t>(105),
|
||||
CancelFromRiskManagementAPI = static_cast<std::uint8_t>(106),
|
||||
SelfMatchPreventionNewestOrderCancelled = static_cast<std::uint8_t>(107),
|
||||
Cancelduetovolquotedoptionorderrestedqtylessthanminordersize = static_cast<std::uint8_t>(108),
|
||||
CancelRFCOrder = static_cast<std::uint8_t>(109),
|
||||
CancelUponContractExpiration = static_cast<std::uint8_t>(110),
|
||||
SystemCancel = static_cast<std::uint8_t>(111),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static ExecReason::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 8:
|
||||
return MarketExchangeOption;
|
||||
case 9:
|
||||
return CancelledNotBest;
|
||||
case 100:
|
||||
return CancelOnDisconnect;
|
||||
case 103:
|
||||
return SelfMatchPreventionOldestOrderCancelled;
|
||||
case 104:
|
||||
return CancelOnGlobexCreditControlsViolation;
|
||||
case 105:
|
||||
return CancelFromFirmsoft;
|
||||
case 106:
|
||||
return CancelFromRiskManagementAPI;
|
||||
case 107:
|
||||
return SelfMatchPreventionNewestOrderCancelled;
|
||||
case 108:
|
||||
return Cancelduetovolquotedoptionorderrestedqtylessthanminordersize;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static ExecReason::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(8): return MarketExchangeOption;
|
||||
case static_cast<std::uint8_t>(9): return CancelledNotBest;
|
||||
case static_cast<std::uint8_t>(100): return CancelOnDisconnect;
|
||||
case static_cast<std::uint8_t>(103): return SelfMatchPreventionOldestOrderCancelled;
|
||||
case static_cast<std::uint8_t>(104): return CancelOnGlobexCreditControlsViolation;
|
||||
case static_cast<std::uint8_t>(105): return CancelFromFirmsoft;
|
||||
case static_cast<std::uint8_t>(106): return CancelFromRiskManagementAPI;
|
||||
case static_cast<std::uint8_t>(107): return SelfMatchPreventionNewestOrderCancelled;
|
||||
case static_cast<std::uint8_t>(108): return Cancelduetovolquotedoptionorderrestedqtylessthanminordersize;
|
||||
case static_cast<std::uint8_t>(109): return CancelRFCOrder;
|
||||
case static_cast<std::uint8_t>(110): return CancelUponContractExpiration;
|
||||
case static_cast<std::uint8_t>(111): return SystemCancel;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ExecReason [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ExecReason [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const ExecReason::Value value) {
|
||||
switch (value) {
|
||||
case MarketExchangeOption:
|
||||
return "MarketExchangeOption";
|
||||
case CancelledNotBest:
|
||||
return "CancelledNotBest";
|
||||
case CancelOnDisconnect:
|
||||
return "CancelOnDisconnect";
|
||||
case SelfMatchPreventionOldestOrderCancelled:
|
||||
return "SelfMatchPreventionOldestOrderCancelled";
|
||||
case CancelOnGlobexCreditControlsViolation:
|
||||
return "CancelOnGlobexCreditControlsViolation";
|
||||
case CancelFromFirmsoft:
|
||||
return "CancelFromFirmsoft";
|
||||
case CancelFromRiskManagementAPI:
|
||||
return "CancelFromRiskManagementAPI";
|
||||
case SelfMatchPreventionNewestOrderCancelled:
|
||||
return "SelfMatchPreventionNewestOrderCancelled";
|
||||
case Cancelduetovolquotedoptionorderrestedqtylessthanminordersize:
|
||||
return "Cancelduetovolquotedoptionorderrestedqtylessthanminordersize";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const ExecReason::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case MarketExchangeOption: return "MarketExchangeOption";
|
||||
case CancelledNotBest: return "CancelledNotBest";
|
||||
case CancelOnDisconnect: return "CancelOnDisconnect";
|
||||
case SelfMatchPreventionOldestOrderCancelled: return "SelfMatchPreventionOldestOrderCancelled";
|
||||
case CancelOnGlobexCreditControlsViolation: return "CancelOnGlobexCreditControlsViolation";
|
||||
case CancelFromFirmsoft: return "CancelFromFirmsoft";
|
||||
case CancelFromRiskManagementAPI: return "CancelFromRiskManagementAPI";
|
||||
case SelfMatchPreventionNewestOrderCancelled: return "SelfMatchPreventionNewestOrderCancelled";
|
||||
case Cancelduetovolquotedoptionorderrestedqtylessthanminordersize: return "Cancelduetovolquotedoptionorderrestedqtylessthanminordersize";
|
||||
case CancelRFCOrder: return "CancelRFCOrder";
|
||||
case CancelUponContractExpiration: return "CancelUponContractExpiration";
|
||||
case SystemCancel: return "SystemCancel";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ExecReason [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ExecReason [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, ExecReason::Value m) {
|
||||
return os << ExecReason::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, ExecReason::Value m)
|
||||
{
|
||||
return os << ExecReason::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_EXECTYPTRDCXL_H_
|
||||
#define _ILINKBINARY_EXECTYPTRDCXL_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class ExecTypTrdCxl {
|
||||
public:
|
||||
enum Value {
|
||||
TradeCorrection = (char)71,
|
||||
TradeCancel = (char)72,
|
||||
NULL_VALUE = (char)0
|
||||
};
|
||||
class ExecTypTrdCxl
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
TradeCorrection = static_cast<char>(71),
|
||||
TradeCancel = static_cast<char>(72),
|
||||
NULL_VALUE = static_cast<char>(0)
|
||||
};
|
||||
|
||||
static ExecTypTrdCxl::Value get(const char value) {
|
||||
switch (value) {
|
||||
case 71:
|
||||
return TradeCorrection;
|
||||
case 72:
|
||||
return TradeCancel;
|
||||
case 0:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static ExecTypTrdCxl::Value get(const char value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<char>(71): return TradeCorrection;
|
||||
case static_cast<char>(72): return TradeCancel;
|
||||
case static_cast<char>(0): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ExecTypTrdCxl [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ExecTypTrdCxl [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const ExecTypTrdCxl::Value value) {
|
||||
switch (value) {
|
||||
case TradeCorrection:
|
||||
return "TradeCorrection";
|
||||
case TradeCancel:
|
||||
return "TradeCancel";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const ExecTypTrdCxl::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case TradeCorrection: return "TradeCorrection";
|
||||
case TradeCancel: return "TradeCancel";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ExecTypTrdCxl [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ExecTypTrdCxl [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, ExecTypTrdCxl::Value m) {
|
||||
return os << ExecTypTrdCxl::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, ExecTypTrdCxl::Value m)
|
||||
{
|
||||
return os << ExecTypTrdCxl::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#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
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_EXPCYCLE_H_
|
||||
#define _ILINKBINARY_EXPCYCLE_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class ExpCycle {
|
||||
public:
|
||||
enum Value {
|
||||
ExpireOnTradingSessionClose = (std::uint8_t)0,
|
||||
Expirationatgivendate = (std::uint8_t)2,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class ExpCycle
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
ExpireOnTradingSessionClose = static_cast<std::uint8_t>(0),
|
||||
Expirationatgivendate = static_cast<std::uint8_t>(2),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static ExpCycle::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return ExpireOnTradingSessionClose;
|
||||
case 2:
|
||||
return Expirationatgivendate;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static ExpCycle::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return ExpireOnTradingSessionClose;
|
||||
case static_cast<std::uint8_t>(2): return Expirationatgivendate;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ExpCycle [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ExpCycle [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const ExpCycle::Value value) {
|
||||
switch (value) {
|
||||
case ExpireOnTradingSessionClose:
|
||||
return "ExpireOnTradingSessionClose";
|
||||
case Expirationatgivendate:
|
||||
return "Expirationatgivendate";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const ExpCycle::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case ExpireOnTradingSessionClose: return "ExpireOnTradingSessionClose";
|
||||
case Expirationatgivendate: return "Expirationatgivendate";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ExpCycle [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ExpCycle [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, ExpCycle::Value m) {
|
||||
return os << ExpCycle::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, ExpCycle::Value m)
|
||||
{
|
||||
return os << ExpCycle::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_FTI_H_
|
||||
#define _ILINKBINARY_FTI_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class FTI {
|
||||
public:
|
||||
enum Value {
|
||||
Backup = (std::uint8_t)0,
|
||||
Primary = (std::uint8_t)1,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class FTI
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Backup = static_cast<std::uint8_t>(0),
|
||||
Primary = static_cast<std::uint8_t>(1),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static FTI::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return Backup;
|
||||
case 1:
|
||||
return Primary;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static FTI::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return Backup;
|
||||
case static_cast<std::uint8_t>(1): return Primary;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum FTI [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum FTI [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const FTI::Value value) {
|
||||
switch (value) {
|
||||
case Backup:
|
||||
return "Backup";
|
||||
case Primary:
|
||||
return "Primary";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const FTI::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Backup: return "Backup";
|
||||
case Primary: return "Primary";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum FTI [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum FTI [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, FTI::Value m) {
|
||||
return os << FTI::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, FTI::Value m)
|
||||
{
|
||||
return os << FTI::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,39 +4,33 @@
|
||||
|
||||
#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()
|
||||
# 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
|
||||
# include <math.h>
|
||||
# define SBE_FLOAT_NAN NAN
|
||||
# define SBE_DOUBLE_NAN NAN
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
# define SBE_CONSTEXPR constexpr
|
||||
# define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
# define SBE_CONSTEXPR
|
||||
# define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
# include <string_view>
|
||||
# define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
# define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
@@ -44,43 +38,43 @@
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
|
||||
#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)
|
||||
# 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)
|
||||
# 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)
|
||||
# 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."
|
||||
# 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)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false)
|
||||
#elif defined(_MSC_VER)
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
#else
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
#endif
|
||||
|
||||
#define SBE_NULLVALUE_INT8 (std::numeric_limits<std::int8_t>::min)()
|
||||
@@ -92,228 +86,276 @@
|
||||
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
|
||||
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::max)()
|
||||
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
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;
|
||||
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 };
|
||||
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_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;
|
||||
};
|
||||
union sbe_double_as_uint_u
|
||||
{
|
||||
double fp_value;
|
||||
std::uint64_t uint_value;
|
||||
};
|
||||
|
||||
GroupSize() = default;
|
||||
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 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,
|
||||
const std::uint64_t actingVersion) :
|
||||
GroupSize(buffer, 0, bufferLength, actingVersion)
|
||||
{
|
||||
}
|
||||
|
||||
GroupSize(char *buffer, const std::uint64_t bufferLength)
|
||||
: GroupSize(buffer, 0, bufferLength, sbeSchemaVersion()) {}
|
||||
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);
|
||||
}
|
||||
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 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 std::uint64_t offset() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_offset;
|
||||
}
|
||||
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT { return m_buffer; }
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
SBE_NODISCARD char *buffer() 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 bufferLength() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_bufferLength;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT {
|
||||
return m_actingVersion;
|
||||
}
|
||||
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)8;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t
|
||||
sbeSchemaVersion() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)5;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static const char *
|
||||
blockLengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT {
|
||||
switch (metaAttribute) {
|
||||
case MetaAttribute::PRESENCE:
|
||||
return "required";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
SBE_NODISCARD static const char *blockLengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "required";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t blockLengthId() SBE_NOEXCEPT {
|
||||
return -1;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t blockLengthId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
blockLengthSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t blockLengthSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool blockLengthInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool blockLengthInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= blockLengthSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 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 blockLengthMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t blockLengthMaxValue() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)65534;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t blockLengthMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(65534);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t blockLengthEncodingLength() SBE_NOEXCEPT {
|
||||
return 2;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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 const char *numInGroupMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "required";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t numInGroupId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t numInGroupId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
numInGroupSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t numInGroupSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool numInGroupInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool numInGroupInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= numInGroupSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 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 numInGroupMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint8_t>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint8_t numInGroupMaxValue() SBE_NOEXCEPT {
|
||||
return (std::uint8_t)254;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint8_t numInGroupMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint8_t>(254);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t numInGroupEncodingLength() SBE_NOEXCEPT {
|
||||
return 1;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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();
|
||||
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 << ", ";
|
||||
builder << R"("numInGroup": )";
|
||||
builder << +writer.numInGroup();
|
||||
|
||||
builder << '}';
|
||||
builder << '}';
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_KEEPALIVELAPSED_H_
|
||||
#define _ILINKBINARY_KEEPALIVELAPSED_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,48 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class KeepAliveLapsed {
|
||||
public:
|
||||
enum Value {
|
||||
NotLapsed = (std::uint8_t)0,
|
||||
Lapsed = (std::uint8_t)1,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class KeepAliveLapsed
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
NotLapsed = static_cast<std::uint8_t>(0),
|
||||
Lapsed = static_cast<std::uint8_t>(1),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static KeepAliveLapsed::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return NotLapsed;
|
||||
case 1:
|
||||
return Lapsed;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static KeepAliveLapsed::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return NotLapsed;
|
||||
case static_cast<std::uint8_t>(1): return Lapsed;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum KeepAliveLapsed [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum KeepAliveLapsed [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const KeepAliveLapsed::Value value) {
|
||||
switch (value) {
|
||||
case NotLapsed:
|
||||
return "NotLapsed";
|
||||
case Lapsed:
|
||||
return "Lapsed";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const KeepAliveLapsed::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case NotLapsed: return "NotLapsed";
|
||||
case Lapsed: return "Lapsed";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum KeepAliveLapsed [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum KeepAliveLapsed [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, KeepAliveLapsed::Value m) {
|
||||
return os << KeepAliveLapsed::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, KeepAliveLapsed::Value m)
|
||||
{
|
||||
return os << KeepAliveLapsed::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_LISTUPDACT_H_
|
||||
#define _ILINKBINARY_LISTUPDACT_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,43 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class ListUpdAct {
|
||||
public:
|
||||
enum Value { Add = (char)65, Delete = (char)68, NULL_VALUE = (char)0 };
|
||||
class ListUpdAct
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Add = static_cast<char>(65),
|
||||
Delete = static_cast<char>(68),
|
||||
NULL_VALUE = static_cast<char>(0)
|
||||
};
|
||||
|
||||
static ListUpdAct::Value get(const char value) {
|
||||
switch (value) {
|
||||
case 65:
|
||||
return Add;
|
||||
case 68:
|
||||
return Delete;
|
||||
case 0:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static ListUpdAct::Value get(const char value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<char>(65): return Add;
|
||||
case static_cast<char>(68): return Delete;
|
||||
case static_cast<char>(0): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ListUpdAct [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ListUpdAct [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const ListUpdAct::Value value) {
|
||||
switch (value) {
|
||||
case Add:
|
||||
return "Add";
|
||||
case Delete:
|
||||
return "Delete";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const ListUpdAct::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Add: return "Add";
|
||||
case Delete: return "Delete";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ListUpdAct [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ListUpdAct [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, ListUpdAct::Value m) {
|
||||
return os << ListUpdAct::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, ListUpdAct::Value m)
|
||||
{
|
||||
return os << ListUpdAct::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_MANUALORDIND_H_
|
||||
#define _ILINKBINARY_MANUALORDIND_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class ManualOrdInd {
|
||||
public:
|
||||
enum Value {
|
||||
Automated = (std::uint8_t)0,
|
||||
Manual = (std::uint8_t)1,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class ManualOrdInd
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Automated = static_cast<std::uint8_t>(0),
|
||||
Manual = static_cast<std::uint8_t>(1),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static ManualOrdInd::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return Automated;
|
||||
case 1:
|
||||
return Manual;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static ManualOrdInd::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return Automated;
|
||||
case static_cast<std::uint8_t>(1): return Manual;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ManualOrdInd [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ManualOrdInd [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const ManualOrdInd::Value value) {
|
||||
switch (value) {
|
||||
case Automated:
|
||||
return "Automated";
|
||||
case Manual:
|
||||
return "Manual";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const ManualOrdInd::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Automated: return "Automated";
|
||||
case Manual: return "Manual";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ManualOrdInd [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ManualOrdInd [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, ManualOrdInd::Value m) {
|
||||
return os << ManualOrdInd::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, ManualOrdInd::Value m)
|
||||
{
|
||||
return os << ManualOrdInd::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_MANUALORDINDREQ_H_
|
||||
#define _ILINKBINARY_MANUALORDINDREQ_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,48 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class ManualOrdIndReq {
|
||||
public:
|
||||
enum Value {
|
||||
Automated = (std::uint8_t)0,
|
||||
Manual = (std::uint8_t)1,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class ManualOrdIndReq
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Automated = static_cast<std::uint8_t>(0),
|
||||
Manual = static_cast<std::uint8_t>(1),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static ManualOrdIndReq::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return Automated;
|
||||
case 1:
|
||||
return Manual;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static ManualOrdIndReq::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return Automated;
|
||||
case static_cast<std::uint8_t>(1): return Manual;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ManualOrdIndReq [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ManualOrdIndReq [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const ManualOrdIndReq::Value value) {
|
||||
switch (value) {
|
||||
case Automated:
|
||||
return "Automated";
|
||||
case Manual:
|
||||
return "Manual";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const ManualOrdIndReq::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Automated: return "Automated";
|
||||
case Manual: return "Manual";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum ManualOrdIndReq [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ManualOrdIndReq [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, ManualOrdIndReq::Value m) {
|
||||
return os << ManualOrdIndReq::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, ManualOrdIndReq::Value m)
|
||||
{
|
||||
return os << ManualOrdIndReq::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_MASSACTIONORDTYP_H_
|
||||
#define _ILINKBINARY_MASSACTIONORDTYP_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,45 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class MassActionOrdTyp {
|
||||
public:
|
||||
enum Value { Limit = (char)50, StopLimit = (char)52, NULL_VALUE = (char)0 };
|
||||
class MassActionOrdTyp
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Limit = static_cast<char>(50),
|
||||
StopLimit = static_cast<char>(52),
|
||||
NULL_VALUE = static_cast<char>(48)
|
||||
};
|
||||
|
||||
static MassActionOrdTyp::Value get(const char value) {
|
||||
switch (value) {
|
||||
case 50:
|
||||
return Limit;
|
||||
case 52:
|
||||
return StopLimit;
|
||||
case 0:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static MassActionOrdTyp::Value get(const char value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<char>(50): return Limit;
|
||||
case static_cast<char>(52): return StopLimit;
|
||||
case static_cast<char>(48): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum MassActionOrdTyp [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassActionOrdTyp [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const MassActionOrdTyp::Value value) {
|
||||
switch (value) {
|
||||
case Limit:
|
||||
return "Limit";
|
||||
case StopLimit:
|
||||
return "StopLimit";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const MassActionOrdTyp::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Limit: return "Limit";
|
||||
case StopLimit: return "StopLimit";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum MassActionOrdTyp [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassActionOrdTyp [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &operator<<(
|
||||
std::basic_ostream<CharT, Traits> &os, MassActionOrdTyp::Value m) {
|
||||
return os << MassActionOrdTyp::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, MassActionOrdTyp::Value m)
|
||||
{
|
||||
return os << MassActionOrdTyp::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_MASSACTIONRESPONSE_H_
|
||||
#define _ILINKBINARY_MASSACTIONRESPONSE_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,49 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class MassActionResponse {
|
||||
public:
|
||||
enum Value {
|
||||
Rejected = (std::uint8_t)0,
|
||||
Accepted = (std::uint8_t)1,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class MassActionResponse
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Rejected = static_cast<std::uint8_t>(0),
|
||||
Accepted = static_cast<std::uint8_t>(1),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static MassActionResponse::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return Rejected;
|
||||
case 1:
|
||||
return Accepted;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static MassActionResponse::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return Rejected;
|
||||
case static_cast<std::uint8_t>(1): return Accepted;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum MassActionResponse [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassActionResponse [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const MassActionResponse::Value value) {
|
||||
switch (value) {
|
||||
case Rejected:
|
||||
return "Rejected";
|
||||
case Accepted:
|
||||
return "Accepted";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const MassActionResponse::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Rejected: return "Rejected";
|
||||
case Accepted: return "Accepted";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum MassActionResponse [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassActionResponse [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &operator<<(
|
||||
std::basic_ostream<CharT, Traits> &os, MassActionResponse::Value m) {
|
||||
return os << MassActionResponse::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, MassActionResponse::Value m)
|
||||
{
|
||||
return os << MassActionResponse::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_MASSACTIONSCOPE_H_
|
||||
#define _ILINKBINARY_MASSACTIONSCOPE_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,63 +25,57 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class MassActionScope {
|
||||
public:
|
||||
enum Value {
|
||||
Instrument = (std::uint8_t)1,
|
||||
All = (std::uint8_t)7,
|
||||
MarketSegmentID = (std::uint8_t)9,
|
||||
InstrumentGroup = (std::uint8_t)10,
|
||||
QuoteSetID = (std::uint8_t)100,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class MassActionScope
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Instrument = static_cast<std::uint8_t>(1),
|
||||
All = static_cast<std::uint8_t>(7),
|
||||
MarketSegmentID = static_cast<std::uint8_t>(9),
|
||||
InstrumentGroup = static_cast<std::uint8_t>(10),
|
||||
QuoteSetID = static_cast<std::uint8_t>(100),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static MassActionScope::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return Instrument;
|
||||
case 7:
|
||||
return All;
|
||||
case 9:
|
||||
return MarketSegmentID;
|
||||
case 10:
|
||||
return InstrumentGroup;
|
||||
case 100:
|
||||
return QuoteSetID;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static MassActionScope::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(1): return Instrument;
|
||||
case static_cast<std::uint8_t>(7): return All;
|
||||
case static_cast<std::uint8_t>(9): return MarketSegmentID;
|
||||
case static_cast<std::uint8_t>(10): return InstrumentGroup;
|
||||
case static_cast<std::uint8_t>(100): return QuoteSetID;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum MassActionScope [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassActionScope [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const MassActionScope::Value value) {
|
||||
switch (value) {
|
||||
case Instrument:
|
||||
return "Instrument";
|
||||
case All:
|
||||
return "All";
|
||||
case MarketSegmentID:
|
||||
return "MarketSegmentID";
|
||||
case InstrumentGroup:
|
||||
return "InstrumentGroup";
|
||||
case QuoteSetID:
|
||||
return "QuoteSetID";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const MassActionScope::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Instrument: return "Instrument";
|
||||
case All: return "All";
|
||||
case MarketSegmentID: return "MarketSegmentID";
|
||||
case InstrumentGroup: return "InstrumentGroup";
|
||||
case QuoteSetID: return "QuoteSetID";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum MassActionScope [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassActionScope [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, MassActionScope::Value m) {
|
||||
return os << MassActionScope::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, MassActionScope::Value m)
|
||||
{
|
||||
return os << MassActionScope::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_MASSCANCELTIF_H_
|
||||
#define _ILINKBINARY_MASSCANCELTIF_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,52 +25,51 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class MassCancelTIF {
|
||||
public:
|
||||
enum Value {
|
||||
Day = (std::uint8_t)0,
|
||||
GoodTillCancel = (std::uint8_t)1,
|
||||
GoodTillDate = (std::uint8_t)6,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class MassCancelTIF
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Day = static_cast<std::uint8_t>(0),
|
||||
GoodTillCancel = static_cast<std::uint8_t>(1),
|
||||
GoodTillDate = static_cast<std::uint8_t>(6),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static MassCancelTIF::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return Day;
|
||||
case 1:
|
||||
return GoodTillCancel;
|
||||
case 6:
|
||||
return GoodTillDate;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static MassCancelTIF::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return Day;
|
||||
case static_cast<std::uint8_t>(1): return GoodTillCancel;
|
||||
case static_cast<std::uint8_t>(6): return GoodTillDate;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum MassCancelTIF [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassCancelTIF [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const MassCancelTIF::Value value) {
|
||||
switch (value) {
|
||||
case Day:
|
||||
return "Day";
|
||||
case GoodTillCancel:
|
||||
return "GoodTillCancel";
|
||||
case GoodTillDate:
|
||||
return "GoodTillDate";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const MassCancelTIF::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Day: return "Day";
|
||||
case GoodTillCancel: return "GoodTillCancel";
|
||||
case GoodTillDate: return "GoodTillDate";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum MassCancelTIF [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassCancelTIF [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, MassCancelTIF::Value m) {
|
||||
return os << MassCancelTIF::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, MassCancelTIF::Value m)
|
||||
{
|
||||
return os << MassCancelTIF::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_MASSCXLREQTYP_H_
|
||||
#define _ILINKBINARY_MASSCXLREQTYP_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class MassCxlReqTyp {
|
||||
public:
|
||||
enum Value {
|
||||
SenderSubID = (std::uint8_t)100,
|
||||
Account = (std::uint8_t)101,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class MassCxlReqTyp
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
SenderSubID = static_cast<std::uint8_t>(100),
|
||||
Account = static_cast<std::uint8_t>(101),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static MassCxlReqTyp::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 100:
|
||||
return SenderSubID;
|
||||
case 101:
|
||||
return Account;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static MassCxlReqTyp::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(100): return SenderSubID;
|
||||
case static_cast<std::uint8_t>(101): return Account;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum MassCxlReqTyp [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassCxlReqTyp [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const MassCxlReqTyp::Value value) {
|
||||
switch (value) {
|
||||
case SenderSubID:
|
||||
return "SenderSubID";
|
||||
case Account:
|
||||
return "Account";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const MassCxlReqTyp::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case SenderSubID: return "SenderSubID";
|
||||
case Account: return "Account";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum MassCxlReqTyp [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassCxlReqTyp [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, MassCxlReqTyp::Value m) {
|
||||
return os << MassCxlReqTyp::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, MassCxlReqTyp::Value m)
|
||||
{
|
||||
return os << MassCxlReqTyp::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_MASSSTATUSORDTYP_H_
|
||||
#define _ILINKBINARY_MASSSTATUSORDTYP_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,49 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class MassStatusOrdTyp {
|
||||
public:
|
||||
enum Value {
|
||||
SenderSubID = (std::uint8_t)100,
|
||||
Account = (std::uint8_t)101,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class MassStatusOrdTyp
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
SenderSubID = static_cast<std::uint8_t>(100),
|
||||
Account = static_cast<std::uint8_t>(101),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static MassStatusOrdTyp::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 100:
|
||||
return SenderSubID;
|
||||
case 101:
|
||||
return Account;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static MassStatusOrdTyp::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(100): return SenderSubID;
|
||||
case static_cast<std::uint8_t>(101): return Account;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum MassStatusOrdTyp [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassStatusOrdTyp [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const MassStatusOrdTyp::Value value) {
|
||||
switch (value) {
|
||||
case SenderSubID:
|
||||
return "SenderSubID";
|
||||
case Account:
|
||||
return "Account";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const MassStatusOrdTyp::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case SenderSubID: return "SenderSubID";
|
||||
case Account: return "Account";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum MassStatusOrdTyp [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassStatusOrdTyp [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &operator<<(
|
||||
std::basic_ostream<CharT, Traits> &os, MassStatusOrdTyp::Value m) {
|
||||
return os << MassStatusOrdTyp::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, MassStatusOrdTyp::Value m)
|
||||
{
|
||||
return os << MassStatusOrdTyp::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_MASSSTATUSREQTYP_H_
|
||||
#define _ILINKBINARY_MASSSTATUSREQTYP_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,54 +25,54 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class MassStatusReqTyp {
|
||||
public:
|
||||
enum Value {
|
||||
Instrument = (std::uint8_t)1,
|
||||
InstrumentGroup = (std::uint8_t)3,
|
||||
MarketSegment = (std::uint8_t)100,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class MassStatusReqTyp
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Instrument = static_cast<std::uint8_t>(1),
|
||||
InstrumentGroup = static_cast<std::uint8_t>(3),
|
||||
AllOrders = static_cast<std::uint8_t>(7),
|
||||
MarketSegment = static_cast<std::uint8_t>(100),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static MassStatusReqTyp::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return Instrument;
|
||||
case 3:
|
||||
return InstrumentGroup;
|
||||
case 100:
|
||||
return MarketSegment;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static MassStatusReqTyp::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(1): return Instrument;
|
||||
case static_cast<std::uint8_t>(3): return InstrumentGroup;
|
||||
case static_cast<std::uint8_t>(7): return AllOrders;
|
||||
case static_cast<std::uint8_t>(100): return MarketSegment;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum MassStatusReqTyp [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassStatusReqTyp [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const MassStatusReqTyp::Value value) {
|
||||
switch (value) {
|
||||
case Instrument:
|
||||
return "Instrument";
|
||||
case InstrumentGroup:
|
||||
return "InstrumentGroup";
|
||||
case MarketSegment:
|
||||
return "MarketSegment";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const MassStatusReqTyp::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Instrument: return "Instrument";
|
||||
case InstrumentGroup: return "InstrumentGroup";
|
||||
case AllOrders: return "AllOrders";
|
||||
case MarketSegment: return "MarketSegment";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum MassStatusReqTyp [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassStatusReqTyp [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &operator<<(
|
||||
std::basic_ostream<CharT, Traits> &os, MassStatusReqTyp::Value m) {
|
||||
return os << MassStatusReqTyp::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, MassStatusReqTyp::Value m)
|
||||
{
|
||||
return os << MassStatusReqTyp::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_MASSSTATUSTIF_H_
|
||||
#define _ILINKBINARY_MASSSTATUSTIF_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,52 +25,54 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class MassStatusTIF {
|
||||
public:
|
||||
enum Value {
|
||||
Day = (std::uint8_t)0,
|
||||
GTC = (std::uint8_t)1,
|
||||
GTD = (std::uint8_t)6,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class MassStatusTIF
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Day = static_cast<std::uint8_t>(0),
|
||||
GTC = static_cast<std::uint8_t>(1),
|
||||
GTD = static_cast<std::uint8_t>(6),
|
||||
GFS = static_cast<std::uint8_t>(99),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static MassStatusTIF::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return Day;
|
||||
case 1:
|
||||
return GTC;
|
||||
case 6:
|
||||
return GTD;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static MassStatusTIF::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return Day;
|
||||
case static_cast<std::uint8_t>(1): return GTC;
|
||||
case static_cast<std::uint8_t>(6): return GTD;
|
||||
case static_cast<std::uint8_t>(99): return GFS;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum MassStatusTIF [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassStatusTIF [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const MassStatusTIF::Value value) {
|
||||
switch (value) {
|
||||
case Day:
|
||||
return "Day";
|
||||
case GTC:
|
||||
return "GTC";
|
||||
case GTD:
|
||||
return "GTD";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const MassStatusTIF::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Day: return "Day";
|
||||
case GTC: return "GTC";
|
||||
case GTD: return "GTD";
|
||||
case GFS: return "GFS";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum MassStatusTIF [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum MassStatusTIF [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, MassStatusTIF::Value m) {
|
||||
return os << MassStatusTIF::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, MassStatusTIF::Value m)
|
||||
{
|
||||
return os << MassStatusTIF::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,39 +4,33 @@
|
||||
|
||||
#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()
|
||||
# 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
|
||||
# include <math.h>
|
||||
# define SBE_FLOAT_NAN NAN
|
||||
# define SBE_DOUBLE_NAN NAN
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
# define SBE_CONSTEXPR constexpr
|
||||
# define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
# define SBE_CONSTEXPR
|
||||
# define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
# include <string_view>
|
||||
# define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
# define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
@@ -44,43 +38,43 @@
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
|
||||
#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)
|
||||
# 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)
|
||||
# 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)
|
||||
# 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."
|
||||
# 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)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false)
|
||||
#elif defined(_MSC_VER)
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
#else
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
#endif
|
||||
|
||||
#define SBE_NULLVALUE_INT8 (std::numeric_limits<std::int8_t>::min)()
|
||||
@@ -92,357 +86,424 @@
|
||||
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
|
||||
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::max)()
|
||||
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
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;
|
||||
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 };
|
||||
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_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;
|
||||
};
|
||||
union sbe_double_as_uint_u
|
||||
{
|
||||
double fp_value;
|
||||
std::uint64_t uint_value;
|
||||
};
|
||||
|
||||
MaturityMonthYear() = default;
|
||||
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 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,
|
||||
const std::uint64_t actingVersion) :
|
||||
MaturityMonthYear(buffer, 0, bufferLength, actingVersion)
|
||||
{
|
||||
}
|
||||
|
||||
MaturityMonthYear(char *buffer, const std::uint64_t bufferLength)
|
||||
: MaturityMonthYear(buffer, 0, bufferLength, sbeSchemaVersion()) {}
|
||||
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);
|
||||
}
|
||||
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 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 std::uint64_t offset() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_offset;
|
||||
}
|
||||
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT { return m_buffer; }
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
SBE_NODISCARD char *buffer() 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 bufferLength() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_bufferLength;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT {
|
||||
return m_actingVersion;
|
||||
}
|
||||
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)8;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t
|
||||
sbeSchemaVersion() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)5;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static const char *
|
||||
yearMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT {
|
||||
switch (metaAttribute) {
|
||||
case MetaAttribute::PRESENCE:
|
||||
return "optional";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
SBE_NODISCARD static const char *yearMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "optional";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t yearId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t yearId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
yearSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t yearSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool yearInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool yearInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= yearSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 yearNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(65535);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t yearMinValue() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)0;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t yearMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t yearMaxValue() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)65534;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t yearMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(65534);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t yearEncodingLength() SBE_NOEXCEPT {
|
||||
return 2;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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 const char *monthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "optional";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t monthId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t monthId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
monthSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t monthSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool monthInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool monthInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= monthSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 monthNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint8_t>(255);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint8_t monthMinValue() SBE_NOEXCEPT {
|
||||
return (std::uint8_t)0;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint8_t monthMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint8_t>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint8_t monthMaxValue() SBE_NOEXCEPT {
|
||||
return (std::uint8_t)254;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint8_t monthMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint8_t>(254);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t monthEncodingLength() SBE_NOEXCEPT {
|
||||
return 1;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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 const char *dayMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "optional";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t dayId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t dayId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
daySinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t daySinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool dayInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool dayInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= daySinceVersion();
|
||||
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;
|
||||
}
|
||||
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 dayNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint8_t>(255);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint8_t dayMinValue() SBE_NOEXCEPT {
|
||||
return (std::uint8_t)0;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint8_t dayMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint8_t>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint8_t dayMaxValue() SBE_NOEXCEPT {
|
||||
return (std::uint8_t)254;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint8_t dayMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint8_t>(254);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t dayEncodingLength() SBE_NOEXCEPT {
|
||||
return 1;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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 const char *weekMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "optional";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t weekId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t weekId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
weekSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t weekSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool weekInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool weekInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= weekSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 weekNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint8_t>(255);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint8_t weekMinValue() SBE_NOEXCEPT {
|
||||
return (std::uint8_t)0;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint8_t weekMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint8_t>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint8_t weekMaxValue() SBE_NOEXCEPT {
|
||||
return (std::uint8_t)254;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint8_t weekMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint8_t>(254);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t weekEncodingLength() SBE_NOEXCEPT {
|
||||
return 1;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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();
|
||||
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"("month": )";
|
||||
builder << +writer.month();
|
||||
|
||||
builder << ", ";
|
||||
builder << R"("day": )";
|
||||
builder << +writer.day();
|
||||
builder << ", ";
|
||||
builder << R"("day": )";
|
||||
builder << +writer.day();
|
||||
|
||||
builder << ", ";
|
||||
builder << R"("week": )";
|
||||
builder << +writer.week();
|
||||
builder << ", ";
|
||||
builder << R"("week": )";
|
||||
builder << +writer.week();
|
||||
|
||||
builder << '}';
|
||||
builder << '}';
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,39 +4,33 @@
|
||||
|
||||
#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()
|
||||
# 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
|
||||
# include <math.h>
|
||||
# define SBE_FLOAT_NAN NAN
|
||||
# define SBE_DOUBLE_NAN NAN
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
# define SBE_CONSTEXPR constexpr
|
||||
# define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
# define SBE_CONSTEXPR
|
||||
# define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
# include <string_view>
|
||||
# define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
# define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
@@ -44,43 +38,43 @@
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
|
||||
#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)
|
||||
# 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)
|
||||
# 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)
|
||||
# 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."
|
||||
# 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)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false)
|
||||
#elif defined(_MSC_VER)
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
#else
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
#endif
|
||||
|
||||
#define SBE_NULLVALUE_INT8 (std::numeric_limits<std::int8_t>::min)()
|
||||
@@ -92,358 +86,424 @@
|
||||
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
|
||||
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::max)()
|
||||
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
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;
|
||||
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 };
|
||||
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_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;
|
||||
};
|
||||
union sbe_double_as_uint_u
|
||||
{
|
||||
double fp_value;
|
||||
std::uint64_t uint_value;
|
||||
};
|
||||
|
||||
MessageHeader() = default;
|
||||
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 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,
|
||||
const std::uint64_t actingVersion) :
|
||||
MessageHeader(buffer, 0, bufferLength, actingVersion)
|
||||
{
|
||||
}
|
||||
|
||||
MessageHeader(char *buffer, const std::uint64_t bufferLength)
|
||||
: MessageHeader(buffer, 0, bufferLength, sbeSchemaVersion()) {}
|
||||
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);
|
||||
}
|
||||
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 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 std::uint64_t offset() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_offset;
|
||||
}
|
||||
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT { return m_buffer; }
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
SBE_NODISCARD char *buffer() 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 bufferLength() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_bufferLength;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT {
|
||||
return m_actingVersion;
|
||||
}
|
||||
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)8;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t
|
||||
sbeSchemaVersion() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)5;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static const char *
|
||||
blockLengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT {
|
||||
switch (metaAttribute) {
|
||||
case MetaAttribute::PRESENCE:
|
||||
return "required";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
SBE_NODISCARD static const char *blockLengthMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "required";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t blockLengthId() SBE_NOEXCEPT {
|
||||
return -1;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t blockLengthId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
blockLengthSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t blockLengthSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool blockLengthInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool blockLengthInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= blockLengthSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 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 blockLengthMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t blockLengthMaxValue() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)65534;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t blockLengthMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(65534);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t blockLengthEncodingLength() SBE_NOEXCEPT {
|
||||
return 2;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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 const char *templateIdMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "required";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t templateIdId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t templateIdId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
templateIdSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t templateIdSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool templateIdInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool templateIdInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= templateIdSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 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 templateIdMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t templateIdMaxValue() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)65534;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t templateIdMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(65534);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t templateIdEncodingLength() SBE_NOEXCEPT {
|
||||
return 2;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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 const char *schemaIdMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "required";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t schemaIdId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t schemaIdId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
schemaIdSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t schemaIdSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool schemaIdInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool schemaIdInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= schemaIdSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 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 schemaIdMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t schemaIdMaxValue() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)65534;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t schemaIdMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(65534);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t schemaIdEncodingLength() SBE_NOEXCEPT {
|
||||
return 2;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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 const char *versionMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "required";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t versionId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t versionId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
versionSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t versionSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool versionInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool versionInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= versionSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 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 versionMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(0);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t versionMaxValue() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)65534;
|
||||
}
|
||||
static SBE_CONSTEXPR std::uint16_t versionMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(65534);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t versionEncodingLength() SBE_NOEXCEPT {
|
||||
return 2;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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();
|
||||
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"("templateId": )";
|
||||
builder << +writer.templateId();
|
||||
|
||||
builder << ", ";
|
||||
builder << R"("schemaId": )";
|
||||
builder << +writer.schemaId();
|
||||
builder << ", ";
|
||||
builder << R"("schemaId": )";
|
||||
builder << +writer.schemaId();
|
||||
|
||||
builder << ", ";
|
||||
builder << R"("version": )";
|
||||
builder << +writer.version();
|
||||
builder << ", ";
|
||||
builder << R"("version": )";
|
||||
builder << +writer.version();
|
||||
|
||||
builder << '}';
|
||||
builder << '}';
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#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
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_OFMOVERRIDEREQ_H_
|
||||
#define _ILINKBINARY_OFMOVERRIDEREQ_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class OFMOverrideReq {
|
||||
public:
|
||||
enum Value {
|
||||
Disabled = (std::uint8_t)0,
|
||||
Enabled = (std::uint8_t)1,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class OFMOverrideReq
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Disabled = static_cast<std::uint8_t>(0),
|
||||
Enabled = static_cast<std::uint8_t>(1),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static OFMOverrideReq::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return Disabled;
|
||||
case 1:
|
||||
return Enabled;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static OFMOverrideReq::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return Disabled;
|
||||
case static_cast<std::uint8_t>(1): return Enabled;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OFMOverrideReq [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OFMOverrideReq [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const OFMOverrideReq::Value value) {
|
||||
switch (value) {
|
||||
case Disabled:
|
||||
return "Disabled";
|
||||
case Enabled:
|
||||
return "Enabled";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const OFMOverrideReq::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Disabled: return "Disabled";
|
||||
case Enabled: return "Enabled";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OFMOverrideReq [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OFMOverrideReq [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, OFMOverrideReq::Value m) {
|
||||
return os << OFMOverrideReq::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, OFMOverrideReq::Value m)
|
||||
{
|
||||
return os << OFMOverrideReq::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_ORDSTATUSTRD_H_
|
||||
#define _ILINKBINARY_ORDSTATUSTRD_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class OrdStatusTrd {
|
||||
public:
|
||||
enum Value {
|
||||
PartiallyFilled = (std::uint8_t)1,
|
||||
Filled = (std::uint8_t)2,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class OrdStatusTrd
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
PartiallyFilled = static_cast<std::uint8_t>(1),
|
||||
Filled = static_cast<std::uint8_t>(2),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static OrdStatusTrd::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return PartiallyFilled;
|
||||
case 2:
|
||||
return Filled;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static OrdStatusTrd::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(1): return PartiallyFilled;
|
||||
case static_cast<std::uint8_t>(2): return Filled;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OrdStatusTrd [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrdStatusTrd [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const OrdStatusTrd::Value value) {
|
||||
switch (value) {
|
||||
case PartiallyFilled:
|
||||
return "PartiallyFilled";
|
||||
case Filled:
|
||||
return "Filled";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const OrdStatusTrd::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case PartiallyFilled: return "PartiallyFilled";
|
||||
case Filled: return "Filled";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OrdStatusTrd [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrdStatusTrd [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, OrdStatusTrd::Value m) {
|
||||
return os << OrdStatusTrd::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, OrdStatusTrd::Value m)
|
||||
{
|
||||
return os << OrdStatusTrd::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_ORDSTATUSTRDCXL_H_
|
||||
#define _ILINKBINARY_ORDSTATUSTRDCXL_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,48 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class OrdStatusTrdCxl {
|
||||
public:
|
||||
enum Value {
|
||||
TradeCorrection = (char)71,
|
||||
TradeCancel = (char)72,
|
||||
NULL_VALUE = (char)0
|
||||
};
|
||||
class OrdStatusTrdCxl
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
TradeCorrection = static_cast<char>(71),
|
||||
TradeCancel = static_cast<char>(72),
|
||||
NULL_VALUE = static_cast<char>(0)
|
||||
};
|
||||
|
||||
static OrdStatusTrdCxl::Value get(const char value) {
|
||||
switch (value) {
|
||||
case 71:
|
||||
return TradeCorrection;
|
||||
case 72:
|
||||
return TradeCancel;
|
||||
case 0:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static OrdStatusTrdCxl::Value get(const char value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<char>(71): return TradeCorrection;
|
||||
case static_cast<char>(72): return TradeCancel;
|
||||
case static_cast<char>(0): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OrdStatusTrdCxl [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrdStatusTrdCxl [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const OrdStatusTrdCxl::Value value) {
|
||||
switch (value) {
|
||||
case TradeCorrection:
|
||||
return "TradeCorrection";
|
||||
case TradeCancel:
|
||||
return "TradeCancel";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const OrdStatusTrdCxl::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case TradeCorrection: return "TradeCorrection";
|
||||
case TradeCancel: return "TradeCancel";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum OrdStatusTrdCxl [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrdStatusTrdCxl [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, OrdStatusTrdCxl::Value m) {
|
||||
return os << OrdStatusTrdCxl::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, OrdStatusTrdCxl::Value m)
|
||||
{
|
||||
return os << OrdStatusTrdCxl::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#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
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_ORDEREVENTTYPE_H_
|
||||
#define _ILINKBINARY_ORDEREVENTTYPE_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class OrderEventType {
|
||||
public:
|
||||
enum Value {
|
||||
PartiallyFilled = (std::uint8_t)4,
|
||||
Filled = (std::uint8_t)5,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class OrderEventType
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
PartiallyFilled = static_cast<std::uint8_t>(4),
|
||||
Filled = static_cast<std::uint8_t>(5),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static OrderEventType::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 4:
|
||||
return PartiallyFilled;
|
||||
case 5:
|
||||
return Filled;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static OrderEventType::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(4): return PartiallyFilled;
|
||||
case static_cast<std::uint8_t>(5): return Filled;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OrderEventType [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrderEventType [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const OrderEventType::Value value) {
|
||||
switch (value) {
|
||||
case PartiallyFilled:
|
||||
return "PartiallyFilled";
|
||||
case Filled:
|
||||
return "Filled";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const OrderEventType::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case PartiallyFilled: return "PartiallyFilled";
|
||||
case Filled: return "Filled";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OrderEventType [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrderEventType [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, OrderEventType::Value m) {
|
||||
return os << OrderEventType::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, OrderEventType::Value m)
|
||||
{
|
||||
return os << OrderEventType::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#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
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_ORDERSTATUS_H_
|
||||
#define _ILINKBINARY_ORDERSTATUS_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,77 +25,72 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class OrderStatus {
|
||||
public:
|
||||
enum Value {
|
||||
New = (char)48,
|
||||
PartiallyFilled = (char)49,
|
||||
Filled = (char)50,
|
||||
Cancelled = (char)52,
|
||||
Replaced = (char)53,
|
||||
Rejected = (char)56,
|
||||
Expired = (char)67,
|
||||
Undefined = (char)85,
|
||||
NULL_VALUE = (char)0
|
||||
};
|
||||
class OrderStatus
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
New = static_cast<char>(48),
|
||||
PartiallyFilled = static_cast<char>(49),
|
||||
Filled = static_cast<char>(50),
|
||||
Cancelled = static_cast<char>(52),
|
||||
Replaced = static_cast<char>(53),
|
||||
PendingCancel = static_cast<char>(54),
|
||||
Rejected = static_cast<char>(56),
|
||||
Expired = static_cast<char>(67),
|
||||
PendingReplace = static_cast<char>(69),
|
||||
Undefined = static_cast<char>(85),
|
||||
NULL_VALUE = static_cast<char>(0)
|
||||
};
|
||||
|
||||
static OrderStatus::Value get(const char value) {
|
||||
switch (value) {
|
||||
case 48:
|
||||
return New;
|
||||
case 49:
|
||||
return PartiallyFilled;
|
||||
case 50:
|
||||
return Filled;
|
||||
case 52:
|
||||
return Cancelled;
|
||||
case 53:
|
||||
return Replaced;
|
||||
case 56:
|
||||
return Rejected;
|
||||
case 67:
|
||||
return Expired;
|
||||
case 85:
|
||||
return Undefined;
|
||||
case 0:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static OrderStatus::Value get(const char value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<char>(48): return New;
|
||||
case static_cast<char>(49): return PartiallyFilled;
|
||||
case static_cast<char>(50): return Filled;
|
||||
case static_cast<char>(52): return Cancelled;
|
||||
case static_cast<char>(53): return Replaced;
|
||||
case static_cast<char>(54): return PendingCancel;
|
||||
case static_cast<char>(56): return Rejected;
|
||||
case static_cast<char>(67): return Expired;
|
||||
case static_cast<char>(69): return PendingReplace;
|
||||
case static_cast<char>(85): return Undefined;
|
||||
case static_cast<char>(0): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OrderStatus [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrderStatus [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const OrderStatus::Value value) {
|
||||
switch (value) {
|
||||
case New:
|
||||
return "New";
|
||||
case PartiallyFilled:
|
||||
return "PartiallyFilled";
|
||||
case Filled:
|
||||
return "Filled";
|
||||
case Cancelled:
|
||||
return "Cancelled";
|
||||
case Replaced:
|
||||
return "Replaced";
|
||||
case Rejected:
|
||||
return "Rejected";
|
||||
case Expired:
|
||||
return "Expired";
|
||||
case Undefined:
|
||||
return "Undefined";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const OrderStatus::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case New: return "New";
|
||||
case PartiallyFilled: return "PartiallyFilled";
|
||||
case Filled: return "Filled";
|
||||
case Cancelled: return "Cancelled";
|
||||
case Replaced: return "Replaced";
|
||||
case PendingCancel: return "PendingCancel";
|
||||
case Rejected: return "Rejected";
|
||||
case Expired: return "Expired";
|
||||
case PendingReplace: return "PendingReplace";
|
||||
case Undefined: return "Undefined";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OrderStatus [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrderStatus [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, OrderStatus::Value m) {
|
||||
return os << OrderStatus::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, OrderStatus::Value m)
|
||||
{
|
||||
return os << OrderStatus::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_ORDERTYPE_H_
|
||||
#define _ILINKBINARY_ORDERTYPE_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,57 +25,54 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class OrderType {
|
||||
public:
|
||||
enum Value {
|
||||
MarketWithProtection = (char)49,
|
||||
Limit = (char)50,
|
||||
StopLimit = (char)52,
|
||||
MarketWithLeftoverAsLimit = (char)75,
|
||||
NULL_VALUE = (char)0
|
||||
};
|
||||
class OrderType
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
MarketWithProtection = static_cast<char>(49),
|
||||
Limit = static_cast<char>(50),
|
||||
StopLimit = static_cast<char>(52),
|
||||
MarketWithLeftoverAsLimit = static_cast<char>(75),
|
||||
NULL_VALUE = static_cast<char>(48)
|
||||
};
|
||||
|
||||
static OrderType::Value get(const char value) {
|
||||
switch (value) {
|
||||
case 49:
|
||||
return MarketWithProtection;
|
||||
case 50:
|
||||
return Limit;
|
||||
case 52:
|
||||
return StopLimit;
|
||||
case 75:
|
||||
return MarketWithLeftoverAsLimit;
|
||||
case 0:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static OrderType::Value get(const char value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<char>(49): return MarketWithProtection;
|
||||
case static_cast<char>(50): return Limit;
|
||||
case static_cast<char>(52): return StopLimit;
|
||||
case static_cast<char>(75): return MarketWithLeftoverAsLimit;
|
||||
case static_cast<char>(48): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OrderType [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrderType [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const OrderType::Value value) {
|
||||
switch (value) {
|
||||
case MarketWithProtection:
|
||||
return "MarketWithProtection";
|
||||
case Limit:
|
||||
return "Limit";
|
||||
case StopLimit:
|
||||
return "StopLimit";
|
||||
case MarketWithLeftoverAsLimit:
|
||||
return "MarketWithLeftoverAsLimit";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const OrderType::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case MarketWithProtection: return "MarketWithProtection";
|
||||
case Limit: return "Limit";
|
||||
case StopLimit: return "StopLimit";
|
||||
case MarketWithLeftoverAsLimit: return "MarketWithLeftoverAsLimit";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OrderType [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrderType [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, OrderType::Value m) {
|
||||
return os << OrderType::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, OrderType::Value m)
|
||||
{
|
||||
return os << OrderType::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_ORDERTYPEREQ_H_
|
||||
#define _ILINKBINARY_ORDERTYPEREQ_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,62 +25,57 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class OrderTypeReq {
|
||||
public:
|
||||
enum Value {
|
||||
MarketwithProtection = (char)49,
|
||||
Limit = (char)50,
|
||||
StopwithProtection = (char)51,
|
||||
StopLimit = (char)52,
|
||||
MarketWithLeftoverAsLimit = (char)75,
|
||||
NULL_VALUE = (char)0
|
||||
};
|
||||
class OrderTypeReq
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
MarketwithProtection = static_cast<char>(49),
|
||||
Limit = static_cast<char>(50),
|
||||
StopwithProtection = static_cast<char>(51),
|
||||
StopLimit = static_cast<char>(52),
|
||||
MarketWithLeftoverAsLimit = static_cast<char>(75),
|
||||
NULL_VALUE = static_cast<char>(0)
|
||||
};
|
||||
|
||||
static OrderTypeReq::Value get(const char value) {
|
||||
switch (value) {
|
||||
case 49:
|
||||
return MarketwithProtection;
|
||||
case 50:
|
||||
return Limit;
|
||||
case 51:
|
||||
return StopwithProtection;
|
||||
case 52:
|
||||
return StopLimit;
|
||||
case 75:
|
||||
return MarketWithLeftoverAsLimit;
|
||||
case 0:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static OrderTypeReq::Value get(const char value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<char>(49): return MarketwithProtection;
|
||||
case static_cast<char>(50): return Limit;
|
||||
case static_cast<char>(51): return StopwithProtection;
|
||||
case static_cast<char>(52): return StopLimit;
|
||||
case static_cast<char>(75): return MarketWithLeftoverAsLimit;
|
||||
case static_cast<char>(0): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OrderTypeReq [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrderTypeReq [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const OrderTypeReq::Value value) {
|
||||
switch (value) {
|
||||
case MarketwithProtection:
|
||||
return "MarketwithProtection";
|
||||
case Limit:
|
||||
return "Limit";
|
||||
case StopwithProtection:
|
||||
return "StopwithProtection";
|
||||
case StopLimit:
|
||||
return "StopLimit";
|
||||
case MarketWithLeftoverAsLimit:
|
||||
return "MarketWithLeftoverAsLimit";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const OrderTypeReq::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case MarketwithProtection: return "MarketwithProtection";
|
||||
case Limit: return "Limit";
|
||||
case StopwithProtection: return "StopwithProtection";
|
||||
case StopLimit: return "StopLimit";
|
||||
case MarketWithLeftoverAsLimit: return "MarketWithLeftoverAsLimit";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum OrderTypeReq [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum OrderTypeReq [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, OrderTypeReq::Value m) {
|
||||
return os << OrderTypeReq::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, OrderTypeReq::Value m)
|
||||
{
|
||||
return os << OrderTypeReq::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,39 +4,33 @@
|
||||
|
||||
#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()
|
||||
# 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
|
||||
# include <math.h>
|
||||
# define SBE_FLOAT_NAN NAN
|
||||
# define SBE_DOUBLE_NAN NAN
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
# define SBE_CONSTEXPR constexpr
|
||||
# define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
# define SBE_CONSTEXPR
|
||||
# define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
# include <string_view>
|
||||
# define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
# define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
@@ -44,43 +38,43 @@
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
|
||||
#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)
|
||||
# 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)
|
||||
# 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)
|
||||
# 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."
|
||||
# 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)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false)
|
||||
#elif defined(_MSC_VER)
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
#else
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
#endif
|
||||
|
||||
#define SBE_NULLVALUE_INT8 (std::numeric_limits<std::int8_t>::min)()
|
||||
@@ -92,214 +86,263 @@
|
||||
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
|
||||
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::max)()
|
||||
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
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;
|
||||
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 };
|
||||
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_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;
|
||||
};
|
||||
union sbe_double_as_uint_u
|
||||
{
|
||||
double fp_value;
|
||||
std::uint64_t uint_value;
|
||||
};
|
||||
|
||||
PRICE9() = default;
|
||||
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 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,
|
||||
const std::uint64_t actingVersion) :
|
||||
PRICE9(buffer, 0, bufferLength, actingVersion)
|
||||
{
|
||||
}
|
||||
|
||||
PRICE9(char *buffer, const std::uint64_t bufferLength)
|
||||
: PRICE9(buffer, 0, bufferLength, sbeSchemaVersion()) {}
|
||||
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);
|
||||
}
|
||||
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 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 std::uint64_t offset() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_offset;
|
||||
}
|
||||
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT { return m_buffer; }
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
SBE_NODISCARD char *buffer() 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 bufferLength() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_bufferLength;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT {
|
||||
return m_actingVersion;
|
||||
}
|
||||
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)8;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t
|
||||
sbeSchemaVersion() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)5;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static const char *
|
||||
mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT {
|
||||
switch (metaAttribute) {
|
||||
case MetaAttribute::PRESENCE:
|
||||
return "required";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
SBE_NODISCARD static const char *mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "required";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t mantissaId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t mantissaId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
mantissaSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= mantissaSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 mantissaNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return SBE_NULLVALUE_INT64;
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT {
|
||||
return -9223372036854775807L;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return INT64_C(-9223372036854775807);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT {
|
||||
return 9223372036854775807L;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return INT64_C(9223372036854775807);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT {
|
||||
return 8;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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 const char *exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "constant";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t exponentId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t exponentId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
exponentSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= exponentSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 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 exponentMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::int8_t>(-127);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT {
|
||||
return (std::int8_t)127;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::int8_t>(127);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
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;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::int8_t exponent() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<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();
|
||||
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 << '}';
|
||||
builder << '}';
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,39 +4,33 @@
|
||||
|
||||
#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()
|
||||
# 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
|
||||
# include <math.h>
|
||||
# define SBE_FLOAT_NAN NAN
|
||||
# define SBE_DOUBLE_NAN NAN
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
# define SBE_CONSTEXPR constexpr
|
||||
# define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
# define SBE_CONSTEXPR
|
||||
# define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
# include <string_view>
|
||||
# define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
# define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
@@ -44,43 +38,43 @@
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
|
||||
#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)
|
||||
# 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)
|
||||
# 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)
|
||||
# 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."
|
||||
# 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)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (false)
|
||||
#elif defined(_MSC_VER)
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (exp)
|
||||
#else
|
||||
#define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
# define SBE_BOUNDS_CHECK_EXPECT(exp, c) (__builtin_expect(exp, c))
|
||||
#endif
|
||||
|
||||
#define SBE_NULLVALUE_INT8 (std::numeric_limits<std::int8_t>::min)()
|
||||
@@ -92,214 +86,263 @@
|
||||
#define SBE_NULLVALUE_UINT32 (std::numeric_limits<std::uint32_t>::max)()
|
||||
#define SBE_NULLVALUE_UINT64 (std::numeric_limits<std::uint64_t>::max)()
|
||||
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
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;
|
||||
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 };
|
||||
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_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;
|
||||
};
|
||||
union sbe_double_as_uint_u
|
||||
{
|
||||
double fp_value;
|
||||
std::uint64_t uint_value;
|
||||
};
|
||||
|
||||
PRICENULL9() = default;
|
||||
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 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,
|
||||
const std::uint64_t actingVersion) :
|
||||
PRICENULL9(buffer, 0, bufferLength, actingVersion)
|
||||
{
|
||||
}
|
||||
|
||||
PRICENULL9(char *buffer, const std::uint64_t bufferLength)
|
||||
: PRICENULL9(buffer, 0, bufferLength, sbeSchemaVersion()) {}
|
||||
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);
|
||||
}
|
||||
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 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 std::uint64_t offset() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_offset;
|
||||
}
|
||||
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT { return m_buffer; }
|
||||
SBE_NODISCARD const char *buffer() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
SBE_NODISCARD char *buffer() 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 bufferLength() const SBE_NOEXCEPT
|
||||
{
|
||||
return m_bufferLength;
|
||||
}
|
||||
|
||||
SBE_NODISCARD std::uint64_t actingVersion() const SBE_NOEXCEPT {
|
||||
return m_actingVersion;
|
||||
}
|
||||
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)8;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaId() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t
|
||||
sbeSchemaVersion() SBE_NOEXCEPT {
|
||||
return (std::uint16_t)5;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint16_t sbeSchemaVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::uint16_t>(8);
|
||||
}
|
||||
|
||||
SBE_NODISCARD static const char *
|
||||
mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT {
|
||||
switch (metaAttribute) {
|
||||
case MetaAttribute::PRESENCE:
|
||||
return "optional";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
SBE_NODISCARD static const char *mantissaMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "optional";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t mantissaId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t mantissaId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
mantissaSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t mantissaSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool mantissaInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= mantissaSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 mantissaNullValue() SBE_NOEXCEPT
|
||||
{
|
||||
return INT64_C(9223372036854775807);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT {
|
||||
return -9223372036854775807L;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return INT64_C(-9223372036854775807);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT {
|
||||
return 9223372036854775807L;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int64_t mantissaMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return INT64_C(9223372036854775807);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t mantissaEncodingLength() SBE_NOEXCEPT {
|
||||
return 8;
|
||||
}
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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 const char *exponentMetaAttribute(const MetaAttribute metaAttribute) SBE_NOEXCEPT
|
||||
{
|
||||
switch (metaAttribute)
|
||||
{
|
||||
case MetaAttribute::PRESENCE: return "constant";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::uint16_t exponentId() SBE_NOEXCEPT { return -1; }
|
||||
static SBE_CONSTEXPR std::uint16_t exponentId() SBE_NOEXCEPT
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t
|
||||
exponentSinceVersion() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::uint64_t exponentSinceVersion() SBE_NOEXCEPT
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT {
|
||||
SBE_NODISCARD bool exponentInActingVersion() SBE_NOEXCEPT
|
||||
{
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
#endif
|
||||
return m_actingVersion >= exponentSinceVersion();
|
||||
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;
|
||||
}
|
||||
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 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 exponentMinValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::int8_t>(-127);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT {
|
||||
return (std::int8_t)127;
|
||||
}
|
||||
static SBE_CONSTEXPR std::int8_t exponentMaxValue() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<std::int8_t>(127);
|
||||
}
|
||||
|
||||
static SBE_CONSTEXPR std::size_t exponentEncodingLength() SBE_NOEXCEPT {
|
||||
return 0;
|
||||
}
|
||||
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;
|
||||
}
|
||||
SBE_NODISCARD static SBE_CONSTEXPR std::int8_t exponent() SBE_NOEXCEPT
|
||||
{
|
||||
return static_cast<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();
|
||||
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 << '}';
|
||||
builder << '}';
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_PARTYDETAILROLE_H_
|
||||
#define _ILINKBINARY_PARTYDETAILROLE_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,63 +25,57 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class PartyDetailRole {
|
||||
public:
|
||||
enum Value {
|
||||
ExecutingFirm = (std::uint16_t)1,
|
||||
CustomerAccount = (std::uint16_t)24,
|
||||
TakeUpFirm = (std::uint16_t)96,
|
||||
Operator = (std::uint16_t)118,
|
||||
TakeUpAccount = (std::uint16_t)1000,
|
||||
NULL_VALUE = (std::uint16_t)65535
|
||||
};
|
||||
class PartyDetailRole
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
ExecutingFirm = static_cast<std::uint16_t>(1),
|
||||
CustomerAccount = static_cast<std::uint16_t>(24),
|
||||
TakeUpFirm = static_cast<std::uint16_t>(96),
|
||||
Operator = static_cast<std::uint16_t>(118),
|
||||
TakeUpAccount = static_cast<std::uint16_t>(1000),
|
||||
NULL_VALUE = static_cast<std::uint16_t>(65535)
|
||||
};
|
||||
|
||||
static PartyDetailRole::Value get(const std::uint16_t value) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return ExecutingFirm;
|
||||
case 24:
|
||||
return CustomerAccount;
|
||||
case 96:
|
||||
return TakeUpFirm;
|
||||
case 118:
|
||||
return Operator;
|
||||
case 1000:
|
||||
return TakeUpAccount;
|
||||
case 65535:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static PartyDetailRole::Value get(const std::uint16_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint16_t>(1): return ExecutingFirm;
|
||||
case static_cast<std::uint16_t>(24): return CustomerAccount;
|
||||
case static_cast<std::uint16_t>(96): return TakeUpFirm;
|
||||
case static_cast<std::uint16_t>(118): return Operator;
|
||||
case static_cast<std::uint16_t>(1000): return TakeUpAccount;
|
||||
case static_cast<std::uint16_t>(65535): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum PartyDetailRole [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum PartyDetailRole [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const PartyDetailRole::Value value) {
|
||||
switch (value) {
|
||||
case ExecutingFirm:
|
||||
return "ExecutingFirm";
|
||||
case CustomerAccount:
|
||||
return "CustomerAccount";
|
||||
case TakeUpFirm:
|
||||
return "TakeUpFirm";
|
||||
case Operator:
|
||||
return "Operator";
|
||||
case TakeUpAccount:
|
||||
return "TakeUpAccount";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const PartyDetailRole::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case ExecutingFirm: return "ExecutingFirm";
|
||||
case CustomerAccount: return "CustomerAccount";
|
||||
case TakeUpFirm: return "TakeUpFirm";
|
||||
case Operator: return "Operator";
|
||||
case TakeUpAccount: return "TakeUpAccount";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error(
|
||||
"unknown value for enum PartyDetailRole [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum PartyDetailRole [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, PartyDetailRole::Value m) {
|
||||
return os << PartyDetailRole::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, PartyDetailRole::Value m)
|
||||
{
|
||||
return os << PartyDetailRole::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#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
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_QUOTEACKSTATUS_H_
|
||||
#define _ILINKBINARY_QUOTEACKSTATUS_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,47 +25,48 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class QuoteAckStatus {
|
||||
public:
|
||||
enum Value {
|
||||
Accepted = (std::uint8_t)0,
|
||||
Rejected = (std::uint8_t)5,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class QuoteAckStatus
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Accepted = static_cast<std::uint8_t>(0),
|
||||
Rejected = static_cast<std::uint8_t>(5),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static QuoteAckStatus::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return Accepted;
|
||||
case 5:
|
||||
return Rejected;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static QuoteAckStatus::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return Accepted;
|
||||
case static_cast<std::uint8_t>(5): return Rejected;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum QuoteAckStatus [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum QuoteAckStatus [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const QuoteAckStatus::Value value) {
|
||||
switch (value) {
|
||||
case Accepted:
|
||||
return "Accepted";
|
||||
case Rejected:
|
||||
return "Rejected";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const QuoteAckStatus::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Accepted: return "Accepted";
|
||||
case Rejected: return "Rejected";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum QuoteAckStatus [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum QuoteAckStatus [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, QuoteAckStatus::Value m) {
|
||||
return os << QuoteAckStatus::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, QuoteAckStatus::Value m)
|
||||
{
|
||||
return os << QuoteAckStatus::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#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
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_QUOTECXLSTATUS_H_
|
||||
#define _ILINKBINARY_QUOTECXLSTATUS_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,62 +25,57 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class QuoteCxlStatus {
|
||||
public:
|
||||
enum Value {
|
||||
CancelperInstrument = (std::uint8_t)1,
|
||||
CancelperInstrumentgroup = (std::uint8_t)3,
|
||||
Cancelallquotes = (std::uint8_t)4,
|
||||
Rejected = (std::uint8_t)5,
|
||||
CancelperQuoteSet = (std::uint8_t)100,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class QuoteCxlStatus
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
CancelperInstrument = static_cast<std::uint8_t>(1),
|
||||
CancelperInstrumentgroup = static_cast<std::uint8_t>(3),
|
||||
Cancelallquotes = static_cast<std::uint8_t>(4),
|
||||
Rejected = static_cast<std::uint8_t>(5),
|
||||
CancelperQuoteSet = static_cast<std::uint8_t>(100),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static QuoteCxlStatus::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return CancelperInstrument;
|
||||
case 3:
|
||||
return CancelperInstrumentgroup;
|
||||
case 4:
|
||||
return Cancelallquotes;
|
||||
case 5:
|
||||
return Rejected;
|
||||
case 100:
|
||||
return CancelperQuoteSet;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static QuoteCxlStatus::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(1): return CancelperInstrument;
|
||||
case static_cast<std::uint8_t>(3): return CancelperInstrumentgroup;
|
||||
case static_cast<std::uint8_t>(4): return Cancelallquotes;
|
||||
case static_cast<std::uint8_t>(5): return Rejected;
|
||||
case static_cast<std::uint8_t>(100): return CancelperQuoteSet;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum QuoteCxlStatus [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum QuoteCxlStatus [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const QuoteCxlStatus::Value value) {
|
||||
switch (value) {
|
||||
case CancelperInstrument:
|
||||
return "CancelperInstrument";
|
||||
case CancelperInstrumentgroup:
|
||||
return "CancelperInstrumentgroup";
|
||||
case Cancelallquotes:
|
||||
return "Cancelallquotes";
|
||||
case Rejected:
|
||||
return "Rejected";
|
||||
case CancelperQuoteSet:
|
||||
return "CancelperQuoteSet";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const QuoteCxlStatus::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case CancelperInstrument: return "CancelperInstrument";
|
||||
case CancelperInstrumentgroup: return "CancelperInstrumentgroup";
|
||||
case Cancelallquotes: return "Cancelallquotes";
|
||||
case Rejected: return "Rejected";
|
||||
case CancelperQuoteSet: return "CancelperQuoteSet";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum QuoteCxlStatus [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum QuoteCxlStatus [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, QuoteCxlStatus::Value m) {
|
||||
return os << QuoteCxlStatus::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, QuoteCxlStatus::Value m)
|
||||
{
|
||||
return os << QuoteCxlStatus::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_QUOTECXLTYP_H_
|
||||
#define _ILINKBINARY_QUOTECXLTYP_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,57 +25,54 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class QuoteCxlTyp {
|
||||
public:
|
||||
enum Value {
|
||||
CancelperInstrument = (std::uint8_t)1,
|
||||
CancelperInstrumentgroup = (std::uint8_t)3,
|
||||
Cancelallquotes = (std::uint8_t)4,
|
||||
CancelperQuoteSet = (std::uint8_t)100,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class QuoteCxlTyp
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
CancelperInstrument = static_cast<std::uint8_t>(1),
|
||||
CancelperInstrumentgroup = static_cast<std::uint8_t>(3),
|
||||
Cancelallquotes = static_cast<std::uint8_t>(4),
|
||||
CancelperQuoteSet = static_cast<std::uint8_t>(100),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static QuoteCxlTyp::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return CancelperInstrument;
|
||||
case 3:
|
||||
return CancelperInstrumentgroup;
|
||||
case 4:
|
||||
return Cancelallquotes;
|
||||
case 100:
|
||||
return CancelperQuoteSet;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static QuoteCxlTyp::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(1): return CancelperInstrument;
|
||||
case static_cast<std::uint8_t>(3): return CancelperInstrumentgroup;
|
||||
case static_cast<std::uint8_t>(4): return Cancelallquotes;
|
||||
case static_cast<std::uint8_t>(100): return CancelperQuoteSet;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum QuoteCxlTyp [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum QuoteCxlTyp [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const QuoteCxlTyp::Value value) {
|
||||
switch (value) {
|
||||
case CancelperInstrument:
|
||||
return "CancelperInstrument";
|
||||
case CancelperInstrumentgroup:
|
||||
return "CancelperInstrumentgroup";
|
||||
case Cancelallquotes:
|
||||
return "Cancelallquotes";
|
||||
case CancelperQuoteSet:
|
||||
return "CancelperQuoteSet";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const QuoteCxlTyp::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case CancelperInstrument: return "CancelperInstrument";
|
||||
case CancelperInstrumentgroup: return "CancelperInstrumentgroup";
|
||||
case Cancelallquotes: return "Cancelallquotes";
|
||||
case CancelperQuoteSet: return "CancelperQuoteSet";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum QuoteCxlTyp [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum QuoteCxlTyp [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, QuoteCxlTyp::Value m) {
|
||||
return os << QuoteCxlTyp::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, QuoteCxlTyp::Value m)
|
||||
{
|
||||
return os << QuoteCxlTyp::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_QUOTETYP_H_
|
||||
#define _ILINKBINARY_QUOTETYP_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,39 +25,45 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class QuoteTyp {
|
||||
public:
|
||||
enum Value { Tradeable = (std::uint8_t)1, NULL_VALUE = (std::uint8_t)255 };
|
||||
class QuoteTyp
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Tradeable = static_cast<std::uint8_t>(1),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static QuoteTyp::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return Tradeable;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static QuoteTyp::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(1): return Tradeable;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum QuoteTyp [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum QuoteTyp [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const QuoteTyp::Value value) {
|
||||
switch (value) {
|
||||
case Tradeable:
|
||||
return "Tradeable";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const QuoteTyp::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Tradeable: return "Tradeable";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum QuoteTyp [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum QuoteTyp [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, QuoteTyp::Value m) {
|
||||
return os << QuoteTyp::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, QuoteTyp::Value m)
|
||||
{
|
||||
return os << QuoteTyp::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,13 +1,11 @@
|
||||
To update ilinkbinary.xml
|
||||
sftp cmeconfig@sftpng.cmegroup.com
|
||||
password: G3t(0nnect3d
|
||||
get /MSGW/NRCert/Templates/ilinkbinary.xml
|
||||
|
||||
To generate:
|
||||
|
||||
Download sbe-all-[version].jar from sbe-logic github releases.
|
||||
|
||||
docker run --rm -it -w /work -v $PWD:/work java java -Dsbe.output.dir=/work -Dsbe.generate.ir="false" -Dsbe.target.language=cpp -jar sbe-all-1.16.1.jar ilinkbinary.xml
|
||||
#docker run --rm -it -w /work -v $PWD:/work java java -Dsbe.output.dir=/work -Dsbe.generate.ir="false" -Dsbe.target.language=uk.co.real_logic.sbe.generation.rust.Rust -jar sbe-all-1.16.1.jar ilinkbinary.xml
|
||||
|
||||
|
||||
To update ilinkbinary.xml
|
||||
sftp cmeconfig@sftpng.cmegroup.com
|
||||
password: G3t(0nnect3d
|
||||
get /MSGW/NRCert/Templates/ilinkbinary.xml
|
||||
|
||||
To generate:
|
||||
|
||||
Download sbe-all-[version].jar from sbe-logic github releases.
|
||||
|
||||
docker run --rm -it -w /work -v $PWD:/work eclipse-temurin:17-jdk-jammy java -Dsbe.output.dir=/work -Dsbe.generate.ir="false" -Dsbe.target.language=cpp -jar sbe-all-1.27.0.jar ilinkbinary.xml
|
||||
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_RFQSIDE_H_
|
||||
#define _ILINKBINARY_RFQSIDE_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,52 +25,51 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class RFQSide {
|
||||
public:
|
||||
enum Value {
|
||||
Buy = (std::uint8_t)1,
|
||||
Sell = (std::uint8_t)2,
|
||||
Cross = (std::uint8_t)8,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class RFQSide
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
Buy = static_cast<std::uint8_t>(1),
|
||||
Sell = static_cast<std::uint8_t>(2),
|
||||
Cross = static_cast<std::uint8_t>(8),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static RFQSide::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 1:
|
||||
return Buy;
|
||||
case 2:
|
||||
return Sell;
|
||||
case 8:
|
||||
return Cross;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static RFQSide::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(1): return Buy;
|
||||
case static_cast<std::uint8_t>(2): return Sell;
|
||||
case static_cast<std::uint8_t>(8): return Cross;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum RFQSide [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum RFQSide [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const RFQSide::Value value) {
|
||||
switch (value) {
|
||||
case Buy:
|
||||
return "Buy";
|
||||
case Sell:
|
||||
return "Sell";
|
||||
case Cross:
|
||||
return "Cross";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const RFQSide::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Buy: return "Buy";
|
||||
case Sell: return "Sell";
|
||||
case Cross: return "Cross";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum RFQSide [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum RFQSide [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, RFQSide::Value m) {
|
||||
return os << RFQSide::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, RFQSide::Value m)
|
||||
{
|
||||
return os << RFQSide::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,86 +2,17 @@
|
||||
#ifndef _ILINKBINARY_REQRESULT_H_
|
||||
#define _ILINKBINARY_REQRESULT_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
|
||||
#define SBE_CONSTEXPR constexpr
|
||||
#define SBE_NOEXCEPT noexcept
|
||||
#else
|
||||
#define SBE_CONSTEXPR
|
||||
#define SBE_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201402L
|
||||
#define SBE_CONSTEXPR_14 constexpr
|
||||
#else
|
||||
#define SBE_CONSTEXPR_14
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#define SBE_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define SBE_NODISCARD
|
||||
#endif
|
||||
|
||||
#if !defined(__STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#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)()
|
||||
@@ -94,57 +25,54 @@
|
||||
|
||||
namespace iLinkBinary {
|
||||
|
||||
class ReqResult {
|
||||
public:
|
||||
enum Value {
|
||||
ValidRequest = (std::uint8_t)0,
|
||||
NoDataFoundThatMatchedSelectionCriteria = (std::uint8_t)2,
|
||||
NotAuthorizedtoRetrieveData = (std::uint8_t)3,
|
||||
DataTemporarilyUnavailable = (std::uint8_t)4,
|
||||
NULL_VALUE = (std::uint8_t)255
|
||||
};
|
||||
class ReqResult
|
||||
{
|
||||
public:
|
||||
enum Value
|
||||
{
|
||||
ValidRequest = static_cast<std::uint8_t>(0),
|
||||
NoDataFoundThatMatchedSelectionCriteria = static_cast<std::uint8_t>(2),
|
||||
NotAuthorizedtoRetrieveData = static_cast<std::uint8_t>(3),
|
||||
DataTemporarilyUnavailable = static_cast<std::uint8_t>(4),
|
||||
NULL_VALUE = static_cast<std::uint8_t>(255)
|
||||
};
|
||||
|
||||
static ReqResult::Value get(const std::uint8_t value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return ValidRequest;
|
||||
case 2:
|
||||
return NoDataFoundThatMatchedSelectionCriteria;
|
||||
case 3:
|
||||
return NotAuthorizedtoRetrieveData;
|
||||
case 4:
|
||||
return DataTemporarilyUnavailable;
|
||||
case 255:
|
||||
return NULL_VALUE;
|
||||
}
|
||||
static ReqResult::Value get(const std::uint8_t value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case static_cast<std::uint8_t>(0): return ValidRequest;
|
||||
case static_cast<std::uint8_t>(2): return NoDataFoundThatMatchedSelectionCriteria;
|
||||
case static_cast<std::uint8_t>(3): return NotAuthorizedtoRetrieveData;
|
||||
case static_cast<std::uint8_t>(4): return DataTemporarilyUnavailable;
|
||||
case static_cast<std::uint8_t>(255): return NULL_VALUE;
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ReqResult [E103]");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ReqResult [E103]");
|
||||
}
|
||||
|
||||
static const char *c_str(const ReqResult::Value value) {
|
||||
switch (value) {
|
||||
case ValidRequest:
|
||||
return "ValidRequest";
|
||||
case NoDataFoundThatMatchedSelectionCriteria:
|
||||
return "NoDataFoundThatMatchedSelectionCriteria";
|
||||
case NotAuthorizedtoRetrieveData:
|
||||
return "NotAuthorizedtoRetrieveData";
|
||||
case DataTemporarilyUnavailable:
|
||||
return "DataTemporarilyUnavailable";
|
||||
case NULL_VALUE:
|
||||
return "NULL_VALUE";
|
||||
}
|
||||
static const char *c_str(const ReqResult::Value value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case ValidRequest: return "ValidRequest";
|
||||
case NoDataFoundThatMatchedSelectionCriteria: return "NoDataFoundThatMatchedSelectionCriteria";
|
||||
case NotAuthorizedtoRetrieveData: return "NotAuthorizedtoRetrieveData";
|
||||
case DataTemporarilyUnavailable: return "DataTemporarilyUnavailable";
|
||||
case NULL_VALUE: return "NULL_VALUE";
|
||||
}
|
||||
|
||||
throw std::runtime_error("unknown value for enum ReqResult [E103]:");
|
||||
}
|
||||
throw std::runtime_error("unknown value for enum ReqResult [E103]:");
|
||||
}
|
||||
|
||||
template <typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> &
|
||||
operator<<(std::basic_ostream<CharT, Traits> &os, ReqResult::Value m) {
|
||||
return os << ReqResult::c_str(m);
|
||||
}
|
||||
template<typename CharT, typename Traits>
|
||||
friend std::basic_ostream<CharT, Traits> & operator << (
|
||||
std::basic_ostream<CharT, Traits> &os, ReqResult::Value m)
|
||||
{
|
||||
return os << ReqResult::c_str(m);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace iLinkBinary
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
Loaded 100 of 125 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user