OnixS Eurex EDCI Handler C++ library 1.0.0
Users' manual and API documentation
Loading...
Searching...
No Matches
Handler Class Reference

Public Member Functions

 Handler (const HandlerSettings &settings)
virtual ~Handler ()
 Handler (const Handler &)=delete
Handleroperator= (const Handler &)=delete
void connect (const std::string &hostName, std::uint16_t port, const Logon &logon, const std::string &localNetworkInterface="")
void connect (const std::string &primaryHostName, std::uint16_t primaryPort, const std::string &secondaryHostName, std::uint16_t secondaryPort, const Logon &logon, const std::string &localNetworkInterface="")
void disconnect ()
void disconnectAsync ()
void registerErrorListener (ErrorListener *listener)
void registerWarningListener (WarningListener *listener)
void registerHandlerStateListener (HandlerStateListener *listener)
void registerConnectionListener (ConnectionListener *listener)
void registerConnectionStateListener (ConnectionStateListener *listener)
void registerSessionListener (SessionListener *listener)
void registerOrderHandlingListener (OrderHandlingListener *listener)
HandlerState::Enum state () const
void log (LogLevel::Enum logLevel, const std::string &str)
const std::string & licenseExpirationDate () const

Static Public Member Functions

static const std::string & version ()

Detailed Description

Definition at line 45 of file Handler.h.

Constructor & Destructor Documentation

◆ Handler() [1/2]

Handler ( const HandlerSettings & settings)

Performs instance initialization.

Parameters
settingsdefines values for various options which affect handler behavior like enabling logging during execution of the handler.

◆ ~Handler()

virtual ~Handler ( )
virtual

Finalizes the Handler.

◆ Handler() [2/2]

Handler ( const Handler & )
delete

Member Function Documentation

◆ connect() [1/2]

void connect ( const std::string & hostName,
std::uint16_t port,
const Logon & logon,
const std::string & localNetworkInterface = "" )

Establishes the connection.

Note
Blocks until the logon reply is received.
Should be called only when Handler is disconnected.
Parameters
hostNameHostname to connect to.
portPort number to connect to.
logonInitial logon message parameters.
localNetworkInterfaceLocal network interface.
Exceptions
std::exceptionCannot set the local network interface.
std::exceptionCannot connect to hostname on port.
std::exceptionCannot configure size of receive buffer for the socket.
std::exceptionCannot configure size of send buffer for the socket.
OperationExceptionInvalid argument is given.

◆ connect() [2/2]

void connect ( const std::string & primaryHostName,
std::uint16_t primaryPort,
const std::string & secondaryHostName,
std::uint16_t secondaryPort,
const Logon & logon,
const std::string & localNetworkInterface = "" )

Establishes the connection.

Note
Blocks until the logon reply is received.
Should be called only when Handler is disconnected.
Parameters
primaryHostNamePrimary hostname to connect to.
primaryPortPrimary port number to connect to.
secondaryHostNameSecondary hostname to connect to.
secondaryPortSecondary port number to connect to.
logonInitial logon message parameters.
localNetworkInterfaceLocal network interface.
Exceptions
std::exceptionCannot set the local network interface.
std::exceptionCannot connect to hostname on port.
std::exceptionCannot configure size of receive buffer for the socket.
std::exceptionCannot configure size of send buffer for the socket.
OperationExceptionInvalid argument is given.

◆ disconnect()

void disconnect ( )

Force session disconnect.

Note
Blocks until the Session Logout procedure is finished.

◆ disconnectAsync()

void disconnectAsync ( )

Async force session disconnect.

◆ licenseExpirationDate()

const std::string & licenseExpirationDate ( ) const

Returns the license expiration date.

Date format is YYYYMMDD.

◆ log()

void log ( LogLevel::Enum logLevel,
const std::string & str )

Logs the given user-level message to the handler log.

◆ operator=()

Handler & operator= ( const Handler & )
delete

◆ registerConnectionListener()

void registerConnectionListener ( ConnectionListener * listener)

Assigns listener for connection events occurred while executing handler. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.

◆ registerConnectionStateListener()

void registerConnectionStateListener ( ConnectionStateListener * listener)

Assigns listener for connection state change events occurred while executing handler. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.

◆ registerErrorListener()

void registerErrorListener ( ErrorListener * listener)

Assigns listener for errors occurred while executing handler. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected

◆ registerHandlerStateListener()

void registerHandlerStateListener ( HandlerStateListener * listener)

Assigns listener for state change events occurred while executing handler. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.

◆ registerOrderHandlingListener()

void registerOrderHandlingListener ( OrderHandlingListener * listener)

Assigns listener for order handling events. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.

◆ registerSessionListener()

void registerSessionListener ( SessionListener * listener)

Assigns listener for session events occurred while executing handler. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.

◆ registerWarningListener()

void registerWarningListener ( WarningListener * listener)

Assigns listener for warnings occurred while executing handler. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected

◆ state()

HandlerState::Enum state ( ) const

Returns handler state.

◆ version()

const std::string & version ( )
static

Returns Handler's version.