Template Class RelativePointer
Defined in File relative_pointer.hpp
Inheritance Relationships
Base Type
public iox::rp::BaseRelativePointer(Class BaseRelativePointer)
Class Documentation
-
template<typename T>
class RelativePointer : public iox::rp::BaseRelativePointer typed version so we can use operator->
Public Functions
-
RelativePointer() noexcept = default
default constructs a RelativePointer as a logical nullptr
-
RelativePointer(ptr_t ptr, id_t id) noexcept
constructs a RelativePointer pointing to the same pointee as ptr in a segment identified by id
- Parameters:
ptr – [in] the pointer whose pointee shall be the same for this
id – [in] is the unique id of the segment
-
RelativePointer(offset_t offset, id_t id) noexcept
constructs a RelativePointer from a given offset and segment id
- Parameters:
offset – [in] is the offset
id – [in] is the unique id of the segment
-
RelativePointer(ptr_t ptr) noexcept
constructs a RelativePointer pointing to the same pointee as ptr
- Parameters:
ptr – [in] the pointer whose pointee shall be the same for this
-
RelativePointer &operator=(ptr_t ptr) noexcept
assigns the RelativePointer to point to the same pointee as ptr
- Parameters:
ptr – [in] the pointer whose pointee shall be the same for this
- Returns:
reference to self
-
template<typename U = T>
std::enable_if<!std::is_void<U>::value, U&>::type operator*() noexcept dereferencing operator which returns a reference to the underlying object
- Template Parameters:
U – a template parameter to enable the dereferencing operator only for non-void T
- Returns:
a reference to the underlying object
-
T *operator->() noexcept
access to the underlying object
- Returns:
a pointer to the underlying object
-
template<typename U = T>
std::enable_if<!std::is_void<U>::value, const U&>::type operator*() const noexcept dereferencing operator which returns a const reference to the underlying object
- Template Parameters:
U – a template parameter to enable the dereferencing operator only for non-void T
- Returns:
a const reference to the underlying object
-
T *operator->() const noexcept
read-only access to the underlying object
- Returns:
a const pointer to the underlying object
-
operator T*() const noexcept
converts the RelativePointer to a pointer of the type of the underlying object
- Returns:
a pointer of type T pointing to the underlying object
-
RelativePointer() noexcept = default