18 #ifndef IOX_UTILS_RELOCATABLE_POINTER_ATOMIC_RELOCATABLE_POINTER_HPP
19 #define IOX_UTILS_RELOCATABLE_POINTER_ATOMIC_RELOCATABLE_POINTER_HPP
37 using offset_t = std::ptrdiff_t;
38 static constexpr offset_t NULL_POINTER_OFFSET = std::numeric_limits<offset_t>::max();
63 T& operator*() const noexcept;
67 operator T*() const noexcept;
70 std::atomic<offset_t> m_offset{NULL_POINTER_OFFSET};
72 inline T* computeRawPtr() const noexcept;
74 inline offset_t computeOffset(const
void* ptr) const noexcept;
79 #include "iceoryx_utils/internal/relocatable_pointer/atomic_relocatable_pointer.inl"
minimalistic relocatable pointer that can be written and read atomically and can be stored safely in ...
Definition: atomic_relocatable_pointer.hpp:35
T * operator->() const noexcept
access to the underlying object in shared memory
Definition: atomic_relocatable_pointer.inl:41
AtomicRelocatablePointer(const T *ptr=nullptr) noexcept
creates an AtomicRelocatablePointer pointing to the same pointee as ptr
Definition: atomic_relocatable_pointer.inl:28
AtomicRelocatablePointer(const AtomicRelocatablePointer &)=delete
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:28