OnixS C++ CME MDP Conflated UDP Handler 1.1.2
API documentation
Loading...
Searching...
No Matches
HandlerListeners.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
23#include <string>
24
27
30
32
34
39{
41 static
44 {
45 static
47 listener;
48
49 return listener;
50 }
51
53 static
56 {
57 static
59 listener;
60
61 return listener;
62 }
63
65 static
68 {
69 static
71 listener;
72
73 return listener;
74 }
75
77 static
80 {
81 static
83 listener;
84
85 return listener;
86 }
87};
88
93 : public SettingGroup
94{
95 // Lets grouping and value assignment control functioning.
96 friend
98 (
100 );
101
102 //
103
104 HandlerListener* handler_;
105 ChannelFeedListener* feeds_;
106 MarketDataListener* marketData_;
107 SecurityListener* security_;
108
109 // Re-initializes the instance as a copy of the
110 // other one and bypassing assignment control.
111 void
112 assignNoControl(
113 const HandlerListeners& other)
114 {
115 handler_= other.handler_;
116 feeds_ = other.feeds_;
117
118 marketData_ = other.marketData_;
119 security_ = other.security_;
120 }
121
122public:
126 controller = NULL)
127 : SettingGroup(controller)
128 , handler_(
130 handler())
131 , feeds_(
133 feeds())
134 , marketData_(
136 marketData())
137 , security_(
139 security())
140 {
141 }
142
146 const HandlerListeners& other)
147 : SettingGroup()
148 , handler_(other.handler_)
149 , feeds_(other.feeds_)
150 , marketData_(other.marketData_)
151 , security_(other.security_)
152 {
153 }
154
157 {
158 }
159
163 handler() const
164 {
165 return
166 (
167 handler_ !=
169 handler()
170 ? handler_
171 : NULL
172 );
173 }
174
182 {
183 return *handler_;
184 }
185
190 void
192 HandlerListener* listener)
193 {
195 (
196 "Handler Listener",
197 handler_,
198 listener
199 ? listener
201 );
202 }
203
207 feeds() const
208 {
209 return
210 (
211 feeds_ !=
213 feeds()
214 ? feeds_
215 : NULL
216 );
217 }
218
226 {
227 return *feeds_;
228 }
229
234 void
236 ChannelFeedListener* listener)
237 {
239 (
240 "ChannelFeed Listener",
241 feeds_,
242 listener
243 ? listener
245 );
246 }
247
252 {
253 return
254 (
255 marketData_ !=
257 marketData()
258 ? marketData_
259 : NULL
260 );
261 }
262
270 {
271 return *marketData_;
272 }
273
278 void
280 MarketDataListener* listener)
281 {
283 (
284 "MarketData Listener",
285 marketData_,
286 listener
287 ? listener
289 );
290 }
291
295 security() const
296 {
297 return
298 (
299 security_ !=
301 security()
302 ? security_
303 : NULL
304 );
305 }
306
314 {
315 return *security_;
316 }
317
322 void
324 SecurityListener* listener)
325 {
327 (
328 "Security Listener",
329 security_,
330 listener
331 ? listener
333 );
334 }
335
341 operator =(
342 const HandlerListeners& other)
343 {
345 (
346 "Handler Listeners",
347 &HandlerListeners::assignNoControl,
348 *this,
349 other
350 );
351
352 return *this;
353 }
354};
355
357ONIXS_CONFLATEDUDP_EXPORTED
358void
360 std::string&,
361 const HandlerListeners&);
362
364inline
365std::string
367 const HandlerListeners& listeners)
368{
369 std::string str;
370
371 toStr(str, listeners);
372
373 return str;
374}
375
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
Definition Bootstrap.h:95
#define ONIXS_CONFLATEDUDP_EXPORTED_STRUCT
Definition Bootstrap.h:59
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Definition Bootstrap.h:157
#define ONIXS_CONFLATEDUDP_LTWT_CLASS_DECL(name)
Definition Bootstrap.h:107
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Definition Bootstrap.h:153
void handler(HandlerListener *listener)
ChannelFeedListener & feedsOrDefault() const
void marketData(MarketDataListener *listener)
void security(SecurityListener *listener)
MarketDataListener & marketDataOrDefault() const
void feeds(ChannelFeedListener *listener)
HandlerListeners(const HandlerListeners &other)
HandlerListeners(SettingAssignController *controller=NULL)
Initializes listeners with default values.
void controlAssignment(const Char *description, Assignee &assignee, Value value) const
ONIXS_CONFLATEDUDP_EXPORTED void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
static HandlerListener & handler()
Default listener for Handler-related events.
static MarketDataListener & marketData()
Default listener for market data -related events.
static SecurityListener & security()
Default listener for security-related events.
static ChannelFeedListener & feeds()
Default listener for feed-related events.
Events raised by Handler while processing market data.
Callbacks invoked by Handler to expose market data entities.