MFClient  1.3.0
 All Classes Functions Variables Enumerations
MFTradingHandler.h
1 /*
2  * Copyright (C) 2015 MarketFactory, Inc. All rights reserved.
3  * Use in source and binary forms, with or without modification, is permitted
4  * provided that the following conditions are met:
5  * 1. You may only use this software for internal evaluation and testing
6  * purposes and may not use the software for engaging
7  * in live trades, unless and until you have entered into a separate agreement
8  * with MarketFactory governing the use of
9  * MarketFactory software in a production environment.
10  * 2. You may not distribute the software (in either source or binary forms) to
11  * third parties.
12  * 3. All copies of source code must retain the above copyright notice, this
13  * list of conditions and the following disclaimer.
14  * THIS SOFTWARE IS PROVIDED BY MARKETFACTORY AND ITS LICENSORS "AS IS" AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
16  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
17  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18  * NO EVENT SHALL MARKETFACTORY OR ITS LICENSORS BE LIABLE FOR ANY DIRECT,
19  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
22  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23  * LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 #ifndef _MF_TRADINGHANDLER_H_
29 #define _MF_TRADINGHANDLER_H_
30 
31 #include <MFTradingSession.h>
32 
33 #include <mftrading/LogonResponse.hpp>
34 #include <mftrading/Logout.hpp>
35 #include <mftrading/LogoutResponse.hpp>
36 #include <mftrading/Heartbeat.hpp>
37 #include <mftrading/MarketDefinition.hpp>
38 #include <mftrading/TradingSessionStatus.hpp>
39 #include <mftrading/ResendRequest.hpp>
40 #include <mftrading/ExecutionReport.hpp>
41 #include <mftrading/OrderCancelReject.hpp>
42 
48  public:
53  virtual void onStart(MFTradingSession& session) = 0;
54 
59  virtual void onStop(MFTradingSession& session) = 0;
60 
64  virtual void onConnect(MFTradingSession& session) = 0;
65 
69  virtual void onDisconnect(const std::string& msg,
70  MFTradingSession& session) = 0;
71 
75  virtual void on(const mftrading::LogonResponse& logonResponse,
76  MFTradingSession& session) = 0;
77 
82  virtual void on(const mftrading::Logout& logout,
83  MFTradingSession& session) = 0;
84 
88  virtual void on(const mftrading::LogoutResponse& logoutResponse,
89  MFTradingSession& session) = 0;
90 
94  virtual void on(const mftrading::Heartbeat& heartbeat,
95  MFTradingSession& session) = 0;
96 
102  virtual void on(const mftrading::ResendRequest& resendRequest,
103  MFTradingSession& session) = 0;
104 
108  virtual void on(const mftrading::MarketDefinition& marketDefinition,
109  MFTradingSession& session) = 0;
110 
115  virtual void on(const mftrading::TradingSessionStatus& tradingSessionStatus,
116  MFTradingSession& session) = 0;
117 
123  virtual void on(mftrading::ExecutionReport& executionReport,
124  MFTradingSession& session) = 0;
125 
129  virtual void on(const mftrading::OrderCancelReject& orderCancelReject,
130  MFTradingSession& session) = 0;
131 };
132 
133 #endif
virtual void onStop(MFTradingSession &session)=0
Called when the session is being removed from processing in the event loop.
virtual void on(const mftrading::LogonResponse &logonResponse, MFTradingSession &session)=0
Called when a logon is successful.
virtual void onDisconnect(const std::string &msg, MFTradingSession &session)=0
Called when the session socket disconnects.
Applications implement this interface in order to process events from a MFTradingSession ...
Definition: MFTradingHandler.h:47
A session with MarketFactory for trading with all the venues for which a user has access...
Definition: MFTradingSession.h:69
virtual void onStart(MFTradingSession &session)=0
Called right before the handler becomes active in the MFClient::run() event loop. ...
virtual void onConnect(MFTradingSession &session)=0
Called when the session establishes a socket connection.