iceoryx_doc  1.0.1
Public Member Functions | List of all members
iox::mepoo::ShmSafeUnmanagedChunk Class Reference

This class to safely store a chunk in shared memory. To be able to do so, torn writes/reads need to prevented, since they create Frankenstein objects. Therefore, the class must not be larger than 64 bits and trivially copy-able in case an application dies while writing this and RouDi needs to clean up. More...

#include <shm_safe_unmanaged_chunk.hpp>

Public Member Functions

 ShmSafeUnmanagedChunk (SharedChunk chunk) noexcept
 takes a SharedChunk without decrementing the chunk reference counter
 
SharedChunk releaseToSharedChunk () noexcept
 Creates a SharedChunk without incrementing the chunk reference counter and invalidates itself.
 
SharedChunk cloneToSharedChunk () noexcept
 Creates a SharedChunk with incrementing the chunk reference counter and does not invalidate itself.
 
bool isLogicalNullptr () const noexcept
 Checks if the underlying RelativePointerData to the chunk is logically a nullptr. More...
 
ChunkHeader * getChunkHeader () noexcept
 Access to the ChunkHeader of the underlying chunk. More...
 
const ChunkHeader * getChunkHeader () const noexcept
 const access to the ChunkHeader of the underlying chunk More...
 
bool isNotLogicalNullptrAndHasNoOtherOwners () const noexcept
 Checks if the underlying RelativePointerData to the chunk is neither logically a nullptr nor that the chunk has other owner. More...
 

Detailed Description

This class to safely store a chunk in shared memory. To be able to do so, torn writes/reads need to prevented, since they create Frankenstein objects. Therefore, the class must not be larger than 64 bits and trivially copy-able in case an application dies while writing this and RouDi needs to clean up.

Member Function Documentation

◆ getChunkHeader() [1/2]

const ChunkHeader* iox::mepoo::ShmSafeUnmanagedChunk::getChunkHeader ( ) const
noexcept

const access to the ChunkHeader of the underlying chunk

Returns
the const pointer to the ChunkHeader of the underlying chunk or nullptr if isLogicalNullptr would return true

◆ getChunkHeader() [2/2]

ChunkHeader* iox::mepoo::ShmSafeUnmanagedChunk::getChunkHeader ( )
noexcept

Access to the ChunkHeader of the underlying chunk.

Returns
the pointer to the ChunkHeader of the underlying chunk or nullptr if isLogicalNullptr would return true

◆ isLogicalNullptr()

bool iox::mepoo::ShmSafeUnmanagedChunk::isLogicalNullptr ( ) const
noexcept

Checks if the underlying RelativePointerData to the chunk is logically a nullptr.

Returns
true if logically a nullptr otherwise false

◆ isNotLogicalNullptrAndHasNoOtherOwners()

bool iox::mepoo::ShmSafeUnmanagedChunk::isNotLogicalNullptrAndHasNoOtherOwners ( ) const
noexcept

Checks if the underlying RelativePointerData to the chunk is neither logically a nullptr nor that the chunk has other owner.

Returns
true if neither logically a nullptr nor other owner chunk owners present, otherwise false

The documentation for this class was generated from the following file: