iceoryx_doc  1.0.1
shm_safe_unmanaged_chunk.hpp
1 // Copyright (c) 2021 by Apex.AI Inc. 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 
17 #ifndef IOX_POSH_MEPOO_SHM_SAFE_UNMANAGED_CHUNK_HPP
18 #define IOX_POSH_MEPOO_SHM_SAFE_UNMANAGED_CHUNK_HPP
19 
20 #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp"
21 #include "iceoryx_utils/internal/relocatable_pointer/relative_pointer_data.hpp"
22 
23 namespace iox
24 {
25 namespace mepoo
26 {
31 {
32  public:
33  ShmSafeUnmanagedChunk() noexcept = default;
34 
37 
40 
43 
46  bool isLogicalNullptr() const noexcept;
47 
51 
55  const ChunkHeader* getChunkHeader() const noexcept;
56 
61 
62  private:
63  rp::RelativePointerData m_chunkManagement;
64 };
65 
66 } // namespace mepoo
67 } // namespace iox
68 
69 #endif // IOX_POSH_MEPOO_SHM_SAFE_UNMANAGED_CHUNK_HPP
WARNING: SharedChunk is not thread safe! Don't share SharedChunk objects between threads!...
Definition: shared_chunk.hpp:35
This class to safely store a chunk in shared memory. To be able to do so, torn writes/reads need to p...
Definition: shm_safe_unmanaged_chunk.hpp:31
ShmSafeUnmanagedChunk(SharedChunk chunk) noexcept
takes a SharedChunk without decrementing the chunk reference counter
bool isNotLogicalNullptrAndHasNoOtherOwners() const noexcept
Checks if the underlying RelativePointerData to the chunk is neither logically a nullptr nor that the...
SharedChunk cloneToSharedChunk() noexcept
Creates a SharedChunk with incrementing the chunk reference counter and does not invalidate itself.
ChunkHeader * getChunkHeader() noexcept
Access to the ChunkHeader of the underlying chunk.
bool isLogicalNullptr() const noexcept
Checks if the underlying RelativePointerData to the chunk is logically a nullptr.
SharedChunk releaseToSharedChunk() noexcept
Creates a SharedChunk without incrementing the chunk reference counter and invalidates itself.
Definition: service_description.hpp:29
Definition: chunk_header.hpp:42