OnixS C++ CME MDP Premium Market Data Handler  5.8.0
API Documentation
User-defined Watch service

By default, the handler uses a precise watch returning Universal Time Coordinated (UTC) time. The SDK exposes the given watch service via the OnixS::CME::MDH::UtcWatch class. It's used by the default implementation of the Feed Engine concept to assign the receive time for incoming data and to determine timeouts. File-based implementation of the Logger abstraction also uses this watch to label logged events.

The SDK allows using a custom watch implementation derived from OnixS::CME::MDH::WatchService. Users may bind its instance to services requiring a watch (Feed Engine, Logger, etc.).

The following code shows how to configure OnixS::CME::MDH::SocketFeedEngine to timestamp packets in local time. It uses OnixS::CME::MDH::LocalWatch.

WatchService& localWatch = LocalWatch::service();
SocketFeedEngineSettings settings;
OnixS::CME::MDH::WatchService::now can be called concurrently, so it must be thread-safe.

The Timestamp class

OnixS::CME::MDH::WatchService::now returns time as an instance of the OnixS::CME::MDH::Timestamp class. Internally the OnixS::CME::MDH::Timestamp corresponds to CME MDH timestamp representation using an unsigned 64-bit integer storing the number of nanoseconds since the Unix Epoch (01-01-1970 00:00:00 UTC). The most effective way to construct an instance of the class is to pass the number of nanoseconds since the Epoch.