minimalistic relocatable pointer that can be written and read atomically and can be stored safely in shared memory. As the basic RelocatablePointer, it must point to something in the same shared memory segment as itself since the internally used offset must be an invariant different across adress spaces. Rationale: the default RelocatablePointer cannot be used in an atomic since the copy ctor is nontrivial.
More...
#include <atomic_relocatable_pointer.hpp>
|
using | offset_t = std::ptrdiff_t |
|
|
static constexpr offset_t | NULL_POINTER_OFFSET = std::numeric_limits<offset_t>::max() |
|
template<typename T>
class iox::rp::AtomicRelocatablePointer< T >
minimalistic relocatable pointer that can be written and read atomically and can be stored safely in shared memory. As the basic RelocatablePointer, it must point to something in the same shared memory segment as itself since the internally used offset must be an invariant different across adress spaces. Rationale: the default RelocatablePointer cannot be used in an atomic since the copy ctor is nontrivial.
◆ AtomicRelocatablePointer() [1/2]
creates an AtomicRelocatablePointer pointing to the same pointee as ptr
- Parameters
-
[in] | ptr | the pointer whose pointee shall be the same for this |
◆ AtomicRelocatablePointer() [2/2]
- Todo:
- : can be implemented when needed, note that the offset must be recomputed during the move/copy
◆ operator T*()
converts the AtomicRelocatablePointer to a pointer of type of the underlying object
- Returns
- a pointer of type T pointing to the underlying object
◆ operator*()
dereferencing operator which returns a reference to the pointee
- Returns
- a reference to the pointee
◆ operator->()
access to the underlying object in shared memory
- Returns
- a pointer to the underlying object
◆ operator=()
assign AtomicRelocatablePointer to point to the same pointee as ptr
- Note
- minimal set of required operators, can be extended later
- Parameters
-
[in] | ptr | the pointer whose pointee shall be the same for this |
- Returns
- reference to self
The documentation for this class was generated from the following files: