31 ONIXS_CMEMDH_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_;
254 assert(NULL != header_);
262 if (size < headerSize)
272 : header_(other.header_)
285 assert(NULL != header_);
287 return static_cast<const void*
>(header_);
299 assert(NULL != header_);
301 return header_->seqNumber;
307 assert(NULL != header_);
309 return header_->sendingTime;
315 assert(NULL != header_);
366 header_ = other.header_;
416 assert(NULL != source_);
440 receiveTime_ = receiveTime;
455 static_cast<Packet&
>(*this) =
456 static_cast<const Packet&
>(other);
458 source_ = other.source_;
459 receiveTime_ = other.receiveTime_;
469 ONIXS_CMEMDH_DATA_PACKING_END
#define ONIXS_CMEMDH_LTWT_CLASS
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Packet(const void *data, size_t size)
BinaryMessageIterator(const void *dataBegin, const void *dataEnd)
value_type & reference
Defines reference to a value type.
~NetPacket()
Does actually nothing.
BinaryMessages messages() const
Returns collection of messages stored by instance.
size_t size() const
Packet size.
void source(const NetFeed &source)
Updates packet source attribute.
Represents time point without time-zone information.
const Timestamp & receiveTime() const
Data reception time (if applicable).
void reset()
Resets the instances to the blank state.
void receiveTime(const Timestamp &receiveTime)
Updates receive time attribute.
BinaryMessages(const void *messagesBegin, const void *messagesEnd)
Initializes messages container.
NetPacket()
Initializes as null packet.
Packet(const Packet &other)
Initializes as a copy of the other instance.
const Timestamp & sendingTime() const
Packet sending time.
UInt16 MessageSize
Aliases message length type.
Base attributes of market data feed.
value_type * pointer
Defines pointer to a value type.
Iterator over SBE-encoded messages.
NetPacket(const NetPacket &other)
Initializes as a copy of the other instance.
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
BinaryMessage message() const
BinaryMessageIterator begin() const
Returns iterator pointing to first encoded message.
ptrdiff_t difference_type
Establishes instance difference type.
Type * advanceByBytes(Type *pointer, ptrdiff_t distance)
Advances given pointer to a given offset (distance) in bytes.
Encapsulates services for manipulating SBE-encoded messages.
#define ONIXS_CMEMDH_LTWT_CLASS_DECL(name)
BinaryMessageIterator end() const
Returns iterator pointing past last encoded message.
void throwBadPacket(size_t packetSize, size_t minimalSize)
Raises exception on ill-formed packet.
NetPacket(const void *data, size_t size)
Initializes with primary attributes.
void reset()
Resets the instance to the null state.
void reset(const void *data, size_t size)
Represents CME binary packet containing SBE messages.
const BinaryMessage value_type
Defines value type.
std::forward_iterator_tag iterator_category
bool operator==(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
SequenceNumber seqNumber() const
Packet sequence number.
const NetFeed & source() const
Identifies source of the packet.
Collection of encoded messages stored in single packet.
~Packet()
Does actually nothing.
ptrdiff_t byteDistance(Left *left, Right *right)
Returns distance in bytes between two pointers.
Packet()
Initializes blank instance.
const void * data() const
Packet bytes.
ONIXS_CMEMDH_EXPORTED void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
#define ONIXS_CMEMDH_NAMESPACE_END