iceoryx_doc  1.0.1
chunk_management.hpp
1 // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
2 // Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 // SPDX-License-Identifier: Apache-2.0
17 #ifndef IOX_POSH_MEPOO_CHUNK_MANAGEMENT_HPP
18 #define IOX_POSH_MEPOO_CHUNK_MANAGEMENT_HPP
19 
20 #include "iceoryx_utils/cxx/helplets.hpp"
21 #include "iceoryx_utils/internal/relocatable_pointer/relative_pointer.hpp"
22 
23 #include <atomic>
24 #include <cstdint>
25 #include <utility>
26 
27 namespace iox
28 {
29 namespace mepoo
30 {
31 class MemPool;
32 struct ChunkHeader;
33 
35 {
36  using base_t = ChunkHeader;
37  using referenceCounterBase_t = uint64_t;
38  using referenceCounter_t = std::atomic<referenceCounterBase_t>;
39 
40  ChunkManagement(const cxx::not_null<base_t*> chunkHeader,
41  const cxx::not_null<MemPool*> mempool,
42  const cxx::not_null<MemPool*> chunkManagementPool) noexcept;
43 
44  iox::rp::RelativePointer<base_t> m_chunkHeader;
45  referenceCounter_t m_referenceCounter{1U};
47  iox::rp::RelativePointer<MemPool> m_mempool;
48  iox::rp::RelativePointer<MemPool> m_chunkManagementPool;
49 };
50 } // namespace mepoo
51 } // namespace iox
52 
53 #endif // IOX_POSH_MEPOO_CHUNK_MANAGEMENT_HPP
Definition: service_description.hpp:29
Definition: chunk_header.hpp:42
Definition: chunk_management.hpp:35
iox::rp::RelativePointer< MemPool > m_mempool
Definition: chunk_management.hpp:47