iox::rp::RelocatablePointer🔗
typed version so we can use operator-> More...
#include <relocatable_pointer.hpp>
Inherits from iox::rp::BaseRelocatablePointer
Public Functions🔗
Name | |
---|---|
RelocatablePointer() default constructs a logical nullptr |
|
RelocatablePointer(const T * ptr) creates a RelocatablePointer pointing to the same pointee as ptr |
|
RelocatablePointer(const BaseRelocatablePointer & other) creates a RelocatablePointer from a BaseRelocatablePointer |
|
RelocatablePointer(T * rawPtr) creates a RelocatablePointer pointing to the same pointee as rawPtr |
|
RelocatablePointer & | operator=(const BaseRelocatablePointer & other) assign this to point to the same pointee as the BaseRelocatablePointer other |
T & | operator*() dereferencing operator which returns a reference to the pointee |
T * | operator->() access to the underlying object in shared memory |
const T & | operator*() const dereferencing operator which returns a const reference to the pointee |
const T * | operator->() const read-only access to the underlying object in shared memory |
T & | operator[](uint64_t index) returns a reference to the memory location of the underlying object + an offset |
operator T*() const converts the RelocatablePointer to a pointer of the type of the underlying object |
Additional inherited members🔗
Public Types inherited from iox::rp::BaseRelocatablePointer
Name | |
---|---|
using std::ptrdiff_t | offset_t |
Public Functions inherited from iox::rp::BaseRelocatablePointer
Name | |
---|---|
BaseRelocatablePointer() default constructs a logical nullptr |
|
BaseRelocatablePointer(const void * ptr) creates a relocatable pointer pointing to the same pointee as ptr |
|
BaseRelocatablePointer(const BaseRelocatablePointer & other) copy constructor |
|
BaseRelocatablePointer(BaseRelocatablePointer && other) move constructor |
|
operator bool() const checks if this is not a logical nullptr |
|
bool | operator!() const checks if this is a logical nullptr |
const void * | get() const access to the underlying object in shared memory |
offset_t | getOffset() const returns the offset |
Protected Functions inherited from iox::rp::BaseRelocatablePointer
Name | |
---|---|
offset_t | computeOffset(const void * ptr) const |
void * | computeRawPtr() const |
Public Attributes inherited from iox::rp::BaseRelocatablePointer
Name | |
---|---|
constexpr offset_t | NULL_POINTER_OFFSET |
Protected Attributes inherited from iox::rp::BaseRelocatablePointer
Name | |
---|---|
offset_t | m_offset |
Detailed Description🔗
template <typename T >
class iox::rp::RelocatablePointer;
typed version so we can use operator->
Public Functions Documentation🔗
function RelocatablePointer🔗
inline RelocatablePointer()
default constructs a logical nullptr
function RelocatablePointer🔗
inline RelocatablePointer(
const T * ptr
)
creates a RelocatablePointer pointing to the same pointee as ptr
Parameters:
- ptr the pointer whose pointee shall be the same for this
function RelocatablePointer🔗
inline RelocatablePointer(
const BaseRelocatablePointer & other
)
creates a RelocatablePointer from a BaseRelocatablePointer
Parameters:
- other is the BaseRelocatablePointer
function RelocatablePointer🔗
inline RelocatablePointer(
T * rawPtr
)
creates a RelocatablePointer pointing to the same pointee as rawPtr
Parameters:
- rawPtr the pointer whose pointee shall be the same for this
function operator=🔗
inline RelocatablePointer & operator=(
const BaseRelocatablePointer & other
)
assign this to point to the same pointee as the BaseRelocatablePointer other
Parameters:
- other the pointer whose pointee shall be the same for this
Return: reference to self
function operator*🔗
inline T & operator*()
dereferencing operator which returns a reference to the pointee
Return: a reference to the pointee
function operator->🔗
inline T * operator->()
access to the underlying object in shared memory
Return: a pointer to the underlying object
function operator*🔗
const T & operator*() const
dereferencing operator which returns a const reference to the pointee
Return: a const reference to the pointee
function operator->🔗
const T * operator->() const
read-only access to the underlying object in shared memory
Return: a const pointer to the underlying object
function operator[]🔗
inline T & operator[](
uint64_t index
)
returns a reference to the memory location of the underlying object + an offset
Parameters:
- index is the offset
Return: a reference to the memory location of the underlying object + an offset
function operator T*🔗
inline operator T*() const
converts the RelocatablePointer to a pointer of the type of the underlying object
Return: a pointer of type T pointing to the underlying object
Updated on 31 May 2022 at 15:29:15 CEST