OnixS C++ CME MDP Premium Market Data Handler 5.11.1
Users' manual and API documentation
Loading...
Searching...
No Matches
MulticastFeed.h
Go to the documentation of this file.
1// Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2//
3// This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
4// and international copyright treaties.
5//
6// Access to and use of the software is governed by the terms of the applicable OnixS Software
7// Services Agreement (the Agreement) and Customer end user license agreements granting
8// a non-assignable, non-transferable and non-exclusive license to use the software
9// for it's own data processing purposes under the terms defined in the Agreement.
10//
11// Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
12// of this source code or associated reference material to any other location for further reproduction
13// or redistribution, and any amendments to this copyright notice, are expressly prohibited.
14//
15// Any reproduction or redistribution for sale or hiring of the Software not in accordance with
16// the terms of the Agreement is a violation of copyright law.
17//
18
19#pragma once
20
21#include <cstddef>
22
27
29
42{
43protected:
46
70 NetFeedType::Enum target,
71 const FeedSettings& feedSettings = generateFeedSettings(),
75
79
93 Threading::Event send(const ByteSpan packet[], std::size_t spansCount);
94
100 void sendPrimary(const ByteSpan packet[], std::size_t spansCount);
101
109 void sendSecondary(const ByteSpan packet[], std::size_t spansCount);
110
114
117 NetFeedRole::Enum secondaryFeed() const noexcept;
118
121 bool hasSecondary() const noexcept;
122
123private:
124 MulticastDelivery(const MulticastDelivery&) = delete;
125 MulticastDelivery& operator=(const MulticastDelivery&) = delete;
126
127 MulticastTargetPtr target_;
128};
129
136
#define ONIXS_CME_MDH_TESTING_NAMESPACE_END
Definition Bootstrap.h:84
#define ONIXS_CME_MDH_TESTING_NAMESPACE_BEGIN
Definition Bootstrap.h:83
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:163
Builds CME MDP packets and delegates their delivery to a delivery policy.
Definition DataFeed.h:132
Implements multicast delivery for DataFeed.
NetFeedRole::Enum secondaryFeed() const noexcept
Identifies the role complementary to the primary feed.
void sendSecondary(const ByteSpan packet[], std::size_t spansCount)
Sends a complete packet synchronously to the secondary feed.
MulticastDelivery(NetFeedType::Enum target, const FeedSettings &feedSettings=generateFeedSettings(), Messaging::TimeSpan arbitrageDelay=Messaging::TimeSpan{}, ReplayDelayer &delayPolicy=CombinedReplayDelayer::service(), const MulticastTargetOptions &options=MulticastTargetOptions{})
Creates and joins the multicast target for one network feed type.
~MulticastDelivery()
Drains queued secondary sends and releases the multicast target.
NetFeedRole::Enum primaryFeed() const noexcept
Identifies the endpoint used for primary transmissions.
bool hasSecondary() const noexcept
Indicates whether the complementary endpoint is configured.
Threading::Event send(const ByteSpan packet[], std::size_t spansCount)
Sends a complete packet to the configured multicast feeds.
void sendPrimary(const ByteSpan packet[], std::size_t spansCount)
Sends a complete packet synchronously to the primary feed.
static constexpr size_t MaxSpansCount
Maximum number of byte spans accepted by a gather send.
FeedSettings generateFeedSettings(ChannelId channel=999)
Generates feed settings for one testing channel.
DataFeed< MulticastDelivery > MulticastFeed
Builds and sends CME MDP packets to a configured multicast feed type.
std::unique_ptr< MulticastTarget > MulticastTargetPtr
std::span< const std::uint8_t > ByteSpan
Provides a non-owning read-only view over contiguous byte storage.
Definition ByteSpan.h:44
SharedFuture< void > Event
Completion signal for an asynchronous operation that does not produce a value.
Definition Future.h:208
static ReplayDelayer & service()
Returns the instance reference.
Identifies feed A or feed B within a redundant pair.
Enum
Supported feed roles.
Enum
Supported market data feed services.
Configures multicast sockets used by a multicast target.