COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
ProtocolLayerExtendingClassHelper.h
1//
2// Copyright 2019 - 2024 (C). Alex Robenko. All rights reserved.
3//
4// This Source Code Form is subject to the terms of the Mozilla Public
5// License, v. 2.0. If a copy of the MPL was not distributed with this
6// file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
8#pragma once
9
10namespace comms
11{
12
13namespace protocol
14{
15
16namespace details
17{
18
19template <bool THasExtendingClass>
20struct ProtocolLayerExtendingClassHelper;
21
22template <>
23struct ProtocolLayerExtendingClassHelper<false>
24{
25 template <typename TLayer, typename TParsedOptions>
26 using Type = TLayer;
27};
28
29template <>
30struct ProtocolLayerExtendingClassHelper<true>
31{
32 template <typename TLayer, typename TParsedOptions>
33 using Type = typename TParsedOptions::ExtendingClass;
34};
35
36template <typename TLayer, typename TParsedOptions>
37using ProtocolLayerExtendingClassT =
38 typename ProtocolLayerExtendingClassHelper<TParsedOptions::HasExtendingClass>::
39 template Type<TLayer, TParsedOptions>;
40
41} // namespace details
42
43} // namespace protocol
44
45} // namespace comms
Main namespace for all classes / functions of COMMS library.