COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
MsgSizeLayerOptionsParser.h
1//
2// Copyright 2019 - 2026 (C). Alex Robenko. All rights reserved.
3//
4// SPDX-License-Identifier: MPL-2.0
5//
6// This Source Code Form is subject to the terms of the Mozilla Public
7// License, v. 2.0. If a copy of the MPL was not distributed with this
8// file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
10#pragma once
11
12#include "comms/options.h"
13
14#include <tuple>
15
16namespace comms
17{
18
19namespace frame
20{
21
22namespace details
23{
24
25template <typename... TOptions>
26class MsgSizeLayerOptionsParser;
27
28template <>
29class MsgSizeLayerOptionsParser<>
30{
31public:
32 static constexpr bool HasExtendingClass = false;
33
34 using ExtendingClass = void;
35
36 template <typename TLayer>
37 using DefineExtendingClass = TLayer;
38};
39
40template <typename T, typename... TOptions>
41class MsgSizeLayerOptionsParser<comms::option::def::ExtendingClass<T>, TOptions...> :
42 public MsgSizeLayerOptionsParser<TOptions...>
43{
44public:
45 static constexpr bool HasExtendingClass = true;
46 using ExtendingClass = T;
47
48 template <typename TLayer>
49 using DefineExtendingClass = ExtendingClass;
50};
51
52template <typename... TOptions>
53class MsgSizeLayerOptionsParser<
54 comms::option::app::EmptyOption,
55 TOptions...> : public MsgSizeLayerOptionsParser<TOptions...>
56{
57};
58
59template <typename... TBundledOptions, typename... TOptions>
60class MsgSizeLayerOptionsParser<
61 std::tuple<TBundledOptions...>,
62 TOptions...> : public MsgSizeLayerOptionsParser<TBundledOptions..., TOptions...>
63{
64};
65
66} // namespace details
67
68} // namespace frame
69
70} // namespace comms
comms::option::def::ExtendingClass< T > ExtendingClass
Same as comms::option::def::ExtendingClass.
Definition options.h:1962
Main namespace for all classes / functions of COMMS library.
STL namespace.
Contains definition of all the options used by the COMMS library.