All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreListNode.h
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
QoreListNode.h
Qore Programming Language
Copyright 2003 - 2013 David Nichols
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License aqore_offset_t with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _QORE_QORELISTNODE_H
#define _QORE_QORELISTNODE_H
#include <qore/AbstractQoreNode.h>
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
class ResolvedCallReferenceNode;
class QoreListNode : public AbstractQoreNode {
friend class StackList;
private:
DLLLOCAL QoreListNode(const QoreListNode&);
DLLLOCAL QoreListNode& operator=(const QoreListNode&);
protected:
struct qore_list_private *priv;
DLLLOCAL void resize(qore_size_t num);
DLLLOCAL QoreListNode* splice_intern(qore_size_t offset, qore_size_t length, ExceptionSink* xsink, bool extract = false);
DLLLOCAL QoreListNode* splice_intern(qore_size_t offset, qore_size_t length, const AbstractQoreNode* l, ExceptionSink* xsink, bool extract = false);
DLLLOCAL qore_size_t check_offset(qore_offset_t offset);
DLLLOCAL void check_offset(qore_offset_t offset, qore_offset_t len, qore_size_t &n_offset, qore_size_t &n_len);
DLLLOCAL int qsort(const ResolvedCallReferenceNode* fr, qore_size_t left, qore_size_t right, bool ascending, ExceptionSink* xsink);
DLLLOCAL int mergesort(const ResolvedCallReferenceNode* fr, bool ascending, ExceptionSink* xsink);
DLLLOCAL QoreListNode* eval_intern(ExceptionSink* xsink) const;
DLLEXPORT virtual ~QoreListNode();
DLLEXPORT virtual bool derefImpl(ExceptionSink* xsink);
DLLEXPORT virtual AbstractQoreNode* evalImpl(ExceptionSink* xsink) const;
DLLLOCAL virtual AbstractQoreNode* evalImpl(bool &needs_deref, ExceptionSink* xsink) const;
DLLLOCAL virtual int64 bigIntEvalImpl(ExceptionSink* xsink) const;
DLLLOCAL virtual int integerEvalImpl(ExceptionSink* xsink) const;
DLLLOCAL virtual bool boolEvalImpl(ExceptionSink* xsink) const;
DLLLOCAL virtual double floatEvalImpl(ExceptionSink* xsink) const;
public:
DLLEXPORT QoreListNode();
DLLEXPORT virtual bool getAsBoolImpl() const;
DLLEXPORT int getAsString(QoreString &str, int foff, ExceptionSink* xsink) const;
DLLEXPORT QoreString *getAsString(bool &del, int foff, ExceptionSink* xsink) const;
//DLLEXPORT virtual bool needs_eval() const;
DLLEXPORT virtual AbstractQoreNode* realCopy() const;
DLLEXPORT virtual bool is_equal_soft(const AbstractQoreNode* v, ExceptionSink* xsink) const;
DLLEXPORT virtual bool is_equal_hard(const AbstractQoreNode* v, ExceptionSink* xsink) const;
DLLEXPORT virtual const char *getTypeName() const;
//DLLEXPORT virtual bool is_value() const;
DLLLOCAL static const char *getStaticTypeName() {
return "list";
}
DLLEXPORT AbstractQoreNode* retrieve_entry(qore_size_t index);
DLLEXPORT const AbstractQoreNode* retrieve_entry(qore_size_t index) const;
DLLEXPORT AbstractQoreNode* get_referenced_entry(qore_size_t index) const;
DLLEXPORT int getEntryAsInt(qore_size_t index) const;
DLLEXPORT AbstractQoreNode** get_entry_ptr(qore_size_t index);
DLLEXPORT AbstractQoreNode** getExistingEntryPtr(qore_size_t index);
DLLEXPORT void set_entry(qore_size_t index, AbstractQoreNode* val, ExceptionSink* xsink);
DLLEXPORT void push(AbstractQoreNode* val);
DLLEXPORT void insert(AbstractQoreNode* val);
DLLEXPORT AbstractQoreNode* pop();
DLLEXPORT AbstractQoreNode* shift();
DLLEXPORT void merge(const QoreListNode* list);
DLLEXPORT int delete_entry(qore_size_t index, ExceptionSink* xsink);
DLLEXPORT void pop_entry(qore_size_t index, ExceptionSink* xsink);
DLLEXPORT QoreListNode* evalList(ExceptionSink* xsink) const;
DLLEXPORT QoreListNode* evalList(bool &needs_deref, ExceptionSink* xsink) const;
DLLEXPORT QoreListNode* copy() const;
DLLEXPORT QoreListNode* copyListFrom(qore_size_t index) const;
DLLEXPORT QoreListNode* sort() const;
DLLEXPORT QoreListNode* sort(const ResolvedCallReferenceNode* fr, ExceptionSink* xsink) const;
DLLEXPORT QoreListNode* sortStable() const;
DLLEXPORT QoreListNode* sortStable(const ResolvedCallReferenceNode* fr, ExceptionSink* xsink) const;
DLLEXPORT QoreListNode* sortDescending() const;
DLLEXPORT QoreListNode* sortDescending(const ResolvedCallReferenceNode* fr, ExceptionSink* xsink) const;
DLLEXPORT QoreListNode* sortDescendingStable() const;
DLLEXPORT QoreListNode* sortDescendingStable(const ResolvedCallReferenceNode* fr, ExceptionSink* xsink) const;
DLLEXPORT AbstractQoreNode* min() const;
DLLEXPORT AbstractQoreNode* max() const;
DLLEXPORT AbstractQoreNode* min(const ResolvedCallReferenceNode* fr, ExceptionSink* xsink) const;
DLLEXPORT AbstractQoreNode* max(const ResolvedCallReferenceNode* fr, ExceptionSink* xsink) const;
DLLEXPORT void splice(qore_offset_t offset, ExceptionSink* xsink);
DLLEXPORT void splice(qore_offset_t offset, qore_offset_t length, ExceptionSink* xsink);
DLLEXPORT void splice(qore_offset_t offset, qore_offset_t length, const AbstractQoreNode* l, ExceptionSink* xsink);
DLLEXPORT QoreListNode* extract(qore_offset_t offset, ExceptionSink* xsink);
DLLEXPORT QoreListNode* extract(qore_offset_t offset, qore_offset_t length, ExceptionSink* xsink);
DLLEXPORT QoreListNode* extract(qore_offset_t offset, qore_offset_t length, const AbstractQoreNode* l, ExceptionSink* xsink);
DLLEXPORT qore_size_t size() const;
DLLEXPORT bool empty() const;
DLLEXPORT QoreListNode* reverse() const;
DLLEXPORT QoreListNode* listRefSelf() const;
DLLEXPORT AbstractQoreNode* swap(qore_offset_t offset, AbstractQoreNode* val);
DLLEXPORT AbstractQoreNode* takeExists(qore_offset_t offset);
// needed only while parsing
DLLLOCAL QoreListNode(bool i);
DLLLOCAL bool isFinalized() const;
DLLLOCAL void setFinalized();
DLLLOCAL bool isVariableList() const;
DLLLOCAL void setVariableList();
DLLLOCAL void clearNeedsEval();
DLLLOCAL void setNeedsEval();
DLLLOCAL void clear();
DLLLOCAL AbstractQoreNode* eval_entry(qore_size_t num, ExceptionSink* xsink) const;
DLLLOCAL virtual AbstractQoreNode* parseInit(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo);
DLLLOCAL QoreListNode* parseInitList(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo);
};
#include <qore/ReferenceHolder.h>
typedef ReferenceHolder<QoreListNode> QoreListNodeHolder;
class ListIterator {
protected:
QoreListNode* l;
qore_offset_t pos;
DLLLOCAL void *operator new(size_t);
public:
DLLEXPORT ListIterator(QoreListNode* lst, qore_size_t n_pos = -1);
DLLEXPORT ListIterator(QoreListNode& lst, qore_size_t n_pos = -1);
DLLEXPORT bool next();
DLLEXPORT bool prev();
DLLEXPORT int set(qore_size_t n_pos);
DLLEXPORT AbstractQoreNode* getValue() const;
DLLEXPORT AbstractQoreNode** getValuePtr() const;
DLLEXPORT AbstractQoreNode* getReferencedValue() const;
DLLEXPORT AbstractQoreNode* takeValue();
DLLEXPORT bool first() const;
DLLEXPORT bool last() const;
//DLLEXPORT void setValue(AbstractQoreNode* val, ExceptionSink* xsink) const;
DLLLOCAL qore_size_t index() const { return pos; }
DLLLOCAL qore_size_t max() const { return l->size(); }
DLLLOCAL QoreListNode* getList() { return l; }
DLLLOCAL bool empty() const {
return l->empty();
}
DLLLOCAL bool valid() const {
return pos == -1 ? false : true;
}
};
class ConstListIterator {
protected:
const QoreListNode* l;
qore_offset_t pos;
public:
DLLEXPORT ConstListIterator(const QoreListNode* lst, qore_size_t n_pos = -1);
DLLEXPORT ConstListIterator(const QoreListNode& lst, qore_size_t n_pos = -1);
DLLEXPORT bool next();
DLLEXPORT bool prev();
DLLEXPORT int set(qore_size_t n_pos);
DLLEXPORT const AbstractQoreNode* getValue() const;
DLLEXPORT AbstractQoreNode* getReferencedValue() const;
DLLEXPORT bool first() const;
DLLEXPORT bool last() const;
DLLLOCAL qore_size_t index() const { return pos; }
DLLLOCAL qore_size_t max() const { return l->size(); }
DLLLOCAL const QoreListNode* getList() const { return l; }
DLLLOCAL bool empty() const {
return l->empty();
}
DLLLOCAL bool valid() const {
return pos == -1 ? false : true;
}
DLLEXPORT void reset();
};
class QoreListNodeEvalOptionalRefHolder {
private:
QoreListNode* val;
ExceptionSink* xsink;
bool needs_deref;
DLLLOCAL void discard_intern() {
if (needs_deref && val)
val->deref(xsink);
}
DLLLOCAL void eval_intern(const QoreListNode* exp) {
if (exp)
val = exp->evalList(needs_deref, xsink);
else {
val = 0;
needs_deref = false;
}
}
DLLLOCAL QoreListNodeEvalOptionalRefHolder(const QoreListNodeEvalOptionalRefHolder&);
DLLLOCAL QoreListNodeEvalOptionalRefHolder& operator=(const QoreListNodeEvalOptionalRefHolder&);
DLLLOCAL void *operator new(size_t);
public:
DLLLOCAL QoreListNodeEvalOptionalRefHolder(ExceptionSink* n_xsink) : xsink(n_xsink) {
needs_deref = false;
val = 0;
}
DLLLOCAL QoreListNodeEvalOptionalRefHolder(const QoreListNode* exp, ExceptionSink* n_xsink) : xsink(n_xsink) {
eval_intern(exp);
}
DLLLOCAL ~QoreListNodeEvalOptionalRefHolder() {
discard_intern();
}
DLLLOCAL void discard() {
discard_intern();
needs_deref = false;
val = 0;
}
DLLLOCAL void assignEval(const QoreListNode* exp) {
discard_intern();
eval_intern(exp);
}
DLLLOCAL void assign(bool n_needs_deref, QoreListNode* n_val) {
discard_intern();
needs_deref = n_needs_deref;
val = n_val;
}
DLLLOCAL bool needsDeref() const {
return needs_deref;
}
DLLLOCAL QoreListNode* getReferencedValue() {
if (needs_deref)
needs_deref = false;
else if (val)
val->ref();
return val;
}
DLLLOCAL void edit() {
if (!val) {
val = new QoreListNode;
needs_deref = true;
}
else if (!needs_deref || !val->is_unique()) {
val = val->copy();
needs_deref = true;
}
}
DLLLOCAL const QoreListNode* operator->() const { return val; }
DLLLOCAL const QoreListNode* operator*() const { return val; }
DLLLOCAL operator bool() const { return val != 0; }
};
#endif
QoreListNode::get_referenced_entry
DLLEXPORT AbstractQoreNode * get_referenced_entry(qore_size_t index) const
returns the element at &quot;index&quot; (first element is index 0), the caller owns the reference ...
QoreListNode::takeExists
DLLEXPORT AbstractQoreNode * takeExists(qore_offset_t offset)
takes the value at the given position and replaces with NULL, only if the list position exists ...
QoreListNode::setNeedsEval
DLLLOCAL void setNeedsEval()
this function is not exported in the qore library
QoreListNode::isFinalized
DLLLOCAL bool isFinalized() const
this function is not exported in the qore library
QoreListNode::sortDescendingStable
DLLEXPORT QoreListNode * sortDescendingStable() const
returns a new list based on executing mergesort on the source list (&quot;this&quot;) in descending order ...
QoreListNode::pop_entry
DLLEXPORT void pop_entry(qore_size_t index, ExceptionSink *xsink)
ConstListIterator::first
DLLEXPORT bool first() const
returns true when the iterator is pointing to the first element in the list
ConstListIterator::ConstListIterator
DLLEXPORT ConstListIterator(const QoreListNode *lst, qore_size_t n_pos=-1)
initializes the iterator to the position given or, if omitted, just before the first element ...
QoreListNode::merge
DLLEXPORT void merge(const QoreListNode *list)
appends the elements of &quot;list&quot; to this list
ConstListIterator::max
DLLLOCAL qore_size_t max() const
returns the number of elements in the list
Definition: QoreListNode.h:669
QoreListNode::clearNeedsEval
DLLLOCAL void clearNeedsEval()
this function is not exported in the qore library
QoreListNode::getAsBoolImpl
virtual DLLEXPORT bool getAsBoolImpl() const
returns false unless perl-boolean-evaluation is enabled, in which case it returns false only when emp...
ConstListIterator::getList
DLLLOCAL const QoreListNode * getList() const
returns the list
Definition: QoreListNode.h:672
ConstListIterator::next
DLLEXPORT bool next()
moves the iterator to the next element, returns true if the iterator is pointing to an element of the...
ConstListIterator::valid
DLLLOCAL bool valid() const
returns true if the iterator is pointing to a valid element
Definition: QoreListNode.h:680
ListIterator::set
DLLEXPORT int set(qore_size_t n_pos)
sets the iterator to a specific position in the list
QoreListNode::isVariableList
DLLLOCAL bool isVariableList() const
this function is not exported in the qore library
ListIterator::ListIterator
DLLEXPORT ListIterator(QoreListNode *lst, qore_size_t n_pos=-1)
initializes the iterator to the position given or, if omitted, just before the first element ...
QoreListNode::mergesort
DLLLOCAL int mergesort(const ResolvedCallReferenceNode *fr, bool ascending, ExceptionSink *xsink)
mergesort sorts the list in-place (stable)
QoreListNodeEvalOptionalRefHolder::~QoreListNodeEvalOptionalRefHolder
DLLLOCAL ~QoreListNodeEvalOptionalRefHolder()
clears the object (dereferences the old object if necessary)
Definition: QoreListNode.h:729
AbstractQoreNode
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:47
QoreListNode::parseInit
virtual DLLLOCAL AbstractQoreNode * parseInit(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo)
for initialization of lists in the parse tree at parse time (always returns &quot;this&quot;) ...
qore_size_t
size_t qore_size_t
used for sizes (same range as a pointer)
Definition: common.h:62
ConstListIterator::getReferencedValue
DLLEXPORT AbstractQoreNode * getReferencedValue() const
returns the current value with an incremented reference count
qore_offset_t
long qore_offset_t
used for offsets that could be negative
Definition: common.h:65
QoreListNodeEvalOptionalRefHolder::QoreListNodeEvalOptionalRefHolder
DLLLOCAL QoreListNodeEvalOptionalRefHolder(const QoreListNode *exp, ExceptionSink *n_xsink)
performs an optional evaluation of the list (sets the dereference flag)
Definition: QoreListNode.h:724
QoreListNode::clear
DLLLOCAL void clear()
this function is not exported in the qore library
ListIterator::next
DLLEXPORT bool next()
moves the iterator to the next element, returns true if the iterator is pointing to an element of the...
ListIterator
For use on the stack only: iterates through a the elements of a QoreListNode.
Definition: QoreListNode.h:504
QoreListNode::floatEvalImpl
virtual DLLLOCAL double floatEvalImpl(ExceptionSink *xsink) const
always returns 0.0
QoreListNode::getExistingEntryPtr
DLLEXPORT AbstractQoreNode ** getExistingEntryPtr(qore_size_t index)
QoreListNode::getAsString
DLLEXPORT int getAsString(QoreString &str, int foff, ExceptionSink *xsink) const
concatenate the verbose string representation of the list (including all contained values) to an exis...
QoreListNodeEvalOptionalRefHolder::QoreListNodeEvalOptionalRefHolder
DLLLOCAL QoreListNodeEvalOptionalRefHolder(ExceptionSink *n_xsink)
initializes an empty object and saves the ExceptionSink object
Definition: QoreListNode.h:718
QoreListNode::listRefSelf
DLLEXPORT QoreListNode * listRefSelf() const
returns &quot;this&quot; with an incremented reference count
QoreListNode::retrieve_entry
DLLEXPORT AbstractQoreNode * retrieve_entry(qore_size_t index)
returns the element at &quot;index&quot; (first element is index 0)
QoreString
Qore&#39;s string type supported by the QoreEncoding class.
Definition: QoreString.h:42
ListIterator::getValue
DLLEXPORT AbstractQoreNode * getValue() const
returns a pointer to the value of the list element
QoreListNode::copyListFrom
DLLEXPORT QoreListNode * copyListFrom(qore_size_t index) const
performs a deep copy of the list starting from element &quot;offset&quot; and returns the new list ...
QoreListNodeEvalOptionalRefHolder::operator->
DLLLOCAL const QoreListNode * operator->() const
returns a pointer to the QoreListNode object being managed
Definition: QoreListNode.h:788
QoreListNode::evalList
DLLEXPORT QoreListNode * evalList(ExceptionSink *xsink) const
evaluates the list and returns a value (or 0)
QoreListNode
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:44
QoreListNode::setFinalized
DLLLOCAL void setFinalized()
this function is not exported in the qore library
ConstListIterator::last
DLLEXPORT bool last() const
returns true when the iterator is pointing to the last element in the list
QoreListNode::~QoreListNode
virtual DLLEXPORT ~QoreListNode()
the destructor is protected so it cannot be called directly
QoreListNodeEvalOptionalRefHolder::discard
DLLLOCAL void discard()
clears the object (dereferences the old object if necessary)
Definition: QoreListNode.h:734
ConstListIterator::prev
DLLEXPORT bool prev()
moves the iterator to the previous element, returns true if the iterator is pointing to an element of...
ConstListIterator::getValue
DLLEXPORT const AbstractQoreNode * getValue() const
returns a pointer to the value of the list element
ListIterator::getList
DLLLOCAL QoreListNode * getList()
returns the list
Definition: QoreListNode.h:577
QoreListNode::eval_entry
DLLLOCAL AbstractQoreNode * eval_entry(qore_size_t num, ExceptionSink *xsink) const
this function is not exported in the qore library
QoreListNode::min
DLLEXPORT AbstractQoreNode * min() const
returns the element having the lowest value (determined by calling OP_LOG_LT - the less-than &quot;&lt;&quot; oper...
ListIterator::prev
DLLEXPORT bool prev()
moves the iterator to the previous element, returns true if the iterator is pointing to an element of...
QoreListNode::bigIntEvalImpl
virtual DLLLOCAL int64 bigIntEvalImpl(ExceptionSink *xsink) const
always returns 0
QoreListNodeEvalOptionalRefHolder::assignEval
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
Definition: QoreListNode.h:741
QoreListNode::is_equal_hard
virtual DLLEXPORT bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const
tests for equality (&quot;deep compare&quot; including all contained values) without type conversions (hard com...
QoreListNode::swap
DLLEXPORT AbstractQoreNode * swap(qore_offset_t offset, AbstractQoreNode *val)
swaps the value at the given position with the value given, caller owns any reference returned ...
QoreListNodeEvalOptionalRefHolder::needsDeref
DLLLOCAL bool needsDeref() const
returns true if the object contains a temporary (evaluated) value that needs a dereference ...
Definition: QoreListNode.h:754
QoreListNode::integerEvalImpl
virtual DLLLOCAL int integerEvalImpl(ExceptionSink *xsink) const
always returns 0
QoreListNode::is_equal_soft
virtual DLLEXPORT bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const
tests for equality (&quot;deep compare&quot; including all contained values) with possible type conversion (sof...
ListIterator::valid
DLLLOCAL bool valid() const
returns true if the iterator is pointing to a valid element
Definition: QoreListNode.h:585
QoreListNode::eval_intern
DLLLOCAL QoreListNode * eval_intern(ExceptionSink *xsink) const
does an unconditional evaluation of the list and returns the new list, 0 if there is a qore-language ...
QoreListNode::parseInitList
DLLLOCAL QoreListNode * parseInitList(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo)
for initialization of lists in the parse tree at parse time (always returns &quot;this&quot;) ...
QoreListNode::pop
DLLEXPORT AbstractQoreNode * pop()
returns the last element of the list, the length is decremented by one, caller owns the reference ...
ListIterator::getValuePtr
DLLEXPORT AbstractQoreNode ** getValuePtr() const
returns a pointer to a pointer of the value of the list element, so it can be changed externally ...
QoreListNode::boolEvalImpl
virtual DLLLOCAL bool boolEvalImpl(ExceptionSink *xsink) const
always returns false
QoreListNode::size
DLLEXPORT qore_size_t size() const
returns the number of elements in the list
AbstractQoreNode::ref
DLLEXPORT void ref() const
increments the reference count
QoreListNode::setVariableList
DLLLOCAL void setVariableList()
this function is not exported in the qore library
ExceptionSink
container for holding Qore-language exception information and also for registering a &quot;thread_exit&quot; ca...
Definition: ExceptionSink.h:35
QoreListNode::getEntryAsInt
DLLEXPORT int getEntryAsInt(qore_size_t index) const
returns the value of element at &quot;index&quot; as an integer (first element is index 0)
AbstractQoreNode::deref
DLLEXPORT void deref(ExceptionSink *xsink)
decrements the reference count and calls derefImpl() if there_can_be_only_one is false, otherwise does nothing
ListIterator::getReferencedValue
DLLEXPORT AbstractQoreNode * getReferencedValue() const
returns the current value with an incremented reference count
QoreListNode::delete_entry
DLLEXPORT int delete_entry(qore_size_t index, ExceptionSink *xsink)
ListIterator::takeValue
DLLEXPORT AbstractQoreNode * takeValue()
if the list is unique (has reference count = 1), returns the current value with the reference count t...
QoreReferenceCounter::is_unique
DLLLOCAL bool is_unique() const
returns true if the reference count is 1
Definition: QoreReferenceCounter.h:61
QoreListNode::sortStable
DLLEXPORT QoreListNode * sortStable() const
returns a new list based on executing mergesort on the source list (&quot;this&quot;)
QoreListNode::max
DLLEXPORT AbstractQoreNode * max() const
returns the element having the highest value (determined by calling OP_LOG_GT - the greater-than &quot;&gt;&quot; ...
QoreListNode::splice
DLLEXPORT void splice(qore_offset_t offset, ExceptionSink *xsink)
truncates the list at position &quot;offset&quot; (first element is offset 0)
ResolvedCallReferenceNode
base class for resolved call references
Definition: CallReferenceNode.h:120
ListIterator::last
DLLEXPORT bool last() const
returns true when the iterator is pointing to the last element in the list
QoreListNode::getTypeName
virtual DLLEXPORT const char * getTypeName() const
returns the type name as a c string
QoreListNode::evalImpl
virtual DLLEXPORT AbstractQoreNode * evalImpl(ExceptionSink *xsink) const
evaluates the list and returns a value (or 0)
ConstListIterator::empty
DLLLOCAL bool empty() const
returns true if the list is empty
Definition: QoreListNode.h:675
ListIterator::first
DLLEXPORT bool first() const
returns true when the iterator is pointing to the first element in the list
ListIterator::max
DLLLOCAL qore_size_t max() const
returns the number of elements in the list
Definition: QoreListNode.h:574
ConstListIterator::reset
DLLEXPORT void reset()
resets the iterator to its initial state
QoreListNode::set_entry
DLLEXPORT void set_entry(qore_size_t index, AbstractQoreNode *val, ExceptionSink *xsink)
sets the value of a list element
QoreListNode::reverse
DLLEXPORT QoreListNode * reverse() const
returns a list with the order of the elements reversed
QoreListNodeEvalOptionalRefHolder::operator*
DLLLOCAL const QoreListNode * operator*() const
returns a pointer to the QoreListNode object being managed
Definition: QoreListNode.h:791
QoreListNodeEvalOptionalRefHolder::assign
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 ...
Definition: QoreListNode.h:747
QoreListNode::get_entry_ptr
DLLEXPORT AbstractQoreNode ** get_entry_ptr(qore_size_t index)
QoreListNode::getStaticTypeName
static DLLLOCAL const char * getStaticTypeName()
returns true if the list does not contain any parse expressions, otherwise returns false ...
Definition: QoreListNode.h:173
QoreListNodeEvalOptionalRefHolder::edit
DLLLOCAL void edit()
will create a unique list so the list can be edited
Definition: QoreListNode.h:772
QoreListNode::copy
DLLEXPORT QoreListNode * copy() const
performs a deep copy of the list and returns the new list
ConstListIterator::index
DLLLOCAL qore_size_t index() const
returns the current iterator position in the list or -1 if not pointing at a valid element ...
Definition: QoreListNode.h:666
QoreListNode::realCopy
virtual DLLEXPORT AbstractQoreNode * realCopy() const
returns true if the list contains parse expressions and therefore needs evaluation to return a value...
ConstListIterator::set
DLLEXPORT int set(qore_size_t n_pos)
sets the iterator to a specific position in the list
ListIterator::empty
DLLLOCAL bool empty() const
returns true if the list is empty
Definition: QoreListNode.h:580
ListIterator::index
DLLLOCAL qore_size_t index() const
returns the current iterator position in the list or -1 if not pointing at a valid element ...
Definition: QoreListNode.h:571
QoreListNode::sort
DLLEXPORT QoreListNode * sort() const
returns a new list based on quicksorting the source list (&quot;this&quot;)
QoreListNodeEvalOptionalRefHolder
For use on the stack only: manages result of the optional evaluation of a QoreListNode.
Definition: QoreListNode.h:689
QoreListNode::shift
DLLEXPORT AbstractQoreNode * shift()
returns the first element of the list, all other entries are moved down to fill up the first position...
QoreListNode::empty
DLLEXPORT bool empty() const
returns true if the list is empty
ReferenceHolder
a templated class to manage a reference count of an object that can throw a Qore-language exception w...
Definition: ReferenceHolder.h:43
QoreListNodeEvalOptionalRefHolder::getReferencedValue
DLLLOCAL QoreListNode * getReferencedValue()
returns a referenced value - the caller will own the reference
Definition: QoreListNode.h:763
QoreListNode::extract
DLLEXPORT QoreListNode * extract(qore_offset_t offset, ExceptionSink *xsink)
truncates the list at position &quot;offset&quot; (first element is offset 0) and returns any elements removed ...
ConstListIterator
For use on the stack only: iterates through elements of a const QoreListNode.
Definition: QoreListNode.h:610
QoreListNode::sortDescending
DLLEXPORT QoreListNode * sortDescending() const
returns a new list based on quicksorting the source list (&quot;this&quot;) in descending order ...
QoreListNode::priv
struct qore_list_private * priv
this structure holds the private implementation for the type
Definition: QoreListNode.h:58
QoreListNode::derefImpl
virtual DLLEXPORT bool derefImpl(ExceptionSink *xsink)
dereferences all elements of the list
QoreListNode::qsort
DLLLOCAL int qsort(const ResolvedCallReferenceNode *fr, qore_size_t left, qore_size_t right, bool ascending, ExceptionSink *xsink)
qsort sorts the list in-place (unstable)