33 ONIXS_CONFLATEDUDP_DATA_PACKING_BEGIN(1)
47 const Header* header_;
59 if (availableSize <
sizeof(Header) ||
60 availableSize < header_->messageSize)
62 throw std::runtime_error
64 "Not enough data to retrieve SBE message. " 73 std::forward_iterator_tag
97 const void* dataBegin,
106 assert(dataBegin <= dataEnd);
113 assert(header_ != end_);
119 assert(header_ != end_);
120 return header_->messageSize -
sizeof(Header);
129 assert(header_ != end_);
145 BinaryMessageIterator&
151 header_->messageSize);
161 const BinaryMessageIterator& other)
const 163 return header_ == other.header_;
169 const BinaryMessageIterator& other)
const 171 return header_ != other.header_;
185 const void* messagesBegin,
186 const void* messagesEnd)
187 : begin_(messagesBegin)
215 "Cannot construct packet over given buffer " 216 "because it doesn't meet requirements on minimal size. " 217 "Size of buffer is ";
219 toStr(error, packetSize);
221 error +=
" byte(s), whereas packet must have at least ";
223 toStr(error, minimalSize);
227 throw std::runtime_error(error);
243 const Header* header_;
267 assert(NULL != header_);
275 if (size < headerSize)
299 : header_(other.header_)
311 operator bool()
const 319 assert(NULL != header_);
321 return static_cast<const void*
>(header_);
333 assert(NULL != header_);
335 return header_->seqNumber;
341 assert(NULL != header_);
343 return header_->sendingTime;
349 assert(NULL != header_);
416 header_ = other.header_;
467 assert(NULL != source_);
491 receiveTime_ = receiveTime;
509 static_cast<Packet&
>(*this) =
510 static_cast<const Packet&
>(other);
512 receiveTime_ = other.receiveTime_;
514 source_ = other.source_;
524 ONIXS_CONFLATEDUDP_DATA_PACKING_END
Packet(const Packet &other)
Initializes as a copy of the other instance.
BinaryMessages messages() const
Returns collection of messages stored by instance.
Packet(const void *data, PacketSize size, const NoVerify &)
Collection of encoded messages stored in single packet.
void reset()
Resets the instances to the blank state.
ptrdiff_t difference_type
Establishes instance difference type.
void reset()
Resets the instance to the null state.
void receiveTime(const Timestamp &receiveTime)
Updates receive time attribute.
NetPacket(const NetPacket &other)
Initializes as a copy of the other instance.
Represents time point without time-zone information.
Base attributes of market data feed.
Represents CME binary packet containing SBE messages.
void toStr(std::string &str, const Message &message)
Serializes FIX message into tag=value format.
NetPacket()
Initializes as null packet.
#define ONIXS_CONFLATEDUDP_LTWT_CLASS_DECL(name)
void source(const NetFeed &source)
Updates packet source attribute.
const void * data() const
Packet bytes.
BinaryMessageIterator end() const
Returns iterator pointing past last encoded message.
~NetPacket()
Does actually nothing.
PacketSize size() const
Packet size.
Encapsulates services for manipulating SBE-encoded messages.
BinaryMessage message() const
value_type & reference
Defines reference to a value type.
void reset(const void *data, PacketSize size, const NoVerify &)
const Timestamp & sendingTime() const
Packet sending time.
MessageSize nextMessageSize() const
const BinaryMessage value_type
Defines value type.
#define ONIXS_CONFLATEDUDP_LTWT_STRUCT
SequenceNumber seqNumber() const
Packet sequence number.
const void * nextMessageData() const
const Timestamp & receiveTime() const
Data reception time (if applicable).
BinaryMessageIterator begin() const
Returns iterator pointing to first encoded message.
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Packet()
Initializes blank instance.
NetPacket(const void *data, PacketSize size)
Initializes with primary attributes.
std::forward_iterator_tag iterator_category
value_type * pointer
Defines pointer to a value type.
Iterator over SBE-encoded messages.
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.
const NetFeed & source() const
Identifies source of the packet.
UInt16 PacketSize
Integral type for measuring packets.
~Packet()
Does actually nothing.
UInt16 MessageSize
Aliases message length type.
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
bool operator==(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
void reset(const void *data, PacketSize size)
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Packet(const void *data, PacketSize size)
void throwBadPacket(PacketSize packetSize, PacketSize minimalSize)
Raises exception on ill-formed packet.
BinaryMessages(const void *messagesBegin, const void *messagesEnd)
Initializes messages container.
BinaryMessageIterator(const void *dataBegin, const void *dataEnd)