OnixS C++ CME MDP Premium Market Data Handler 5.9.0
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
98protected:
101 : id_(id)
102 , seqNumber_(0)
103 , userData_(0)
104 {
105 }
106
109
112 {
113 seqNumber_ = seqNumber;
114 }
115
118 {
119 userData_ = data;
120 }
121
122private:
123 const SecurityId id_;
124
125 UInt32 seqNumber_;
126
127 std::string symbol_;
128 std::string group_;
129 std::string asset_;
130
131 UserData userData_;
132
133 Security(const Security&);
134
135 Security& operator=(const Security&);
136};
137
140void brief(std::string&, const Security&);
141
143inline std::string brief(const Security& security)
144{
145 std::string str;
146
147 brief(str, security);
148
149 return str;
150}
151
154void toStr(std::string&, const Security&);
155
157inline std::string toStr(const Security& security)
158{
159 std::string str;
160
161 toStr(str, security);
162
163 return str;
164}
165
#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_EXPORTED
Definition Compiler.h:171
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:117
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
StrRef asset() const
String field that indicates the underlying asset code (Product Code).
Definition Security.h:72
UserData userData() const
User-defined data.
Definition Security.h:93
void seqNumber(UInt32 seqNumber)
Updates sequence number.
Definition Security.h:111
SecurityId id() const
Unique security identifier.
Definition Security.h:37
StrRef group() const
Security group code.
Definition Security.h:59
UInt64 UserData
User-defined data to be attached.
Definition Security.h:90
Security(SecurityId id)
Initializes instance.
Definition Security.h:100
void asset(const StrRef &asset)
Updates asset code.
Definition Security.h:78
~Security()
Cleans everything up.
Definition Security.h:108
StrRef symbol() const
Security name or symbol.
Definition Security.h:43
Provides efficient way of accessing text-based values without copying content of the text being refer...
Definition String.h:42
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.