OnixS Xetra MDI Market Data Handler for C++  1.0.0.0
Building Order Books

Handler is able to build internal Order Books. To activate this feature, set OnixS::Xetra::MarketData::MDI::HandlerSettings::buildInternalOrderBooks on and pass an instance of OnixS::Xetra::MarketData::MDI::OrderBookListener to OnixS::Xetra::MarketData::MDI::Handler::registerOrderBookListener.

Note
OnixS::Xetra::MarketData::MDI::HandlerSettings::buildInternalOrderBooks is set by default.
If OnixS::Xetra::MarketData::MDI::HandlerSettings::buildInternalOrderBooks is set, but OnixS::Xetra::MarketData::MDI::OrderBookListener is not registered, OnixS::Xetra::MarketData::MDI::WarningListener::onWarning callback will be invoked with corresponding message.
If OnixS::Xetra::MarketData::MDI::HandlerSettings::buildInternalOrderBooks is not set, but OnixS::Xetra::MarketData::MDI::OrderBookListener is registered, OnixS::Xetra::MarketData::MDI::WarningListener::onWarning callback will be invoked with corresponding message.

To achieve better performance, the Order Books are created in preallocated memory area. To adjust preallocated memory pool size, set OnixS::Xetra::MarketData::MDI::HandlerSettings::maxBooksObjectAmount. The default value is 500;

If the preallocated objects amount is not enough to place, all the created books and the exception will be thrown when book creation fails.

HandlerSettings settings;
settings.buildInternalOrderBooks = true;
settings.maxBooksObjectAmount = 100;
// ...
Handler handler(settings);
BookListener listener;
handler.registerOrderBookListener(&listener);

If building internal Order Books is turned on correctly, corresponding callbacks will be invoked. OnixS::Xetra::MarketData::MDI::OrderBookListener::onOrderBookUpdated is invoked when any Order Book object's state is changed. A reference to corresponding Order Book object is passed into this callback.

Lifetime of the OnixS::Xetra::MarketData::MDI::OrderBook object, passed to the OnixS::Xetra::MarketData::MDI::OrderBookListener::onOrderBookUpdated callback, is unpredictable after returning from it. So the reference, passed into the callback, may become invalid at any time after returning from it and should not be stored. Read-only copy of the workbook can be created through the call to OnixS::Xetra::MarketData::MDI::OrderBook::snapshot(). Caller is responsible for the deletion of this book.

OnixS::Xetra::MarketData::MDI::OrderBookListener::onOrderBookInvalidated is invoked if Order Book object becomes invalidated because of detected message gaps or data loss. Corresponding Security ID is passed into the callback.