COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
MsgDataLayerOptionsParser.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/Field.h"
14#include "comms/options.h"
15
16#include <cstdint>
17#include <tuple>
18
19namespace comms
20{
21
22namespace frame
23{
24
25namespace details
26{
27
28class MsgDataLayerField : public
30 comms::Field<comms::option::def::BigEndian>,
31 std::uint8_t,
32 comms::option::HasName
33 >
34{
35public:
36 static const char* name()
37 {
38 return "Data";
39 }
40};
41
42template <typename... TOptions>
43class MsgDataLayerOptionsParser;
44
45template <>
46class MsgDataLayerOptionsParser<>
47{
48public:
49 static constexpr bool HasFieldType = false;
50 using FieldType = MsgDataLayerField;
51};
52
53template <typename TField, typename... TOptions>
54class MsgDataLayerOptionsParser<comms::option::def::FieldType<TField>, TOptions...> :
55 public MsgDataLayerOptionsParser<TOptions...>
56{
57public:
58 static constexpr bool HasFieldType = true;
59 using FieldType = TField;
60};
61
62template <typename... TOptions>
63class MsgDataLayerOptionsParser<
64 comms::option::app::EmptyOption,
65 TOptions...> : public MsgDataLayerOptionsParser<TOptions...>
66{
67};
68
69template <typename... TBundledOptions, typename... TOptions>
70class MsgDataLayerOptionsParser<
71 std::tuple<TBundledOptions...>,
72 TOptions...> : public MsgDataLayerOptionsParser<TBundledOptions..., TOptions...>
73{
74};
75
76} // namespace details
77
78} // namespace frame
79
80} // namespace comms
Contains definition of comms::field::ArrayList.
Contains definition of comms::Field class.
Field that represents a sequential collection of fields.
Definition ArrayList.h:200
comms::option::def::FieldType< TMsg > FieldType
Same as comms::option::def::FieldType.
Definition options.h:1505
Main namespace for all classes / functions of COMMS library.
STL namespace.
Contains definition of all the options used by the COMMS library.