OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  8.1.0
API documentation
MdiHandlerImpl.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 #include <boost/unordered_set.hpp>
22 
24 
25 #include "Formatting.h"
26 #include "MdiPacketProcessor.h"
27 #include "MdiDataRepository.h"
28 #include "BaseHandlerImp.h"
29 #include "MessagePool.h"
30 
31 
32 namespace OnixS {
33 namespace Eurex {
34 namespace MarketData {
35 namespace Implementation {
36 
38 {
39  typedef BaseHandlerImp base;
40 
41 public:
42  /// Initialize new instance.
43  explicit
44  MdiHandlerImpl(const MdiHandlerSettings & settings);
45 
46  /// Finalize instance.
47  ~MdiHandlerImpl() override;
48 
49  void bindFeedEngine(FeedEngine& feedEngine);
50 
51  /// Start handler.
52  void start ();
53 
54  /// Starts replaying previously logged data.
55  void start(const ReplayOptions& options);
56 
57  /// Stop handler.
58  void stop() override;
59 
60  /// Returns commons services as shared object.
61  ListenerHolder& listenerHolder() { return *listenerHolder_; }
62 
63  void invokeError (const std::string& description) override;
64  void invokeWarning (const std::string& description) override;
65 
67 
70  void setSecurityIdFilters(const SecurityIdFilters& filters);
72 
73 private:
74  void initLogger(const HandlerSettings &settings);
75 
76 private:
77 
78  void onStarting() override;
79  void onStopping() override;
80 
81  void onStateChanged(State::Enum newState) override;
82 
83  void checkXmlFile();
84 
85  void initListenerHolder();
86 
87 private:
88  void onPacketData(DataSource& dataSource, const char* data, size_t length, size_t headerSize);
89  void onPacketGap();
90  void onSenderCompIdChange(unsigned int lastSenderCompId, unsigned int newSenderCompId, SequenceNumber lastSeqNum, SequenceNumber newSeqNum);
91  void onInactivity();
92  void onFeedInactivity(OnixS::HandlerCore::MarketData::FE::NetFeedRole::Enum id);
93 
94 private:
95  MdiHandlerSettings settings_;
96 
97  Logging::LogFacility logFacilityForIncrementals_;
98 
99  AccumulatingAllocator messageContentAllocator_;
100 
101  LoggerPtr logger_;
102  boost::scoped_ptr<ListenerHolder> listenerHolder_;
103 
104  boost::scoped_ptr<MdiPacketProcessor> incrementalPacketProcessor_;
105 
106  MulticastFeedClusterPtr incrementalFeeds_;
107 
108  boost::scoped_ptr<FixDecoder> incrementalFixDecoder_;
109 
110  boost::scoped_ptr<MdiDataRepository> dataRepository_;
111 };
112 
113 } // namespace Implementation
114 
116 {
118 
119 public:
120 Impl(const MdiHandlerSettings & settings)
121  : base(settings)
122 {}
123 };
124 
125 }}}
126 
unsigned int SequenceNumber
Alias for sequence numbers.
Manages processing machinery for market data received from feeds.
Definition: FeedEngine.h:287
MarketDepthTraits::MarketSegmentId2Depth MarketSegmentId2Depth
Impl(const MdiHandlerSettings &settings)
boost::scoped_ptr< HandlerCore::Common::HandlerLogger > LoggerPtr
void invokeWarning(const std::string &description) override
MDI handler configuration settings.
void setMarketSegmentId2Depth(const MarketSegmentId2Depth &map)
ListenerHolder & listenerHolder()
Returns commons services as shared object.
MdiHandlerImpl(const MdiHandlerSettings &settings)
Initialize new instance.
Handler base configuration settings.
Definition: Defines.h:30
void setMarketSegmentIdFilters(const MarketSegmentIdFilters &filters)
FilteringTraits::MarketSegmentIdFilters MarketSegmentIdFilters
Defines params which affect logs replay.
Definition: Replay.h:77
Implementation::MdiHandlerImpl base
void setSecurityIdFilters(const SecurityIdFilters &filters)
void invokeError(const std::string &description) override
FilteringTraits::SecurityIdFilters SecurityIdFilters