28 #ifndef _MF_MFCLIENT_H
29 #define _MF_MFCLIENT_H
31 #include <MFTradingSession.h>
32 #include <MFStpBookingSession.h>
33 #include <MFMarketDataSession.h>
34 #include <MFTradeDateRollOverSession.h>
38 #include <EASTL/vector_map.h>
40 #include <boost/asio.hpp>
41 #include <boost/noncopyable.hpp>
191 const std::string& username,
192 const std::string& password,
193 const std::string& hostname,
195 bool relogonOnDisconnect
217 const std::string& username,
218 const std::string& password,
219 const std::string& hostname,
221 bool relogonOnDisconnect
244 const std::string& username,
245 const std::string& password,
246 const std::string& hostname,
247 MFProto::VenueID venueID,
249 bool relogonOnDisconnect
275 const std::string& venueName,
276 MFProto::VenueID venueID,
277 const std::string& username,
278 const std::string& password,
279 const std::string& hostname,
281 bool relogonOnDisconnect
292 void onTimer(
const boost::system::error_code& ec);
294 typedef eastl::vector_map<MFProto::VenueID, MFMarketDataSession*>
295 MarketDataSessionMap;
297 std::auto_ptr<MFTradingSession> _tradingSession;
298 std::auto_ptr<MFStpBookingSession> _stpBookingSession;
299 std::auto_ptr <MFTradeDateRollOverSession> _tradeDateRollOverSession;
301 MarketDataSessionMap _marketDataSessions;
302 boost::asio::io_service _ioService;
305 boost::asio::deadline_timer _timer;
MFStpBookingSession * newTcpStpBookingSession(MFStpBookingHandler &handler, const std::string &username, const std::string &password, const std::string &hostname, uint16_t port, bool relogonOnDisconnect)
Creates a session for connecting to the stp booking gateway over TCP. If the MFClient(uint16_t base...
Definition: MFClient.cpp:185
MFTradingSession * newTcpTradingSession(MFTradingHandler &handler, const std::string &username, const std::string &password, const std::string &hostname, uint16_t port, bool relogonOnDisconnect)
Creates a session for connecting to the trading gateway over TCP. If the MFClient(uint16_t baseport...
Definition: MFClient.cpp:159
Applications implement this interface in order to process marketdata messages from a MFMarketDataSess...
Definition: MFMarketDataHandler.h:49
Applications implement this interface in order to process events from a MFStpBookingSession ...
Definition: MFStpBookingHandler.h:51
Applications implement this interface in order to process events from a MFTradeRollOverDateSession ...
Definition: MFTradeDateRollOverHandler.h:48
bool isMarketDataSessionRegistered(MFProto::VenueID venueID)
Returns whether or not there is a registered market data session for a venueID. MFProto::VenueID
Definition: MFClient.cpp:272
Applications implement this interface in order to process events from a MFTradingSession ...
Definition: MFTradingHandler.h:47
Central class for managing sessions with MarketFactory. Create sessions using this class...
Definition: MFClient.h:83
MFMarketDataSession * newTcpMarketDataSession(MFMarketDataHandler &handler, const std::string &venueName, MFProto::VenueID venueID, const std::string &username, const std::string &password, const std::string &hostname, uint16_t port, bool relogonOnDisconnect)
Creates a session for connecting to a particular venue gateway over TCP. If the MFClient(uint16_t b...
Definition: MFClient.cpp:239
size_t run()
Runs the event loop. This will trigger the onStart method on any registered handlers. Runs the event loop. This will trigger the onStart method on any registered handlers. If this loop ends by the user calling MFClient::stop(), the MFClient is dead and cannot be reused.
Definition: MFClient.cpp:83
void stop()
Stops the event loop and closes open sockets. Signals onStop in all registered handlers. This can be called from an external thread or internally from a handler.
Definition: MFClient.cpp:97
MFClient()
Initialize MFClient with no baseport. You must provide a port to the trading session with a MFClient:...
Definition: MFClient.cpp:44
A session with MarketFactory for trading with all the venues for which a user has access...
Definition: MFTradingSession.h:69
void stopStpBooking()
Stops the StpBooking event loop and closes open sockets. Signals onStop in all registered handlers...
Definition: MFClient.cpp:121
MFTradeDateRollOverSession * newTcpTradeDateRollOverSession(MFTradeDateRollOverHandler &handler, const std::string &username, const std::string &password, const std::string &hostname, MFProto::VenueID venueID, uint16_t port, bool relogonOnDisconnect)
Creates a session for connecting to the trade date roll over gateway over TCP. If the MFClient(uint...
Definition: MFClient.cpp:214
A session used to interact with a single venue for market data.
Definition: MFMarketDataSession.h:60
A session with MarketFactory for trading with all the venues for which a user has access...
Definition: MFStpBookingSession.h:69
size_t runTradeDateRollOver()
Runs the TradeDateRollOver event loop. This will trigger the onStart method on any registered handler...
Definition: MFClient.cpp:132
static const uint16_t AUTO_CALCULATE_PORT_VALUE
Definition: MFClient.h:88
void stopTradeDateRollOver()
Stops the TradeDateRollOver event loop and closes open sockets. Signals onStop in all registered hand...
Definition: MFClient.cpp:144
size_t runStpBooking()
Runs the StpBooking event loop. This will trigger the onStart method on any registered handlers...
Definition: MFClient.cpp:109
A session with MarketFactory for trading with all the venues for which a user has access...
Definition: MFTradeDateRollOverSession.h:65