OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.5.1
API documentation
Event Listeners

Events in the Handler

There were five major events exposed by the Handler: Exchange message received, Order Book Changed, Handler (Feed) state changed and Error occurred.

Exchange message received event is fired by the Handler at the time when a subscription is being started. Handler calls associated listener (event handler) for each message it receives. Invocation of the event handler is performed in the same thread in which OnixS::ICE::iMpact::MarketData::Handler::start member was called. Once the subscription is successfully started, the event of this type will no more be fired for subscribed markets (until next start).

Order Book changed event is raised by the Handler in response to received notifications from Multicast Price Feed about added or modified orders, changes in price levels, performed trades, etc. Events of this type occur only when the subscription is active. Associated listener will never be called before OnixS::ICE::iMpact::MarketData::Handler::start succeed and after subscription will be stopped using OnixS::ICE::iMpact::MarketData::Handler::stop member.

Handler (Feed) state changed event is raised by the Handler at the time when the handler' or feed' state is changed.

The Error occurred event is fired by the Handler if any error condition met. This could be a generic error like inability to write to a log file as well as some kind of failure scenario like the reception of a message from Multicast Price Feed with the invalid sequence number. This event is raised by the Handler only when a subscription is active.

Listening for a particular event

For each of these events Handler provides an interface (C++ class with virtual members) like OnixS::ICE::iMpact::MarketData::ErrorListener which has to be implemented to handle the event and a member like OnixS::ICE::iMpact::MarketData::Handler::registerErrorListener which allows to associate instance of event handler with a appropriate event in scope of particular ICE iMpact Handler.

Below table depicts correspondence between events, interfaces for listeners and the Handler's members to subscribe to an event:

Event Listener interface to be implemented Handler's member to register listener
Futures/OTC Product Definition Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onFuturesProductDefinition OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Strip Info received OnixS::ICE::iMpact::MarketData::ExchangeListener::onStripInfo OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Options Product Definition Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onOptionsProductDefinition OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Options Strategy Definition Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onOptionsStrategyDefinition OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Market Snapshot Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onMarketSnapshot OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Trade Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onTrade OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Investigated Trade Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onInvestigatedTrade OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Cancelled Trade Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onCancelledTrade OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Market Statistics Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onMarketStatistics OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Market State Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onMarketStateChange OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
System Text Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onSystemText OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Open Interest Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onOpenInterest OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Open Price Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onOpenPrice OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Settlement Price Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onSettlementPrice OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Marker/Index Prices Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onMarkerIndexPrices OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
End Of Day Market Summary Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onEndOfDayMarketSummary OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Market Event Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onMarketEvent OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Pre-Open Price Indicator Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onPreOpenPriceIndicator OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Market Snapshot Order Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onMarketSnapshotOrder OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Add/Modify Order Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onAddModifyOrder OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Delete Order Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onDeleteOrder OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Bundle Marker Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onBundleMarker OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Market Snapshot Price Level Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onMarketSnapshotPriceLevel OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Add Price Level Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onAddPriceLevel OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Change Price Level Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onChangePriceLevel OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Delete Price Level Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onDeletePriceLevel OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
New Options Strategy Definition Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onNewOptionsStrategyDefinition OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
New Options Market Definition Message Received OnixS::ICE::iMpact::MarketData::ExchangeListener::onNewOptionsMarketDefinition OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
RFQ Message received OnixS::ICE::iMpact::MarketData::ExchangeListener::onRfq OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Option Open Interest Message received OnixS::ICE::iMpact::MarketData::ExchangeListener::onOptionOpenInterest OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Option Settlement Price Message received OnixS::ICE::iMpact::MarketData::ExchangeListener::onOptionSettlementPrice OnixS::ICE::iMpact::MarketData::Handler::registerExchangeListener
Order Book updated OnixS::ICE::iMpact::MarketData::OrderBookUpdateListener::onOrderBookUpdated OnixS::ICE::iMpact::MarketData::Handler::registerOrderBookUpdateListener
Order Book updated after message bundle OnixS::ICE::iMpact::MarketData::OrderBookBundleUpdateListener::onOrderBookBundleUpdated OnixS::ICE::iMpact::MarketData::Handler::registerOrderBookBundleUpdateListener
Handler state change OnixS::ICE::iMpact::MarketData::HandlerStateChangeListener::onHandlerStateChange OnixS::ICE::iMpact::MarketData::Handler::registerHandlerStateChangeListener
Feed started OnixS::ICE::iMpact::MarketData::FeedListener::onFeedStarted OnixS::ICE::iMpact::MarketData::Handler::registerFeedListener
Feed stopped OnixS::ICE::iMpact::MarketData::FeedListener::onFeedStopped OnixS::ICE::iMpact::MarketData::Handler::registerFeedListener
Feed error occurred OnixS::ICE::iMpact::MarketData::FeedListener::onFeedError OnixS::ICE::iMpact::MarketData::Handler::registerFeedListener
Multicast message block begin OnixS::ICE::iMpact::MarketData::FeedListener::onMulticastMessageBlockBegin OnixS::ICE::iMpact::MarketData::Handler::registerFeedListener
Multicast message block end OnixS::ICE::iMpact::MarketData::FeedListener::onMulticastMessageBlockEnd OnixS::ICE::iMpact::MarketData::Handler::registerFeedListener
Error occurred OnixS::ICE::iMpact::MarketData::ErrorListener OnixS::ICE::iMpact::MarketData::Handler::registerErrorListener
Log replay finished OnixS::ICE::iMpact::MarketData::LogReplayListener::onReplayFinished

OnixS::ICE::iMpact::MarketData::Handler::registerLogReplayListener

Example

The following sample demonstrates how to receive notifications about errors occurred in the Handler:

// `ErrorListener` interface can be hidden from publicity
// to make Handler 'exclusive' user of onError member.
{
public:
// Assigns itself to given handler as error listener.
{
handler->registerErrorListener(this);
}
private:
// Implements base interface to dump errors onto console.
void onError(const Error& error)
{
std::cerr << "Error occurred: " << error.description() << std::endl;
}
};
HandlerSettings handlerSettings;
Handler handler(handlerSettings);
ErrorDumper errorDumper(&handler);