// Copyright Onix Solutions Limited [OnixS]. All rights reserved. // // This software owned by Onix Solutions Limited [OnixS] and is // protected by copyright law and international copyright treaties. // // Access to and use of the software is governed by the terms of the applicable // OnixS Software Services Agreement (the Agreement) and Customer end user license // agreements granting a non-assignable, non-transferable and non-exclusive license // to use the software for it's own data processing purposes under the terms defined // in the Agreement. // // Except as otherwise granted within the terms of the Agreement, copying or // reproduction of any part of this source code or associated reference material // to any other location for further reproduction or redistribution, and any // amendments to this copyright notice, are expressly prohibited. // // Any reproduction or redistribution for sale or hiring of the Software not in // accordance with the terms of the Agreement is a violation of copyright law. // #pragma once #include ONIXS_CMEMDH_NAMESPACE_BEGIN /// Casts SBE-encoded message to given type. template < class Message > inline Message typify( const BinaryMessage& message) { return Message( message.binary(), message.binarySize()); } /// Casts given binary message according to template/type /// information and processes casted messages by given processor. /// /// Returned value indicates whether message type was successfully /// recognized and pushed to processor for further processing. Unknown /// messages aren't processed and thus false result is returned. template < class Processor > bool processTypified( const BinaryMessage& binary, Processor& processor) { switch (binary.templateId()) { case InstrumentDefinitionFuture27::TemplateId: { processor( typify (binary)); return true; } case InstrumentDefinitionSpread29::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshBook32::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshDailyStatistics33::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshLimitsBanding34::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshSessionStatistics35::TemplateId: { processor( typify (binary)); return true; } case SnapshotFullRefresh38::TemplateId: { processor( typify (binary)); return true; } case InstrumentDefinitionOption41::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshTradeSummary42::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshOrderBook43::TemplateId: { processor( typify (binary)); return true; } case SnapshotFullRefreshOrderBook44::TemplateId: { processor( typify (binary)); return true; } case ChannelReset4::TemplateId: { processor( typify (binary)); return true; } case AdminHeartbeat12::TemplateId: { processor( typify (binary)); return true; } case AdminLogin15::TemplateId: { processor( typify (binary)); return true; } case AdminLogout16::TemplateId: { processor( typify (binary)); return true; } case InstrumentDefinitionFuture54::TemplateId: { processor( typify (binary)); return true; } case InstrumentDefinitionSpread56::TemplateId: { processor( typify (binary)); return true; } case SecurityStatus30::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshBook46::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshDailyStatistics49::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshLimitsBanding50::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshSessionStatistics51::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshVolume37::TemplateId: { processor( typify (binary)); return true; } case SnapshotFullRefresh52::TemplateId: { processor( typify (binary)); return true; } case QuoteRequest39::TemplateId: { processor( typify (binary)); return true; } case InstrumentDefinitionOption55::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshTradeSummary48::TemplateId: { processor( typify (binary)); return true; } case IncrementalRefreshOrderBook47::TemplateId: { processor( typify (binary)); return true; } case SnapshotFullRefreshOrderBook53::TemplateId: { processor( typify (binary)); return true; } default: return false; } } ONIXS_CMEMDH_NAMESPACE_END