Basic offset pointer class template. More...
#include <eagine/memory/offset_ptr.hpp>
Public Types | |
using | address = basic_address< std::is_const_v< Pointee > > |
The non-const address types. | |
using | const_address = basic_address< true > |
The const address types. | |
using | offset_type = OffsetType |
The offset type. | |
using | pointer = Pointee * |
The non-const pointer type. | |
using | const_pointer = std::add_const_t< Pointee > * |
The const pointer type. | |
using | reference = Pointee & |
The non-const reference type. | |
using | const_reference = std::add_const_t< Pointee > & |
The const reference type. | |
template<typename P , typename O > | |
using | enable_if_convertible = std::enable_if< std::is_convertible_v< O, OffsetType > &&std::is_convertible_v< P *, Pointee * > > |
Enabled if basic_offset_ptr<P, O> is compatible with this. | |
Public Member Functions | |
constexpr | basic_offset_ptr () noexcept=default |
Default constructor. More... | |
constexpr | basic_offset_ptr (offset_type offs) noexcept |
Construction from a byte offset. | |
constexpr | basic_offset_ptr (address addr) noexcept |
Construction from a memory address. | |
basic_offset_ptr (Pointee *ptr) noexcept | |
Construction from a pointer. | |
basic_offset_ptr (const basic_offset_ptr &that) noexcept | |
Copy constructor. | |
basic_offset_ptr (basic_offset_ptr &&that) noexcept | |
Move constructor. | |
template<typename P , typename O , typename = enable_if_convertible<P, O>, typename = enable_if_different<P, O>> | |
basic_offset_ptr (const basic_offset_ptr< P, O > &that) noexcept | |
Conversion copy constructor. | |
auto | operator= (const basic_offset_ptr &that) noexcept -> basic_offset_ptr & |
Copy assignment operator. | |
auto | operator= (basic_offset_ptr &&that) noexcept -> basic_offset_ptr & |
Move assignment operator. | |
auto | reset (Pointee *ptr) noexcept -> auto & |
Point this pointer to another pointee. | |
auto | reset (address adr) noexcept -> auto & |
Point this pointer to another address. | |
constexpr auto | is_null () const noexcept -> bool |
Indicates that the pointer is null. | |
constexpr | operator bool () const noexcept |
Indicates that the pointer is not null. More... | |
constexpr auto | offset () const noexcept -> offset_type |
Returns the byte offset value. | |
auto | addr () noexcept -> address |
Returns the pointed-to address. | |
constexpr auto | addr () const noexcept -> const_address |
Returns the pointed-to address. | |
auto | data () noexcept -> pointer |
Returns the stored pointer. | |
constexpr auto | data () const noexcept -> const_pointer |
Returns the stored pointer. | |
auto | get () noexcept -> pointer |
Returns the stored pointer. Alias for data(). More... | |
constexpr auto | get () const noexcept -> const_pointer |
Returns the stored pointer. Alias for data(). More... | |
operator pointer () noexcept | |
Implicit conversion to pointer type. More... | |
constexpr | operator const_pointer () const noexcept |
Implicit conversion to const pointer type. More... | |
auto | operator* () noexcept -> reference |
Dereferences this pointer. | |
constexpr auto | operator* () const noexcept -> const_reference |
Dereferences this pointer. | |
auto | operator-> () noexcept -> pointer |
Dereferences this pointer. | |
constexpr auto | operator-> () const noexcept -> const_pointer |
Dereferences this pointer. | |
auto | operator++ () noexcept -> auto & |
Pointer arithmentic increment. | |
auto | operator-- () noexcept -> auto & |
Pointer arithmentic decrement. | |
auto | operator[] (offset_type index) noexcept -> reference |
Pointer array subscript operator. | |
constexpr auto | operator[] (offset_type index) const noexcept -> const_reference |
Pointer array subscript operator. | |
Basic offset pointer class template.
|
constexprdefaultnoexcept |
Default constructor.
Referenced by eagine::memory::basic_offset_ptr< const shader_source_header >::operator++(), eagine::memory::basic_offset_ptr< const shader_source_header >::operator--(), and eagine::memory::basic_offset_ptr< const shader_source_header >::reset().
|
inlineconstexprnoexcept |
|
inlinenoexcept |
Returns the stored pointer. Alias for data().
Referenced by eagine::memory::basic_offset_ptr< const shader_source_header >::operator const_pointer(), eagine::memory::basic_offset_ptr< const shader_source_header >::operator pointer(), eagine::memory::basic_offset_ptr< const shader_source_header >::operator++(), and eagine::memory::basic_offset_ptr< const shader_source_header >::operator--().
|
inlineexplicitconstexprnoexcept |
Indicates that the pointer is not null.
|
inlineconstexprnoexcept |
Implicit conversion to const pointer type.
|
inlinenoexcept |
Implicit conversion to pointer type.