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