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