MeixnerGC  1.0
gc_base_ptr Class Reference

#include <gc_ptr.h>

Inheritance diagram for gc_base_ptr:

Public Member Functions

 gc_base_ptr (gc_object *c=nullptr)
 
 gc_base_ptr (const gc_base_ptr &o)
 
 gc_base_ptr (gc_base_ptr &&o)
 
void operator= (nullptr_t)
 
void operator= (const gc_base_ptr &o)
 
void operator= (gc_base_ptr &&o)
 
void reset ()
 
 ~gc_base_ptr ()
 

Protected Types

enum  PtrType { ROOT, GC_HEAP }
 

Protected Attributes

enum gc_base_ptr::PtrType type
 
std::atomic< gc_base_ptr * > next
 
std::atomic< gc_object * > object
 

Friends

void gc_collect ()
 

Detailed Description

base class for gc_ptr containing all shared code

Member Enumeration Documentation

enum gc_base_ptr::PtrType
protected

pointer type

Enumerator
ROOT 

pointer belongs to the root set

GC_HEAP 

pointer resides in an allocated object

Constructor & Destructor Documentation

gc_base_ptr::gc_base_ptr ( gc_object c = nullptr)
explicit

constructor

gc_base_ptr::gc_base_ptr ( const gc_base_ptr o)
inline

copy constructor

gc_base_ptr::gc_base_ptr ( gc_base_ptr &&  o)

move constructor

gc_base_ptr::~gc_base_ptr ( )

destructor

Member Function Documentation

void gc_base_ptr::operator= ( nullptr_t  )

assignment operator

void gc_base_ptr::operator= ( const gc_base_ptr o)

assignment operator

void gc_base_ptr::operator= ( gc_base_ptr &&  o)

move assignment operator

void gc_base_ptr::reset ( )

reset to nullptr

Friends And Related Function Documentation

void gc_collect ( )
friend

manually trigger garbage collection. Normally this is not required as the collection starts automatically. It may be useful in low-memory situations to force a garbage collection.

Member Data Documentation

std::atomic<gc_base_ptr *> gc_base_ptr::next
protected

pointer to next gc_ptr within the same allocated object

std::atomic<gc_object *> gc_base_ptr::object
protected

pointer to the object

enum gc_base_ptr::PtrType gc_base_ptr::type
protected

pointer type


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