My Project
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
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 ()
 

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.

1821  }
const vaddr_t VADDR_NULL
Definition: vspace.h:1417

◆ 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()

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

Definition at line 1857 of file vspace.h.

1857  {
1858  return VRef<void>(internals::vmem_alloc(n));
1859  }
vaddr_t vmem_alloc(size_t size)
Definition: vspace.cc:808

◆ 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

◆ 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:756

◆ from_vaddr()

static 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  }

◆ 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  }

◆ to_ptr()

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

Definition at line 1843 of file vspace.h.

1843  {
1844  return internals::vmem.to_ptr(vaddr);
1845  }
static VMem & vmem
Definition: vspace.h:1635
void * to_ptr(vaddr_t vaddr)
Definition: vspace.h:1620

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: