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