xentara-plugin v1.2.1
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::memory::Array::Handle Class Referencefinal

#include <memory/Array_Handle.hpp>

Public Member Functions

constexpr Handle () noexcept=default
 Default constructor.
 
auto operator== (const Handle &) const -> bool=default
 Comparison operator.
 
auto operator<=> (const Handle &rhs) const -> auto=default
 Comparison operator.
 
constexpr auto offset () const noexcept -> std::size_t
 Gets the offset within the array data.
 
auto operator++ () noexcept -> Handle &
 Increments the handle by a one byte.
 
auto operator++ (int) noexcept -> Handle
 Increments the handle by a one byte.
 
auto operator-- () noexcept -> Handle &
 Decrements the handle by a one byte.
 
auto operator-- (int) noexcept -> Handle
 Decrements the handle by a one byte.
 
auto operator+= (std::ptrdiff_t offset) noexcept -> Handle &
 Offsets the handle by a specific number of bytes.
 
auto operator-= (std::ptrdiff_t offset) noexcept -> Handle &
 Offsets the handle by a specific number of bytes.
 

Constructor & Destructor Documentation

◆ Handle()

constexpr xentara::memory::Array::Handle::Handle ( )
constexprdefaultnoexcept

Default constructor.

This constructor creates an invalid handle. Do not attempt to use this handle, the associated memory may not be valid.

Member Function Documentation

◆ offset()

constexpr auto xentara::memory::Array::Handle::offset ( ) const -> std::size_t
constexprnoexcept

Gets the offset within the array data.

◆ operator++() [1/2]

auto xentara::memory::Array::Handle::operator++ ( ) -> Handle &
noexcept

Increments the handle by a one byte.

Attention
This can make the handle point to invalid data. It is your respoinsibility to ensure that the handle does not end up pointing outside of the array's data.
Returns
Returns a reference to this object

◆ operator++() [2/2]

auto xentara::memory::Array::Handle::operator++ ( int  ) -> Handle
noexcept

Increments the handle by a one byte.

Attention
This can make the handle point to invalid data. It is your respoinsibility to ensure that the handle does not end up pointing outside of the array's data.
Returns
The old value of the handle

◆ operator+=()

auto xentara::memory::Array::Handle::operator+= ( std::ptrdiff_t  offset) -> Handle &
noexcept

Offsets the handle by a specific number of bytes.

Attention
This can make the handle point to invalid data. It is your respoinsibility to ensure that the handle does not end up pointing outside of the array's data.
Parameters
offsetThe number of bytes to move the handle
Returns
Returns a reference to this object

◆ operator--() [1/2]

auto xentara::memory::Array::Handle::operator-- ( ) -> Handle &
noexcept

Decrements the handle by a one byte.

Attention
This can make the handle point to invalid data. It is your respoinsibility to ensure that the handle does not end up pointing outside of the array's data.
Returns
Returns a reference to this object

◆ operator--() [2/2]

auto xentara::memory::Array::Handle::operator-- ( int  ) -> Handle
noexcept

Decrements the handle by a one byte.

Attention
This can make the handle point to invalid data. It is your respoinsibility to ensure that the handle does not end up pointing outside of the array's data.
Returns
The old value of the handle

◆ operator-=()

auto xentara::memory::Array::Handle::operator-= ( std::ptrdiff_t  offset) -> Handle &
noexcept

Offsets the handle by a specific number of bytes.

Attention
This can make the handle point to invalid data. It is your respoinsibility to ensure that the handle does not end up pointing outside of the array's data.
Parameters
offsetThe negative number of bytes to move the handle
Returns
Returns a reference to this object

◆ operator<=>()

auto xentara::memory::Array::Handle::operator<=> ( const Handle rhs) const -> auto=default
default

Comparison operator.

◆ operator==()

auto xentara::memory::Array::Handle::operator== ( const Handle ) const -> bool=default
default

Comparison operator.