Chombo + EB
3.0
|
A reference-counting handle class. More...
#include <RefCountedPtr.H>
Public Member Functions | |
RefCountedPtr (T *ptr=0) | |
RefCountedPtr (const RefCountedPtr< T > &other) | |
~RefCountedPtr () | |
const RefCountedPtr< T > & | operator= (const RefCountedPtr< T > &rhs) |
assignement operator. copies pointer member More... | |
T * | operator-> () |
dereference access operator. use like a pointer derefence access function. More... | |
const T * | operator-> () const |
bool | isNull () const |
T & | operator* () |
pointer dereference. More... | |
const T & | operator* () const |
operator const T * () const | |
auto conversion to regular const pointer where required. More... | |
bool | isNonUnique () const |
true when refcount is one. More... | |
int | refCount () const |
void | swap (RefCountedPtr< T > &b) |
template<class T2 > | |
operator RefCountedPtr< T2 > () | |
Template Conversion. More... | |
void | neverDelete () |
void | increment () |
void | decrement () |
Static Public Member Functions | |
static const std::string & | name () |
Protected Attributes | |
T * | ptr_ |
int * | refCount_ |
Static Protected Attributes | |
static std::string | name_ |
static BArena | s_Arena |
static int | size_ = sizeof(T)+2*sizeof(int) |
Friends | |
template<class T2 > | |
class | RefCountedPtr |
A reference-counting handle class.
This is to be used as a pointer to class T. This will feel and smell just like a built-in pointer except:
This class is completely inlined.
typical usage:
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
assignement operator. copies pointer member
copies pointer member and integer pointer, decreases refcount of rhs member before assignment. this refcount increased my one.
|
inline |
dereference access operator. use like a pointer derefence access function.
|
inline |
|
inline |
Referenced by Scheduler::PeriodicFunctionLessThan::operator()().
|
inline |
pointer dereference.
|
inline |
|
inline |
auto conversion to regular const pointer where required.
|
inline |
true when refcount is one.
|
inline |
|
inline |
Template Conversion.
provides a mechanism for the compiler to generate a conversion to a base class, like a real pointer would have
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
protected |
Referenced by RefCountedPtr< DataFactory< NodeFArrayBox > >::isNull(), RefCountedPtr< ViscousBaseEBBC >::operator const ViscousBaseEBBC *(), RefCountedPtr< DataFactory< NodeFArrayBox > >::operator RefCountedPtr< T2 >(), RefCountedPtr< DataFactory< NodeFArrayBox > >::operator*(), RefCountedPtr< DataFactory< NodeFArrayBox > >::operator->(), RefCountedPtr< DataFactory< NodeFArrayBox > >::operator=(), RefCountedPtr< DataFactory< NodeFArrayBox > >::RefCountedPtr(), RefCountedPtr< DataFactory< NodeFArrayBox > >::swap(), and RefCountedPtr< DataFactory< NodeFArrayBox > >::~RefCountedPtr().
|
protected |
Referenced by RefCountedPtr< DataFactory< NodeFArrayBox > >::decrement(), RefCountedPtr< DataFactory< NodeFArrayBox > >::increment(), RefCountedPtr< DataFactory< NodeFArrayBox > >::isNonUnique(), RefCountedPtr< DataFactory< NodeFArrayBox > >::neverDelete(), RefCountedPtr< DataFactory< NodeFArrayBox > >::operator RefCountedPtr< T2 >(), RefCountedPtr< DataFactory< NodeFArrayBox > >::operator=(), RefCountedPtr< DataFactory< NodeFArrayBox > >::refCount(), RefCountedPtr< DataFactory< NodeFArrayBox > >::RefCountedPtr(), RefCountedPtr< DataFactory< NodeFArrayBox > >::swap(), and RefCountedPtr< DataFactory< NodeFArrayBox > >::~RefCountedPtr().
|
staticprotected |
Referenced by RefCountedPtr< DataFactory< NodeFArrayBox > >::name().
|
staticprotected |
|
staticprotected |
Referenced by RefCountedPtr< DataFactory< NodeFArrayBox > >::increment().