OnixS C++ CME MDP Premium Market Data Handler 5.11.1
Users' manual and API documentation
Loading...
Searching...
No Matches
MemoryPoolSettings.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 <cstddef>
24#include <string>
25
26#include <OnixS/CME/MDH/ABI.h>
27
29
37{
38public:
42 MemoryPoolSettings() noexcept = default;
43
52
56 std::size_t blockIncrease() const noexcept
57 {
58 return blockIncrease_;
59 }
60
65 void blockIncrease(std::size_t increase);
66
73 std::size_t increaseQty() const noexcept
74 {
75 return increaseQty_;
76 }
77
85 void increaseQty(std::size_t qty);
86
90 std::size_t chunkSize() const noexcept
91 {
92 return chunkSize_;
93 }
94
101 void chunkSize(std::size_t size);
102
106 std::size_t chunkScaling() const noexcept
107 {
108 return chunkScaling_;
109 }
110
115 void chunkScaling(std::size_t factor);
116
117private:
118 std::size_t blockIncrease_ = 48;
119 std::size_t increaseQty_ = 32;
120 std::size_t chunkSize_ = 20;
121 std::size_t chunkScaling_ = 2;
122};
123
128void toStr(std::string& str, const MemoryPoolSettings& settings);
129
133inline ONIXS_CMEMDH_NODISCARD std::string toStr(const MemoryPoolSettings& settings)
134{
135 std::string str;
136
137 toStr(str, settings);
138
139 return str;
140}
141
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:69
#define ONIXS_CMEMDH_LTWT
Definition Bootstrap.h:61
#define ONIXS_CMEMDH_LTWT_EXPORTED
Definition Bootstrap.h:62
#define ONIXS_CMEMDH_NAMESPACE_END
Definition Bootstrap.h:73
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:163
#define ONIXS_CMEMDH_NODISCARD
Definition Compiler.h:165
Configures allocation and caching behavior of the handler's memory pool.
MemoryPoolSettings() noexcept=default
Creates settings with their default values.
void blockIncrease(std::size_t increase)
Sets the allocation granularity for memory blocks.
std::size_t blockIncrease() const noexcept
Returns the allocation granularity for memory blocks.
std::size_t chunkSize() const noexcept
Returns the initial number of equally sized blocks allocated per chunk.
void increaseQty(std::size_t qty)
Sets the number of block-size increments cached by the memory pool.
void chunkSize(std::size_t size)
Sets the initial number of equally sized blocks allocated per chunk.
std::size_t increaseQty() const noexcept
Returns the number of block-size increments cached by the memory pool.
void chunkScaling(std::size_t factor)
Sets the factor used to grow successive chunks.
std::size_t chunkScaling() const noexcept
Returns the factor used to grow successive chunks.
void toStr(std::string &str, BookState::Enum bookState)
Appends a string representation of a book state.
STL namespace.