#pragma once namespace sp { namespace details { // TBase is interface class // TOptions... are the implementation options template struct MessageImplBuilder { // ParsedOptions class is supposed to be defined in comms::Message class using InterfaceOptions = typename TBase::ParsedOptions; // Parse implementation options using ImplOptions = MessageImplParsedOptions; // Provide GetIdImpl() if possible static const bool HasStaticNumIdImpl = InterfaceOptions::HasMsgIdType && ImplOptions::HasStaticNumIdImpl; using Base1 = typename MessageImplProcessStaticNumId::Type; // Provide DispatchImpl() if possible static const bool HasDispatchImpl = InterfaceOptions::HasHandler && ImplOptions::HasDispatchImpl; using Base2 = typename MessageImplProcessDispatch::Type; // Provide access to fields if possible using Base3 = typename MessageImplProcessFields::Type; // Provide ReadImpl() if possible static const bool HasReadImpl = InterfaceOptions::HasReadOperations && ImplOptions::HasFieldsImpl; using Base4 = typename MessageImplProcessReadFields::Type; // Provide WriteImpl() if possible static const bool HasWriteImpl = InterfaceOptions::HasWriteOperations && ImplOptions::HasFieldsImpl; using Base5 = typename MessageImplProcessWriteFields::Type; // Provide ValidImpl() if possible static const bool HasValidImpl = InterfaceOptions::HasValid && ImplOptions::HasFieldsImpl; using Base6 = typename MessageImplProcessValidFields::Type; // The last BaseN must be taken as final type. using Type = Base6; }; } // namespace details } // namespace sp