OnixS C++ ICE Binary Order Entry Handler 1.0.0
API Documentation
Loading...
Searching...
No Matches
MaxMessageSize.h
Go to the documentation of this file.
1// Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2//
3// This software owned by Onix Solutions Limited [OnixS] and is
4// protected by copyright law and international copyright treaties.
5//
6// Access to and use of the software is governed by the terms of the applicable
7// OnixS Software Services Agreement (the Agreement) and Customer end user license
8// agreements granting a non-assignable, non-transferable and non-exclusive license
9// to use the software for it's own data processing purposes under the terms defined
10// in the Agreement.
11//
12// Except as otherwise granted within the terms of the Agreement, copying or
13// reproduction of any part of this source code or associated reference material
14// to any other location for further reproduction or redistribution, and any
15// amendments to this copyright notice, are expressly prohibited.
16//
17// Any reproduction or redistribution for sale or hiring of the Software not in
18// accordance with the terms of the Agreement is a violation of copyright law.
19//
20
21#pragma once
22
23#include <OnixS/ICE/BOE/ABI.h>
25
29
31
33
36
37
38template <typename Message>
40{
41 static constexpr bool UseCustomValue = false;
42};
43
45template<typename Message>
46constexpr
48{
49 return
50 ONIXS_ICEBOE_ASSERT(Message::getMaxMessageSize(maxGroupItems) <= MaxSbeMessageSize),
51 static_cast<MessageSize>(Message::getMaxMessageSize(maxGroupItems));
52}
53
55template<typename Message>
56constexpr
57typename std::enable_if<MaxMessageSizeTraits<Message>::UseCustomValue, MessageSize>::type
63
65template<typename Message>
66constexpr
67typename std::enable_if<!MaxMessageSizeTraits<Message>::UseCustomValue, MessageSize>::type
69{
70 return calculateMaxMessageSize<Message>(maxGroupItems);
71}
72
73
74template<typename Message, UInt8 MaxGroupItems>
76{
77 enum {Size = getMaxMessageSize<Message>(MaxGroupItems)};
78};
79
80
81template<typename Message>
82constexpr
84{
85 return
86 Message::blockLength(Message::Schema::Version)
88 + Message::getMinimalVariableFieldsSize(Message::Schema::Version);
89}
90
91
92template<typename Message>
97
#define ONIXS_ICEBOE_MESSAGING_NAMESPACE_BEGIN
Definition ABI.h:102
#define ONIXS_ICEBOE_MESSAGING_NAMESPACE_END
Definition ABI.h:106
constexpr UInt16 getMinMessageSize()
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 MaxSbeMessageSize
Maximum supported message size.
UInt16 MessageSize
Message length type.
Definition Aliases.h:29
constexpr MessageSize calculateMaxMessageSize(UInt8 maxGroupItems)
Calculates the buffer size for a message with the given number of repeating group items.
Traits for calculating the buffer size of a message.