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