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 478 of file vspace.h.

Constructor & Destructor Documentation

◆ VRef() [1/3]

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

Definition at line 481 of file vspace.h.

481 : vaddr(vaddr) {
482 }
internals::vaddr_t vaddr
Definition: vspace.h:480

◆ VRef() [2/3]

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

Definition at line 485 of file vspace.h.

486 }
const vaddr_t VADDR_NULL
Definition: vspace.h:84

◆ VRef() [3/3]

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

Definition at line 505 of file vspace.h.

505 {
507 }
static vaddr_t allocated_ptr_to_vaddr(void *ptr)
Definition: vspace.h:362

Member Function Documentation

◆ alloc()

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

Definition at line 522 of file vspace.h.

522 {
523 return VRef<void>(internals::vmem_alloc(n));
524 }
vaddr_t vmem_alloc(size_t size)
Definition: vspace.cc:243

◆ as_ptr()

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

Definition at line 511 of file vspace.h.

511 {
512 return (void *) to_ptr();
513 }
void * to_ptr() const
Definition: vspace.h:508

◆ cast()

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

Definition at line 519 of file vspace.h.

519 {
521 }
static VRef< T > from_vaddr(internals::vaddr_t vaddr)
Definition: vspace.h:420

◆ free()

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

Definition at line 525 of file vspace.h.

525 {
528 }
void vmem_free(vaddr_t vaddr)
Definition: vspace.cc:195

◆ from_vaddr()

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

Definition at line 487 of file vspace.h.

487 {
488 return VRef(vaddr);
489 }

◆ is_null()

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

Definition at line 502 of file vspace.h.

502 {
504 }

◆ offset()

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

Definition at line 490 of file vspace.h.

490 {
491 return vaddr;
492 }

◆ operator bool()

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

Definition at line 493 of file vspace.h.

493 {
495 }

◆ operator!=()

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

Definition at line 499 of file vspace.h.

499 {
500 return vaddr != other.vaddr;
501 }

◆ operator=()

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

Definition at line 514 of file vspace.h.

514 {
515 vaddr = other.vaddr;
516 return *this;
517 }

◆ operator==()

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

Definition at line 496 of file vspace.h.

496 {
497 return vaddr == other.vaddr;
498 }

◆ to_ptr()

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

Definition at line 508 of file vspace.h.

508 {
510 }
static VMem & vmem
Definition: vspace.h:300
void * to_ptr(vaddr_t vaddr)
Definition: vspace.h:285

Field Documentation

◆ vaddr

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

Definition at line 480 of file vspace.h.


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