OnixS CME Drop Copy Handler C++ library  5.4.1
API documentation
Listening to Market Data

Events in the Handler

Once the Handler is started, it listens to a market data from the network, processes it (decodes messages, validates message order, updates order books) and invokes client code for further processing.

The Handler processes market data asynchronously and uses concept of events and event listeners to notify client code about a particular occasion like receiption of security definition or direct book update.

Listening for a particular Event

For each event like Error Occurred Handler provides an interface (C++ class with pure virtual members) like OnixS::CME::DropCopy::ErrorListener. Client code must implement this interface (C++ class) to be able to handle events of a particular type. Handler also exposes a member like OnixS::CME::DropCopy::Handler::registerErrorListener which allows to associate an instance of the event handler with a appropriate event in bounds of a particular instance of the OnixS::CME::DropCopy::Handler class.

Associating listener for a particular event with an instance of the OnixS::CME::DropCopy::Handler class must be performed while the Handler is in stopped stated. Once the Handler is started, changing listener-event associations is not allowed and may lead to unpredictable behavior as well as may cause unexpected errors.

Associating event listener with an instance of the OnixS::CME::DropCopy::Handler class is also called subscribing to an event.

Primary High-level Events

There're multiple events exposed by the Handler. All events can be logically divided onto high- and low- level event sub-set. High-level events reflect various results of market data processing done by the Handler like Security Definition Received, Market Book Updated, and Trading occurred. Low-level events are designed for more control over data processing as well for more flexibility and described in different section of this documentation including Advanced Programming section.

Below table describes primary high-level events exposed by the Handler as well as depicts correspondence between events, interfaces for listeners and the Handler's members to subscribe to an event:

Event Listener (C++ class) to be implemented Handler's member to register listener Description
Execution Report Message received OnixS::CME::DropCopy::DropCopyServiceListener::onExecutionReportReceived OnixS::CME::DropCopy::Handler::registerDropCopyServiceListener Occurs when Execution Report Message received.
Mass Order Cancel Report Message received OnixS::CME::DropCopy::DropCopyServiceListener::onMassOrderCancelReportReceived OnixS::CME::DropCopy::Handler::registerDropCopyServiceListener Occurs when Mass Order Cancel Report Message received.