#include <OnixS/CME/MDH/testing/DataFeed.h>
Public Types | |
| enum | : std::size_t |
Public Member Functions | |
| template<typename... Arguments, typename std::enable_if< !details::IsDataFeedSelfConstruction< DataFeed, Arguments... >::value, int >::type = 0> | |
| DataFeed (Arguments &&... arguments) | |
| virtual | ~DataFeed ()=default |
| template<typename... Messages> | |
| auto | send (SequenceNumber seqNum, Messages &&... messages) -> EnableSend< Threading::Event, Messages... > |
| template<typename... Messages> | |
| auto | send (SequenceNumber seqNum, Messaging::Timestamp sendingTime, Messages &&... messages) -> EnableSend< Threading::Event, Messages... > |
| template<class Collection, details::EnableIfByteSpanCollection< Collection > = 0> | |
| Threading::Event | send (SequenceNumber seqNum, Collection &&messages) |
| template<class Collection, details::EnableIfByteSpanCollection< Collection > = 0> | |
| Threading::Event | send (SequenceNumber seqNum, Messaging::Timestamp sendingTime, Collection &&messages) |
| template<typename... Messages> | |
| auto | send (SequenceNumber seqNum, PacketHolder< Messages... > &packet) -> EnablePacketHolderSend< Threading::Event, Messages... > |
| template<typename... Messages> | |
| auto | send (SequenceNumber seqNum, Messaging::Timestamp sendingTime, PacketHolder< Messages... > &packet) -> EnablePacketHolderSend< Threading::Event, Messages... > |
| template<typename... Messages> | |
| auto | send (SequenceNumber seqNum, PacketHolder< Messages... > &&packet) -> EnablePacketHolderSend< Threading::Event, Messages... > |
| template<typename... Messages> | |
| auto | send (SequenceNumber seqNum, Messaging::Timestamp sendingTime, PacketHolder< Messages... > &&packet) -> EnablePacketHolderSend< Threading::Event, Messages... > |
| template<typename... Messages> | |
| auto | sendPrimary (SequenceNumber seqNum, Messages &&... messages) -> EnableSend< void, Messages... > |
| template<typename... Messages> | |
| auto | sendPrimary (SequenceNumber seqNum, Messaging::Timestamp sendingTime, Messages &&... messages) -> EnableSend< void, Messages... > |
| template<class Collection, details::EnableIfByteSpanCollection< Collection > = 0> | |
| void | sendPrimary (SequenceNumber seqNum, Collection &&messages) |
| template<class Collection, details::EnableIfByteSpanCollection< Collection > = 0> | |
| void | sendPrimary (SequenceNumber seqNum, Messaging::Timestamp sendingTime, Collection &&messages) |
| template<typename... Messages> | |
| auto | sendPrimary (SequenceNumber seqNum, PacketHolder< Messages... > &packet) -> EnablePacketHolderSend< void, Messages... > |
| template<typename... Messages> | |
| auto | sendPrimary (SequenceNumber seqNum, Messaging::Timestamp sendingTime, PacketHolder< Messages... > &packet) -> EnablePacketHolderSend< void, Messages... > |
| template<typename... Messages> | |
| auto | sendPrimary (SequenceNumber seqNum, PacketHolder< Messages... > &&packet) -> EnablePacketHolderSend< void, Messages... > |
| template<typename... Messages> | |
| auto | sendPrimary (SequenceNumber seqNum, Messaging::Timestamp sendingTime, PacketHolder< Messages... > &&packet) -> EnablePacketHolderSend< void, Messages... > |
| template<typename... Messages> | |
| auto | sendSecondary (SequenceNumber seqNum, Messages &&... messages) -> EnableSend< void, Messages... > |
| template<typename... Messages> | |
| auto | sendSecondary (SequenceNumber seqNum, Messaging::Timestamp sendingTime, Messages &&... messages) -> EnableSend< void, Messages... > |
| template<class Collection, details::EnableIfByteSpanCollection< Collection > = 0> | |
| void | sendSecondary (SequenceNumber seqNum, Collection &&messages) |
| template<class Collection, details::EnableIfByteSpanCollection< Collection > = 0> | |
| void | sendSecondary (SequenceNumber seqNum, Messaging::Timestamp sendingTime, Collection &&messages) |
| template<typename... Messages> | |
| auto | sendSecondary (SequenceNumber seqNum, PacketHolder< Messages... > &packet) -> EnablePacketHolderSend< void, Messages... > |
| template<typename... Messages> | |
| auto | sendSecondary (SequenceNumber seqNum, Messaging::Timestamp sendingTime, PacketHolder< Messages... > &packet) -> EnablePacketHolderSend< void, Messages... > |
| template<typename... Messages> | |
| auto | sendSecondary (SequenceNumber seqNum, PacketHolder< Messages... > &&packet) -> EnablePacketHolderSend< void, Messages... > |
| template<typename... Messages> | |
| auto | sendSecondary (SequenceNumber seqNum, Messaging::Timestamp sendingTime, PacketHolder< Messages... > &&packet) -> EnablePacketHolderSend< void, Messages... > |
| NetFeedRole::Enum | primaryFeed () const noexcept |
| NetFeedRole::Enum | secondaryFeed () const noexcept |
| bool | hasSecondary () const noexcept |
Protected Types | |
| enum | : std::size_t |
| template<typename... Messages> | |
| using | MessageSpans = std::array<ByteSpan, sizeof...(Messages)> |
| template<typename Result, typename... Messages> | |
| using | EnableSend |
| template<typename Result, typename... Messages> | |
| using | EnablePacketHolderSend = typename std::enable_if<(sizeof...(Messages) < SendMaxSpansCount), Result>::type |
Each send operation prepends a packet header containing the supplied sequence number and either an explicitly supplied sending time or the current UTC time. The delivery policy owns routing and any resources required to send the completed packet.
| Delivery | Protected delivery policy providing construction, destruction, packet delivery, and feed-role queries. It must provide:
|
The span array and all bytes referenced by its elements remain valid only for the duration of each delivery hook call. A delivery policy must consume or copy them before returning, including when send() returns an event for work that completes asynchronously.
DataFeed forwards each completed packet to the corresponding delivery hook and propagates its return value and exceptions. The policy defines transport, routing, completion, and delivery-failure semantics.
All members may be protected. Constructor arguments supplied to DataFeed are forwarded to the corresponding Delivery constructor.
Definition at line 131 of file DataFeed.h.
|
protected |
Enables a result type for a packet holder within the delivery span limit.
| Result | Return type of the enabled overload. |
| Messages | Message types held by the packet. |
Definition at line 159 of file DataFeed.h.
|
protected |
Enables a result type for a non-empty materializable message pack.
| Result | Return type of the enabled overload. |
| Messages | Holder or recipe argument types; packet headers are excluded. |
Definition at line 148 of file DataFeed.h.
|
protected |
Fixed-size array of non-owning message byte views.
| Messages | Message argument types represented by the views. |
Definition at line 142 of file DataFeed.h.
| anonymous enum : std::size_t |
Maximum number of byte spans accepted by the delivery policy, including the packet header.
| Enumerator | ||
|---|---|---|
| MaxSpansCount | Delivery::MaxSpansCount | |
Definition at line 163 of file DataFeed.h.
|
protected |
| Enumerator | ||
|---|---|---|
| SendMaxSpansCount | Delivery::MaxSpansCount | |
Definition at line 137 of file DataFeed.h.
|
inlineexplicit |
Constructs the selected delivery policy with the supplied arguments.
| Arguments | Delivery constructor argument types. |
| arguments | Arguments forwarded to the delivery constructor. |
| Any | exception thrown by the delivery constructor. |
Definition at line 172 of file DataFeed.h.
|
virtualdefault |
Destroys the selected delivery policy and its resources.
|
inlinenoexcept |
Returns whether the delivery policy reports a secondary feed.
Definition at line 643 of file DataFeed.h.
|
inlinenoexcept |
Returns the primary feed role reported by the delivery policy.
Definition at line 627 of file DataFeed.h.
|
inlinenoexcept |
Returns the secondary feed role reported by the delivery policy.
Definition at line 635 of file DataFeed.h.
|
inline |
Sends a contiguous collection of encoded messages as one packet.
A packet header containing seqNum and the current UTC sending time is prepended to the supplied message bytes. The collection must expose data() returning exactly ByteSpan* or const ByteSpan*, and size() returning a non-boolean integral type. The collection, its span descriptors, and all referenced bytes are consumed or copied before this method returns and need not remain valid while the returned event is pending.
| Collection | Contiguous collection of encoded message byte views. |
| seqNum | Packet sequence number. |
| messages | Nonempty collection whose size and storage must remain unchanged for the duration of this call. |
| std::runtime_error | If the collection reports a negative or zero size, has null descriptor storage, contains a nonempty span with null data, or contains at least MaxSpansCount messages. |
| Any | exception thrown by the collection's size() or data() accessor. |
| Any | exception thrown by the delivery policy. |
Definition at line 248 of file DataFeed.h.
|
inline |
Sends one or more held messages as one packet through the delivery policy.
The completed packet is passed to Delivery::send(). Message bytes are consumed or copied before this method returns and need not remain valid while the returned event represents pending work.
| Messages | Non-empty pack of message holders or reusable recipes. |
| seqNum | Packet sequence number. |
| messages | Held messages or recipes materialized in argument order. |
| Any | exception thrown while materializing a recipe or converting a held message to a byte span. No packet is transmitted if materialization fails. |
| Any | exception thrown by the delivery policy. |
Definition at line 200 of file DataFeed.h.
|
inline |
Sends a contiguous collection of encoded messages with an explicit packet sending time.
| Collection | Contiguous collection of encoded message byte views. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| messages | Nonempty collection of encoded message byte views. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 263 of file DataFeed.h.
|
inline |
Sends one or more held messages with an explicit packet sending time.
| Messages | Non-empty pack of message holders or reusable recipes. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| messages | Held messages or recipes materialized in argument order. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 217 of file DataFeed.h.
|
inline |
Sends a temporary packet holder's messages with an explicit packet sending time.
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| packet | Temporary packet holder whose messages are sent in template argument order. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 336 of file DataFeed.h.
|
inline |
Sends a packet holder's messages with an explicit packet sending time.
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| packet | Packet holder whose messages are sent in template argument order. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 299 of file DataFeed.h.
|
inline |
Sends a temporary packet holder's messages through the delivery policy.
Message prefixes are committed before transmission. The packet's bytes are consumed or copied before this method returns, so destroying the temporary is safe while the returned event represents pending work.
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| packet | Temporary packet holder whose messages are sent in template argument order. |
| Any | exception thrown by the delivery policy. |
Definition at line 321 of file DataFeed.h.
|
inline |
Sends a packet holder's messages through the delivery policy.
Message prefixes are committed before the packet is passed to Delivery::send(). The packet may be modified or destroyed after this method returns, even while the returned event represents pending work.
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| packet | Packet holder whose messages are sent in template argument order. |
| Any | exception thrown by the delivery policy. |
Definition at line 284 of file DataFeed.h.
|
inline |
Sends a contiguous collection of encoded messages to the primary feed.
A packet header containing seqNum and the current UTC sending time is prepended. The collection must expose data() returning exactly ByteSpan* or const ByteSpan*, and size() returning a non-boolean integral type.
| Collection | Contiguous collection of encoded message byte views. |
| seqNum | Packet sequence number. |
| messages | Nonempty collection whose size, span descriptors, and referenced bytes must remain valid and unchanged for this call. |
| std::runtime_error | If the collection reports a negative or zero size, has null descriptor storage, contains a nonempty span with null data, or contains at least MaxSpansCount messages. |
| Any | exception thrown by the collection's size() or data() accessor. |
| Any | exception thrown by the delivery policy. |
Definition at line 400 of file DataFeed.h.
|
inline |
Sends one or more held messages as one packet to the primary feed.
The completed packet is passed to Delivery::sendPrimary(). Message storage must remain valid only for the duration of this call.
| Messages | Non-empty pack of message holders or reusable recipes. |
| seqNum | Packet sequence number. |
| messages | Held messages or recipes materialized in argument order. |
| Any | exception thrown while materializing a recipe or converting a held message to a byte span. No packet is transmitted if materialization fails. |
| Any | exception thrown by the delivery policy. |
Definition at line 359 of file DataFeed.h.
|
inline |
Sends encoded messages to the primary feed with an explicit packet sending time.
| Collection | Contiguous collection of encoded message byte views. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| messages | Nonempty collection of encoded message byte views. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 413 of file DataFeed.h.
|
inline |
Sends one or more held messages to the primary feed with an explicit packet sending time.
| Messages | Non-empty pack of message holders or reusable recipes. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| messages | Held messages or recipes materialized in argument order. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 374 of file DataFeed.h.
|
inline |
Sends a temporary packet holder to the primary feed with an explicit packet sending time.
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| packet | Temporary packet holder whose messages are sent in template argument order. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 477 of file DataFeed.h.
|
inline |
Sends a packet holder to the primary feed with an explicit packet sending time.
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| packet | Packet holder whose messages are sent in template argument order. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 444 of file DataFeed.h.
|
inline |
Sends a temporary packet holder's messages to the primary feed.
Message prefixes are committed before the packet is passed to Delivery::sendPrimary(). The temporary is no longer referenced after this method returns.
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| packet | Temporary packet holder whose messages are sent in template argument order. |
| Any | exception thrown by the delivery policy. |
Definition at line 464 of file DataFeed.h.
|
inline |
Sends a packet holder's messages to the primary feed.
Message prefixes are committed before the packet is passed to Delivery::sendPrimary().
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| packet | Packet holder whose messages are sent in template argument order. |
| Any | exception thrown by the delivery policy. |
Definition at line 431 of file DataFeed.h.
|
inline |
Sends a contiguous collection of encoded messages to the secondary feed.
A packet header containing seqNum and the current UTC sending time is prepended. The collection must expose data() returning exactly ByteSpan* or const ByteSpan*, and size() returning a non-boolean integral type.
| Collection | Contiguous collection of encoded message byte views. |
| seqNum | Packet sequence number. |
| messages | Nonempty collection whose size, span descriptors, and referenced bytes must remain valid and unchanged for this call. |
| std::runtime_error | If the collection reports a negative or zero size, has null descriptor storage, contains a nonempty span with null data, or contains at least MaxSpansCount messages. |
| Any | exception thrown by the collection's size() or data() accessor. |
| Any | exception thrown by the delivery policy. |
Definition at line 541 of file DataFeed.h.
|
inline |
Sends one or more held messages as one packet to the secondary feed.
The completed packet is passed to Delivery::sendSecondary(). Message storage must remain valid only for the duration of this call.
| Messages | Non-empty pack of message holders or reusable recipes. |
| seqNum | Packet sequence number. |
| messages | Held messages or recipes materialized in argument order. |
| Any | exception thrown while materializing a recipe or converting a held message to a byte span. No packet is transmitted if materialization fails. |
| Any | exception thrown by the delivery policy. |
Definition at line 500 of file DataFeed.h.
|
inline |
Sends encoded messages to the secondary feed with an explicit packet sending time.
| Collection | Contiguous collection of encoded message byte views. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| messages | Nonempty collection of encoded message byte views. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 554 of file DataFeed.h.
|
inline |
Sends one or more held messages to the secondary feed with an explicit packet sending time.
| Messages | Non-empty pack of message holders or reusable recipes. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| messages | Held messages or recipes materialized in argument order. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 515 of file DataFeed.h.
|
inline |
Sends a temporary packet holder to the secondary feed with an explicit packet sending time.
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| packet | Temporary packet holder whose messages are sent in template argument order. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 618 of file DataFeed.h.
|
inline |
Sends a packet holder to the secondary feed with an explicit packet sending time.
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| sendingTime | Sending timestamp encoded in the packet header. |
| packet | Packet holder whose messages are sent in template argument order. |
| Any | exception reported by the timestamp-omitting overload. |
Definition at line 585 of file DataFeed.h.
|
inline |
Sends a temporary packet holder's messages to the secondary feed.
Message prefixes are committed before the packet is passed to Delivery::sendSecondary(). The temporary is no longer referenced after this method returns.
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| packet | Temporary packet holder whose messages are sent in template argument order. |
| Any | exception thrown by the delivery policy. |
Definition at line 605 of file DataFeed.h.
|
inline |
Sends a packet holder's messages to the secondary feed.
Message prefixes are committed before the packet is passed to Delivery::sendSecondary().
| Messages | Message types held by the packet. |
| seqNum | Packet sequence number. |
| packet | Packet holder whose messages are sent in template argument order. |
| Any | exception thrown by the delivery policy. |
Definition at line 572 of file DataFeed.h.