OnixS C++ CME Market Data Handler  5.4.0
API documentation
MessageListener.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 
28 /// Exposes the FIX message being processed
29 /// by the Handler and the packet containing it.
32 {
33  const NetPacket& packet_;
34  const Message& message_;
35 
36  // Coping/cloning is not supposed.
37 
39  const MessageArgs&);
40 
41  MessageArgs&
42  operator =(
43  const MessageArgs&);
44 
45 public:
46  /// Initializes instance with given message
47  /// instance and packet containing that message.
49  const NetPacket& packet,
50  const Message& message)
51  : packet_(packet)
52  , message_(message)
53  {
54  }
55 
56  /// Instance of packet containing the message.
57  const NetPacket& packet() const
58  {
59  return packet_;
60  }
61 
62  /// Instance of message being processed.
63  const Message& message() const
64  {
65  return message_;
66  }
67 };
68 
69 /// Callbacks invoked by Handler during market data
70 /// processing to reflect various stages of processing.
71 /// The given listener transforms binary messages into
72 /// universal FIX-like interface for easier operating.
75 : public MarketDataListener
76 {
77  virtual
78  void
79  onPacket(
80  Handler&,
81  const PacketArgs&)
82  {
83  }
84 
85  void
86  onMessage(
87  Handler& handler,
88  const ChannelReset4Args& args)
89  {
90  onMessage(
91  handler,
93  args.packet(),
94  ChannelReset4(args.message())));
95  }
96 
97  void
98  onEndOfMessage(
99  Handler& handler,
100  const ChannelReset4Args& args)
101  {
102  onEndOfMessage(
103  handler,
104  MessageArgs(
105  args.packet(),
106  ChannelReset4(args.message())));
107  }
108 
109  void
110  onMessage(
111  Handler& handler,
112  const AdminHeartbeat12Args& args)
113  {
114  onMessage(
115  handler,
116  MessageArgs(
117  args.packet(),
118  AdminHeartbeat12(args.message())));
119  }
120 
121  void
122  onEndOfMessage(
123  Handler& handler,
124  const AdminHeartbeat12Args& args)
125  {
126  onEndOfMessage(
127  handler,
128  MessageArgs(
129  args.packet(),
130  AdminHeartbeat12(args.message())));
131  }
132 
133  void
134  onMessage(
135  Handler& handler,
136  const AdminLogin15Args& args)
137  {
138  onMessage(
139  handler,
140  MessageArgs(
141  args.packet(),
142  AdminLogin15(args.message())));
143  }
144 
145  void
146  onEndOfMessage(
147  Handler& handler,
148  const AdminLogin15Args& args)
149  {
150  onEndOfMessage(
151  handler,
152  MessageArgs(
153  args.packet(),
154  AdminLogin15(args.message())));
155  }
156 
157  void
158  onMessage(
159  Handler& handler,
160  const AdminLogout16Args& args)
161  {
162  onMessage(
163  handler,
164  MessageArgs(
165  args.packet(),
166  AdminLogout16(args.message())));
167  }
168 
169  void
170  onEndOfMessage(
171  Handler& handler,
172  const AdminLogout16Args& args)
173  {
174  onEndOfMessage(
175  handler,
176  MessageArgs(
177  args.packet(),
178  AdminLogout16(args.message())));
179  }
180 
181  void
182  onMessage(
183  Handler& handler,
184  const AdminLogin408Args& args)
185  {
186  onMessage(
187  handler,
188  MessageArgs(
189  args.packet(),
190  AdminLogin408(args.message())));
191  }
192 
193  void
194  onEndOfMessage(
195  Handler& handler,
196  const AdminLogin408Args& args)
197  {
198  onEndOfMessage(
199  handler,
200  MessageArgs(
201  args.packet(),
202  AdminLogin408(args.message())));
203  }
204 
205  void
206  onMessage(
207  Handler& handler,
208  const AdminLogout409Args& args)
209  {
210  onMessage(
211  handler,
212  MessageArgs(
213  args.packet(),
214  AdminLogout409(args.message())));
215  }
216 
217  void
218  onEndOfMessage(
219  Handler& handler,
220  const AdminLogout409Args& args)
221  {
222  onEndOfMessage(
223  handler,
224  MessageArgs(
225  args.packet(),
226  AdminLogout409(args.message())));
227  }
228 
229  void
230  onMessage(
231  Handler& handler,
232  const AdminHeartbeat410Args& args)
233  {
234  onMessage(
235  handler,
236  MessageArgs(
237  args.packet(),
238  AdminHeartbeat410(args.message())));
239  }
240 
241  void
242  onEndOfMessage(
243  Handler& handler,
244  const AdminHeartbeat410Args& args)
245  {
246  onEndOfMessage(
247  handler,
248  MessageArgs(
249  args.packet(),
250  AdminHeartbeat410(args.message())));
251  }
252 
253  void
254  onMessage(
255  Handler& handler,
256  const SecurityStatus30Args& args)
257  {
258  onMessage(
259  handler,
260  MessageArgs(
261  args.packet(),
262  SecurityStatus30(args.message())));
263  }
264 
265  void
266  onEndOfMessage(
267  Handler& handler,
268  const SecurityStatus30Args& args)
269  {
270  onEndOfMessage(
271  handler,
272  MessageArgs(
273  args.packet(),
274  SecurityStatus30(args.message())));
275  }
276 
277  void
278  onMessage(
279  Handler& handler,
280  const IncrementalRefreshVolume37Args& args)
281  {
282  onMessage(
283  handler,
284  MessageArgs(
285  args.packet(),
287  }
288 
289  void
290  onEndOfMessage(
291  Handler& handler,
292  const IncrementalRefreshVolume37Args& args)
293  {
294  onEndOfMessage(
295  handler,
296  MessageArgs(
297  args.packet(),
299  }
300 
301  void
302  onMessage(
303  Handler& handler,
304  const QuoteRequest39Args& args)
305  {
306  onMessage(
307  handler,
308  MessageArgs(
309  args.packet(),
310  QuoteRequest39(args.message())));
311  }
312 
313  void
314  onEndOfMessage(
315  Handler& handler,
316  const QuoteRequest39Args& args)
317  {
318  onEndOfMessage(
319  handler,
320  MessageArgs(
321  args.packet(),
322  QuoteRequest39(args.message())));
323  }
324 
325  void
326  onMessage(
327  Handler& handler,
328  const IncrementalRefreshBook46Args& args)
329  {
330  onMessage(
331  handler,
332  MessageArgs(
333  args.packet(),
335  }
336 
337  void
338  onEndOfMessage(
339  Handler& handler,
340  const IncrementalRefreshBook46Args& args)
341  {
342  onEndOfMessage(
343  handler,
344  MessageArgs(
345  args.packet(),
347  }
348 
349  void
350  onMessage(
351  Handler& handler,
353  {
354  onMessage(
355  handler,
356  MessageArgs(
357  args.packet(),
359  }
360 
361  void
362  onEndOfMessage(
363  Handler& handler,
365  {
366  onEndOfMessage(
367  handler,
368  MessageArgs(
369  args.packet(),
371  }
372 
373  void
374  onMessage(
375  Handler& handler,
377  {
378  onMessage(
379  handler,
380  MessageArgs(
381  args.packet(),
383  }
384 
385  void
386  onEndOfMessage(
387  Handler& handler,
389  {
390  onEndOfMessage(
391  handler,
392  MessageArgs(
393  args.packet(),
395  }
396 
397  void
398  onMessage(
399  Handler& handler,
401  {
402  onMessage(
403  handler,
404  MessageArgs(
405  args.packet(),
407  }
408 
409  void
410  onEndOfMessage(
411  Handler& handler,
413  {
414  onEndOfMessage(
415  handler,
416  MessageArgs(
417  args.packet(),
419  }
420 
421  void
422  onMessage(
423  Handler& handler,
425  {
426  onMessage(
427  handler,
428  MessageArgs(
429  args.packet(),
431  }
432 
433  void
434  onEndOfMessage(
435  Handler& handler,
437  {
438  onEndOfMessage(
439  handler,
440  MessageArgs(
441  args.packet(),
443  }
444 
445  void
446  onMessage(
447  Handler& handler,
449  {
450  onMessage(
451  handler,
452  MessageArgs(
453  args.packet(),
455  }
456 
457  void
458  onEndOfMessage(
459  Handler& handler,
461  {
462  onEndOfMessage(
463  handler,
464  MessageArgs(
465  args.packet(),
467  }
468 
469  void
470  onMessage(
471  Handler& handler,
472  const SnapshotFullRefresh52Args& args)
473  {
474  onMessage(
475  handler,
476  MessageArgs(
477  args.packet(),
478  SnapshotFullRefresh52(args.message())));
479  }
480 
481  void
482  onEndOfMessage(
483  Handler& handler,
484  const SnapshotFullRefresh52Args& args)
485  {
486  onEndOfMessage(
487  handler,
488  MessageArgs(
489  args.packet(),
490  SnapshotFullRefresh52(args.message())));
491  }
492 
493  void
494  onMessage(
495  Handler& handler,
497  {
498  onMessage(
499  handler,
500  MessageArgs(
501  args.packet(),
503  }
504 
505  void
506  onEndOfMessage(
507  Handler& handler,
509  {
510  onEndOfMessage(
511  handler,
512  MessageArgs(
513  args.packet(),
515  }
516 
517  void
518  onMessage(
519  Handler& handler,
521  {
522  onMessage(
523  handler,
524  MessageArgs(
525  args.packet(),
527  }
528 
529  void
530  onEndOfMessage(
531  Handler& handler,
533  {
534  onEndOfMessage(
535  handler,
536  MessageArgs(
537  args.packet(),
539  }
540 
541  void
542  onMessage(
543  Handler& handler,
545  {
546  onMessage(
547  handler,
548  MessageArgs(
549  args.packet(),
551  }
552 
553  void
554  onEndOfMessage(
555  Handler& handler,
557  {
558  onEndOfMessage(
559  handler,
560  MessageArgs(
561  args.packet(),
563  }
564 
565  void
566  onMessage(
567  Handler& handler,
569  {
570  onMessage(
571  handler,
572  MessageArgs(
573  args.packet(),
575  }
576 
577  void
578  onEndOfMessage(
579  Handler& handler,
581  {
582  onEndOfMessage(
583  handler,
584  MessageArgs(
585  args.packet(),
587  }
588 
589  void
590  onMessage(
591  Handler& handler,
593  {
594  onMessage(
595  handler,
596  MessageArgs(
597  args.packet(),
599  }
600 
601  void
602  onEndOfMessage(
603  Handler& handler,
605  {
606  onEndOfMessage(
607  handler,
608  MessageArgs(
609  args.packet(),
611  }
612 
613 
614 
615 public:
616  /// Invoked when processing of the given message has begun.
617  virtual
618  void
620  Handler&,
621  const MessageArgs&)
622  {
623  }
624 
625  /// Invoked when processing of the message is ended.
626  virtual
627  void
629  Handler&,
630  const MessageArgs&)
631  {
632  }
633 };
634 
#define ONIXS_CMEMDH_LTWT_CLASS
Definition: Bootstrap.h:94
#define ONIXS_CMEMDHFIX_NAMESPACE_BEGIN
Definition: Bootstrap.h:160
const Message & message() const
Instance of message being processed.
const NetPacket & packet() const
Instance of packet containing the message.
const NetPacket & packet() const
Instance of packet containing the message.
MessageArgs(const NetPacket &packet, const Message &message)
#define ONIXS_CMEMDHFIX_NAMESPACE_END
Definition: Bootstrap.h:164
#define ONIXS_CMEMDH_EXPORTED_CLASS
Definition: Bootstrap.h:54
virtual void onEndOfMessage(Handler &, const MessageArgs &)
Invoked when processing of the message is ended.
const Message & message() const
Instance of message being processed.
virtual void onMessage(Handler &, const MessageArgs &)
Invoked when processing of the given message has begun.