OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.4.3
API documentation
EmdsHandler.cpp
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 
22 
23 #include "EmdsHandlerImpl.h"
24 #include "Version.h"
25 
26 #include <OnixS/HandlerCore/ErrorBuilder.h>
27 
28 namespace OnixS {
29 namespace Eurex {
30 namespace MarketData {
31 
32 using namespace HandlerCore::MarketData;
33 using namespace HandlerCore::Common;
34 
36  : impl_(new Impl(settings))
37 {
38 }
39 
41 {
42  delete impl_;
43 }
44 
46 {
47  if (HandlerState::Stopped == state()) impl_->listenerHolder().set (listener);
48  else throw OperationException (BOOST_CURRENT_FUNCTION, "Unable to change listener while handler connected");
49 }
50 
52 {
53  if (HandlerState::Stopped == state()) impl_->listenerHolder().set (listener);
54  else throw OperationException (BOOST_CURRENT_FUNCTION, "Unable to change listener while handler connected");
55 }
56 
58 {
59  if (HandlerState::Stopped == state()) impl_->listenerHolder().set (listener);
60  else throw OperationException (BOOST_CURRENT_FUNCTION, "Unable to change listener while handler connected");
61 }
62 
64 {
65  if (HandlerState::Stopped == state()) impl_->listenerHolder().set (listener);
66  else throw OperationException (BOOST_CURRENT_FUNCTION, "Unable to change listener while handler connected");
67 }
68 
70 {
71  if (HandlerState::Stopped == state()) impl_->listenerHolder().set (listener);
72  else throw OperationException (BOOST_CURRENT_FUNCTION, "Unable to change listener while handler connected");
73 }
74 
76 {
77  if (HandlerState::Stopped == state()) impl_->listenerHolder().set (listener);
78  else throw OperationException (BOOST_CURRENT_FUNCTION, "Unable to change listener while handler connected");
79 }
80 
82 {
83  if (HandlerState::Stopped == state()) impl_->bindFeedEngine(feedEngine);
84  else throw OperationException(BOOST_CURRENT_FUNCTION, "Unable to change listener while handler connected");
85 }
86 
88 {
89  impl_->start();
90 }
91 
92 void EmdsHandler::start(const ReplayOptions& options)
93 {
94  if (HandlerState::Stopped != state())
95  throw OperationException (BOOST_CURRENT_FUNCTION, "Handler already started");
96 
97  impl_->start(options);
98 }
99 
101 {
102  impl_->stop();
103 }
104 
106 {
107  return HandlerState::Enum(impl_->getState());
108 }
109 
110 /*
111 Logging
112 */
113 
114 void EmdsHandler::log (OnixS::Eurex::MarketData::LogLevel::Enum logLevel, const char * logMessage, size_t length)
115 {
116  impl_->commonLog (int (logLevel), logMessage, length);
117 }
118 
119 void EmdsHandler::log (OnixS::Eurex::MarketData::LogLevel::Enum logLevel, const char * logMessage)
120 {
121  impl_->commonLog (int (logLevel), logMessage, strlen (logMessage));
122 }
123 
124 void EmdsHandler::log (OnixS::Eurex::MarketData::LogLevel::Enum logLevel, const std::string& str)
125 {
126  impl_->commonLog (int (logLevel), str.c_str(), str.length());
127 }
128 
129 /*
130 Information requests
131 */
132 
134 {
135  return impl_->licenseExpirationDate().c_str();
136 }
137 
138 const char* EmdsHandler::version()
139 {
141 }
142 
143 /*
144 Filters
145 */
146 
148 {
149  impl_->setMarketSegmentIdFilters(filters);
150 }
151 
153 {
155 }
156 
158 {
159  impl_->setSecurityIdFilters(filters);
160 }
161 
163 {
165 }
166 
167 }}}
168 
void bindFeedEngine(FeedEngine &feedEngine)
Definition: EmdsHandler.cpp:81
EmdsHandler(const EmdsHandlerSettings &settings)
Definition: EmdsHandler.cpp:35
Manages processing machinery for market data received from feeds.
Definition: FeedEngine.h:287
void setMarketSegmentIdFilters(const MarketSegmentIdFilters &filters)
void registerErrorListener(ErrorListener *listener)
Definition: EmdsHandler.cpp:45
void removeAllSecurityIdFilters()
Remove all filters.
static const char * version()
Returns Handler&#39;s version.
void registerExchangeTradeListener(ExchangeTradeListener *listener)
Definition: EmdsHandler.cpp:75
void registerSettlementListener(SettlementListener *listener)
Definition: EmdsHandler.cpp:63
EMDI handler configuration settings.
void registerHandlerStateListener(HandlerStateListener *listener)
Definition: EmdsHandler.cpp:57
void registerOpenInterestListener(OpenInterestListener *listener)
Definition: EmdsHandler.cpp:69
virtual ~EmdsHandler()
Finalizes the Handler.
Definition: EmdsHandler.cpp:40
void commonLog(int logLevel, const char *msg, size_t length)
User&#39;s common log.
void setSecurityIdFilters(const SecurityIdFilters &filters)
Definition: Defines.h:30
FilteringTraits::MarketSegmentIdFilters MarketSegmentIdFilters
Defines params which affect logs replay.
Definition: Replay.h:77
ListenerHolder & listenerHolder()
Returns commons services as shared object.
void setSecurityIdFilters(const SecurityIdFilters &filters)
void setMarketSegmentIdFilters(const MarketSegmentIdFilters &filters)
void set(ErrorListener *listener) ONIXS_NOEXCEPT
FilteringTraits::SecurityIdFilters SecurityIdFilters
Enum
Defines the state that the handler is in.
void log(LogLevel::Enum logLevel, const char *logMessage, size_t length)
Logs the given user-level message to the handler log.
void registerWarningListener(WarningListener *listener)
Definition: EmdsHandler.cpp:51
void removeAllMarketSegmentIdFilters()
Remove all filters.
const char * licenseExpirationDate() const
Returns the license expiration date.
HandlerState::Enum state() const
Returns handler state.