OnixS C++ CME MDP Premium Market Data Handler 5.10.2
Users' manual and API documentation
Loading...
Searching...
No Matches
Security.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
4// protected by copyright law and international copyright treaties.
5//
6// Access to and use of the software is governed by the terms of the applicable
7// OnixS Software Services Agreement (the Agreement) and Customer end user license
8// agreements granting a non-assignable, non-transferable and non-exclusive license
9// to use the software for it's own data processing purposes under the terms defined
10// in the Agreement.
11//
12// Except as otherwise granted within the terms of the Agreement, copying or
13// reproduction of any part of this source code or associated reference material
14// to any other location for further reproduction or redistribution, and any
15// amendments to this copyright notice, are expressly prohibited.
16//
17// Any reproduction or redistribution for sale or hiring of the Software not in
18// accordance with the terms of the Agreement is a violation of copyright law.
19//
20
21#pragma once
22
26
28
31{
32public:
38 SecurityId id() const
39 {
40 return id_;
41 }
42
45 {
46 return Messaging::toStrRef(symbol_);
47 }
48
51 {
52 symbol_.assign(symbol.begin(), symbol.size());
53 }
54
61 {
62 return Messaging::toStrRef(group_);
63 }
64
67 {
68 group_.assign(group.begin(), group.size());
69 }
70
74 {
75 return Messaging::toStrRef(asset_);
76 }
77
80 {
81 asset_.assign(asset.begin(), asset.size());
82 }
83
86 {
87 return seqNumber_;
88 }
89
92
95 {
96 return userData_;
97 }
98
101 {
102 return lastEventTime_;
103 }
104
105protected:
108 : id_(id)
109 , seqNumber_(0)
110 , userData_(0)
111 {
112 }
113
115 ~Security() = default;
116
119 {
120 seqNumber_ = seqNumber;
121 }
122
125 {
126 userData_ = data;
127 }
128
131 {
132 lastEventTime_ = ts;
133 }
134
135private:
136 const SecurityId id_;
137
138 Messaging::UInt32 seqNumber_;
139
140 std::string symbol_;
141 std::string group_;
142 std::string asset_;
143
144 UserData userData_;
145 Messaging::Timestamp lastEventTime_;
146
147 Security(const Security&);
148
149 Security& operator=(const Security&);
150};
151
154void brief(std::string&, const Security&);
155
157inline std::string brief(const Security& security)
158{
159 std::string str;
160
161 brief(str, security);
162
163 return str;
164}
165
168void toStr(std::string&, const Security&);
169
171inline std::string toStr(const Security& security)
172{
173 std::string str;
174
175 toStr(str, security);
176
177 return str;
178}
179
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:54
#define ONIXS_CMEMDH_LTWT
Definition Bootstrap.h:46
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:55
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:148
The time point without the time-zone information.
Definition Time.h:425
Attributes associated with security.
Definition Security.h:31
void userData(UserData data)
Sets user-defined data.
Definition Security.h:124
void group(Messaging::StrRef group)
Assigns security group code.
Definition Security.h:66
Messaging::UInt32 seqNumber() const
Security-level sequence number.
Definition Security.h:85
void lastEventTime(Messaging::Timestamp ts) noexcept
Updates TransactTime of the last event that triggered a book update.
Definition Security.h:130
~Security()=default
Cleans everything up.
Messaging::Timestamp lastEventTime() const noexcept
TransactTime of the last event that triggered a book update.
Definition Security.h:100
UserData userData() const
User-defined data.
Definition Security.h:94
Messaging::StrRef asset() const
Definition Security.h:73
void symbol(Messaging::StrRef symbol)
Updates security name or symbol.
Definition Security.h:50
SecurityId id() const
Definition Security.h:38
void seqNumber(Messaging::UInt32 seqNumber)
Updates sequence number.
Definition Security.h:118
Messaging::StrRef group() const
Definition Security.h:60
Messaging::UInt64 UserData
User-defined data to be attached.
Definition Security.h:91
Security(SecurityId id)
Initializes instance.
Definition Security.h:107
Messaging::StrRef symbol() const
Security name or symbol.
Definition Security.h:44
void asset(Messaging::StrRef asset)
Updates asset code.
Definition Security.h:79
std::uint32_t UInt32
uInt32.
Definition Integral.h:35
std::basic_string_view< Char > StrRef
Definition StrRef.h:46
StrRef toStrRef(const std::string &str)
Constructs a StrRef instance over th std::string content.
Definition StrRef.h:367
std::uint64_t UInt64
uInt64.
Definition Integral.h:37
Messaging::Int32 SecurityId
Unique security identifier.
Definition Domain.h:31
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
void brief(std::string &, const ConsolidatedBook &)
Book brief info.