OnixS C++ CME MDP Conflated UDP Handler  1.1.2
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  void
78  onPacket(
79  Handler&,
80  const PacketArgs&) ONIXS_CONFLATEDUDP_OVERRIDE
81  {
82  }
83 
84  void
85  onMessage(
86  Handler& handler,
87  const ChannelReset4Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
88  {
89  onMessage(
90  handler,
92  args.packet(),
93  ChannelReset4(args.message())));
94  }
95 
96  void
97  onEndOfMessage(
98  Handler& handler,
99  const ChannelReset4Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
100  {
101  onEndOfMessage(
102  handler,
103  MessageArgs(
104  args.packet(),
105  ChannelReset4(args.message())));
106  }
107 
108  void
109  onMessage(
110  Handler& handler,
111  const AdminHeartbeat12Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
112  {
113  onMessage(
114  handler,
115  MessageArgs(
116  args.packet(),
117  AdminHeartbeat12(args.message())));
118  }
119 
120  void
121  onEndOfMessage(
122  Handler& handler,
123  const AdminHeartbeat12Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
124  {
125  onEndOfMessage(
126  handler,
127  MessageArgs(
128  args.packet(),
129  AdminHeartbeat12(args.message())));
130  }
131 
132  void
133  onMessage(
134  Handler& handler,
135  const AdminLogin15Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
136  {
137  onMessage(
138  handler,
139  MessageArgs(
140  args.packet(),
141  AdminLogin15(args.message())));
142  }
143 
144  void
145  onEndOfMessage(
146  Handler& handler,
147  const AdminLogin15Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
148  {
149  onEndOfMessage(
150  handler,
151  MessageArgs(
152  args.packet(),
153  AdminLogin15(args.message())));
154  }
155 
156  void
157  onMessage(
158  Handler& handler,
159  const AdminLogout16Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
160  {
161  onMessage(
162  handler,
163  MessageArgs(
164  args.packet(),
165  AdminLogout16(args.message())));
166  }
167 
168  void
169  onEndOfMessage(
170  Handler& handler,
171  const AdminLogout16Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
172  {
173  onEndOfMessage(
174  handler,
175  MessageArgs(
176  args.packet(),
177  AdminLogout16(args.message())));
178  }
179 
180  void
181  onMessage(
182  Handler& handler,
183  const SecurityStatus30Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
184  {
185  onMessage(
186  handler,
187  MessageArgs(
188  args.packet(),
189  SecurityStatus30(args.message())));
190  }
191 
192  void
193  onEndOfMessage(
194  Handler& handler,
195  const SecurityStatus30Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
196  {
197  onEndOfMessage(
198  handler,
199  MessageArgs(
200  args.packet(),
201  SecurityStatus30(args.message())));
202  }
203 
204  void
205  onMessage(
206  Handler& handler,
207  const IncrementalRefreshLimitsBanding50Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
208  {
209  onMessage(
210  handler,
211  MessageArgs(
212  args.packet(),
214  }
215 
216  void
217  onEndOfMessage(
218  Handler& handler,
219  const IncrementalRefreshLimitsBanding50Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
220  {
221  onEndOfMessage(
222  handler,
223  MessageArgs(
224  args.packet(),
226  }
227 
228  void
229  onMessage(
230  Handler& handler,
231  const AdminLogin408Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
232  {
233  onMessage(
234  handler,
235  MessageArgs(
236  args.packet(),
237  AdminLogin408(args.message())));
238  }
239 
240  void
241  onEndOfMessage(
242  Handler& handler,
243  const AdminLogin408Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
244  {
245  onEndOfMessage(
246  handler,
247  MessageArgs(
248  args.packet(),
249  AdminLogin408(args.message())));
250  }
251 
252  void
253  onMessage(
254  Handler& handler,
255  const AdminLogout409Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
256  {
257  onMessage(
258  handler,
259  MessageArgs(
260  args.packet(),
261  AdminLogout409(args.message())));
262  }
263 
264  void
265  onEndOfMessage(
266  Handler& handler,
267  const AdminLogout409Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
268  {
269  onEndOfMessage(
270  handler,
271  MessageArgs(
272  args.packet(),
273  AdminLogout409(args.message())));
274  }
275 
276  void
277  onMessage(
278  Handler& handler,
279  const AdminHeartbeat410Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
280  {
281  onMessage(
282  handler,
283  MessageArgs(
284  args.packet(),
285  AdminHeartbeat410(args.message())));
286  }
287 
288  void
289  onEndOfMessage(
290  Handler& handler,
291  const AdminHeartbeat410Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
292  {
293  onEndOfMessage(
294  handler,
295  MessageArgs(
296  args.packet(),
297  AdminHeartbeat410(args.message())));
298  }
299 
300  void
301  onMessage(
302  Handler& handler,
303  const InstrumentDefinitionFX63Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
304  {
305  onMessage(
306  handler,
307  MessageArgs(
308  args.packet(),
310  }
311 
312  void
313  onEndOfMessage(
314  Handler& handler,
315  const InstrumentDefinitionFX63Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
316  {
317  onEndOfMessage(
318  handler,
319  MessageArgs(
320  args.packet(),
322  }
323 
324  void
325  onMessage(
326  Handler& handler,
327  const IncrementalRefreshBookLongQty64Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
328  {
329  onMessage(
330  handler,
331  MessageArgs(
332  args.packet(),
334  }
335 
336  void
337  onEndOfMessage(
338  Handler& handler,
339  const IncrementalRefreshBookLongQty64Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
340  {
341  onEndOfMessage(
342  handler,
343  MessageArgs(
344  args.packet(),
346  }
347 
348  void
349  onMessage(
350  Handler& handler,
351  const IncrementalRefreshTradeSummaryLongQty65Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
352  {
353  onMessage(
354  handler,
355  MessageArgs(
356  args.packet(),
358  }
359 
360  void
361  onEndOfMessage(
362  Handler& handler,
363  const IncrementalRefreshTradeSummaryLongQty65Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
364  {
365  onEndOfMessage(
366  handler,
367  MessageArgs(
368  args.packet(),
370  }
371 
372  void
373  onMessage(
374  Handler& handler,
375  const SnapshotFullRefreshLongQty69Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
376  {
377  onMessage(
378  handler,
379  MessageArgs(
380  args.packet(),
382  }
383 
384  void
385  onEndOfMessage(
386  Handler& handler,
387  const SnapshotFullRefreshLongQty69Args& args) ONIXS_CONFLATEDUDP_OVERRIDE
388  {
389  onEndOfMessage(
390  handler,
391  MessageArgs(
392  args.packet(),
394  }
395 
396  void onMessage(Handler&, const MultiContainerArgs&) ONIXS_CONFLATEDUDP_OVERRIDE {}
397  void onEndOfMessage(Handler&, const MultiContainerArgs&) ONIXS_CONFLATEDUDP_OVERRIDE {}
398 
399 public:
400  /// Invoked when processing of the given message has begun.
401  virtual
402  void
404  Handler&,
405  const MessageArgs&)
406  {
407  }
408 
409  /// Invoked when processing of the message is ended.
410  virtual
411  void
413  Handler&,
414  const MessageArgs&)
415  {
416  }
417 };
418 
virtual void onEndOfMessage(Handler &, const MessageArgs &)
Invoked when processing of the message is ended.
const Message & message() const
Instance of message being processed.
const NetPacket & packet() const
Instance of packet containing the message.
#define ONIXS_CONFLATEDUDPFIX_NAMESPACE_END
Definition: Bootstrap.h:165
virtual void onMessage(Handler &, const MessageArgs &)
Invoked when processing of the given message has begun.
const Message & message() const
Instance of message being processed.
const NetPacket & packet() const
Instance of packet containing the message.
#define ONIXS_CONFLATEDUDP_EXPORTED_CLASS
Definition: Bootstrap.h:55
MessageArgs(const NetPacket &packet, const Message &message)
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
Definition: Bootstrap.h:95
#define ONIXS_CONFLATEDUDPFIX_NAMESPACE_BEGIN
Definition: Bootstrap.h:161