26template <
typename TMessage>
27using MessageStaticNumIdBoolType =
28 typename comms::util::LazyDeepConditional<
29 comms::isMessageBase<TMessage>()
31 comms::util::MessageCheckHasStaticId,
32 comms::util::FalseType,
37struct MessageStaticNumIdCheckHelper
39 template <
typename TMessage>
40 constexpr bool operator()(
bool value)
const
42 return value && MessageStaticNumIdBoolType<TMessage>::value;
46template <
typename... TMessages>
47using AllMessagesHaveStaticNumIdBoolType =
48 std::integral_constant<
53template <
typename TAllMessages>
54struct AllMessagesHaveStaticNumIdCheckHelper;
56template <
typename... TMessages>
57struct AllMessagesHaveStaticNumIdCheckHelper<
std::tuple<TMessages...> >
59 static constexpr bool Value = AllMessagesHaveStaticNumIdBoolType<TMessages...>::value;
62template <
typename TAllMessages>
63constexpr bool allMessagesHaveStaticNumId()
65 return AllMessagesHaveStaticNumIdCheckHelper<TAllMessages>::Value;
68template <
typename TMessage>
69constexpr bool messageHasStaticNumId()
71 return MessageStaticNumIdBoolType<TMessage>::value;
74template <
bool TAllSorted,
bool TMoreThanOne,
typename...>
75class AllMessagesStrongSortedCheckHelper;
77template <
bool TMoreThanOne,
typename... TParams>
78class AllMessagesStrongSortedCheckHelper<false, TMoreThanOne, TParams...>
81 template <
typename...>
82 using Type = std::false_type;
85template <
typename... TParams>
86class AllMessagesStrongSortedCheckHelper<true, false, TParams...>
89 template <
typename...>
90 using Type = std::true_type;
93template <
typename... TParams>
94class AllMessagesStrongSortedCheckHelper<true, true, TParams...>
97 template <
typename TMsg1,
typename TMsg2,
typename... TRest>
100 (TMsg1::staticMsgId() < TMsg2::staticMsgId())
102 typename AllMessagesStrongSortedCheckHelper<
true, (0U <
sizeof...(TRest))>::template Type<TMsg2, TRest...>,
107template <
bool TAllSorted,
bool TMoreThanOne,
typename...>
108class AllMessagesWeakSortedCheckHelper;
110template <
bool TMoreThanOne,
typename... TParams >
111class AllMessagesWeakSortedCheckHelper<false, TMoreThanOne, TParams...>
114 template <
typename... TRest>
115 using Type = std::false_type;
118template <
typename... TParams>
119class AllMessagesWeakSortedCheckHelper<true, false, TParams...>
122 template <
typename... TRest>
123 using Type = std::true_type;
126template <
typename... TParams>
127class AllMessagesWeakSortedCheckHelper<true, true, TParams...>
130 template <
typename TMsg1,
typename TMsg2,
typename... TRest>
133 (TMsg1::staticMsgId() <= TMsg2::staticMsgId())
135 typename AllMessagesWeakSortedCheckHelper<
true, (0U <
sizeof...(TRest))>::template Type<TMsg2, TRest...>,
140template <
typename TAllMessages>
141struct AllMessagesStrongSortedCheckHelperWrap;
143template <
typename... TAllMessages>
144struct AllMessagesStrongSortedCheckHelperWrap<
std::tuple<TAllMessages...> >
146 static constexpr bool Value =
147 AllMessagesStrongSortedCheckHelper<
148 (AllMessagesHaveStaticNumIdBoolType<TAllMessages...>::value),
149 (1U <
sizeof...(TAllMessages))
150 >::template Type<TAllMessages...>::value;
153template <
typename TAllMessages>
154struct AllMessagesWeakSortedCheckHelperWrap;
156template <
typename... TAllMessages>
157struct AllMessagesWeakSortedCheckHelperWrap<
std::tuple<TAllMessages...> >
159 static constexpr bool Value =
160 AllMessagesWeakSortedCheckHelper<
161 (AllMessagesHaveStaticNumIdBoolType<TAllMessages...>::value),
162 (1U <
sizeof...(TAllMessages))
163 >::template Type<TAllMessages...>::value;
166template <
typename TAllMessages>
167constexpr bool allMessagesAreStrongSorted()
169 return AllMessagesStrongSortedCheckHelperWrap<TAllMessages>::Value;
172template <
typename TAllMessages>
173constexpr bool allMessagesAreWeakSorted()
175 return AllMessagesWeakSortedCheckHelperWrap<TAllMessages>::Value;
This file contains classes required for generic custom assertion functionality.
Provides common base class for the custom messages with default implementation.
Contains various tuple type manipulation classes and functions.
constexpr TValue tupleTypeAccumulate(const TValue &value, TFunc &&func)
Performs "accumulate" algorithm on every type of the tuple.
Definition Tuple.h:685
Main namespace for all classes / functions of COMMS library.
Replacement to std::conditional.
Definition type_traits.h:28
Replacement to some types from standard type_traits.