32 #ifndef _QORE_SINGLEVALUEITERATOR_H
34 #define _QORE_SINGLEVALUEITERATOR_H
41 DLLLOCAL SingleValueIterator() : validp(false) {
44 DLLLOCAL SingleValueIterator(
const QoreValue v) : val(v.refSelf()), validp(false) {
47 DLLLOCAL SingleValueIterator(
const SingleValueIterator& old) : val(old.val.refSelf()), validp(old.validp) {
50 DLLLOCAL
bool next() {
53 return (validp = !validp);
58 xsink->
raiseException(
"ITERATOR-ERROR",
"the %s is not pointing at a valid element; make sure %s::next() returns True before calling this method", getName(), getName());
68 DLLLOCAL
bool valid()
const {
72 DLLLOCAL
void reset() {
85 DLLLOCAL
virtual const char* getName()
const {
return "SingleValueIterator"; }
87 DLLLOCAL
virtual const QoreTypeInfo* getElementType()
const {
88 return val.getTypeInfo();
virtual DLLLOCAL void deref()
decrements the reference count of the object without the possibility of throwing a Qore-language exce...
Definition: AbstractPrivateData.h:65
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
DLLEXPORT AbstractQoreNode * raiseException(const char *err, const char *fmt,...)
appends a Qore-language exception to the list
defines a Qore-language class
Definition: QoreClass.h:249
abstract base class for iterator private data
Definition: QoreIteratorBase.h:68
DLLEXPORT bool ROdereference() const
atomically decrements the reference count
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275
DLLEXPORT QoreValue refSelf() const
references the contained value if type == QV_Node, returns itself