Qore Programming Language 1.19.5
Loading...
Searching...
No Matches
ValueHolder Class Reference

holds an object and dereferences it in the destructor More...

#include <QoreValue.h>

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

Public Member Methods

DLLLOCAL ValueHolder (ExceptionSink *xs)
 creates an empty object
 
DLLLOCAL ValueHolder (QoreValue n_v, ExceptionSink *xs)
 creates the object with the given value
 
DLLEXPORT ~ValueHolder ()
 dereferences any contained node
 
DLLEXPORT QoreValue getReferencedValue ()
 returns a referenced value; caller owns the reference; the current object is left undisturbed
 
DLLLOCAL operator bool () const
 returns true if the value is not NOTHING
 
DLLLOCAL QoreValueoperator= (QoreValue nv)
 assigns the object, any currently-held value is dereferenced before the assignment
 
DLLEXPORT QoreValue release ()
 returns a QoreValue object and leaves the current object empty; the caller owns any reference contained in the return value
 
template<typename T >
DLLLOCAL T * releaseAs ()
 returns a pointer to a value of the given class and leaves the current object empty More...
 
- 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
 

Additional Inherited Members

- Private Attributes inherited from ValueHolderBase
QoreValue v
 the value held
 
ExceptionSinkxsink
 for possible Qore-language exceptions
 

Detailed Description

holds an object and dereferences it in the destructor

Member Function Documentation

◆ releaseAs()

template<typename T >
DLLLOCAL T * ValueHolder::releaseAs ( )
inline

returns a pointer to a value of the given class and leaves the current object empty

the caller owns any reference contained in the return value

References QoreSimpleValue::get(), release(), and ValueHolderBase::v.


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