MFClient  1.3.0
 All Classes Functions Variables Enumerations
Public Member Functions | Static Public Attributes | List of all members
MFClient Class Reference

Central class for managing sessions with MarketFactory.
Create sessions using this class. They will be automatically registered with this MFClient. More...

#include <MFClient.h>

Inheritance diagram for MFClient:

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.

Parameters
baseportuint16_t - trading and market data sessions can use this as a basis to calculate port numbers
More...
 
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...
 
MFTradingSessionnewTcpTradingSession (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.

Parameters
handlerMFTradingHandler& -
usernamestd::string&
passwordstd::string&
hostnamestd::string&
portuint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have MFClient automatically choose port.
relogonOnDisconnectautomatically logons when a disconnection occurs.
More...
 
MFStpBookingSessionnewTcpStpBookingSession (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.

Parameters
handlerMFStbBookingHandler& -
usernamestd::string&
passwordstd::string&
hostnamestd::string&
portuint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have MFClient automatically choose port.
relogonOnDisconnectautomatically logons when a disconnection occurs.
More...
 
MFTradeDateRollOverSessionnewTcpTradeDateRollOverSession (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.

Parameters
handlerMFTradeDateRollOverHandler& -
usernamestd::string&
passwordstd::string&
hostnamestd::string&
venueIDVenue_Id
portuint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have MFClient automatically choose port.
relogonOnDisconnectautomatically logons when a disconnection occurs.
More...
 
MFMarketDataSessionnewTcpMarketDataSession (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.

Parameters
handlerMFTradingHandler&
venueNamestd::string& - name of the venue
venueIDMFProto::VenueID
usernamestd::string&
passwordstd::string&
hostnamestd::string&
portuint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have it automatically choose port.
relogonOnDisconnectautomatically logons when a disconnection occurs.
More...
 
bool isMarketDataSessionRegistered (MFProto::VenueID venueID)
 Returns whether or not there is a registered market data session for a venueID.

Parameters
venueIDMFProto::VenueID
More...
 

Static Public Attributes

static const uint16_t AUTO_CALCULATE_PORT_VALUE = 0
 

Detailed Description

Central class for managing sessions with MarketFactory.
Create sessions using this class. They will be automatically registered with this MFClient.

Port calculation:

Constructor & Destructor Documentation

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.

Parameters
baseportuint16_t - trading and market data sessions can use this as a basis to calculate port numbers

Member Function Documentation

bool MFClient::isMarketDataSessionRegistered ( MFProto::VenueID  venueID)

Returns whether or not there is a registered market data session for a venueID.

Parameters
venueIDMFProto::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.

Parameters
handlerMFTradingHandler&
venueNamestd::string& - name of the venue
venueIDMFProto::VenueID
usernamestd::string&
passwordstd::string&
hostnamestd::string&
portuint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have it automatically choose port.
relogonOnDisconnectautomatically 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.

Parameters
handlerMFStbBookingHandler& -
usernamestd::string&
passwordstd::string&
hostnamestd::string&
portuint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have MFClient automatically choose port.
relogonOnDisconnectautomatically 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.

Parameters
handlerMFTradeDateRollOverHandler& -
usernamestd::string&
passwordstd::string&
hostnamestd::string&
venueIDVenue_Id
portuint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have MFClient automatically choose port.
relogonOnDisconnectautomatically 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.

Parameters
handlerMFTradingHandler& -
usernamestd::string&
passwordstd::string&
hostnamestd::string&
portuint16_t - specify MFClient::AUTO_CALCULATE_PORT_VALUE to have MFClient automatically choose port.
relogonOnDisconnectautomatically 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.

Member Data Documentation

const uint16_t MFClient::AUTO_CALCULATE_PORT_VALUE = 0
static

Value to supply in calls to MFClient::newTcpTradingSession() and MFClient::newTcpMarketDataSession() to have the port automatically calculated


The documentation for this class was generated from the following files: