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