Qore Programming Language
0.8.11
|
this class manages reference counts for the optional evaluation of AbstractQoreNode objects More...
#include <QoreNodeEvalOptionalRefHolder.h>
Public Member Functions | |
DLLLOCAL | QoreNodeEvalOptionalRefHolder (ExceptionSink *n_xsink) |
constructor used to create a holder object | |
DLLLOCAL | QoreNodeEvalOptionalRefHolder (const AbstractQoreNode *exp, ExceptionSink *n_xsink) |
constructor with a value that will call the class' eval(needs_deref) method | |
DLLLOCAL | ~QoreNodeEvalOptionalRefHolder () |
discards any temporary value evaluated by the constructor or assigned by "assign()" | |
DLLLOCAL void | assign (bool n_needs_deref, AbstractQoreNode *n_val) |
assigns a new value to this holder object | |
DLLLOCAL void | discard () |
discards any temporary value evaluated by the constructor or assigned by "assign()" | |
DLLLOCAL AbstractQoreNode * | getReferencedValue () |
returns a referenced value - the caller will own the reference | |
DLLLOCAL bool | isTemp () const |
returns true if the value is temporary (needs dereferencing) | |
DLLLOCAL | operator bool () const |
returns true if a value is being held | |
DLLLOCAL const AbstractQoreNode * | operator* () const |
returns the object being managed | |
DLLLOCAL const AbstractQoreNode * | operator-> () const |
returns the object being managed | |
this class manages reference counts for the optional evaluation of AbstractQoreNode objects
This class can only be used on the stack (cannot be allocated dynamically). This class is designed to avoid atomic reference count increments and decrements whenever possible and to avoid an "eval()" call for types that do not require it (such as value types). It is used extensively internally but normally should not need to be used outside of the qore library itself.