COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
ProtocolLayerBaseOptionsParser.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 ProtocolLayerBaseOptionsParser;
24
25template <>
26class ProtocolLayerBaseOptionsParser<>
27{
28public:
29 static constexpr bool HasForceReadUntilDataSplit = false;
30 static constexpr bool HasDisallowReadUntilDataSplit = false;
31};
32
33template <typename... TOptions>
34class ProtocolLayerBaseOptionsParser<
35 comms::option::def::ProtocolLayerForceReadUntilDataSplit, TOptions...> :
36 public ProtocolLayerBaseOptionsParser<TOptions...>
37{
38public:
39 static constexpr bool HasForceReadUntilDataSplit = true;
40};
41
42template <typename... TOptions>
43class ProtocolLayerBaseOptionsParser<
44 comms::option::def::ProtocolLayerDisallowReadUntilDataSplit, TOptions...> :
45 public ProtocolLayerBaseOptionsParser<TOptions...>
46{
47public:
48 static constexpr bool HasDisallowReadUntilDataSplit = true;
49};
50
51template <typename... TOptions>
52class ProtocolLayerBaseOptionsParser<
53 comms::option::app::EmptyOption,
54 TOptions...> : public ProtocolLayerBaseOptionsParser<TOptions...>
55{
56};
57
58template <typename... TBundledOptions, typename... TOptions>
59class ProtocolLayerBaseOptionsParser<
60 std::tuple<TBundledOptions...>,
61 TOptions...> : public ProtocolLayerBaseOptionsParser<TBundledOptions..., TOptions...>
62{
63};
64
65} // namespace details
66
67} // namespace protocol
68
69} // namespace comms
Main namespace for all classes / functions of COMMS library.
STL namespace.
Contains definition of all the options used by the COMMS library.