31ONIXS_CMESTREAMLINEDMDH_DATA_PACKING_BEGIN(1)
45 const Header* header_;
57 if (availableSize <
sizeof(Header) ||
58 availableSize < header_->messageSize)
60 throw std::runtime_error(
61 "Not enough data to retrieve SBE message. ");
69 std::forward_iterator_tag
93 const void* dataBegin,
102 assert(dataBegin <= dataEnd);
113 assert(header_ != end_);
118 header_->messageSize -
136 header_->messageSize);
148 return header_ == other.header_;
156 return header_ != other.header_;
170 const void* messagesBegin,
171 const void* messagesEnd)
172 : begin_(messagesBegin)
206 "Cannot construct packet over given buffer "
207 "because it doesn't meet requirements on minimal size. "
208 "Size of buffer is ";
210 toStr(error, packetSize);
212 error +=
" byte(s), whereas packet must have at least ";
214 toStr(error, minimalSize);
218 throw std::runtime_error(error);
230 const Header* header_;
262 if (
size < headerSize)
272 : header_(other.header_)
287 return static_cast<const void*
>(header_);
301 return header_->seqNumber;
309 return header_->sendingTime;
366 header_ = other.header_;
455 static_cast<Packet&
>(*this) =
456 static_cast<const Packet&
>(other);
458 source_ = other.source_;
459 receiveTime_ = other.receiveTime_;
469ONIXS_CMESTREAMLINEDMDH_DATA_PACKING_END
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS_DECL(name)
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS
#define ONIXS_CMESTREAMLINEDMDH_NULLPTR
Iterator over SBE-encoded messages.
std::forward_iterator_tag iterator_category
BinaryMessage message() const
Gets reference to encoded message.
BinaryMessageIterator(const void *dataBegin, const void *dataEnd)
Constructs encoded message iterator from raw data pointers.
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)
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.
NetPacket(const void *data, size_t size)
Initializes with primary attributes.
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.
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.
size_t size() const
Packet size.
const void * data() const
Packet bytes.
~Packet()
Does actually nothing.
void reset(const void *data, size_t size)
Re-initializes the instance to refer to the other content.
SequenceNumber seqNumber() const
Packet sequence number.
Packet()
Initializes blank instance.
Packet(const void *data, size_t size)
Initializes binary packet over given buffer.
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.
Represents time point without time-zone information.
ptrdiff_t byteDistance(Left *left, Right *right)
Returns distance in bytes between two pointers.
Type * advanceByBytes(Type *pointer, ptrdiff_t distance)
Advances given pointer to a given offset (distance) in bytes.
void throwBadPacket(size_t packetSize, size_t minimalSize)
Raises exception on ill-formed packet.
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.
void toStr(std::string &str, const Decimal &number)