OnixS C++ CME MDP Conflated UDP Handler 1.1.2
API documentation
Loading...
Searching...
No Matches
Filtering.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
33{
34public:
37 typedef
40
43 typedef
46
49 typedef
52
55 typedef
58
63
67 const
69 : securityIds_(
70 other.securityIds())
71 , securityGroups_(
72 other.securityGroups())
73 , symbols_(
74 other.symbols())
75 , assets_(
76 other.assets_)
77 {
78 }
79
81 const
82 SecurityIds&
84 {
85 return securityIds_;
86 }
87
89 SecurityIds&
91 {
92 return securityIds_;
93 }
94
96 const
97 SecurityGroups&
99 {
100 return securityGroups_;
101 }
102
104 SecurityGroups&
106 {
107 return securityGroups_;
108 }
109
111 const
112 Symbols&
113 symbols() const
114 {
115 return symbols_;
116 }
117
119 Symbols&
121 {
122 return symbols_;
123 }
124
126 const
127 Assets&
128 assets() const
129 {
130 return assets_;
131 }
132
134 Assets&
136 {
137 return assets_;
138 }
139
141 void clear()
142 {
143 securityIds_.clear();
144 securityGroups_.clear();
145
146 symbols_.clear();
147 assets_.clear();
148 }
149
153 operator =(
154 const
155 InstrumentSelection& other)
156 {
157 if (this != &other)
158 {
160 ids(
161 other.securityIds());
162
164 groups(
165 other.securityGroups());
166
168 other.symbols());
169
171 other.assets());
172
173 //
174
175 securityIds_.swap(ids);
176 securityGroups_.swap(groups);
177
178 symbols_.swap(symbols);
179 assets_.swap(assets);
180 }
181
182 return *this;
183 }
184
185private:
186 SecurityIds securityIds_;
187 SecurityGroups securityGroups_;
188
189 Symbols symbols_;
190 Assets assets_;
191};
192
194ONIXS_CONFLATEDUDP_EXPORTED
195void
197 std::string&,
198 const
200
202inline
203std::string
205 const
207 selection)
208{
209 std::string str;
210
211 toStr(str, selection);
212
213 return str;
214}
215
216//
217
220inline
221bool
223 const
225 SecurityIds& ids,
226 SecurityId id)
227{
228 return (
229 ids.empty() ||
230 (ids.end() != ids.find(id))
231 );
232}
233
236inline
237bool
239 const TinyStrSet& selection,
240 const StrRef& value)
241{
242 return (
243 value.empty()
244 ||
245 selection.empty()
246 ||
247 (selection.end() !=
248 selection.find(value))
249 );
250}
251
254inline
255bool
257 const InstrumentSelection& selection,
258 const Security& security)
259{
260 return (
261 selected(
262 selection.securityIds(),
263 security.id())
264 &&
265 selected(
266 selection.securityGroups(),
267 security.group())
268 &&
269 selected(
270 selection.symbols(),
271 security.symbol())
272 &&
273 selected(
274 selection.assets(),
275 security.asset())
276 );
277}
278
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
Definition Bootstrap.h:95
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Definition Bootstrap.h:157
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Definition Bootstrap.h:153
Assets & assets()
Securities selected by their assets.
Definition Filtering.h:135
const SecurityGroups & securityGroups() const
Securities selected by their groups.
Definition Filtering.h:98
InstrumentSelection()
Initializes empty selection.
Definition Filtering.h:60
SecurityGroups & securityGroups()
Securities selected by their groups.
Definition Filtering.h:105
const Symbols & symbols() const
Securities selected by their symbols.
Definition Filtering.h:113
const Assets & assets() const
Securities selected by their assets.
Definition Filtering.h:128
SecurityIds & securityIds()
Securities selected by their identifiers.
Definition Filtering.h:90
Symbols & symbols()
Securities selected by their symbols.
Definition Filtering.h:120
InstrumentSelection(const InstrumentSelection &other)
Definition Filtering.h:66
const SecurityIds & securityIds() const
Securities selected by their identifiers.
Definition Filtering.h:83
Attributes associated with security.
Definition Security.h:30
StrRef symbol() const
Security name or symbol.
Definition Security.h:80
bool empty() const
Indicates whether the set is empty.
Definition TinySet.h:379
ConstIterator end() const
Provides iterating facilities.
Definition TinySet.h:410
ConstIterator find(const Item &item) const
Definition TinySet.h:420
bool selected(const InstrumentSelection::SecurityIds &ids, SecurityId id)
Definition Filtering.h:222
ONIXS_CONFLATEDUDP_EXPORTED void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
Int32 SecurityId
Unique security identifier.
Definition Domain.h:31