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