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