OnixS C++ CME MDP Premium Market Data Handler  5.8.9
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.
31 {
32  const NetPacket& packet_;
33  const Message& message_;
34 
35  // Coping/cloning is not supposed.
36 
37  MessageArgs(const MessageArgs&);
38 
39  MessageArgs& operator=(const MessageArgs&);
40 
41 public:
42  /// Initializes instance with given message
43  /// instance and packet containing that message.
44  MessageArgs(const NetPacket& packet, const Message& message)
45  : packet_(packet)
46  , message_(message)
47  {
48  }
49 
50  /// Instance of packet containing the message.
51  const NetPacket& packet() const
52  {
53  return packet_;
54  }
55 
56  /// Instance of message being processed.
57  const Message& message() const
58  {
59  return message_;
60  }
61 };
62 
63 /// Callbacks invoked by Handler during market data
64 /// processing to reflect various stages of processing.
65 /// The given listener transforms binary messages into
66 /// universal FIX-like interface for easier operating.
68 {
69  void onPacket(Handler&, const PacketArgs&) ONIXS_CMEMDH_OVERRIDE {}
70 
71  void onMessage(Handler& handler, const ChannelReset4Args& args) ONIXS_CMEMDH_OVERRIDE
72  {
73  onMessage(handler, MessageArgs(args.packet(), ChannelReset4(args.message())));
74  }
75 
76  void onEndOfMessage(Handler& handler, const ChannelReset4Args& args) ONIXS_CMEMDH_OVERRIDE
77  {
78  onEndOfMessage(handler, MessageArgs(args.packet(), ChannelReset4(args.message())));
79  }
80 
81  void onMessage(Handler& handler, const AdminHeartbeat12Args& args) ONIXS_CMEMDH_OVERRIDE
82  {
83  onMessage(handler, MessageArgs(args.packet(), AdminHeartbeat12(args.message())));
84  }
85 
86  void onEndOfMessage(Handler& handler, const AdminHeartbeat12Args& args) ONIXS_CMEMDH_OVERRIDE
87  {
88  onEndOfMessage(handler, MessageArgs(args.packet(), AdminHeartbeat12(args.message())));
89  }
90 
91  void onMessage(Handler& handler, const AdminLogin15Args& args) ONIXS_CMEMDH_OVERRIDE
92  {
93  onMessage(handler, MessageArgs(args.packet(), AdminLogin15(args.message())));
94  }
95 
96  void onEndOfMessage(Handler& handler, const AdminLogin15Args& args) ONIXS_CMEMDH_OVERRIDE
97  {
98  onEndOfMessage(handler, MessageArgs(args.packet(), AdminLogin15(args.message())));
99  }
100 
101  void onMessage(Handler& handler, const AdminLogout16Args& args) ONIXS_CMEMDH_OVERRIDE
102  {
103  onMessage(handler, MessageArgs(args.packet(), AdminLogout16(args.message())));
104  }
105 
106  void onEndOfMessage(Handler& handler, const AdminLogout16Args& args) ONIXS_CMEMDH_OVERRIDE
107  {
108  onEndOfMessage(handler, MessageArgs(args.packet(), AdminLogout16(args.message())));
109  }
110 
111  void onMessage(Handler& handler, const AdminLogin408Args& args) ONIXS_CMEMDH_OVERRIDE
112  {
113  onMessage(handler, MessageArgs(args.packet(), AdminLogin408(args.message())));
114  }
115 
116  void onEndOfMessage(Handler& handler, const AdminLogin408Args& args) ONIXS_CMEMDH_OVERRIDE
117  {
118  onEndOfMessage(handler, MessageArgs(args.packet(), AdminLogin408(args.message())));
119  }
120 
121  void onMessage(Handler& handler, const AdminLogout409Args& args) ONIXS_CMEMDH_OVERRIDE
122  {
123  onMessage(handler, MessageArgs(args.packet(), AdminLogout409(args.message())));
124  }
125 
126  void onEndOfMessage(Handler& handler, const AdminLogout409Args& args) ONIXS_CMEMDH_OVERRIDE
127  {
128  onEndOfMessage(handler, MessageArgs(args.packet(), AdminLogout409(args.message())));
129  }
130 
131  void onMessage(Handler& handler, const AdminHeartbeat410Args& args) ONIXS_CMEMDH_OVERRIDE
132  {
133  onMessage(handler, MessageArgs(args.packet(), AdminHeartbeat410(args.message())));
134  }
135 
136  void onEndOfMessage(Handler& handler, const AdminHeartbeat410Args& args) ONIXS_CMEMDH_OVERRIDE
137  {
138  onEndOfMessage(handler, MessageArgs(args.packet(), AdminHeartbeat410(args.message())));
139  }
140 
141  void onMessage(Handler& handler, const SecurityStatus30Args& args) ONIXS_CMEMDH_OVERRIDE
142  {
143  onMessage(handler, MessageArgs(args.packet(), SecurityStatus30(args.message())));
144  }
145 
146  void onEndOfMessage(Handler& handler, const SecurityStatus30Args& args) ONIXS_CMEMDH_OVERRIDE
147  {
148  onEndOfMessage(handler, MessageArgs(args.packet(), SecurityStatus30(args.message())));
149  }
150 
151  void onMessage(Handler& handler, const IncrementalRefreshVolume37Args& args) ONIXS_CMEMDH_OVERRIDE
152  {
153  onMessage(handler, MessageArgs(args.packet(), IncrementalRefreshVolume37(args.message())));
154  }
155 
156  void onEndOfMessage(Handler& handler, const IncrementalRefreshVolume37Args& args) ONIXS_CMEMDH_OVERRIDE
157  {
158  onEndOfMessage(handler, MessageArgs(args.packet(), IncrementalRefreshVolume37(args.message())));
159  }
160 
161  void onMessage(Handler& handler, const QuoteRequest39Args& args) ONIXS_CMEMDH_OVERRIDE
162  {
163  onMessage(handler, MessageArgs(args.packet(), QuoteRequest39(args.message())));
164  }
165 
166  void onEndOfMessage(Handler& handler, const QuoteRequest39Args& args) ONIXS_CMEMDH_OVERRIDE
167  {
168  onEndOfMessage(handler, MessageArgs(args.packet(), QuoteRequest39(args.message())));
169  }
170 
171  void onMessage(Handler& handler, const IncrementalRefreshBook46Args& args) ONIXS_CMEMDH_OVERRIDE
172  {
173  onMessage(handler, MessageArgs(args.packet(), IncrementalRefreshBook46(args.message())));
174  }
175 
176  void onEndOfMessage(Handler& handler, const IncrementalRefreshBook46Args& args) ONIXS_CMEMDH_OVERRIDE
177  {
178  onEndOfMessage(handler, MessageArgs(args.packet(), IncrementalRefreshBook46(args.message())));
179  }
180 
181  void onMessage(Handler& handler, const IncrementalRefreshOrderBook47Args& args) ONIXS_CMEMDH_OVERRIDE
182  {
183  onMessage(handler, MessageArgs(args.packet(), IncrementalRefreshOrderBook47(args.message())));
184  }
185 
186  void onEndOfMessage(Handler& handler, const IncrementalRefreshOrderBook47Args& args) ONIXS_CMEMDH_OVERRIDE
187  {
188  onEndOfMessage(handler, MessageArgs(args.packet(), IncrementalRefreshOrderBook47(args.message())));
189  }
190 
191  void onMessage(Handler& handler, const IncrementalRefreshTradeSummary48Args& args) ONIXS_CMEMDH_OVERRIDE
192  {
193  onMessage(handler, MessageArgs(args.packet(), IncrementalRefreshTradeSummary48(args.message())));
194  }
195 
196  void onEndOfMessage(Handler& handler, const IncrementalRefreshTradeSummary48Args& args) ONIXS_CMEMDH_OVERRIDE
197  {
198  onEndOfMessage(handler, MessageArgs(args.packet(), IncrementalRefreshTradeSummary48(args.message())));
199  }
200 
201  void onMessage(Handler& handler, const IncrementalRefreshDailyStatistics49Args& args) ONIXS_CMEMDH_OVERRIDE
202  {
203  onMessage(handler, MessageArgs(args.packet(), IncrementalRefreshDailyStatistics49(args.message())));
204  }
205 
206  void onEndOfMessage(Handler& handler, const IncrementalRefreshDailyStatistics49Args& args) ONIXS_CMEMDH_OVERRIDE
207  {
208  onEndOfMessage(handler, MessageArgs(args.packet(), IncrementalRefreshDailyStatistics49(args.message())));
209  }
210 
211  void onMessage(Handler& handler, const IncrementalRefreshLimitsBanding50Args& args) ONIXS_CMEMDH_OVERRIDE
212  {
213  onMessage(handler, MessageArgs(args.packet(), IncrementalRefreshLimitsBanding50(args.message())));
214  }
215 
216  void onEndOfMessage(Handler& handler, const IncrementalRefreshLimitsBanding50Args& args) ONIXS_CMEMDH_OVERRIDE
217  {
218  onEndOfMessage(handler, MessageArgs(args.packet(), IncrementalRefreshLimitsBanding50(args.message())));
219  }
220 
221  void onMessage(Handler& handler, const IncrementalRefreshSessionStatistics51Args& args) ONIXS_CMEMDH_OVERRIDE
222  {
223  onMessage(handler, MessageArgs(args.packet(), IncrementalRefreshSessionStatistics51(args.message())));
224  }
225 
226  void onEndOfMessage(Handler& handler, const IncrementalRefreshSessionStatistics51Args& args) ONIXS_CMEMDH_OVERRIDE
227  {
228  onEndOfMessage(handler, MessageArgs(args.packet(), IncrementalRefreshSessionStatistics51(args.message())));
229  }
230 
231  void onMessage(Handler& handler, const SnapshotFullRefresh52Args& args) ONIXS_CMEMDH_OVERRIDE
232  {
233  onMessage(handler, MessageArgs(args.packet(), SnapshotFullRefresh52(args.message())));
234  }
235 
236  void onEndOfMessage(Handler& handler, const SnapshotFullRefresh52Args& args) ONIXS_CMEMDH_OVERRIDE
237  {
238  onEndOfMessage(handler, MessageArgs(args.packet(), SnapshotFullRefresh52(args.message())));
239  }
240 
241  void onMessage(Handler& handler, const SnapshotFullRefreshOrderBook53Args& args) ONIXS_CMEMDH_OVERRIDE
242  {
243  onMessage(handler, MessageArgs(args.packet(), SnapshotFullRefreshOrderBook53(args.message())));
244  }
245 
246  void onEndOfMessage(Handler& handler, const SnapshotFullRefreshOrderBook53Args& args) ONIXS_CMEMDH_OVERRIDE
247  {
248  onEndOfMessage(handler, MessageArgs(args.packet(), SnapshotFullRefreshOrderBook53(args.message())));
249  }
250 
251  void onMessage(Handler& handler, const InstrumentDefinitionFuture54Args& args) ONIXS_CMEMDH_OVERRIDE
252  {
253  onMessage(handler, MessageArgs(args.packet(), InstrumentDefinitionFuture54(args.message())));
254  }
255 
256  void onEndOfMessage(Handler& handler, const InstrumentDefinitionFuture54Args& args) ONIXS_CMEMDH_OVERRIDE
257  {
258  onEndOfMessage(handler, MessageArgs(args.packet(), InstrumentDefinitionFuture54(args.message())));
259  }
260 
261  void onMessage(Handler& handler, const InstrumentDefinitionOption55Args& args) ONIXS_CMEMDH_OVERRIDE
262  {
263  onMessage(handler, MessageArgs(args.packet(), InstrumentDefinitionOption55(args.message())));
264  }
265 
266  void onEndOfMessage(Handler& handler, const InstrumentDefinitionOption55Args& args) ONIXS_CMEMDH_OVERRIDE
267  {
268  onEndOfMessage(handler, MessageArgs(args.packet(), InstrumentDefinitionOption55(args.message())));
269  }
270 
271  void onMessage(Handler& handler, const InstrumentDefinitionSpread56Args& args) ONIXS_CMEMDH_OVERRIDE
272  {
273  onMessage(handler, MessageArgs(args.packet(), InstrumentDefinitionSpread56(args.message())));
274  }
275 
276  void onEndOfMessage(Handler& handler, const InstrumentDefinitionSpread56Args& args) ONIXS_CMEMDH_OVERRIDE
277  {
278  onEndOfMessage(handler, MessageArgs(args.packet(), InstrumentDefinitionSpread56(args.message())));
279  }
280 
281  void onMessage(Handler& handler, const InstrumentDefinitionFixedIncome57Args& args) ONIXS_CMEMDH_OVERRIDE
282  {
283  onMessage(handler, MessageArgs(args.packet(), InstrumentDefinitionFixedIncome57(args.message())));
284  }
285 
286  void onEndOfMessage(Handler& handler, const InstrumentDefinitionFixedIncome57Args& args) ONIXS_CMEMDH_OVERRIDE
287  {
288  onEndOfMessage(handler, MessageArgs(args.packet(), InstrumentDefinitionFixedIncome57(args.message())));
289  }
290 
291  void onMessage(Handler&, const MultiContainerArgs&) ONIXS_CMEMDH_OVERRIDE {}
292  void onEndOfMessage(Handler&, const MultiContainerArgs&) ONIXS_CMEMDH_OVERRIDE {}
293 
294 public:
295  /// Invoked when processing of the given message has begun.
296  virtual void onMessage(Handler&, const MessageArgs&) {}
297 
298  /// Invoked when processing of the message is ended.
299  virtual void onEndOfMessage(Handler&, const MessageArgs&) {}
300 };
301 
Exposes the FIX message being processed by the Handler and the packet containing it.
Callbacks invoked by Handler during market data processing to reflect various stages of processing...
#define ONIXS_CMEMDH_OVERRIDE
Definition: Compiler.h:165
Encapsulates all the machinery related with market data processing from CME Market Data Platform...
Definition: Handler.h:55
#define ONIXS_CMEMDHFIX_NAMESPACE_BEGIN
Definition: Bootstrap.h:70
const Message & message() const
Instance of message being processed.
const NetPacket & packet() const
Instance of packet containing the message.
Callbacks invoked by Handler during market data processing to reflect various stages of processing...
const NetPacket & packet() const
Instance of packet containing the message.
#define ONIXS_CMEMDH_LTWT
Definition: Bootstrap.h:46
MessageArgs(const NetPacket &packet, const Message &message)
Initializes instance with given message instance and packet containing that message.
#define ONIXS_CMEMDHFIX_NAMESPACE_END
Definition: Bootstrap.h:71
virtual void onEndOfMessage(Handler &, const MessageArgs &)
Invoked when processing of the message is ended.
Collection of market data supplied via message processing callbacks.
#define ONIXS_CMEMDH_EXPORTED
Definition: Compiler.h:160
Implements FIX-like interface over the SBE-encoded message.
Definition: Message.h:215
const Message & message() const
Instance of message being processed.
virtual void onMessage(Handler &, const MessageArgs &)
Invoked when processing of the given message has begun.