24 #ifndef _QORE_QORENODEEVALOPTIONALREFHOLDER_H
26 #define _QORE_QORENODEEVALOPTIONALREFHOLDER_H
43 DLLLOCAL
void discard_intern() {
44 if (needs_deref && val)
52 DLLLOCAL QoreNodeEvalOptionalRefHolder& operator=(
const QoreNodeEvalOptionalRefHolder&);
57 DLLLOCAL
void *
operator new(size_t);
67 val = exp->
eval(needs_deref, xsink);
89 needs_deref = n_needs_deref;
109 DLLLOCAL
operator bool()
const {
return val != 0; }
112 DLLLOCAL
bool isTemp()
const {
return needs_deref; }
DLLLOCAL void assign(bool n_needs_deref, AbstractQoreNode *n_val)
assigns a new value to this holder object
Definition: QoreNodeEvalOptionalRefHolder.h:87
DLLLOCAL const AbstractQoreNode * operator*() const
returns the object being managed
Definition: QoreNodeEvalOptionalRefHolder.h:106
DLLEXPORT AbstractQoreNode * eval(ExceptionSink *xsink) const
evaluates the object and returns a value (or 0)
DLLLOCAL void discard()
discards any temporary value evaluated by the constructor or assigned by "assign()" ...
Definition: QoreNodeEvalOptionalRefHolder.h:80
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:47
DLLLOCAL QoreNodeEvalOptionalRefHolder(ExceptionSink *n_xsink)
constructor used to create a holder object
Definition: QoreNodeEvalOptionalRefHolder.h:61
DLLEXPORT void ref() const
increments the reference count
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:35
DLLEXPORT void deref(ExceptionSink *xsink)
decrements the reference count and calls derefImpl() if there_can_be_only_one is false, otherwise does nothing
DLLLOCAL const AbstractQoreNode * operator->() const
returns the object being managed
Definition: QoreNodeEvalOptionalRefHolder.h:103
DLLLOCAL QoreNodeEvalOptionalRefHolder(const AbstractQoreNode *exp, ExceptionSink *n_xsink)
constructor with a value that will call the class' eval(needs_deref) method
Definition: QoreNodeEvalOptionalRefHolder.h:65
DLLLOCAL AbstractQoreNode * getReferencedValue()
returns a referenced value - the caller will own the reference
Definition: QoreNodeEvalOptionalRefHolder.h:94
DLLLOCAL ~QoreNodeEvalOptionalRefHolder()
discards any temporary value evaluated by the constructor or assigned by "assign()" ...
Definition: QoreNodeEvalOptionalRefHolder.h:75
this class manages reference counts for the optional evaluation of AbstractQoreNode objects ...
Definition: QoreNodeEvalOptionalRefHolder.h:37
DLLLOCAL bool isTemp() const
returns true if the value is temporary (needs dereferencing)
Definition: QoreNodeEvalOptionalRefHolder.h:112