Qore Programming Language 1.13.0
Loading...
Searching...
No Matches
ValueEvalRefHolder Class Reference

evaluates an AbstractQoreNode and dereferences the stored value in the destructor More...

#include <QoreValue.h>

Inheritance diagram for ValueEvalRefHolder:
[legend]
Collaboration diagram for ValueEvalRefHolder:
[legend]

Public Member Methods

DLLEXPORT ValueEvalRefHolder (const AbstractQoreNode *exp, ExceptionSink *xs)
 evaluates the exp argument
 
DLLEXPORT ValueEvalRefHolder (const QoreValue exp, ExceptionSink *xs)
 evaluates the exp argument More...
 
DLLEXPORT ValueEvalRefHolder (ExceptionSink *xs)
 creates the object with with no evaluation More...
 
DLLEXPORT int eval (const AbstractQoreNode *exp)
 evaluates the argument, returns -1 for error, 0 = OK More...
 
DLLEXPORT int eval (const QoreValue exp)
 evaluates the argument, returns -1 for error, 0 = OK More...
 
- Public Member Methods inherited from ValueOptionalRefHolder
DLLLOCAL ValueOptionalRefHolder (ExceptionSink *xs)
 creates an empty object
 
DLLLOCAL ValueOptionalRefHolder (QoreValue n_v, bool nd, ExceptionSink *xs)
 creates the object with the given values
 
DLLLOCAL void clearTemp ()
 sets needs_deref = false
 
DLLEXPORT void ensureReferencedValue ()
 
DLLEXPORT QoreValue getReferencedValue ()
 returns a referenced value; caller owns the reference; the current object is not disturbed
 
DLLLOCAL bool isTemp () const
 returns true if the value is temporary (needs dereferencing)
 
DLLLOCAL operator bool () const
 returns true if the value is not NOTHING
 
DLLLOCAL void setValue (QoreValue nv)
 assigns a new non-temporary value
 
DLLLOCAL void setValue (QoreValue nv, bool temp)
 assigns a new value
 
DLLLOCAL AbstractQoreNodetakeNode (bool &nd)
 returns the stored AbstractQoreNode pointer and sets the dereference flag as an output variable
 
template<typename T >
DLLLOCAL T * takeReferencedNode ()
 returns the stored node value and leaves the current object empty
 
DLLEXPORT QoreValue takeReferencedValue ()
 returns a QoreValue after incrementing the reference count of any node value stored if necessary
 
DLLLOCAL QoreValue takeValue (bool &nd)
 returns the stored value and sets the dereference flag as an output variable
 
DLLLOCAL void takeValueFrom (ValueOptionalRefHolder &val)
 returns the stored value which must be dereferenced if it is a node object (i.e. type == QV_Node)
 
- Public Member Methods inherited from ValueHolderBase
DLLLOCAL ValueHolderBase (ExceptionSink *xs)
 creates an ampty object
 
DLLLOCAL ValueHolderBase (QoreValue n_v, ExceptionSink *xs)
 creates the object with the given value
 
DLLLOCAL QoreValueoperator* ()
 returns the value being managed
 
DLLLOCAL const QoreValueoperator* () const
 returns the value being managed
 
DLLLOCAL QoreValueoperator-> ()
 returns the value being managed
 
DLLLOCAL const QoreValueoperator-> () const
 returns the value being managed
 

Private Member Methods

DLLLOCAL int evalIntern (const AbstractQoreNode *exp)
 evaluates the argument, returns -1 for error, 0 = OK More...
 
DLLLOCAL int evalIntern (const QoreValue exp)
 evaluates the argument, returns -1 for error, 0 = OK More...
 

Additional Inherited Members

- Private Attributes inherited from ValueOptionalRefHolder
bool needs_deref
 flag indicating if the value should be dereferenced in the destructor or not
 
- Private Attributes inherited from ValueHolderBase
QoreValue v
 the value held
 
ExceptionSinkxsink
 for possible Qore-language exceptions
 

Detailed Description

evaluates an AbstractQoreNode and dereferences the stored value in the destructor

Constructor & Destructor Documentation

◆ ValueEvalRefHolder() [1/2]

DLLEXPORT ValueEvalRefHolder::ValueEvalRefHolder ( const QoreValue  exp,
ExceptionSink xs 
)

evaluates the exp argument

Since
Qore 0.9

◆ ValueEvalRefHolder() [2/2]

DLLEXPORT ValueEvalRefHolder::ValueEvalRefHolder ( ExceptionSink xs)

creates the object with with no evaluation

Since
Qore 0.8.13.1

Member Function Documentation

◆ eval() [1/2]

DLLEXPORT int ValueEvalRefHolder::eval ( const AbstractQoreNode exp)

evaluates the argument, returns -1 for error, 0 = OK

Since
Qore 0.8.13.1

◆ eval() [2/2]

DLLEXPORT int ValueEvalRefHolder::eval ( const QoreValue  exp)

evaluates the argument, returns -1 for error, 0 = OK

Since
Qore 0.9

◆ evalIntern() [1/2]

DLLLOCAL int ValueEvalRefHolder::evalIntern ( const AbstractQoreNode exp)
private

evaluates the argument, returns -1 for error, 0 = OK

Since
Qore 0.8.13.1

◆ evalIntern() [2/2]

DLLLOCAL int ValueEvalRefHolder::evalIntern ( const QoreValue  exp)
private

evaluates the argument, returns -1 for error, 0 = OK

Since
Qore 0.9

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