OnixS C++ CME MDP Conflated UDP Handler  1.1.2
API documentation
SecurityListener.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 
24 
26 
29 
31 
34 
35 /// Collection of attributes associated with
36 /// security-related data in security listener
37 /// callbacks.
38 template
39 <
40  class Container,
41  class Data = typename Container::Entry
42 >
44 {
45  Data entry_;
46  Container message_;
47  const NetPacket& packet_;
48 
49  /// Reinitializes instance as copy of other one.
51  operator =(
52  const SecurityDataArgs&);
53 
54 public:
55  /// Type of message whose instance
56  /// is referenced by given arguments.
57  typedef Container Message;
58 
59  /// Type of repeating group entry whose
60  /// instance referenced by given arguments.
61  typedef Data Entry;
62 
63  /// Initializes instance with
64  /// given market data entry.
66  const NetPacket& packet,
67  const Message& message,
68  const Entry& entry)
69  : entry_(entry)
70  , message_(message)
71  , packet_(packet)
72  {
73  }
74 
75  /// Initializes instance as copy of other one.
77  const SecurityDataArgs& other)
78  : entry_(other.entry_)
79  , message_(other.message_)
80  , packet_(other.packet_)
81  {
82  }
83 
84  /// Instance of the packet containing the message
85  /// which in its turn contains the market data entry.
86  const NetPacket& packet() const
87  {
88  return packet_;
89  }
90 
91  /// Instance of message containing market data entry.
92  const Message& message() const
93  {
94  return message_;
95  }
96 
97  /// Instance of market data being referenced.
98  const Entry& entry() const
99  {
100  return entry_;
101  }
102 };
103 
104 namespace
105 {
106  /// Empty order list.
107  inline
108  const
110  nullOrders()
111  {
112  static
113  const
115  theNull;
116 
117  return theNull;
118  }
119 }
120 
121 /// Attributes of trade summary.
122 template
123 <
124  class Summary,
125  class Data = typename Summary::Entry
126 >
128 : public SecurityDataArgs
129 <
130  Summary,
131  Data
132 >
133 {
134  const TradeOrderIds& orderIds_;
135 
137  operator =(
138  const TradeSummaryArgs&);
139 
140 public:
141  typedef
143  <
144  Summary,
145  Data
146  >
148 
149  /// Aliases type of message holding
150  /// trade summary repeating group entries.
151  typedef
152  typename
153  Base::Message
155 
156  /// Aliases trade summary data entry.
157  typedef
158  typename
159  Base::Entry
161 
162  /// Aliases collection of order ids.
163  typedef
166 
167  /// Initializes instance with data to be referenced.
169  const NetPacket& packet,
170  const Message& message,
171  const Entry& entry,
172  const OrderIds& ids = nullOrders())
173  : Base(packet, message, entry)
174  , orderIds_(ids)
175  {
176  }
177 
178  /// Initializes the instance as ref-copy of the other one.
180  const TradeSummaryArgs& other)
181  : Base(static_cast<const Base&>(other))
182  , orderIds_(other.orderIds_)
183  {
184  }
185 
186  /// Order details referring to given trade.
187  /// Collection may be empty if order details
188  /// gather is not enabled.
189  ///
190  /// @see HandlerSettings::tradeProcessing
191  /// for more information.
192  const
193  OrderIds&
194  orderIds() const
195  {
196  return orderIds_;
197  }
198 };
199 
200 typedef
202 <
204 >
206 
207 /// Instantiation of security data attributes for MBP book atomic updates.
208 typedef
210 <
212 >
214 
215 /// Instantiation of security data attributes for limits and banding.
216 typedef
218 <
220 >
222 
223 //
224 
225 /// Instantiation of security data attributes for recovery data.
226 typedef
228 <
230 >
232 
233 //
234 
235 /// Exposes details of book maintenance failure.
236 template
237 <
238  class Book
239 >
240 class
242 {
243 public:
244  /// Initializes instance with reference
245  /// to a book and failure reason.
247  const Book& book,
248  const std::string& description)
249  : book_(book)
250  , description_(description)
251  {
252  }
253 
254  /// Book which wasn't updated successfully.
255  const Book& book() const
256  {
257  return book_;
258  }
259 
260  /// Details on book update failure.
261  const std::string& description() const
262  {
263  return description_;
264  }
265 
266 private:
267  const Book& book_;
268  const std::string& description_;
269 
271  const BookUpdateErrorArgs&);
272 
274  operator =(
275  const BookUpdateErrorArgs&);
276 };
277 
278 /// Instantiation of book update error
279 /// arguments for books of direct type.
280 typedef
283 
284 /// Callbacks invoked by Handler to expose market data entities.
286 {
287  /// Invoked when book reset procedure
288  /// is spawned by MDP on a channel.
289  virtual
290  void
292  Handler&)
293  {
294  }
295 
296  /// Invoked upon instrument definition reception.
297  virtual
298  void
300  Handler&,
301  const Security&,
303  {
304  }
305 
306  /// Invoked upon processing of an instrument
307  /// definition extracted from instrument cache.
308  virtual
309  void
311  Handler&,
312  const Security&,
314  {
315  }
316 
317  /// Invoked for the instrument whose instrument
318  /// data wasn't received but other data like trades
319  /// or book updates is about to be processed.
320  virtual
321  void
323  Handler&,
324  Security&)
325  {
326  }
327 
328  /// Invoked when snapshot is received for
329  /// the security while Handler recovers market
330  /// state from snapshots.
331  virtual
332  void
334  Handler&,
335  const Security&,
337  {
338  }
339 
340  /// Invoked when trade is recovered from snapshot
341  /// while Handler recovers market state from snapshots.
342  virtual
343  void
345  Handler&,
346  const Security&,
347  const Recovery69EntryArgs&)
348  {
349  }
350 
351  /// Invoked when trade summary
352  /// is received for the security.
353  virtual
354  void
356  Handler&,
357  const Security&,
358  const TradeSummary65Args&)
359  {
360  }
361 
362  /// Invoked when electronic volume is
363  /// recovered from snapshot for the security.
364  virtual
365  void
367  Handler&,
368  const Security&,
369  const Recovery69EntryArgs&)
370  {
371  }
372 
373  /// Invoked when atomic book update for
374  // the security is recovered from snapshot.
375 virtual
376  void
378  Handler&,
379  const Security&,
380  const Recovery69EntryArgs&)
381  {
382  }
383 
384  /// Invoked when atomic book update
385  /// for the security is received.
386  virtual
387  void
389  Handler&,
390  const Security&,
392  {
393  }
394 
395  /// Invoked when direct book
396  /// is updated for the security.
397  ///
398  /// @note Callback is invoked if direct
399  /// book maintenance is enabled.
400  ///
401  /// @see HandlerSettings::bookManagement()
402  /// for more information.
403  virtual
404  void
406  Handler&,
407  const Security&,
408  const DirectBook&)
409  {
410  }
411 
412  /// Invoked when Handler fails to update
413  /// direct book for given security.
414  virtual
415  void
417  Handler&,
418  const Security&,
420  {
421  }
422 
423  /// Invoked when settlement price for the
424  /// security is recovered from snapshot.
425  virtual
426  void
428  Handler&,
429  const Security&,
430  const Recovery69EntryArgs&)
431  {
432  }
433 
434  /// Invoked when cleared volume for the
435  /// security is recovered from snapshot.
436  virtual
437  void
439  Handler&,
440  const Security&,
441  const Recovery69EntryArgs&)
442  {
443  }
444 
445  /// Invoked when open interest for the
446  /// security is recovered from snapshot.
447  virtual
448  void
450  Handler&,
451  const Security&,
452  const Recovery69EntryArgs&)
453  {
454  }
455 
456  /// Invoked when fixing price recovered
457  /// from snapshot for given security.
458  virtual
459  void
461  Handler&,
462  const Security&,
463  const Recovery69EntryArgs&)
464  {
465  }
466 
467  /// Invoked when opening price recovered
468  /// from snapshot for given security.
469  virtual
470  void
472  Handler&,
473  const Security&,
474  const Recovery69EntryArgs&)
475  {
476  }
477 
478  /// Invoked when session high trade price
479  /// recovered from snapshot for given security.
480  virtual
481  void
483  Handler&,
484  const Security&,
485  const Recovery69EntryArgs&)
486  {
487  }
488 
489  /// Invoked when session low trade price
490  /// recovered from snapshot for given security.
491  virtual
492  void
494  Handler&,
495  const Security&,
496  const Recovery69EntryArgs&)
497  {
498  }
499 
500  /// Invoked when session highest bid price
501  /// recovered from snapshot for given security.
502  virtual
503  void
505  Handler&,
506  const Security&,
507  const Recovery69EntryArgs&)
508  {
509  }
510 
511  /// Invoked when session lowest offer price
512  /// recovered from snapshot for given security.
513  virtual
514  void
516  Handler&,
517  const Security&,
518  const Recovery69EntryArgs&)
519  {
520  }
521 
522  /// Invoked when threshold limits and price
523  /// band variation is received for the security.
524  virtual
525  void
527  Handler&,
528  const Security&,
529  const LimitsAndBanding50Args&)
530  {
531  }
532 
533  /// Invoked when security status
534  /// is recovered from snapshot.
535  virtual
536  void
538  Handler&,
539  const Security&,
541  {
542  }
543 
544  /// Invoked when security status
545  /// is received for given security.
546  virtual
547  void
549  Handler&,
550  const Security&,
551  const SecurityStatus30Args&)
552  {
553  }
554 
555  /// Invoked when security status
556  /// is received for group of securities.
557  virtual
558  void
560  Handler&,
561  const SecurityStatus30Args&)
562  {
563  }
564 
565  /// Invoked when gap on is detected in market
566  /// data referring to the given security.
567  virtual
568  void
570  Handler&,
571  const Security&,
572  UInt32)
573  {
574  }
575 };
576 
SecurityDataArgs(const SecurityDataArgs &other)
Initializes instance as copy of other one.
virtual void onElectronicVolume(Handler &, const Security &, const Recovery69EntryArgs &)
virtual void onBookAtomicUpdate(Handler &, const Security &, const Recovery69EntryArgs &)
Invoked when atomic book update for.
virtual void onLowestOffer(Handler &, const Security &, const Recovery69EntryArgs &)
TradeSummaryArgs(const NetPacket &packet, const Message &message, const Entry &entry, const OrderIds &ids=nullOrders())
Initializes instance with data to be referenced.
virtual void onHighTradePrice(Handler &, const Security &, const Recovery69EntryArgs &)
virtual void onBookAtomicUpdate(Handler &, const Security &, const MbpBook64AtomicUpdateArgs &)
BookUpdateErrorArgs(const Book &book, const std::string &description)
Callbacks invoked by Handler to expose market data entities.
virtual void onDefinition(Handler &, const Security &, const FIX::MultiContainerArgs &)
virtual void onStatus(Handler &, const Security &, const SnapshotFullRefreshLongQty69Args &)
SecurityDataArgs< IncrementalRefreshLimitsBanding50 > LimitsAndBanding50Args
Instantiation of security data attributes for limits and banding.
virtual void onGap(Handler &, const Security &, UInt32)
SecurityDataArgs< IncrementalRefreshBookLongQty64 > MbpBook64AtomicUpdateArgs
Instantiation of security data attributes for MBP book atomic updates.
virtual void onUndefined(Handler &, Security &)
UInt32 UInt32
uInt32.
Definition: Fields.h:261
virtual void onSettlementPrice(Handler &, const Security &, const Recovery69EntryArgs &)
virtual void onFixingPrice(Handler &, const Security &, const Recovery69EntryArgs &)
Exposes details of book maintenance failure.
virtual void onHighestBid(Handler &, const Security &, const Recovery69EntryArgs &)
virtual void onTrade(Handler &, const Security &, const Recovery69EntryArgs &)
TradeSummaryArgs(const TradeSummaryArgs &other)
Initializes the instance as ref-copy of the other one.
#define ONIXS_CONFLATEDUDP_EXPORTED_CLASS_DECL(typeName)
Definition: Bootstrap.h:47
SecurityDataArgs< SnapshotFullRefreshLongQty69 > Recovery69EntryArgs
Instantiation of security data attributes for recovery data.
virtual void onOpenInterest(Handler &, const Security &, const Recovery69EntryArgs &)
virtual void onLimitsAndBanding(Handler &, const Security &, const LimitsAndBanding50Args &)
SecurityDataArgs< Summary, Data > Base
virtual void onDefinition(Handler &, const Security &, const InstrumentDefinitionFX63Args &)
Invoked upon instrument definition reception.
const Entry & entry() const
Instance of market data being referenced.
TradeOrderIds OrderIds
Aliases collection of order ids.
#define ONIXS_CONFLATEDUDP_EXPORTED_STRUCT
Definition: Bootstrap.h:59
const std::string & description() const
Details on book update failure.
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Definition: Bootstrap.h:157
virtual void onTrade(Handler &, const Security &, const TradeSummary65Args &)
virtual void onBookUpdate(Handler &, const Security &, const DirectBook &)
virtual void onGroupStatus(Handler &, const SecurityStatus30Args &)
const Message & message() const
Instance of message containing market data entry.
const Book & book() const
Book which wasn&#39;t updated successfully.
Base::Entry Entry
Aliases trade summary data entry.
virtual void onLowTradePrice(Handler &, const Security &, const Recovery69EntryArgs &)
virtual void onStatus(Handler &, const Security &, const SecurityStatus30Args &)
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Definition: Bootstrap.h:153
Attributes associated with security.
Definition: Security.h:29
virtual void onClearedVolume(Handler &, const Security &, const Recovery69EntryArgs &)
SecurityDataArgs(const NetPacket &packet, const Message &message, const Entry &entry)
virtual void onRecovery(Handler &, const Security &, const SnapshotFullRefreshLongQty69Args &)
virtual void onOpeningPrice(Handler &, const Security &, const Recovery69EntryArgs &)
TradeSummaryArgs< IncrementalRefreshTradeSummaryLongQty65 > TradeSummary65Args
BookUpdateErrorArgs< DirectBook > DirectBookUpdateErrorArgs
virtual void onBookUpdateError(Handler &, const Security &, const DirectBookUpdateErrorArgs &)