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