COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
DispatchMsgHelperType.h
1//
2// Copyright 2020 - 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
13
14#include <cstddef>
15#include <type_traits>
16
17namespace comms
18{
19
20namespace details
21{
22
23enum class DispatchMsgTypeEnum
24{
25 Multiple,
26 Single,
27 None
28};
29
30template <std::size_t TCount>
31using DispatchMsgHelperIntType =
33 TCount == 0U
34 >::template Type<
35 std::integral_constant<DispatchMsgTypeEnum, DispatchMsgTypeEnum::None>,
37 TCount == 1U
38 >::template Type<
39 std::integral_constant<DispatchMsgTypeEnum, DispatchMsgTypeEnum::Single>,
40 std::integral_constant<DispatchMsgTypeEnum, DispatchMsgTypeEnum::Multiple>
41 >
42 >;
43
44} // namespace details
45
46} // namespace comms
Main namespace for all classes / functions of COMMS library.
Replacement to std::conditional.
Definition type_traits.h:32
Replacement to some types from standard type_traits.