COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
ChecksumLayerOptionsParser.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
14#include <tuple>
15
16namespace comms
17{
18
19namespace frame
20{
21
22namespace details
23{
24
25template <typename... TOptions>
26class ChecksumLayerOptionsParser;
27
28template <>
29class ChecksumLayerOptionsParser<>
30{
31public:
32 static constexpr bool HasVerifyBeforeRead = false;
33 static constexpr bool HasExtendingClass = false;
34
35 using ExtendingClass = void;
36
37 template <typename TLayer>
38 using DefineExtendingClass = TLayer;
39
40 template <typename TOpt>
41 using SuppressForVerifyBeforeRead = TOpt;
42
43};
44
45template <typename... TOptions>
46class ChecksumLayerOptionsParser<comms::option::def::FrameLayerVerifyBeforeRead, TOptions...> :
47 public ChecksumLayerOptionsParser<TOptions...>
48{
49public:
50 static constexpr bool HasVerifyBeforeRead = true;
51
52 template <typename TOpt>
53 using SuppressForVerifyBeforeRead = comms::option::app::EmptyOption;
54};
55
56template <typename T, typename... TOptions>
57class ChecksumLayerOptionsParser<comms::option::def::ExtendingClass<T>, TOptions...> :
58 public ChecksumLayerOptionsParser<TOptions...>
59{
60public:
61 static constexpr bool HasExtendingClass = true;
62 using ExtendingClass = T;
63
64 template <typename TLayer>
65 using DefineExtendingClass = ExtendingClass;
66};
67
68template <typename... TOptions>
69class ChecksumLayerOptionsParser<
70 comms::option::app::EmptyOption,
71 TOptions...> : public ChecksumLayerOptionsParser<TOptions...>
72{
73};
74
75template <typename... TBundledOptions, typename... TOptions>
76class ChecksumLayerOptionsParser<
77 std::tuple<TBundledOptions...>,
78 TOptions...> : public ChecksumLayerOptionsParser<TBundledOptions..., TOptions...>
79{
80};
81
82} // namespace details
83
84} // namespace frame
85
86} // 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.
No-op option, doesn't have any effect.
Definition options.h:1284