33ONIXS_CMEMDH_DATA_PACKING_BEGIN(1)
66 : header_(static_cast<const Header*>(dataBegin))
70 assert(dataBegin <= dataEnd);
81 assert(header_ != end_);
83 return BinaryMessage(header_ + 1, header_->messageSize -
sizeof(Header));
106 return header_ == other.header_;
112 return header_ != other.header_;
122 const Header* header_;
124 const Packet* packet_;
126 void validate()
const
128 const size_t availableSize = byteDistance(end_, header_);
130 if ONIXS_CMEMDH_LIKELY(availableSize != 0)
131 if ONIXS_CMEMDH_UNLIKELY(availableSize < sizeof(Header) || availableSize < header_->messageSize)
132 throwBadMessage(packet_);
142 : begin_(messagesBegin)
192 : header_(static_cast<const Header*>(
data))
200 if ONIXS_CMEMDH_UNLIKELY(
size < headerSize)
207 : header_(static_cast<const Header*>(
data))
214 : header_(other.header_)
224 operator bool()
const
234 return static_cast<const void*
>(header_);
248 return header_->seqNumber;
256 return header_->sendingTime;
280 if ONIXS_CMEMDH_UNLIKELY(!
data ||
size < headerSize)
283 header_ =
static_cast<const Header*
>(
data);
291 header_ =
static_cast<const Header*
>(
data);
300 header_ = other.header_;
313 const Header* header_;
346 , receiveTime_(other.receiveTime_)
347 , source_(other.source_)
393 static_cast<Packet&
>(*this) =
static_cast<const Packet&
>(other);
395 receiveTime_ = other.receiveTime_;
397 source_ = other.source_;
411ONIXS_CMEMDH_DATA_PACKING_END
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
#define ONIXS_CMEMDH_LTWT
#define ONIXS_CMEMDH_LTWT_CLASS_DECL(name)
#define ONIXS_CMEMDH_NAMESPACE_END
#define ONIXS_CMEMDH_NULLPTR
#define ONIXS_CMEMDH_EXPORTED
Iterator over SBE-encoded messages.
BinaryMessageIterator(const void *dataBegin, const void *dataEnd, const Packet *packet)
Constructs encoded message iterator from raw data pointers.
BinaryMessage operator*() const
Dereferences encoded message.
std::forward_iterator_tag iterator_category
BinaryMessage message() const
Gets reference to encoded message.
bool operator!=(const BinaryMessageIterator &other) const
Checks whether two iterators are not equal.
BinaryMessageIterator & operator++()
Advances iterator to next message.
bool operator==(const BinaryMessageIterator &other) const
Checks whether two iterators are equal.
value_type & reference
Defines reference to a value type.
const BinaryMessage value_type
Defines value type.
ptrdiff_t difference_type
Establishes instance difference type.
value_type * pointer
Defines pointer to a value type.
Encapsulates services for manipulating SBE-encoded messages.
Collection of encoded messages stored in single packet.
BinaryMessages(const void *messagesBegin, const void *messagesEnd, const Packet *packet=nullptr)
Initializes messages container.
BinaryMessageIterator begin() const
Returns iterator pointing to first encoded message.
BinaryMessageIterator end() const
Returns iterator pointing past last encoded message.
Base attributes of market data feed.
void source(const NetFeed &source)
Updates packet source attribute.
~NetPacket()
Does actually nothing.
const Timestamp & receiveTime() const
Data reception time (if applicable).
NetPacket()
Initializes as null packet.
NetPacket(const void *data, PacketSize size)
Initializes with primary attributes.
NetPacket & operator=(const NetPacket &other)
Re-initializes as a copy of the other instance.
void reset()
Resets the instances to the blank state.
NetPacket(const NetPacket &other)
Initializes as a copy of the other instance.
void receiveTime(const Timestamp &receiveTime)
Updates receive time attribute.
const NetFeed & source() const
Identifies source of the packet.
Represents CME binary packet containing SBE messages.
const Timestamp & sendingTime() const
Packet sending time.
Packet(const void *data, PacketSize size)
Initializes binary packet over the given buffer.
void reset(const void *data, PacketSize size)
Re-initializes the instance to refer to the other content.
const void * data() const
Packet bytes.
~Packet()
Does actually nothing.
PacketSize size() const
Packet size.
SequenceNumber seqNumber() const
Packet sequence number.
Packet()
Initializes blank instance.
void reset(const void *data, PacketSize size, const NoVerify &)
Re-initializes the instance to refer to the other content.
BinaryMessages messages() const
Returns collection of messages stored by instance.
void reset()
Resets the instance to the null state.
Packet(const Packet &other)
Initializes as a copy of the other instance.
Packet & operator=(const Packet &other)
Re-initializes the instance as the copy of the other one.
Packet(const void *data, PacketSize size, const NoVerify &)
Initializes binary packet over the given buffer.
Represents time point without time-zone information.
Type * advanceByBytes(Type *pointer, ptrdiff_t distance)
Advances given pointer to a given offset (distance) in bytes.
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
UInt16 MessageSize
Aliases message length type.
UInt32 SequenceNumber
Integral type used to identify packets in a sequence transmitted by MDP.
NetPacket PacketArgs
Alias for a type keeping collection of packet-related attributes.
UInt16 PacketSize
Integral type for measuring packets.
void throwBadMessage(const Packet *packet)
Raises exception on ill-formed message.
void throwBadPacket(PacketSize packetSize, PacketSize minimalSize, const void *data)
Raises exception on ill-formed packet.
Used to identify the necessity to omit verification where that's applicable.