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 (C) 2003 - 2015 David Nichols
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Note that the Qore library is released under a choice of three open-source
licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
information.
*/
#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;
friend struct qore_list_private;
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 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:679
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:682
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:690
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:739
AbstractQoreNode
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:55
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:71
ConstListIterator::getReferencedValue
DLLEXPORT AbstractQoreNode * getReferencedValue() const
returns the current value with an incremented reference count
QoreListNodeEvalOptionalRefHolder::QoreListNodeEvalOptionalRefHolder
DLLLOCAL QoreListNodeEvalOptionalRefHolder(const QoreListNode *exp, ExceptionSink *n_xsink)
performs an optional evaluation of the list (sets the dereference flag)
Definition: QoreListNode.h:734
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:514
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:728
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:82
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:798
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:52
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:744
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:587
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:751
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:764
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:595
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:43
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
int64
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:228
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...
qore_offset_t
intptr_t qore_offset_t
used for offsets that could be negative
Definition: common.h:74
QoreReferenceCounter::is_unique
DLLLOCAL bool is_unique() const
returns true if the reference count is 1
Definition: QoreReferenceCounter.h:69
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:130
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:685
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:584
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:801
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:757
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:182
QoreListNodeEvalOptionalRefHolder::edit
DLLLOCAL void edit()
will create a unique list so the list can be edited
Definition: QoreListNode.h:782
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:676
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:590
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:581
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:699
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:51
QoreListNodeEvalOptionalRefHolder::getReferencedValue
DLLLOCAL QoreListNode * getReferencedValue()
returns a referenced value - the caller will own the reference
Definition: QoreListNode.h:773
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:620
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:67
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)