Enables the trackTopOfTheBookOnly setting so the Handler reports order book updates only when the best bid or ask changes. This reduces processing overhead when only the top of the book is of interest.
Source code
#include "../Common/Defaults.h"
#include "../Common/MarketDataEventTracer.h"
#include "../Common/ServiceEventTracer.h"
#include "../Common/Utils.h"
#include <cstdlib>
#ifndef _WIN32
# include <pthread.h>
# include <csignal>
# include <cstdio>
# include <vector>
#endif
int main(int , char** )
{
try
{
introduceMyself("Track Top Of The Book Only");
handler.bindFeedEngine(feedEngine);
ServiceEventTracer serviceEventTracer;
serviceEventTracer.attachTo(handler);
MarketDataEventTracer marketDataEventTracer;
marketDataEventTracer.attachTo(handler);
);
subscriptions.insert(brentFutures);
handler.start(subscriptions);
readUserResponse();
std::cout << "Shutdown the Handler..." << std::endl;
handler.stop();
std::cout << "Done." << std::endl;
}
catch (const std::exception& ex)
{
std::cerr << "Error: " << ex.what() << std::endl;
return EXIT_FAILURE;
}
catch (...)
{
std::cerr << "Unknown exception." << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}