iceoryx_doc  1.0.1
Public Member Functions | List of all members
iox::rp::RelocatablePointer< T > Class Template Reference

typed version so we can use operator-> More...

#include <relocatable_pointer.hpp>

Inheritance diagram for iox::rp::RelocatablePointer< T >:
Inheritance graph
[legend]
Collaboration diagram for iox::rp::RelocatablePointer< T >:
Collaboration graph
[legend]

Public Member Functions

 RelocatablePointer () noexcept
 default constructs a logical nullptr
 
 RelocatablePointer (const T *ptr) noexcept
 creates a RelocatablePointer pointing to the same pointee as ptr More...
 
 RelocatablePointer (const BaseRelocatablePointer &other) noexcept
 creates a RelocatablePointer from a BaseRelocatablePointer More...
 
 RelocatablePointer (T *rawPtr) noexcept
 creates a RelocatablePointer pointing to the same pointee as rawPtr More...
 
RelocatablePointeroperator= (const BaseRelocatablePointer &other) noexcept
 assign this to point to the same pointee as the BaseRelocatablePointer other More...
 
T & operator* () noexcept
 dereferencing operator which returns a reference to the pointee More...
 
T * operator-> () noexcept
 access to the underlying object in shared memory More...
 
const T & operator* () const noexcept
 dereferencing operator which returns a const reference to the pointee More...
 
const T * operator-> () const noexcept
 read-only access to the underlying object in shared memory More...
 
T & operator[] (uint64_t index) noexcept
 returns a reference to the memory location of the underlying object + an offset More...
 
 operator T* () const noexcept
 converts the RelocatablePointer to a pointer of the type of the underlying object More...
 
- Public Member Functions inherited from iox::rp::BaseRelocatablePointer
 BaseRelocatablePointer () noexcept
 default constructs a logical nullptr
 
 BaseRelocatablePointer (const void *ptr) noexcept
 creates a relocatable pointer pointing to the same pointee as ptr More...
 
 BaseRelocatablePointer (const BaseRelocatablePointer &other) noexcept
 copy constructor More...
 
 BaseRelocatablePointer (BaseRelocatablePointer &&other) noexcept
 move constructor More...
 
BaseRelocatablePointeroperator= (const BaseRelocatablePointer &other) noexcept
 copy assignment More...
 
BaseRelocatablePointeroperator= (const void *rawPtr) noexcept
 assign BaseRelocatablePointer to point to the same pointee as rawPtr More...
 
BaseRelocatablePointeroperator= (BaseRelocatablePointer &&other) noexcept
 move assignment More...
 
const void * operator* () const noexcept
 read-only access to the underlying object in shared memory More...
 
 operator bool () const noexcept
 checks if this is not a logical nullptr More...
 
bool operator! () const noexcept
 checks if this is a logical nullptr More...
 
const void * get () const noexcept
 access to the underlying object in shared memory More...
 
offset_t getOffset () const noexcept
 returns the offset More...
 

Additional Inherited Members

- Public Types inherited from iox::rp::BaseRelocatablePointer
using offset_t = std::ptrdiff_t
 
- Static Public Attributes inherited from iox::rp::BaseRelocatablePointer
static constexpr offset_t NULL_POINTER_OFFSET = std::numeric_limits<offset_t>::max()
 
- Protected Member Functions inherited from iox::rp::BaseRelocatablePointer
offset_t computeOffset (const void *ptr) const noexcept
 
void * computeRawPtr () const noexcept
 
- Protected Attributes inherited from iox::rp::BaseRelocatablePointer
offset_t m_offset {NULL_POINTER_OFFSET}
 

Detailed Description

template<typename T>
class iox::rp::RelocatablePointer< T >

typed version so we can use operator->

Constructor & Destructor Documentation

◆ RelocatablePointer() [1/3]

template<typename T >
iox::rp::RelocatablePointer< T >::RelocatablePointer ( const T *  ptr)
inlinenoexcept

creates a RelocatablePointer pointing to the same pointee as ptr

Parameters
[in]ptrthe pointer whose pointee shall be the same for this

◆ RelocatablePointer() [2/3]

template<typename T >
iox::rp::RelocatablePointer< T >::RelocatablePointer ( const BaseRelocatablePointer< T > &  other)
inlinenoexcept

creates a RelocatablePointer from a BaseRelocatablePointer

Parameters
[in]otheris the BaseRelocatablePointer

◆ RelocatablePointer() [3/3]

template<typename T >
iox::rp::RelocatablePointer< T >::RelocatablePointer ( T *  rawPtr)
inlinenoexcept

creates a RelocatablePointer pointing to the same pointee as rawPtr

Parameters
[in]rawPtrthe pointer whose pointee shall be the same for this

Member Function Documentation

◆ operator T*()

template<typename T >
iox::rp::RelocatablePointer< T >::operator T*
inlinenoexcept

converts the RelocatablePointer to a pointer of the type of the underlying object

Returns
a pointer of type T pointing to the underlying object

◆ operator*() [1/2]

template<typename T >
const T & iox::rp::RelocatablePointer< T >::operator*
inlinenoexcept

dereferencing operator which returns a const reference to the pointee

Returns
a const reference to the pointee

◆ operator*() [2/2]

template<typename T >
T & iox::rp::RelocatablePointer< T >::operator*
inlinenoexcept

dereferencing operator which returns a reference to the pointee

Returns
a reference to the pointee

◆ operator->() [1/2]

template<typename T >
const T * iox::rp::RelocatablePointer< T >::operator->
inlinenoexcept

read-only access to the underlying object in shared memory

Returns
a const pointer to the underlying object

◆ operator->() [2/2]

template<typename T >
T * iox::rp::RelocatablePointer< T >::operator->
inlinenoexcept

access to the underlying object in shared memory

Returns
a pointer to the underlying object

◆ operator=()

template<typename T >
RelocatablePointer< T > & iox::rp::RelocatablePointer< T >::operator= ( const BaseRelocatablePointer< T > &  other)
inlinenoexcept

assign this to point to the same pointee as the BaseRelocatablePointer other

Parameters
[in]otherthe pointer whose pointee shall be the same for this
Returns
reference to self

◆ operator[]()

template<typename T >
T & iox::rp::RelocatablePointer< T >::operator[] ( uint64_t  index)
inlinenoexcept

returns a reference to the memory location of the underlying object + an offset

Parameters
[in]indexis the offset
Returns
a reference to the memory location of the underlying object + an offset

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