OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  8.1.0
API documentation
MdiDataRepository.h
Go to the documentation of this file.
1 /*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 #pragma once
20 
21 #include <set>
22 #include <map>
23 
26 
27 #include "DataRepository.hpp"
28 #include "ListenerHolder.h"
29 #include "InternalDefines.h"
30 
31 
32 namespace TestHelpers { struct MdiDataRepositoryAccessor; }
33 
34 
35 namespace OnixS {
36 namespace Eurex {
37 namespace MarketData {
38 namespace Implementation {
39 
40 
42 
44 
46 
47 class MdiDataRepository : public DataRepository<MdiDataRepositoryConfig>
48 {
50 
51 public:
52  explicit MdiDataRepository(const MdiDataRepositoryConfig &config);
53  virtual ~MdiDataRepository();
54 
55  void onMessage(const DataSource& dataSource, const CORE::Message& msg, TemplateId templateId);
56  void onPacketGap();
57  void onSenderCompIdChange();
58  void noDataOnFeeds();
59 
60  void setMarketSegmentId2Depth(const MarketSegmentId2Depth& map);
61 
62  void setMarketSegmentIdFilters(const MarketSegmentIdFilters& filters);
63  void clearMarketSegmentIdFilters();
64 
65  void setSecurityIdFilters(const SecurityIdFilters& filters);
66  void removeAllSecurityIdFilters();
67 
68  void preBuildProductDataRepositories();
69 
70 private:
71  //void resetRecoveryProcess();
72  MdiProductDataRepository* getOrCreateProductDataRepository(MarketSegmentId marketSegmentId, bool create);
73  bool processCachedIncrementals();
74 
75  void clearProductDataRepositories();
76 
77  bool filterSecurityId(const SecurityId& securityId) const;
78 
79  bool shouldBuildInternalOrderBooks () const { return config_.settings.buildInternalOrderBooks; }
80  //bool shouldStartRecoveryOnPacketGap() const { return config_.settings.startRecoveryOnPacketGap; }
81 
82 private:
83  MarketSegmentId firstMarketSegmentId_;
84 
85  typedef std::set<MarketSegmentId> MarketSegmentIdFilters_;
86  MarketSegmentIdFilters_ marketSegmentIdfilters_;
87 
88  SecurityIdFilters securityIdFilters_;
89 
90  std::set<SecurityId> securityIDs_;
91  std::set<MarketSegmentId> marketSegmentIDs_;
92 
93  typedef std::map<MarketSegmentId, MarketDepth> MarketSegmentId2Depth_;
94  MarketSegmentId2Depth_ marketSegmentId2Depth_;
95 
96  std::vector<MdiProductDataRepository*> productDataRepositories_;
97 
98 private:
99  friend struct TestHelpers::MdiDataRepositoryAccessor;
100 
101  typedef std::map<MarketSegmentId, MdiProductDataRepository*> MdiProductDataRepositories_;
102  MdiProductDataRepositories_ productDataRepositories();
103 };
104 
105 
106 }}}}
107 
MarketDepthTraits::MarketSegmentId2Depth MarketSegmentId2Depth
Definition: Defines.h:30
FilteringTraits::MarketSegmentIdFilters MarketSegmentIdFilters
DataRepositoryConfig< ListenerHolder, MdiHandlerSettings > MdiDataRepositoryConfig
Int64 SecurityId
Alias for Security Id type.
Definition: Defines.h:51
FilteringTraits::SecurityIdFilters SecurityIdFilters
UInt32 MarketSegmentId
Alias for Market Segment ID type.
Definition: Defines.h:40
OnixS::FIX::Core::FAST::TemplateId TemplateId