OnixS C++ CME MDP Premium Market Data Handler 5.11.1
Users' manual and API documentation
Loading...
Searching...
No Matches
IncrementalRefreshSessionStatistics.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 <type_traits>
22#include <utility>
23
24#include <OnixS/CME/MDH/ABI.h>
30#include <OnixS/CME/MDH/Watch.h>
31
33
36
38namespace details
39{
40 template <typename Holder>
42
44 enum class IncrementalRefreshSessionStatisticsInitializationTag {};
46
47 template <Messaging::UpdateAction::Enum Action>
48 struct IsSessionStatisticsAction : std::integral_constant<bool,
49 Action == Messaging::UpdateAction::New || Action == Messaging::UpdateAction::Delete>
50 {};
51
52 template <Messaging::UpdateAction::Enum Action, typename Holder>
53 using EnableSessionStatisticsEntry = typename std::enable_if<
55
56 template <Messaging::UpdateAction::Enum Action, typename Holder>
60 {
61 auto entry = appendGroupEntry(message->entries(), [&message](
62 typename decltype(message->entries())::Size size) { return message->entries(size); });
63
64 entry.setUpdateAction(Action);
65 entry.setEntryType(entryType);
66 entry.setSecurityId(securityId);
67 entry.setRptSeq(rptSeq);
68 entry.setEntryPx(price);
69 entry.setOpenCloseSettlFlag(Messaging::OpenCloseSettlFlag::DailyOpenPrice);
70 entry.entrySizeNull();
71
72 return entry;
73 }
74}
75
82template <typename Holder, details::IncrementalRefreshSessionStatisticsInitializationTag...>
83auto initialize(Holder& message, EventFlags::Bits eventIndicator, Messaging::Timestamp transactTime = UtcWatch::now()) noexcept
84 -> details::EnableIncrementalRefreshSessionStatistics<Holder>
85{
86 return details::initializeMessage<IncrementalRefreshSessionStatistics>(message, eventIndicator, transactTime);
87}
88
94template <typename Holder, details::IncrementalRefreshSessionStatisticsInitializationTag...>
96auto initialize(EventFlags::Bits eventIndicator, Messaging::Timestamp transactTime = UtcWatch::now()) -> decltype(
98{
100}
101
113template <Messaging::UpdateAction::Enum Action, typename Holder>
114auto addEntry(
118{
119 details::appendSessionStatisticsEntry<Action>(message, securityId, entryType, rptSeq, price);
120
121 return message;
122}
123
125namespace details
126{
127 template <Messaging::UpdateAction::Enum Action>
129 {
130 template <typename Holder, typename... Arguments>
131 static auto apply(Holder& message, Arguments&&... arguments) -> decltype(
132 addEntry<Action>(message, std::forward<Arguments>(arguments)...),
133 appendSessionStatisticsEntry<Action>(message, std::forward<Arguments>(arguments)...))
134 {
135 return appendSessionStatisticsEntry<Action>(message, std::forward<Arguments>(arguments)...);
136 }
137 };
138
139 template <>
141 {
142 template <Messaging::UpdateAction::Enum Action, typename Holder, typename... Arguments>
143 static auto apply(Holder& message, Arguments&&... arguments) -> typename std::enable_if<
146 message, std::forward<Arguments>(arguments)...))>::type
147 {
149 message, std::forward<Arguments>(arguments)...);
150 }
151 };
152}
153
#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
FixedPointDecimal< Int64, IntegralConstant< Int8, -9 > > Decimal9
Decimal with constant exponent -9.
Definition Composites.h:37
std::uint32_t UInt32
uInt32.
Definition Integral.h:35
EnableMutableMessageHolder< IncrementalRefreshSessionStatistics, Holder > EnableIncrementalRefreshSessionStatistics
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
typename std::enable_if< IsMutableMessageHolder< ExpectedHolder, Holder >::value, Holder & >::type EnableMutableMessageHolder
typename std::enable_if< IsSessionStatisticsAction< Action >::value, EnableIncrementalRefreshSessionStatistics< Holder > >::type EnableSessionStatisticsEntry
auto initializeMessage(Holder &message, EventFlags::Bits eventIndicator, Messaging::Timestamp transactTime) noexcept -> EnableMutableMessageHolder< ExpectedHolder, Holder >
Group::Entry appendGroupEntry(Group group, Resize resize)
Messaging::IncrementalRefreshSessionStatistics51::Entry appendSessionStatisticsEntry(Holder &message, SecurityId securityId, Messaging::EntryTypeStatistics::Enum entryType, Messaging::UInt32 rptSeq, Messaging::Decimal9 price)
MessageHolder< Messaging::IncrementalRefreshSessionStatistics51 > IncrementalRefreshSessionStatistics
Owns storage for an incremental session-statistics refresh test message.
SecurityId securityId(const Messaging::FIX::MultiContainer &message)
Definition Accessors.h:43
Messaging::Int32 SecurityId
Identifies a security in CME MDP 3.0 market data.
Definition Domain.h:31
Messaging::MatchEventIndicator::Bits Bits
Protocol storage type for combined event flags.
Definition EventFlags.h:30
static auto apply(Holder &message, Arguments &&... arguments) -> typename std::enable_if< IsSessionStatisticsAction< Action >::value, decltype(SessionStatisticsEntryOperation< Action >::apply(message, std::forward< Arguments >(arguments)...))>::type
static auto apply(Holder &message, Arguments &&... arguments) -> decltype(addEntry< Action >(message, std::forward< Arguments >(arguments)...), appendSessionStatisticsEntry< Action >(message, std::forward< Arguments >(arguments)...))