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