OnixS C++ CME MDP Premium Market Data Handler 5.11.1
Users' manual and API documentation
Loading...
Searching...
No Matches
SecurityStatus.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 SecurityStatusInitializationTag {};
46
48 {
49 template <typename Holder>
50 static auto apply(
51 Holder& message, SecurityId securityId,
52 Messaging::SecurityTradingStatus::Enum securityTradingStatus,
53 EventFlags::Bits eventIndicator, Messaging::Timestamp transactTime) noexcept
55 {
56 message->reset();
57 message->setTransactTime(transactTime);
58 message->setSecurityGroup(Messaging::StrRef{});
59 message->setAsset(Messaging::StrRef{});
60 message->setSecurityId(securityId);
61 message->setTradeDate(transactTime);
62 message->setMatchEventIndicator(Messaging::MatchEventIndicator(eventIndicator));
63 message->setSecurityTradingStatus(securityTradingStatus);
64 message->setHaltReason(Messaging::HaltReason::MarketEvent);
65 message->setSecurityTradingEvent(Messaging::SecurityTradingEvent::NoEvent);
66
67 return message;
68 }
69 };
70}
71
82template <typename Holder, details::SecurityStatusInitializationTag...>
83auto initialize(
84 Holder& message, SecurityId securityId,
85 Messaging::SecurityTradingStatus::Enum securityTradingStatus,
86 EventFlags::Bits eventIndicator = EventFlags::None,
88{
90 message, securityId, securityTradingStatus, eventIndicator, transactTime);
91}
92
102template <typename Holder, details::SecurityStatusInitializationTag...>
104auto initialize(
106 EventFlags::Bits eventIndicator = EventFlags::None,
107 Messaging::Timestamp transactTime = UtcWatch::now()) -> decltype(
110 securityId, securityTradingStatus, eventIndicator, transactTime))
111{
114 securityId, securityTradingStatus, eventIndicator, transactTime);
115}
116
#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
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
typename std::enable_if< IsMutableMessageHolder< ExpectedHolder, Holder >::value, Holder & >::type EnableMutableMessageHolder
EnableMutableMessageHolder< SecurityStatus, Holder > EnableSecurityStatus
MessageHolder< Messaging::SecurityStatus30 > SecurityStatus
Owns storage for a security-status 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
@ None
No event flags are set.
Definition EventFlags.h:36
static auto apply(Holder &message, SecurityId securityId, Messaging::SecurityTradingStatus::Enum securityTradingStatus, EventFlags::Bits eventIndicator, Messaging::Timestamp transactTime) noexcept -> EnableSecurityStatus< Holder >