OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::memory::basic_offset_ptr< Pointee, OffsetType > Class Template Reference

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.
 

Detailed Description

template<typename Pointee, typename OffsetType>
class eagine::memory::basic_offset_ptr< Pointee, OffsetType >

Basic offset pointer class template.

Constructor & Destructor Documentation

◆ basic_offset_ptr()

template<typename Pointee , typename OffsetType >
constexpr eagine::memory::basic_offset_ptr< Pointee, OffsetType >::basic_offset_ptr ( )
constexprdefaultnoexcept

Member Function Documentation

◆ get() [1/2]

template<typename Pointee , typename OffsetType >
constexpr auto eagine::memory::basic_offset_ptr< Pointee, OffsetType >::get ( ) const -> const_pointer
inlineconstexprnoexcept

Returns the stored pointer. Alias for data().

See also
data

◆ get() [2/2]

◆ operator bool()

template<typename Pointee , typename OffsetType >
constexpr eagine::memory::basic_offset_ptr< Pointee, OffsetType >::operator bool ( ) const
inlineexplicitconstexprnoexcept

Indicates that the pointer is not null.

See also
is_null

◆ operator const_pointer()

template<typename Pointee , typename OffsetType >
constexpr eagine::memory::basic_offset_ptr< Pointee, OffsetType >::operator const_pointer ( ) const
inlineconstexprnoexcept

Implicit conversion to const pointer type.

See also
get

◆ operator pointer()

template<typename Pointee , typename OffsetType >
eagine::memory::basic_offset_ptr< Pointee, OffsetType >::operator pointer ( )
inlinenoexcept

Implicit conversion to pointer type.

See also
get

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

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).