iceoryx_posh
2.0.3
iceoryx_posh
mepoo
mepoo_config.hpp
1
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
//
15
// SPDX-License-Identifier: Apache-2.0
16
#ifndef IOX_POSH_MEPOO_MEPOO_CONFIG_HPP
17
#define IOX_POSH_MEPOO_MEPOO_CONFIG_HPP
18
19
#include "iceoryx_hoofs/cxx/vector.hpp"
20
#include "iceoryx_posh/iceoryx_posh_types.hpp"
21
22
#include <cstdint>
23
24
namespace
iox
25
{
26
namespace
roudi
27
{
28
class
PortManager;
29
}
30
namespace
mepoo
31
{
32
struct
MePooConfig
33
{
34
public
:
35
struct
Entry
36
{
38
Entry
(uint32_t f_size, uint32_t f_chunkCount) noexcept
39
: m_size(f_size)
40
, m_chunkCount(f_chunkCount)
41
{
42
}
43
uint32_t m_size{0};
44
uint32_t m_chunkCount{0};
45
};
46
47
using
MePooConfigContainerType = cxx::vector<Entry, MAX_NUMBER_OF_MEMPOOLS>;
48
MePooConfigContainerType m_mempoolConfig;
49
51
MePooConfig
() noexcept = default;
52
55
const MePooConfigContainerType*
getMemPoolConfig
() const noexcept;
56
59
void
addMemPool
(
Entry
f_entry) noexcept;
60
62
MePooConfig
&
setDefaults
() noexcept;
63
65
MePooConfig
&
optimize
() noexcept;
66
};
67
68
}
// namespace mepoo
69
}
// namespace iox
70
71
#endif
// IOX_POSH_MEPOO_MEPOO_CONFIG_HPP
iox::mepoo::MePooConfig::Entry
Definition:
mepoo_config.hpp:36
iox::mepoo::MePooConfig::Entry::Entry
Entry(uint32_t f_size, uint32_t f_chunkCount) noexcept
set the size and count of memory chunks
Definition:
mepoo_config.hpp:38
iox::mepoo::MePooConfig
Definition:
mepoo_config.hpp:33
iox::mepoo::MePooConfig::addMemPool
void addMemPool(Entry f_entry) noexcept
Function for adding new entry.
iox::mepoo::MePooConfig::MePooConfig
MePooConfig() noexcept=default
Default constructor to set the configuration for memory pools.
iox::mepoo::MePooConfig::optimize
MePooConfig & optimize() noexcept
Function for optimizing the size of memory pool according to new entry.
iox::mepoo::MePooConfig::setDefaults
MePooConfig & setDefaults() noexcept
Function for creating default memory pools.
iox::mepoo::MePooConfig::getMemPoolConfig
const MePooConfigContainerType * getMemPoolConfig() const noexcept
Get function for receiving memory pool configuration.
Generated by
1.9.4