xentara-plugin v1.2.1
The Xentara Plugin Framework
|
A handle to a single C++ value object located in a memory resource. More...
#include <memory/ObjectHandle.hpp>
Public Types | |
using | TargetObject = memory::Object< Type > |
The object type describing the structure. | |
using | Element = typename TargetObject::Element |
The C++ object type. | |
Public Member Functions | |
MemoryHandle () noexcept=default | |
Default constructor. | |
MemoryHandle (const RawMemoryHandle &rawHandle) noexcept | |
Creates a handle for an object in a memory block. | |
MemoryHandle (std::nullptr_t) noexcept | |
Conversion from an null pointer. | |
template<typename Base > requires std::derived_from<Type, Base> | |
operator ObjectHandle< Base > () const | |
Gets a handle to an unambiguous base class. | |
auto | operator= (std::nullptr_t) noexcept -> MemoryHandle & |
Assignment operator for a null pointer. | |
auto | operator== (std::nullptr_t) const -> bool |
Comparison operator with a null pointer. | |
operator bool () const noexcept | |
Checks for a null handle. | |
auto | operator== (const MemoryHandle &) const -> bool=default |
Comparison operator. | |
auto | operator<=> (const MemoryHandle &) const -> auto=default |
Comparison operator. | |
auto | memoryResource () const noexcept -> MemoryResource & |
Returns the memory resource that the object resides in. | |
constexpr auto | blockHandle () const noexcept -> const MemoryResource::BlockHandle & |
Returns a a handle to the memory block that holds the object. | |
constexpr auto | rawHandle () const noexcept -> const RawMemoryHandle & |
Returns a handle to the raw memory holding the object. | |
auto | offset () const noexcept -> std::size_t |
Gets the offset of the object within the block data. | |
auto | initializer () const -> Initializer< TargetObject > |
Creates an initializer for additional initialization. | |
template<typename TypeOrBase , typename MemberType > requires std::derived_from<Type, TypeOrBase> | |
auto | member (MemberType TypeOrBase::*member) const noexcept -> ObjectHandle< MemberType > |
Returns a handle to a member. | |
template<std::same_as< Type > BitFieldType = Type> requires utils::tools::UnsignedIntegral<BitFieldType> | |
auto | bits (Type mask) const noexcept -> BitFieldHandle< BitFieldType > |
Returns a handle to a bit field using the object's value. | |
template<std::same_as< Type > BitFieldType = Type> requires utils::tools::UnsignedIntegral<BitFieldType> | |
auto | bit (BitFieldType mask) const noexcept -> BitHandle |
Returns a Boolean handle to single bit in a bit field using the object's value. | |
auto | operator++ () noexcept -> MemoryHandle & |
Increments the handle by a one element. | |
auto | operator++ (int) noexcept -> MemoryHandle |
Increments the handle by a one element. | |
auto | operator-- () noexcept -> MemoryHandle & |
Decrements the handle by a one element. | |
auto | operator-- (int) noexcept -> MemoryHandle |
Decrements the handle by a one element. | |
auto | operator+= (std::ptrdiff_t count) noexcept -> MemoryHandle & |
Offsets the handle by a specific number of elements. | |
auto | operator-= (std::ptrdiff_t count) noexcept -> MemoryHandle & |
Offsets the handle by a specific number of elements. | |
A handle to a single C++ value object located in a memory resource.
Type | The type of the C++ object this handle refers to |
using xentara::memory::MemoryHandle< Object< Type > >::Element = typename TargetObject::Element |
The C++ object type.
using xentara::memory::MemoryHandle< Object< Type > >::TargetObject = memory::Object<Type> |
The object type describing the structure.
|
defaultnoexcept |
Default constructor.
This constructor constructs a null handle
|
noexcept |
Creates a handle for an object in a memory block.
|
noexcept |
Conversion from an null pointer.
This constructor constructs a null handle
|
noexcept |
Returns a Boolean handle to single bit in a bit field using the object's value.
mask | A mask describing the desired bit. Must have exactly one bit set. |
|
noexcept |
Returns a handle to a bit field using the object's value.
mask | A mask describing the relevant bits |
|
constexprnoexcept |
Returns a a handle to the memory block that holds the object.
auto xentara::memory::MemoryHandle< Object< Type > >::initializer | ( | ) | const -> Initializer<TargetObject> |
Creates an initializer for additional initialization.
This function can be used to perform additional initialization of the object from code locations where the original initializer returned when the block was allocated is not available.
|
noexcept |
Returns a handle to a member.
member | The member |
|
noexcept |
Returns the memory resource that the object resides in.
|
noexcept |
Gets the offset of the object within the block data.
|
explicitnoexcept |
Checks for a null handle.
xentara::memory::MemoryHandle< Object< Type > >::operator ObjectHandle< Base > | ( | ) | const |
Gets a handle to an unambiguous base class.
|
noexcept |
Increments the handle by a one element.
|
noexcept |
Increments the handle by a one element.
|
noexcept |
Offsets the handle by a specific number of elements.
count | The number of elements to move the handle |
|
noexcept |
Decrements the handle by a one element.
|
noexcept |
Decrements the handle by a one element.
|
noexcept |
Offsets the handle by a specific number of elements.
count | The negative number of elements to move the handle |
|
default |
Comparison operator.
|
noexcept |
Assignment operator for a null pointer.
|
default |
Comparison operator.
auto xentara::memory::MemoryHandle< Object< Type > >::operator== | ( | std::nullptr_t | ) | const -> bool |
Comparison operator with a null pointer.
|
constexprnoexcept |
Returns a handle to the raw memory holding the object.