OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.4.3
API documentation
EobiHandlerImpl.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*
4 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
5 *
6 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
7 * and international copyright treaties.
8 *
9 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
10 * Services Agreement (the Agreement) and Customer end user license agreements granting
11 * a non-assignable, non-transferable and non-exclusive license to use the software
12 * for it's own data processing purposes under the terms defined in the Agreement.
13 *
14 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
15 * of this source code or associated reference material to any other location for further reproduction
16 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
17 *
18 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
19 * the terms of the Agreement is a violation of copyright law.
20 */
21 
23 
24 #include <boost/unordered_set.hpp>
25 
26 #include "../BaseHandlerImp.h"
27 #include "../HandlerLogger.h"
28 #include "../Version.h"
29 
30 #include "EobiListenerHolder.h"
31 #include "EobiDataRepository.h"
32 #include "EobiPacketProcessor.h"
33 #include "EobiBookImpl.h"
34 
35 namespace OnixS {
36 namespace Eurex {
37 namespace MarketData {
38 namespace EOBI {
39 namespace Implementation {
40 
42 
44 {
45  typedef BaseHandlerImp base;
46 
47 public:
48  /// Initialize new instance.
49  explicit
50  EobiHandlerImpl(const EobiHandlerSettings & settings);
51 
52  /// Finalize instance.
53  ~EobiHandlerImpl() override;
54 
55  void bindFeedEngine(FeedEngine& feedEngine);
56 
57  /// Start handler.
58  void start ();
59 
60  /// Starts replaying previously logged data.
61  void start(const ReplayOptions& options);
62 
63  /// Stop handler.
64  void stop() override;
65 
66  /// Returns commons services as shared object.
67  EobiListenerHolder& listenerHolder() { return *listenerHolder_; }
68 
69  /// Invoke helpers
70  void invokeError (const std::string& description) override;
71  void invokeWarning (const std::string& description) override;
72 
73  void setPartitionIdFilters(const PartitionIdFilters& filters);
74  void removeAllPartitionIdFilters();
75  void setMarketSegmentIdFilters(const MarketSegmentIdFilters& filters);
76  void removeAllMarketSegmentIdFilters();
77  void setSecurityIdFilters(const SecurityIdFilters& filters);
78  void removeAllSecurityIdFilters();
79 
80 protected:
81  void onStarting() override;
82  void onStopping() override;
83 
84  void onStateChanged(State::Enum newState) override;
85 
86 protected:
87  void onIncrementalPacketData(DataSource& dataSource, const char* data, size_t length);
88  void onIncrementalPacketGap();
89  void onApplSeqReset();
90  void onIncrementalInactivity();
91  void onIncrementalFeedInactivity(HandlerCore::MarketData::FE::NetFeedRole::Enum id);
92 
93  void onSnapshotPacketData(DataSource& dataSource, const char* data, size_t length);
94  void onSnapshotPacketGap();
95  void onSnapshotInactivity();
96  void onSnapshotFeedInactivity(HandlerCore::MarketData::FE::NetFeedRole::Enum id);
97 
98  void onSnapshotStartRequest();
99  void onSnapshotStopRequest();
100 
101 private:
102  EobiDataRepository* createAndInitDataRepository(const EobiHandlerSettings &settings);
103  HandlerCore::Common::HandlerLogger* createAndInitLogger(const EobiHandlerSettings &settings);
104  bool shouldLogPackets() const;
105 
106  void initListenerHolder();
107 
108 private:
109  EobiHandlerSettings settings_;
110  boost::scoped_ptr<OrderBookAllocator> bookAllocator_;
111 
112  LoggerPtr logger_;
113  Logging::LogFacility logFacilityForSnapshots_;
114  Logging::LogFacility logFacilityForIncrementals_;
115 
116  boost::scoped_ptr<EobiPacketProcessor> snapshotPacketProcessor_;
117  boost::scoped_ptr<EobiPacketProcessor> incrementalPacketProcessor_;
118  boost::scoped_ptr<EobiListenerHolder> listenerHolder_;
119  boost::scoped_ptr<EobiDataRepository> dataRepository_;
120 
121  MulticastFeedClusterPtr incrementalFeeds_;
122  MulticastFeedClusterPtr snapshotFeeds_;
123 };
124 
125 } // namespace Implementation
126 
128 {
130 
131 public:
132  Impl(const EobiHandlerSettings & settings) : base(settings) {}
133 };
134 
135 }}}}
136 
Manages processing machinery for market data received from feeds.
Definition: FeedEngine.h:287
boost::scoped_ptr< HandlerCore::Common::HandlerLogger > LoggerPtr
Impl(const EobiHandlerSettings &settings)
FilteringTraits::PartitionIdFilters PartitionIdFilters
Definition: Defines.h:30
FilteringTraits::MarketSegmentIdFilters MarketSegmentIdFilters
Defines params which affect logs replay.
Definition: Replay.h:77
EOBI handler configuration settings.
FilteringTraits::SecurityIdFilters SecurityIdFilters
EobiListenerHolder & listenerHolder()
Returns commons services as shared object.