COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
TransportValueLayerOptionsParser.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#include "comms/frame/details/TransportValueLayerAllBases.h"
12
13namespace comms
14{
15
16namespace frame
17{
18
19namespace details
20{
21
22template <typename... TOptions>
23class TransportValueLayerOptionsParser;
24
25template <>
26class TransportValueLayerOptionsParser<>
27{
28public:
29 static const bool HasPseudoValue = false;
30 static constexpr bool HasExtendingClass = false;
31
32 using ExtendingClass = void;
33
34 template <typename TBase>
35 using BuildPseudoBase = TBase;
36
37 template <typename TLayer>
38 using DefineExtendingClass = TLayer;
39
40 template <typename TNextLayer>
41 using ForceReadUntilDataSplitIfNeeded =
43 std::is_void<typename FrameLayerMsgPtr<TNextLayer>::Type>::value
44 >::template Type <
47 // If the MsgPtr is not defined, then the MsgIdLayer is
48 // probably an outer layer, as the result the message
49 // object is properly allocated when transport value
50 // read operation is reached.
51 >;
52};
53
54template <typename... TOptions>
55class TransportValueLayerOptionsParser<comms::option::def::PseudoValue, TOptions...> :
56 public TransportValueLayerOptionsParser<TOptions...>
57{
58public:
59 static const bool HasPseudoValue = true;
60
61 template <typename TBase>
62 using BuildPseudoBase = TransportValueLayerPseudoBase<TBase>;
63};
64
65template <typename T, typename... TOptions>
66class TransportValueLayerOptionsParser<comms::option::def::ExtendingClass<T>, TOptions...> :
67 public TransportValueLayerOptionsParser<TOptions...>
68{
69public:
70 static constexpr bool HasExtendingClass = true;
71 using ExtendingClass = T;
72
73 template <typename TLayer>
74 using DefineExtendingClass = ExtendingClass;
75};
76
77template <typename... TOptions>
78class TransportValueLayerOptionsParser<
79 comms::option::def::FrameLayerSuppressReadUntilDataSplitForcing,
80 TOptions...> :
81 public TransportValueLayerOptionsParser<TOptions...>
82{
83public:
84 template <typename TNextLayer>
85 using ForceReadUntilDataSplitIfNeeded = comms::option::app::EmptyOption;
86};
87
88template <typename... TOptions>
89class TransportValueLayerOptionsParser<
90 comms::option::app::EmptyOption,
91 TOptions...> : public TransportValueLayerOptionsParser<TOptions...>
92{
93};
94
95template <typename... TBundledOptions, typename... TOptions>
96class TransportValueLayerOptionsParser<
97 std::tuple<TBundledOptions...>,
98 TOptions...> : public TransportValueLayerOptionsParser<TBundledOptions..., TOptions...>
99{
100};
101
102} // namespace details
103
104} // namespace frame
105
106} // namespace comms
comms::option::def::ExtendingClass< T > ExtendingClass
Same as comms::option::def::ExtendingClass.
Definition options.h:1949
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:1271
Option to force comms::frame::FrameLayerBase class to split read operation "until" and "from" data (p...
Definition options.h:1105
Replacement to std::conditional.
Definition type_traits.h:29