37#if defined(ONIXS_ILINK3_CXX11)
40template <
typename Message>
41struct MaxMessageSizeTraits
43 static constexpr bool UseCustomValue =
false;
47template<
typename Message>
53 static_cast<MessageSize>(Message::getMaxMessageSize(maxGroupItems));
57template<
typename Message>
59typename std::enable_if<MaxMessageSizeTraits<Message>::UseCustomValue,
MessageSize>::type
63 MaxMessageSizeTraits<Message>::calculateMaxMessageSize();
67template<
typename Message>
69typename std::enable_if<!MaxMessageSizeTraits<Message>::UseCustomValue,
MessageSize>::type
76template<
typename Message, UInt8 MaxGroupItems>
77struct GetMaxMessageSize
83template<
typename Message>
85UInt16 getMinMessageSize()
88 Message::blockLength(Message::Schema::Version)
90 + Message::getMinimalVariableFieldsSize(Message::Schema::Version);
94template<
typename Message>
95struct GetMinMessageSize
97 enum {Size = getMinMessageSize<Message>()};
103template<
typename Message, UInt8>
104struct GetMaxMessageSize
110template<
typename Message>
111struct GetMinMessageSize
113 enum {Size =
sizeof(SimpleOpenFramingHeader) +
sizeof(MessageHeader) + 1};
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_END
#define ONIXS_ILINK3_MESSAGING_NAMESPACE_BEGIN
#define ONIXS_ILINK3_CONST_OR_CONSTEXPR
constexpr std::enable_if< MaxMessageSizeTraits< Message >::UseCustomValue, MessageSize >::type getMaxMessageSize(UInt8)
Calculates the buffer size for a message with the given number of repeating group items.
constexpr UInt16 MaxILink3MessageSize
Maximum supported message size.
UInt16 MessageSize
Message length type.
constexpr MessageSize calculateMaxMessageSize(UInt8 maxGroupItems)
Calculates the buffer size for a message with the given number of repeating group items.