ReXGlue SDK
Loading...
Searching...
No Matches
rex::kernel::be_ptr< T > Struct Template Reference

#include <rex/kernel/types/memory.h>

Public Member Functions

 operator u32 () const
u32 GetAddress () const
 operator bool () const
T * GetHost () const
T * TryGetHost () const
T * GetHost (const rex::kernel::MemoryView &view) const
T * TryGetHost (const rex::kernel::MemoryView &view) const
T * operator-> () const
be_ptr & operator= (u32 v)
template<typename P>
requires (detail::kIsHostPointerFor<P, T>)
be_ptr & operator= (P host_pointer)

Public Attributes

be_u32 value

Detailed Description

template<typename T>
struct rex::kernel::be_ptr< T >

Typed guest pointer that resolves to a host pointer.

Member Function Documentation

◆ GetAddress()

template<typename T>
u32 rex::kernel::be_ptr< T >::GetAddress ( ) const
inline
Returns
The guest address, 0 for a null pointer.

◆ GetHost() [1/2]

template<typename T>
T * rex::kernel::be_ptr< T >::GetHost ( ) const
inline

Resolves the pointer through the guest memory of the calling thread.

Returns
The host pointer, null when the guest address is 0.

◆ GetHost() [2/2]

template<typename T>
T * rex::kernel::be_ptr< T >::GetHost ( const rex::kernel::MemoryView & view) const
inline

Resolves the pointer through a memory view, for a host thread with no bound runtime.

Returns
The host pointer, null when the guest address is 0.

◆ operator=()

template<typename T>
template<typename P>
requires (detail::kIsHostPointerFor<P, T>)
be_ptr & rex::kernel::be_ptr< T >::operator= ( P host_pointer)
inline

Sets the pointer to a host pointer into the guest memory of the calling thread.

Template Parameters
PThe host pointer type, convertible to const T*, or std::nullptr_t.
Parameters
host_pointerThe host pointer, null for a null pointer.

◆ TryGetHost() [1/2]

template<typename T>
T * rex::kernel::be_ptr< T >::TryGetHost ( ) const
inline

Resolves the pointer through the guest memory of the calling thread only when the title could read it.

Returns
The host pointer, null when the address is 0, is misaligned for T, is in no heap, has an unreadable page, or the calling thread has no runtime.

◆ TryGetHost() [2/2]

template<typename T>
T * rex::kernel::be_ptr< T >::TryGetHost ( const rex::kernel::MemoryView & view) const
inline

Resolves the pointer through a memory view only when the title could read it, for a host thread with no bound runtime.

Returns
The host pointer, null when the address is 0, is misaligned for T, is in no heap, or has an unreadable page.

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