OnixS C++ CME MDP Premium Market Data Handler 5.9.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
25
27
30{
31public:
37 SecurityId id() const
38 {
39 return id_;
40 }
41
43 StrRef symbol() const
44 {
45 return toStrRef(symbol_);
46 }
47
49 void symbol(const StrRef& symbol)
50 {
51 symbol_.assign(symbol.items(), symbol.size());
52 }
53
59 StrRef group() const
60 {
61 return toStrRef(group_);
62 }
63
65 void group(const StrRef& group)
66 {
67 group_.assign(group.items(), group.size());
68 }
69
72 StrRef asset() const
73 {
74 return toStrRef(asset_);
75 }
76
78 void asset(const StrRef& asset)
79 {
80 asset_.assign(asset.items(), asset.size());
81 }
82
85 {
86 return seqNumber_;
87 }
88
91
94 {
95 return userData_;
96 }
97
100 {
101 return lastEventTime_;
102 }
103
104protected:
107 : id_(id)
108 , seqNumber_(0)
109 , userData_(0)
110 {
111 }
112
115
118 {
119 seqNumber_ = seqNumber;
120 }
121
124 {
125 userData_ = data;
126 }
127
130 {
131 lastEventTime_ = ts;
132 }
133
134private:
135 const SecurityId id_;
136
137 UInt32 seqNumber_;
138
139 std::string symbol_;
140 std::string group_;
141 std::string asset_;
142
143 UserData userData_;
144 Timestamp lastEventTime_;
145
146 Security(const Security&);
147
148 Security& operator=(const Security&);
149};
150
153void brief(std::string&, const Security&);
154
156inline std::string brief(const Security& security)
157{
158 std::string str;
159
160 brief(str, security);
161
162 return str;
163}
164
167void toStr(std::string&, const Security&);
168
170inline std::string toStr(const Security& security)
171{
172 std::string str;
173
174 toStr(str, security);
175
176 return str;
177}
178
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:67
#define ONIXS_CMEMDH_LTWT
Definition Bootstrap.h:46
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:68
#define ONIXS_CMEMDH_NOEXCEPT
Definition Compiler.h:180
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:179
Attributes associated with security.
Definition Security.h:30
UInt32 seqNumber() const
Security-level sequence number.
Definition Security.h:84
void userData(UserData data)
Sets user-defined data.
Definition Security.h:123
void symbol(const StrRef &symbol)
Updates security name or symbol.
Definition Security.h:49
void group(const StrRef &group)
Assigns security group code.
Definition Security.h:65
Timestamp lastEventTime() const noexcept
TransactTime of the last event that triggered a book update.
Definition Security.h:99
StrRef asset() const
Definition Security.h:72
UserData userData() const
User-defined data.
Definition Security.h:93
void seqNumber(UInt32 seqNumber)
Updates sequence number.
Definition Security.h:117
SecurityId id() const
Definition Security.h:37
StrRef group() const
Definition Security.h:59
UInt64 UserData
User-defined data to be attached.
Definition Security.h:90
Security(SecurityId id)
Initializes instance.
Definition Security.h:106
void lastEventTime(Timestamp ts) noexcept
Updates TransactTime of the last event that triggered a book update.
Definition Security.h:129
void asset(const StrRef &asset)
Updates asset code.
Definition Security.h:78
~Security()
Cleans everything up.
Definition Security.h:114
StrRef symbol() const
Security name or symbol.
Definition Security.h:43
Represents time point without time-zone information.
Definition Time.h:388
UInt64 UInt64
uInt64.
Definition Fields.h:205
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
UInt32 UInt32
uInt32.
Definition Fields.h:202
StrRef toStrRef(const std::string &str)
Constructs StrRef instance over std::string content.
Definition String.h:155
Int32 SecurityId
Unique security identifier.
Definition Domain.h:31
void brief(std::string &, const ConsolidatedBook &)
Book brief info.