Qore Programming Language  1.7.0
QoreListNodeEvalOptionalRefHolder Class Reference

For use on the stack only: manages result of the optional evaluation of a QoreListNode. More...

#include <QoreListNodeEvalOptionalRefHolder.h>

Public Member Methods

DLLLOCAL QoreListNodeEvalOptionalRefHolder (const QoreListNode *exp, ExceptionSink *n_xsink)
 performs an optional evaluation of the list (sets the dereference flag)
 
DLLLOCAL QoreListNodeEvalOptionalRefHolder (ExceptionSink *n_xsink)
 initializes an empty object and saves the ExceptionSink object
 
DLLLOCAL ~QoreListNodeEvalOptionalRefHolder ()
 clears the object (dereferences the old object if necessary)
 
DLLLOCAL void assign (bool n_needs_deref, QoreListNode *n_val)
 assigns a new value and dereference flag to this object, dereferences the old object if necessary
 
DLLLOCAL void assignEval (const QoreListNode *exp)
 assigns a new value by executing the given list and dereference flag to this object, dereferences the old object if necessary
 
DLLLOCAL void assignEval (QoreListNode *exp)
 assigns a new value by executing the given list and dereference flag to this object, dereferences the old object if necessary
 
DLLLOCAL bool canEdit () const
 returns true if the value being managed can be edited/updated
 
DLLLOCAL void discard ()
 clears the object (dereferences the old object if necessary)
 
DLLLOCAL void edit ()
 will create a unique list so the list can be edited
 
DLLLOCAL QoreListNodegetReferencedValue ()
 returns a referenced value - the caller will own the reference More...
 
DLLLOCAL bool needsDeref () const
 returns true if the object contains a temporary (evaluated) value that needs a dereference
 
DLLLOCAL operator bool () const
 returns true if a QoreListNode object pointer is being managed, false if the pointer is 0
 
DLLLOCAL const QoreListNodeoperator* () const
 returns a pointer to the QoreListNode object being managed
 
DLLLOCAL const QoreListNodeoperator-> () const
 returns a pointer to the QoreListNode object being managed More...
 

Detailed Description

For use on the stack only: manages result of the optional evaluation of a QoreListNode.

Member Function Documentation

◆ getReferencedValue()

DLLLOCAL QoreListNode* QoreListNodeEvalOptionalRefHolder::getReferencedValue ( )
inline

returns a referenced value - the caller will own the reference

The list is referenced if necessary (if it was a temporary value)

Returns
the list value, where the caller will own the reference count

◆ operator->()

DLLLOCAL const QoreListNode* QoreListNodeEvalOptionalRefHolder::operator-> ( ) const
inline

returns a pointer to the QoreListNode object being managed

if you need a referenced value, use getReferencedValue()

Returns
a pointer to the QoreListNode object being managed (or 0 if none)

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