COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
MsgSizeLayerOptionsParser.h
1//
2// Copyright 2019 - 2025 (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
10#include "comms/options.h"
11
12#include <tuple>
13
14namespace comms
15{
16
17namespace frame
18{
19
20namespace details
21{
22
23
24template <typename... TOptions>
25class MsgSizeLayerOptionsParser;
26
27template <>
28class MsgSizeLayerOptionsParser<>
29{
30public:
31 static constexpr bool HasExtendingClass = false;
32
33 using ExtendingClass = void;
34
35 template <typename TLayer>
36 using DefineExtendingClass = TLayer;
37};
38
39template <typename T, typename... TOptions>
40class MsgSizeLayerOptionsParser<comms::option::def::ExtendingClass<T>, TOptions...> :
41 public MsgSizeLayerOptionsParser<TOptions...>
42{
43public:
44 static constexpr bool HasExtendingClass = true;
45 using ExtendingClass = T;
46
47 template <typename TLayer>
48 using DefineExtendingClass = ExtendingClass;
49};
50
51template <typename... TOptions>
52class MsgSizeLayerOptionsParser<
53 comms::option::app::EmptyOption,
54 TOptions...> : public MsgSizeLayerOptionsParser<TOptions...>
55{
56};
57
58template <typename... TBundledOptions, typename... TOptions>
59class MsgSizeLayerOptionsParser<
60 std::tuple<TBundledOptions...>,
61 TOptions...> : public MsgSizeLayerOptionsParser<TBundledOptions..., TOptions...>
62{
63};
64
65} // namespace details
66
67} // namespace frame
68
69} // namespace comms
comms::option::def::ExtendingClass< T > ExtendingClass
Same as comms::option::def::ExtendingClass.
Definition options.h:1949
Main namespace for all classes / functions of COMMS library.
STL namespace.
Contains definition of all the options used by the COMMS library.