OnixS C++ CME MDP Premium Market Data Handler  5.8.3
API Documentation
FeedConsumer.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 <OnixS/CME/MDH/String.h>
24 
26 
27 // A bit of forward declarations.
28 
31 
32 /// Represents an interface through which the
33 /// Feed Engine pushes market data received for
34 /// the feeds.
36 {
37 public:
38  /// Tries to gain access to the given consumer.
39  ///
40  /// Before invoking any other member, the consumer
41  /// must be successfully acquired. This is because
42  /// the consumer may be busy while handling the other
43  /// event from the other source.
44  virtual bool tryAcquire() = 0;
45 
46  /// Releases previously acquired consumer.
47  virtual void release() = 0;
48 
49  /// Invoked by the feed engine machinery
50  /// when a packet is received for the feed
51  /// associated with the given consumer.
52  ///
53  /// The given member must be invoked only when
54  /// the consumer was already successfully acquired.
55  virtual void onPacket(const NetPacket&) = 0;
56 
57  /// Invoked by the feed engine machinery
58  /// when any packet wasn't received for the
59  /// feed associated with the given consumer
60  /// for a predefined amount of time.
61  ///
62  /// The given member must be invoked only when
63  /// the consumer was already successfully acquired.
64  virtual void onTimeout(const NetFeed&) = 0;
65 
66  /// Invoked by the feed engine machinery
67  /// when the feed associated with the given
68  /// consumer has reached its expiration time.
69  /// The expiration time for the feed is defined
70  /// by the 'expirationTime' member.
71  ///
72  /// The given member must be invoked only when
73  /// the consumer was already successfully acquired.
74  virtual void onExpiration(const NetFeed&) = 0;
75 
76  /// Invoked by the feed engine machinery when
77  /// it experienced an issue while receiving data
78  /// for the feed associated with the given consumer.
79  ///
80  /// The given member must be invoked only when
81  /// the consumer was already successfully acquired.
82  virtual void onFailure(const NetFeed&, const Char*) = 0;
83 
84 protected:
85  /// Protected construction for descendants.
87 
88  /// Lifetime of the instance is not maintained
89  /// through the interface of the given class.
90  virtual ~NetFeedConsumer() {}
91 
92 private:
94 
95  NetFeedConsumer& operator=(const NetFeedConsumer&);
96 };
97 
virtual ~NetFeedConsumer()
Lifetime of the instance is not maintained through the interface of the given class.
Definition: FeedConsumer.h:90
char Char
Character type alias.
Definition: String.h:36
Base attributes of market data feed.
Definition: Feed.h:54
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition: Bootstrap.h:67
#define ONIXS_CMEMDH_EXPORTED
Definition: Compiler.h:135
#define ONIXS_CMEMDH_LTWT_CLASS_DECL(name)
Definition: Bootstrap.h:48
NetFeedConsumer()
Protected construction for descendants.
Definition: FeedConsumer.h:86
Represents an interface through which the Feed Engine pushes market data received for the feeds...
Definition: FeedConsumer.h:35
#define ONIXS_CMEMDH_NAMESPACE_END
Definition: Bootstrap.h:68