xentara-plugin v1.2.1
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::memory::MemoryHandle< BitField< Type > > Class Template Referencefinal

A handle to a bit field object located in a memory resource. More...

#include <memory/BitFieldHandle.hpp>

Public Types

using TargetBitField = memory::BitField< Type >
 The object type describing the structure.
 
using BaseType = typename TargetBitField::BaseType
 The unsigned integer type that holds the bits.
 

Public Member Functions

 MemoryHandle () noexcept=default
 Default constructor.
 
 MemoryHandle (const ObjectHandle< Type > &baseHandle, Type mask) noexcept
 Creates a handle for bits in an integer referenced by another handle.
 
 MemoryHandle (const RawMemoryHandle &rawHandle, Type mask) noexcept
 Creates a handle for a bit field in a memory block.
 
 MemoryHandle (std::nullptr_t) noexcept
 Conversion from an null pointer.
 
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 data resides in.
 
constexpr auto blockHandle () const noexcept -> const MemoryResource::BlockHandle &
 Returns a a handle to the memory block that holds the data.
 
constexpr auto baseHandle () const noexcept -> const ObjectHandle< Type > &
 Returns a handle to the integer containing the bits.
 
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 base value within the block data.
 
constexpr auto mask () const -> Type
 Gets the mask describing the relevant bits.
 

Detailed Description

template<utils::tools::UnsignedIntegral Type>
class xentara::memory::MemoryHandle< BitField< Type > >

A handle to a bit field object located in a memory resource.

Template Parameters
TypeThe unsigned integer type that holds the bits

Member Typedef Documentation

◆ BaseType

template<utils::tools::UnsignedIntegral Type>
using xentara::memory::MemoryHandle< BitField< Type > >::BaseType = typename TargetBitField::BaseType

The unsigned integer type that holds the bits.

◆ TargetBitField

template<utils::tools::UnsignedIntegral Type>
using xentara::memory::MemoryHandle< BitField< Type > >::TargetBitField = memory::BitField<Type>

The object type describing the structure.

Constructor & Destructor Documentation

◆ MemoryHandle() [1/4]

template<utils::tools::UnsignedIntegral Type>
xentara::memory::MemoryHandle< BitField< Type > >::MemoryHandle ( )
defaultnoexcept

Default constructor.

This constructor constructs a null handle

◆ MemoryHandle() [2/4]

template<utils::tools::UnsignedIntegral Type>
xentara::memory::MemoryHandle< BitField< Type > >::MemoryHandle ( const ObjectHandle< Type > &  baseHandle,
Type  mask 
)
noexcept

Creates a handle for bits in an integer referenced by another handle.

Parameters
baseHandleA handle to the base value
maskA mask describing the relevant bits

◆ MemoryHandle() [3/4]

template<utils::tools::UnsignedIntegral Type>
xentara::memory::MemoryHandle< BitField< Type > >::MemoryHandle ( const RawMemoryHandle< BitField< Type > > &  rawHandle,
Type  mask 
)
noexcept

Creates a handle for a bit field in a memory block.

Parameters
rawHandleA handle to the raw memory containing the base value
maskA mask describing the relevant bits

◆ MemoryHandle() [4/4]

template<utils::tools::UnsignedIntegral Type>
xentara::memory::MemoryHandle< BitField< Type > >::MemoryHandle ( std::nullptr_t  )
noexcept

Conversion from an null pointer.

This constructor constructs a null handle

Member Function Documentation

◆ baseHandle()

template<utils::tools::UnsignedIntegral Type>
constexpr auto xentara::memory::MemoryHandle< BitField< Type > >::baseHandle ( ) const -> const ObjectHandle<Type> &
constexprnoexcept

Returns a handle to the integer containing the bits.

◆ blockHandle()

template<utils::tools::UnsignedIntegral Type>
constexpr auto xentara::memory::MemoryHandle< BitField< Type > >::blockHandle ( ) const -> const MemoryResource::BlockHandle &
constexprnoexcept

Returns a a handle to the memory block that holds the data.

◆ mask()

template<utils::tools::UnsignedIntegral Type>
constexpr auto xentara::memory::MemoryHandle< BitField< Type > >::mask ( ) const -> Type
constexpr

Gets the mask describing the relevant bits.

◆ memoryResource()

template<utils::tools::UnsignedIntegral Type>
auto xentara::memory::MemoryHandle< BitField< Type > >::memoryResource ( ) const -> MemoryResource &
noexcept

Returns the memory resource that the data resides in.

◆ offset()

template<utils::tools::UnsignedIntegral Type>
auto xentara::memory::MemoryHandle< BitField< Type > >::offset ( ) const -> std::size_t
noexcept

Gets the offset of the base value within the block data.

◆ operator bool()

template<utils::tools::UnsignedIntegral Type>
xentara::memory::MemoryHandle< BitField< Type > >::operator bool ( ) const
explicitnoexcept

Checks for a null handle.

◆ operator<=>()

template<utils::tools::UnsignedIntegral Type>
auto xentara::memory::MemoryHandle< BitField< Type > >::operator<=> ( const MemoryHandle< BitField< Type > > &  ) const -> auto=default
default

Comparison operator.

◆ operator=()

template<utils::tools::UnsignedIntegral Type>
auto xentara::memory::MemoryHandle< BitField< Type > >::operator= ( std::nullptr_t  ) -> MemoryHandle &
noexcept

Assignment operator for a null pointer.

◆ operator==() [1/2]

template<utils::tools::UnsignedIntegral Type>
auto xentara::memory::MemoryHandle< BitField< Type > >::operator== ( const MemoryHandle< BitField< Type > > &  ) const -> bool=default
default

Comparison operator.

◆ operator==() [2/2]

template<utils::tools::UnsignedIntegral Type>
auto xentara::memory::MemoryHandle< BitField< Type > >::operator== ( std::nullptr_t  ) const -> bool

Comparison operator with a null pointer.

◆ rawHandle()

template<utils::tools::UnsignedIntegral Type>
constexpr auto xentara::memory::MemoryHandle< BitField< Type > >::rawHandle ( ) const -> const RawMemoryHandle &
constexprnoexcept

Returns a handle to the raw memory holding the object.