Central class for managing sessions with MarketFactory.
Create sessions using this class. They will be automatically registered with this MFClient.
More...
#include <MFClient.h>
Public Member Functions | |||||||||||||||||
| MFClient () | |||||||||||||||||
| Initialize MFClient with no baseport. You must provide a port to the trading session with a MFClient::newTcpTradingSession() and/or the market data sessions via MFClient::newTcpTradingSession(). More... | |||||||||||||||||
| MFClient (uint16_t baseport) | |||||||||||||||||
Initialize MFClient with a provided baseport. You can provide MFClient::AUTO_CALCULATE_PORT_VALUE as the port parameter when creating a session (either trading or market data) and the port will be calculated automatically.
| |||||||||||||||||
| 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. More... | |||||||||||||||||
| 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. More... | |||||||||||||||||
| size_t | runStpBooking () | ||||||||||||||||
| Runs the StpBooking 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. More... | |||||||||||||||||
| void | stopStpBooking () | ||||||||||||||||
| Stops the StpBooking 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. More... | |||||||||||||||||
| size_t | runTradeDateRollOver () | ||||||||||||||||
| Runs the TradeDateRollOver 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::stopTradeDateRollOver(), the MFClient is dead and cannot be reused. More... | |||||||||||||||||
| void | stopTradeDateRollOver () | ||||||||||||||||
| Stops the TradeDateRollOver 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. More... | |||||||||||||||||
| 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) constructor was used (implying a baseport was provided), providing MFClient::AUTO_CALCULATE_PORT_VALUE as the port will cause the port number to be automatically calculated.
| |||||||||||||||||
| 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 baseport) constructor was used (implying a baseport was provided), providing MFClient::AUTO_CALCULATE_PORT_VALUE as the port will cause the port number to be automatically calculated.
| |||||||||||||||||
| 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(uint16_t baseport) constructor was used (implying a baseport was provided), providing MFClient::AUTO_CALCULATE_PORT_VALUE as the port will cause the port number to be automatically calculated.
| |||||||||||||||||
| 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 baseport) constructor was used (implying a baseport was provided) or MFClient::newTcpTradingSession() was previously called, providing MFClient::AUTO_CALCULATE_PORT_VALUE as the port will cause the port number to be automatically calculated.
| |||||||||||||||||
| bool | isMarketDataSessionRegistered (MFProto::VenueID venueID) | ||||||||||||||||
Returns whether or not there is a registered market data session for a venueID.
| |||||||||||||||||
Static Public Attributes | |
| static const uint16_t | AUTO_CALCULATE_PORT_VALUE = 0 |
Central class for managing sessions with MarketFactory.
Create sessions using this class. They will be automatically registered with this MFClient.
Port calculation:
| MFClient::MFClient | ( | ) |
Initialize MFClient with no baseport. You must provide a port to the trading session with a MFClient::newTcpTradingSession() and/or the market data sessions via MFClient::newTcpTradingSession().
| MFClient::MFClient | ( | uint16_t | baseport | ) |
Initialize MFClient with a provided baseport. You can provide MFClient::AUTO_CALCULATE_PORT_VALUE as the port parameter when creating a session (either trading or market data) and the port will be calculated automatically.
| baseport | uint16_t - trading and market data sessions can use this as a basis to calculate port numbers |
| bool MFClient::isMarketDataSessionRegistered | ( | MFProto::VenueID | venueID | ) |
Returns whether or not there is a registered market data session for a venueID.
| venueID | MFProto::VenueID |
| MFMarketDataSession * MFClient::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 baseport) constructor was used (implying a baseport was provided) or MFClient::newTcpTradingSession() was previously called, providing MFClient::AUTO_CALCULATE_PORT_VALUE as the port will cause the port number to be automatically calculated.
| handler | MFTradingHandler& |
| venueName | std::string& - name of the venue |
| venueID | MFProto::VenueID |
| username | std::string& |
| password | std::string& |
| hostname | std::string& |
| port | uint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have it automatically choose port. |
| relogonOnDisconnect | automatically logons when a disconnection occurs. |
| MFStpBookingSession * MFClient::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 baseport) constructor was used (implying a baseport was provided), providing MFClient::AUTO_CALCULATE_PORT_VALUE as the port will cause the port number to be automatically calculated.
| handler | MFStbBookingHandler& - |
| username | std::string& |
| password | std::string& |
| hostname | std::string& |
| port | uint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have MFClient automatically choose port. |
| relogonOnDisconnect | automatically logons when a disconnection occurs. |
| MFTradeDateRollOverSession * MFClient::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(uint16_t baseport) constructor was used (implying a baseport was provided), providing MFClient::AUTO_CALCULATE_PORT_VALUE as the port will cause the port number to be automatically calculated.
| handler | MFTradeDateRollOverHandler& - |
| username | std::string& |
| password | std::string& |
| hostname | std::string& |
| venueID | Venue_Id |
| port | uint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have MFClient automatically choose port. |
| relogonOnDisconnect | automatically logons when a disconnection occurs. |
| MFTradingSession * MFClient::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) constructor was used (implying a baseport was provided), providing MFClient::AUTO_CALCULATE_PORT_VALUE as the port will cause the port number to be automatically calculated.
| handler | MFTradingHandler& - |
| username | std::string& |
| password | std::string& |
| hostname | std::string& |
| port | uint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have MFClient automatically choose port. |
| relogonOnDisconnect | automatically logons when a disconnection occurs. |
| size_t MFClient::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.
Note: run() cannot be called after this MFClient is MFClient::stop()ed.
| size_t MFClient::runStpBooking | ( | ) |
Runs the StpBooking 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.
Note: run() cannot be called after this MFClient is MFClient::stop()ed.
| size_t MFClient::runTradeDateRollOver | ( | ) |
Runs the TradeDateRollOver 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::stopTradeDateRollOver(), the MFClient is dead and cannot be reused.
Note: runTradeDateRollOver() cannot be called after this MFClient is MFClient::stopTradeDateRollOver()ed.
| void MFClient::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.
| void MFClient::stopStpBooking | ( | ) |
Stops the StpBooking 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.
| void MFClient::stopTradeDateRollOver | ( | ) |
Stops the TradeDateRollOver 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.
|
static |
Value to supply in calls to MFClient::newTcpTradingSession() and MFClient::newTcpMarketDataSession() to have the port automatically calculated
1.8.5