31 ONIXS_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 -
130 BinaryMessageIterator&
136 header_->messageSize);
146 const BinaryMessageIterator& other)
const 148 return header_ == other.header_;
154 const BinaryMessageIterator& other)
const 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_;
440 receiveTime_ = receiveTime;
455 static_cast<Packet&
>(*this) =
456 static_cast<const Packet&
>(other);
458 source_ = other.source_;
459 receiveTime_ = other.receiveTime_;
469 ONIXS_CMESTREAMLINEDMDH_DATA_PACKING_END
BinaryMessage message() const
Gets reference to encoded message.
NetPacket(const NetPacket &other)
Initializes as a copy of the other instance.
Represents time point without time-zone information.
Encapsulates services for manipulating SBE-encoded messages.
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
std::forward_iterator_tag iterator_category
bool operator==(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Type * advanceByBytes(Type *pointer, ptrdiff_t distance)
Advances given pointer to a given offset (distance) in bytes.
const void * data() const
Packet bytes.
value_type & reference
Defines reference to a value type.
const Timestamp & sendingTime() const
Packet sending time.
void reset()
Resets the instance to the null state.
NetPacket PacketArgs
Alias for a type keeping collection of packet-related attributes.
Collection of encoded messages stored in single packet.
Base attributes of market data feed.
SequenceNumber seqNumber() const
Packet sequence number.
UInt32 SequenceNumber
Integral type used to identify packets in a sequence transmitted by MDP.
const Timestamp & receiveTime() const
Data reception time (if applicable).
void receiveTime(const Timestamp &receiveTime)
Updates receive time attribute.
value_type * pointer
Defines pointer to a value type.
~NetPacket()
Does actually nothing.
Iterator over SBE-encoded messages.
BinaryMessageIterator end() const
Returns iterator pointing past last encoded message.
BinaryMessageIterator(const void *dataBegin, const void *dataEnd)
Constructs encoded message iterator from raw data pointers.
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS
BinaryMessages messages() const
Returns collection of messages stored by instance.
void reset()
Resets the instances to the blank state.
UInt16 MessageSize
Aliases message length type.
void toStr(std::string &str, const Decimal &number)
size_t size() const
Packet size.
Packet()
Initializes blank instance.
Packet(const void *data, size_t size)
Initializes binary packet over given buffer.
void throwBadPacket(size_t packetSize, size_t minimalSize)
Raises exception on ill-formed packet.
void reset(const void *data, size_t size)
Re-initializes the instance to refer to the other content.
ptrdiff_t difference_type
Establishes instance difference type.
const NetFeed & source() const
Identifies source of the packet.
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS_DECL(name)
const BinaryMessage value_type
Defines value type.
#define ONIXS_CMESTREAMLINEDMDH_NULLPTR
ptrdiff_t byteDistance(Left *left, Right *right)
Returns distance in bytes between two pointers.
Packet(const Packet &other)
Initializes as a copy of the other instance.
NetPacket(const void *data, size_t size)
Initializes with primary attributes.
BinaryMessageIterator begin() const
Returns iterator pointing to first encoded message.
~Packet()
Does actually nothing.
NetPacket()
Initializes as null packet.
Represents CME binary packet containing SBE messages.
void source(const NetFeed &source)
Updates packet source attribute.
BinaryMessages(const void *messagesBegin, const void *messagesEnd)
Initializes messages container.
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN