My Project
Loading...
Searching...
No Matches
vspace::VRef< void > Struct Reference

#include <vspace.h>

Public Member Functions

 VRef ()
size_t offset () const
 operator bool () const
bool operator== (VRef< void > other)
bool operator!= (VRef< void > other)
bool is_null ()
 VRef (void *ptr)
void * to_ptr () const
void * as_ptr () const
VRef< void > & operator= (VRef< void > other)
template<typename U>
VRef< U > cast ()
void free ()
void & as_ref () const
void & operator* () const
void * operator-> ()
void & operator[] (size_t index)

Static Public Member Functions

static VRef< void > from_vaddr (internals::vaddr_t vaddr)
static VRef< void > alloc (size_t n=1)

Private Member Functions

 VRef (internals::vaddr_t vaddr)

Private Attributes

internals::vaddr_t vaddr

Detailed Description

Definition at line 1813 of file vspace.h.

Constructor & Destructor Documentation

◆ VRef() [1/3]

vspace::VRef< void >::VRef ( internals::vaddr_t vaddr)
inlineprivate

Definition at line 1816 of file vspace.h.

1816 : vaddr(vaddr) {
1817 }
internals::vaddr_t vaddr
Definition vspace.h:1815

◆ VRef() [2/3]

vspace::VRef< void >::VRef ( )
inline

Definition at line 1820 of file vspace.h.

◆ VRef() [3/3]

vspace::VRef< void >::VRef ( void * ptr)
inline

Definition at line 1840 of file vspace.h.

1840 {
1842 }
static vaddr_t allocated_ptr_to_vaddr(void *ptr)
Definition vspace.h:1697

Member Function Documentation

◆ alloc()

VRef< void > vspace::VRef< void >::alloc ( size_t n = 1)
inlinestatic

Definition at line 1857 of file vspace.h.

1857 {
1859 }

◆ as_ptr()

void * vspace::VRef< void >::as_ptr ( ) const
inline

Definition at line 1846 of file vspace.h.

1846 {
1847 return (void *) to_ptr();
1848 }
void * to_ptr() const
Definition vspace.h:1843

◆ as_ref()

void & vspace::VRef< void >::as_ref ( ) const
inline

Definition at line 1782 of file vspace.h.

1782 {
1783 return *(T *) to_ptr();
1784 }

◆ cast()

template<typename U>
VRef< U > vspace::VRef< void >::cast ( )
inline

Definition at line 1854 of file vspace.h.

1854 {
1855 return VRef<U>::from_vaddr(vaddr);
1856 }
static VRef< T > from_vaddr(internals::vaddr_t vaddr)
Definition vspace.h:1755

◆ free()

void vspace::VRef< void >::free ( )
inline

Definition at line 1860 of file vspace.h.

1860 {
1863 }
void vmem_free(vaddr_t vaddr)
Definition vspace.cc:802

◆ from_vaddr()

VRef< void > vspace::VRef< void >::from_vaddr ( internals::vaddr_t vaddr)
inlinestatic

Definition at line 1822 of file vspace.h.

1822 {
1823 return VRef(vaddr);
1824 }

◆ is_null()

bool vspace::VRef< void >::is_null ( )
inline

Definition at line 1837 of file vspace.h.

1837 {
1838 return vaddr == internals::VADDR_NULL;
1839 }

◆ offset()

size_t vspace::VRef< void >::offset ( ) const
inline

Definition at line 1825 of file vspace.h.

1825 {
1826 return vaddr;
1827 }

◆ operator bool()

vspace::VRef< void >::operator bool ( ) const
inline

Definition at line 1828 of file vspace.h.

1828 {
1829 return vaddr != internals::VADDR_NULL;
1830 }

◆ operator!=()

bool vspace::VRef< void >::operator!= ( VRef< void > other)
inline

Definition at line 1834 of file vspace.h.

1834 {
1835 return vaddr != other.vaddr;
1836 }
internals::vaddr_t vaddr
Definition vspace.h:1749

◆ operator*()

void & vspace::VRef< void >::operator* ( ) const
inline

Definition at line 1785 of file vspace.h.

1785 {
1786 return *(T *) to_ptr();
1787 }

◆ operator->()

void * vspace::VRef< void >::operator-> ( )
inline

Definition at line 1788 of file vspace.h.

1788 {
1789 return (T *) to_ptr();
1790 }

◆ operator=()

VRef< void > & vspace::VRef< void >::operator= ( VRef< void > other)
inline

Definition at line 1849 of file vspace.h.

1849 {
1850 vaddr = other.vaddr;
1851 return *this;
1852 }

◆ operator==()

bool vspace::VRef< void >::operator== ( VRef< void > other)
inline

Definition at line 1831 of file vspace.h.

1831 {
1832 return vaddr == other.vaddr;
1833 }

◆ operator[]()

void & vspace::VRef< void >::operator[] ( size_t index)
inline

Definition at line 1795 of file vspace.h.

1795 {
1796 return as_ptr()[index];
1797 }
void * as_ptr() const
Definition vspace.h:1846

◆ to_ptr()

void * vspace::VRef< void >::to_ptr ( ) const
inline

Definition at line 1843 of file vspace.h.

1843 {
1845 }
void * to_ptr() const
Definition vspace.h:1776

Field Documentation

◆ vaddr

internals::vaddr_t vspace::VRef< void >::vaddr
private

Definition at line 1815 of file vspace.h.


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