35#ifndef QORE_REFERENCE_HOLDER_H_
36#define QORE_REFERENCE_HOLDER_H_
51template<
typename T =
class AbstractQoreNode>
90 DLLLOCAL
operator bool()
const {
return p !=
nullptr; }
105 void*
operator new(size_t) =
delete;
117template<
typename T =
class SimpleQoreNode>
132 DLLLOCAL T* operator->() {
return p; }
133 DLLLOCAL T* operator*() {
return p; }
134 DLLLOCAL
const T* operator->()
const {
return p; }
135 DLLLOCAL
const T* operator*()
const {
return p; }
136 DLLLOCAL
void operator=(T* nv) {
141 DLLLOCAL T *release() {
146 DLLLOCAL
operator bool()
const {
return p != 0; }
154 void*
operator new(size_t) =
delete;
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:50
a templated class to manage a reference count of an object that can throw a Qore-language exception w...
Definition: ReferenceHolder.h:52
DLLLOCAL ReferenceHolder(T *p_, ExceptionSink *xsink_)
populates with object with data and the ExceptionSink pointer
Definition: ReferenceHolder.h:58
DLLLOCAL T * operator->()
returns the pointer being managed
Definition: ReferenceHolder.h:64
DLLLOCAL ~ReferenceHolder()
calls deref(ExceptionSink *) on the pointer being managed if not 0
Definition: ReferenceHolder.h:61
DLLLOCAL const T * operator*() const
returns the pointer being managed
Definition: ReferenceHolder.h:73
DLLLOCAL const T * operator->() const
returns the pointer being managed
Definition: ReferenceHolder.h:70
DLLLOCAL T ** getPtrPtr()
returns a pointer to the pointer being managed
Definition: ReferenceHolder.h:93
DLLLOCAL ReferenceHolder(ExceptionSink *xsink_)
creates an empty ReferenceHolder
Definition: ReferenceHolder.h:55
DLLLOCAL T *& getRef()
returns a reference to the ptr being managed
Definition: ReferenceHolder.h:96
DLLLOCAL T * operator*()
returns the pointer being managed
Definition: ReferenceHolder.h:67
DLLLOCAL T * release()
releases the pointer to the caller
Definition: ReferenceHolder.h:83
DLLLOCAL void operator=(T *nv)
assigns a new pointer to the holder, dereferences the current pointer if any
Definition: ReferenceHolder.h:76
manages a reference count of a pointer to a class that takes a simple "deref()" call with no argument...
Definition: ReferenceHolder.h:118
DLLLOCAL SimpleRefHolder(SimpleRefHolder &&old)
move constructor
Definition: ReferenceHolder.h:126