OnixS C++ CME MDP Premium Market Data Handler 5.11.1
Users' manual and API documentation
Loading...
Searching...
No Matches
InstrumentDefinitionFuture.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 <string>
22#include <type_traits>
23#include <utility>
24
25#include <OnixS/CME/MDH/ABI.h>
30#include <OnixS/CME/MDH/Watch.h>
31
33
36
41{
42 return Messaging::constructStrRef("M6A");
43}
44
49{
50 return Messaging::constructStrRef("M6A");
51}
52
57{
58 return Messaging::constructStrRef("M6A");
59}
60
63
66
68namespace details
69{
71 enum class InstrumentDefinitionFutureInitializationTag {};
73
75 {
76 return Messaging::constructStrRef("GBX");
77 }
78
80 {
81 return Messaging::constructStrRef("GBI");
82 }
83
84 template <Messaging::SecurityUpdateAction::Enum Action>
85 struct IsAddOrModifyInstrumentDefinition : std::integral_constant<bool,
86 Action == Messaging::SecurityUpdateAction::Add || Action == Messaging::SecurityUpdateAction::Modify>
87 {};
88
89 template <Messaging::SecurityUpdateAction::Enum Action>
90 struct IsDeleteInstrumentDefinition : std::integral_constant<bool, Action == Messaging::SecurityUpdateAction::Delete>
91 {};
92
93 template <Messaging::SecurityUpdateAction::Enum Action, typename Holder>
94 using EnableAddOrModifyInstrumentDefinition = typename std::enable_if<
97 Holder&>::type;
98
99 template <Messaging::SecurityUpdateAction::Enum Action, typename Holder>
100 using EnableDeleteInstrumentDefinition = typename std::enable_if<
103 Holder&>::type;
104
105 template <Messaging::SecurityUpdateAction::Enum Action>
107 {
108 template <typename Holder>
109 static auto apply(
110 Holder& message, Messaging::UInt32 totNumReports, SecurityId securityId,
112 Messaging::Int8 realMarketDepth, Messaging::Int8 impliedMarketDepth,
113 Messaging::Timestamp lastUpdateTime)
115 {
116 message->reset();
117 message->setTotNumReports(totNumReports);
118 message->setMatchEventIndicator(Messaging::MatchEventIndicator());
119 message->setLastUpdateTime(lastUpdateTime);
120 message->setSecurityId(securityId);
121 message->setSecurityUpdateAction(Action);
122 message->setSymbol(symbol);
123 message->setSecurityGroup(group);
124 message->setAsset(asset);
125
126 auto feedTypes = message->feedTypes(2);
127 feedTypes[0].setFeedType(InstrumentDefinitionFutureRealBookFeed());
128 feedTypes[0].setMarketDepth(realMarketDepth);
129 feedTypes[1].setFeedType(InstrumentDefinitionFutureImpliedBookFeed());
130 feedTypes[1].setMarketDepth(impliedMarketDepth);
131
132 return message;
133 }
134 };
135
136 template <Messaging::SecurityUpdateAction::Enum Action>
138 {
139 template <typename Holder>
140 static auto apply(
141 Holder& message, Messaging::UInt32 totNumReports, SecurityId securityId,
142 Messaging::Timestamp lastUpdateTime) noexcept
144 {
145 message->reset();
146 message->setTotNumReports(totNumReports);
147 message->setMatchEventIndicator(Messaging::MatchEventIndicator());
148 message->setLastUpdateTime(lastUpdateTime);
149 message->setSecurityId(securityId);
150 message->setSecurityUpdateAction(Action);
151 message->setSymbol(Messaging::StrRef{});
152 message->setSecurityGroup(Messaging::StrRef{});
153 message->setAsset(Messaging::StrRef{});
154
155 return message;
156 }
157 };
158}
159
174template <
176 typename Holder,
177 details::InstrumentDefinitionFutureInitializationTag...>
192
212template <
213 typename Holder,
215 details::InstrumentDefinitionFutureInitializationTag...>
240
242template <
243 typename Holder,
245 typename String,
246 details::InstrumentDefinitionFutureInitializationTag...>
247auto initialize(
248 Messaging::UInt32 totNumReports, SecurityId securityId, String&& symbol,
249 Messaging::StrRef group = DefaultInstrumentDefinitionFutureGroup(),
250 Messaging::StrRef asset = DefaultInstrumentDefinitionFutureAsset(),
251 Messaging::Int8 realMarketDepth = DefaultInstrumentDefinitionFutureRealMarketDepth,
252 Messaging::Int8 impliedMarketDepth = DefaultInstrumentDefinitionFutureImpliedMarketDepth,
253 Messaging::Timestamp lastUpdateTime = UtcWatch::now())
254 -> typename std::enable_if<
255 std::is_same<typename std::decay<String>::type, std::string>::value &&
256 !std::is_lvalue_reference<String>::value>::type = delete;
257
259template <
260 typename Holder,
262 typename String,
263 details::InstrumentDefinitionFutureInitializationTag...>
264auto initialize(
266 String&& group,
267 Messaging::StrRef asset = DefaultInstrumentDefinitionFutureAsset(),
268 Messaging::Int8 realMarketDepth = DefaultInstrumentDefinitionFutureRealMarketDepth,
269 Messaging::Int8 impliedMarketDepth = DefaultInstrumentDefinitionFutureImpliedMarketDepth,
270 Messaging::Timestamp lastUpdateTime = UtcWatch::now())
271 -> typename std::enable_if<
272 std::is_same<typename std::decay<String>::type, std::string>::value &&
273 !std::is_lvalue_reference<String>::value>::type = delete;
274
276template <
277 typename Holder,
279 typename String,
280 details::InstrumentDefinitionFutureInitializationTag...>
281auto initialize(
283 Messaging::StrRef group, String&& asset,
284 Messaging::Int8 realMarketDepth = DefaultInstrumentDefinitionFutureRealMarketDepth,
285 Messaging::Int8 impliedMarketDepth = DefaultInstrumentDefinitionFutureImpliedMarketDepth,
286 Messaging::Timestamp lastUpdateTime = UtcWatch::now())
287 -> typename std::enable_if<
288 std::is_same<typename std::decay<String>::type, std::string>::value &&
289 !std::is_lvalue_reference<String>::value>::type = delete;
290
299template <
301 typename Holder,
302 details::InstrumentDefinitionFutureInitializationTag...>
303auto initialize(
304 Holder& message, Messaging::UInt32 totNumReports, SecurityId securityId,
305 Messaging::Timestamp lastUpdateTime = UtcWatch::now())
307{
309 message, totNumReports, securityId, lastUpdateTime);
310}
311
321template <
322 typename Holder,
324 details::InstrumentDefinitionFutureInitializationTag...>
341
#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_NODISCARD
Definition Compiler.h:165
The time point without the time-zone information.
Definition Time.h:450
Owns fixed-capacity storage for a prefixed CME message.
static Messaging::Timestamp now() noexcept
Returns current UTC time.
Definition Watch.h:66
constexpr StrRef constructStrRef(const char(&value)[Size]) noexcept
Definition StrRef.h:389
std::uint32_t UInt32
uInt32.
Definition Integral.h:35
std::int8_t Int8
int8.
Definition Integral.h:30
std::basic_string_view< Char > StrRef
Definition StrRef.h:46
auto makeInitializationRecipe(Arguments &&... arguments) -> typename std::enable_if< IsMutableMessageHolder< ExpectedHolder, Holder >::value, decltype(makeMessageRecipe< typename std::decay< Holder >::type >(makeMessageOperation< Operation >(std::forward< Arguments >(arguments)...)))>::type
constexpr Messaging::StrRef InstrumentDefinitionFutureRealBookFeed() noexcept
constexpr Messaging::StrRef InstrumentDefinitionFutureImpliedBookFeed() noexcept
typename std::enable_if< IsDeleteInstrumentDefinition< Action >::value && IsMutableMessageHolder< InstrumentDefinitionFuture, Holder >::value, Holder & >::type EnableDeleteInstrumentDefinition
typename std::enable_if< IsAddOrModifyInstrumentDefinition< Action >::value && IsMutableMessageHolder< InstrumentDefinitionFuture, Holder >::value, Holder & >::type EnableAddOrModifyInstrumentDefinition
constexpr Messaging::StrRef DefaultInstrumentDefinitionFutureSymbol() noexcept
Returns the default futures instrument symbol used by the test builder.
constexpr Messaging::Int8 DefaultInstrumentDefinitionFutureImpliedMarketDepth
Default implied-book depth used by the test builder.
constexpr Messaging::Int8 DefaultInstrumentDefinitionFutureRealMarketDepth
Default real-book depth used by the test builder.
constexpr Messaging::StrRef DefaultInstrumentDefinitionFutureGroup() noexcept
Returns the default futures security group used by the test builder.
constexpr Messaging::StrRef DefaultInstrumentDefinitionFutureAsset() noexcept
Returns the default futures asset used by the test builder.
MessageHolder< Messaging::InstrumentDefinitionFuture54 > InstrumentDefinitionFuture
Owns storage for a futures instrument-definition test message.
SecurityId securityId(const Messaging::FIX::MultiContainer &message)
Definition Accessors.h:43
Messaging::StrRef symbol(const Messaging::FIX::MultiContainer &message)
Definition Accessors.h:68
Messaging::Int32 SecurityId
Identifies a security in CME MDP 3.0 market data.
Definition Domain.h:31
Messaging::StrRef asset(const Messaging::FIX::MultiContainer &message)
Definition Accessors.h:77
static auto apply(Holder &message, Messaging::UInt32 totNumReports, SecurityId securityId, Messaging::StrRef symbol, Messaging::StrRef group, Messaging::StrRef asset, Messaging::Int8 realMarketDepth, Messaging::Int8 impliedMarketDepth, Messaging::Timestamp lastUpdateTime) -> EnableAddOrModifyInstrumentDefinition< Action, Holder >
static auto apply(Holder &message, Messaging::UInt32 totNumReports, SecurityId securityId, Messaging::Timestamp lastUpdateTime) noexcept -> EnableDeleteInstrumentDefinition< Action, Holder >