OnixS C++ B3 Binary UMDF Market Data Handler 1.10.0
Users' manual and API documentation
Loading...
Searching...
No Matches
Handler.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
20#pragma once
21
22#include <unordered_set>
23#include <vector>
24
30
31namespace OnixS
32{
33 namespace B3
34 {
35 namespace MarketData
36 {
37 namespace UMDF
38 {
39 namespace Implementation { struct ReplayHelper; }
40 class ErrorListener;
41 class FeedEngine;
42 class WarningListener;
43 class MessageListener;
45
46 struct HandlerSettings;
47
49 class ONIXS_B3_UMDF_MD_API Handler
50 {
51 public:
56 explicit
57 Handler (const HandlerSettings& settings);
58
60 virtual ~Handler();
61
67
73
79
85
91
96 void start ();
97
99 void stop (bool wait);
100
103
105 void log (LogLevel::Enum logLevel, const char* logMessage, size_t length);
106
108 void log (LogLevel::Enum logLevel, const char* logMessage);
109
111 void log (LogLevel::Enum logLevel, const std::string& str);
112
114 std::string licenseExpirationDate () const;
115
117 static const char* version ();
118
120 void replayLogs (const ReplayOptions& options);
121
123 void replayPcap (const ReplayOptions& options, const FilesList& instrument, const FilesList& snapshot);
124
127
129 Handler& subscribe(std::initializer_list<Messaging::SecurityID> securityIds);
130
133
135 Handler& unsubscribe(std::initializer_list<Messaging::SecurityID> securityIds);
136
137 private:
138 Handler (const Handler&); //no implementation
139 Handler& operator = (const Handler&); //no implementation
140
141 private:
142 friend struct Implementation::ReplayHelper;
143 struct Impl;
144 Impl* impl_;
145 };
146
148 ONIXS_B3_UMDF_MD_API
149 void replayPcap (const std::vector<Handler*>& handlers, const ReplayOptions& options, const FilesList& instrument, const FilesList& snapshot, bool* stopRequest = nullptr);
150
152 ONIXS_B3_UMDF_MD_API
153 void replayLog (const std::vector<Handler*>& handlers, const ReplayOptions& options, bool* stopRequest = nullptr);
154 }
155 }
156 }
157}
Defines an interface through which the Handler notifies subscribers about errors occurred.
The Feed Engine machinery.
Definition FeedEngine.h:128
Defines an interface through which the Handler notifies subscribers about change of its state.
Handler & unsubscribe(Messaging::SecurityID securityId)
Removes security id from the security filter.
void registerWarningListener(WarningListener *listener)
Assigns listener for warnings occurred while executing handler.
Handler & unsubscribe(std::initializer_list< Messaging::SecurityID > securityIds)
Removes a few security ids from the security filter.
void registerHandlerStateListener(HandlerStateListener *listener)
Assigns listener for state change events occurred while executing handler.
void stop(bool wait)
Stop handler.
void registerErrorListener(ErrorListener *listener)
Assigns listener for errors occurred while executing handler.
void log(LogLevel::Enum logLevel, const std::string &str)
Logs the given user-level message to the handler log.
std::string licenseExpirationDate() const
Returns the license expiration date.
void log(LogLevel::Enum logLevel, const char *logMessage, size_t length)
Logs the given user-level message to the handler log.
Handler(const HandlerSettings &settings)
Performs instance initialization.
Handler & subscribe(Messaging::SecurityID securityId)
Adds security id to the security filter.
static const char * version()
Returns Handler's version.
void registerOrderBookListener(OrderBookListener *listener)
Assigns listener to receive notification about order book states while executing handler.
HandlerState::Enum state() const
Returns handler state.
virtual ~Handler()
Finalizes the Handler.
void replayPcap(const ReplayOptions &options, const FilesList &instrument, const FilesList &snapshot)
Replay pcap files.
Handler & subscribe(std::initializer_list< Messaging::SecurityID > securityIds)
Adds a few security ids to the security filter.
void registerMessageListener(MessageListener *listener)
Assigns listener to receive notifications when market data messages are received while executing hand...
void log(LogLevel::Enum logLevel, const char *logMessage)
Logs the given user-level message to the handler log.
void replayLogs(const ReplayOptions &options)
Starts replaying previously logged data.
Defines an interface through which the Handler notifies subscribers about warnings occurred.
UInt64 SecurityID
Security ID as defined by B3's Trading System.
Definition Fields.h:168
std::vector< std::string > FilesList
Ordered list of files to be replayed.
Definition Replay.h:74
ONIXS_B3_UMDF_MD_API void replayLog(const std::vector< Handler * > &handlers, const ReplayOptions &options, bool *stopRequest=nullptr)
Replays log files.
ONIXS_B3_UMDF_MD_API void replayPcap(const std::vector< Handler * > &handlers, const ReplayOptions &options, const FilesList &instrument, const FilesList &snapshot, bool *stopRequest=nullptr)
Replays pcap files.
Enum
Defines the state that the handler is in.
Defines params which affect replay.
Definition Replay.h:88