![]() |
Qore Programming Language - C/C++ Library 2.1.1
|
This is the list container type in Qore, dynamically allocated only, reference counted. More...
#include <QoreListNode.h>
Public Member Functions | |
| DLLEXPORT | QoreListNode () |
| create an empty list | |
| DLLLOCAL | QoreListNode (bool i) |
| this function is not exported in the qore library | |
| DLLEXPORT | QoreListNode (const QoreTypeInfo *valueTypeInfo) |
| creates an empty list with the given value type | |
| DLLEXPORT QoreListNode * | copy () const |
| performs a deep copy of the list and returns the new list | |
| DLLEXPORT QoreListNode * | copyListFrom (size_t index) const |
| performs a deep copy of the list starting from element "offset" and returns the new list | |
| DLLEXPORT bool | empty () const |
| returns true if the list is empty | |
| DLLEXPORT QoreListNode * | evalList (bool &needs_deref, ExceptionSink *xsink) const |
| optionally evaluates the list | |
| DLLEXPORT QoreListNode * | evalList (ExceptionSink *xsink) const |
| evaluates the list and returns a value (or 0) | |
| DLLEXPORT QoreListNode * | extract (qore_offset_t offset) |
| truncates the list at position "offset" (first element is offset 0) and returns any elements removed from the list as a new list | |
| DLLEXPORT QoreListNode * | extract (qore_offset_t offset, qore_offset_t length) |
| removes "length" elements at position "offset" (first element is offset 0) and returns any elements removed from the list as a new list | |
| DLLEXPORT QoreListNode * | extract (qore_offset_t offset, qore_offset_t length, const QoreValue l, ExceptionSink *xsink) |
| adds a single value or a list of values ("l") to list possition "offset", while removing "length" elements and returns any elements removed from the list as a new list | |
| virtual DLLEXPORT bool | getAsBoolImpl () const |
| returns false unless perl-boolean-evaluation is enabled, in which case it returns false only when empty | |
| DLLEXPORT QoreString * | getAsString (bool &del, int foff, ExceptionSink *xsink) const |
| returns a QoreString giving the verbose string representation of the List (including all contained values) | |
| DLLEXPORT int | getAsString (QoreString &str, int foff, ExceptionSink *xsink) const |
| concatenate the verbose string representation of the list (including all contained values) to an existing QoreString | |
| DLLEXPORT int | getEntryAsInt (size_t index) const |
| returns the value of element at "index" as an integer (first element is index 0) | |
| DLLEXPORT QoreValue | getReferencedEntry (size_t index) const |
| returns the element at "index" (first element is index 0), the caller owns the reference | |
| DLLEXPORT const QoreTypeInfo * | getTypeInfo () const |
| returns the type info structure for the current value; also works for lists with a specific value type | |
| virtual DLLEXPORT const char * | getTypeName () const |
| returns the type name as a c string | |
| DLLEXPORT const QoreTypeInfo * | getValueTypeInfo () const |
| returns the value type declaration (if set) | |
| DLLEXPORT int | insert (QoreValue val, ExceptionSink *xsink) |
| inserts a value in the first position of the list | |
| virtual DLLEXPORT bool | is_equal_hard (const AbstractQoreNode *v, ExceptionSink *xsink) const |
| tests for equality ("deep compare" including all contained values) without type conversions (hard compare) | |
| virtual DLLEXPORT bool | is_equal_soft (const AbstractQoreNode *v, ExceptionSink *xsink) const |
| tests for equality ("deep compare" including all contained values) with possible type conversion (soft compare) | |
| DLLLOCAL bool | isFinalized () const |
| this function is not exported in the qore library | |
| DLLLOCAL bool | isVariableList () const |
| this function is not exported in the qore library | |
| DLLEXPORT QoreListNode * | listRefSelf () const |
| returns "this" with an incremented reference count | |
| DLLEXPORT QoreValue | max (const ResolvedCallReferenceNode *fr, ExceptionSink *xsink) const |
| returns the element having the highest value (determined by calling the function reference passed to give lexical order) | |
| DLLEXPORT QoreValue | max (ExceptionSink *xsink) const |
| returns the element having the highest value (determined by calling OP_LOG_GT - the greater-than ">" operator) | |
| DLLEXPORT int | merge (const QoreListNode *list, ExceptionSink *xsink) |
| appends the elements of "list" to this list | |
| DLLEXPORT QoreValue | min (const ResolvedCallReferenceNode *fr, ExceptionSink *xsink) const |
| returns the element having the lowest value (determined by calling the function reference passed to give lexical order) | |
| DLLEXPORT QoreValue | min (ExceptionSink *xsink) const |
| returns the element having the lowest value (determined by calling OP_LOG_LT - the less-than "<" operator) | |
| virtual DLLLOCAL int | parseInit (QoreValue &val, QoreParseContext &parse_context) |
| for initialization of lists in the parse tree at parse time (always returns "this") | |
| DLLEXPORT QoreValue | pop () |
| returns the last element of the list, the length is decremented by one, caller owns the reference | |
| DLLEXPORT int | push (QoreValue val, ExceptionSink *xsink) |
| adds a value to the list | |
| virtual DLLEXPORT AbstractQoreNode * | realCopy () const |
| returns true if the list contains parse expressions and therefore needs evaluation to return a value, false if not | |
| DLLEXPORT QoreValue | retrieveEntry (size_t index) |
| returns the element at "index" (first element is index 0) | |
| DLLEXPORT const QoreValue | retrieveEntry (size_t index) const |
| returns the element at "index" (first element is index 0) | |
| DLLEXPORT QoreListNode * | reverse () const |
| returns a list with the order of the elements reversed | |
| DLLEXPORT int | setEntry (size_t index, QoreValue val, ExceptionSink *xsink) |
| sets the value of a list element | |
| DLLLOCAL void | setFinalized () |
| this function is not exported in the qore library | |
| DLLLOCAL void | setVariableList () |
| this function is not exported in the qore library | |
| DLLEXPORT QoreValue | shift () |
| returns the first element of the list, all other entries are moved down to fill up the first position, caller owns the reference | |
| DLLEXPORT size_t | size () const |
| returns the number of elements in the list | |
| DLLEXPORT QoreListNode * | sort (const ResolvedCallReferenceNode *fr, ExceptionSink *xsink) const |
| returns a new list based on quicksorting the source list ("this") using the passed function reference to determine lexical order | |
| DLLEXPORT QoreListNode * | sort (ExceptionSink *xsink) const |
| returns a new list based on quicksorting the source list ("this") | |
| DLLEXPORT QoreListNode * | sortDescending (const ResolvedCallReferenceNode *fr, ExceptionSink *xsink) const |
| returns a new list based on quicksorting the source list ("this") in descending order, using the passed function reference to determine lexical order | |
| DLLEXPORT QoreListNode * | sortDescending (ExceptionSink *xsink) const |
| returns a new list based on quicksorting the source list ("this") in descending order | |
| DLLEXPORT QoreListNode * | sortDescendingStable (const ResolvedCallReferenceNode *fr, ExceptionSink *xsink) const |
| returns a new list based on executing mergesort on the source list ("this") in descending order, using the passed function reference to determine lexical order | |
| DLLEXPORT QoreListNode * | sortDescendingStable (ExceptionSink *xsink) const |
| returns a new list based on executing mergesort on the source list ("this") in descending order | |
| DLLEXPORT QoreListNode * | sortStable (const ResolvedCallReferenceNode *fr, ExceptionSink *xsink) const |
| returns a new list based on executing mergesort on the source list ("this") using the passed function reference to determine lexical order | |
| DLLEXPORT QoreListNode * | sortStable (ExceptionSink *xsink) const |
| returns a new list based on executing mergesort on the source list ("this") | |
| DLLEXPORT QoreListNode * | splice (qore_offset_t offset) |
| truncates the list at position "offset" (first element is offset 0) and returns any elements removed from the list as a new list | |
| DLLEXPORT QoreListNode * | splice (qore_offset_t offset, qore_offset_t length) |
| removes "length" elements at position "offset" (first element is offset 0) and returns any elements removed from the list as a new list | |
| DLLEXPORT QoreListNode * | splice (qore_offset_t offset, qore_offset_t length, const QoreValue l, ExceptionSink *xsink) |
| adds a single value or a list of values ("l") to list possition "offset", while removing "length" elements and returns any elements removed from the list as a new list | |
| DLLEXPORT bool | weakDeref () |
| Decrements the weak reference count for this object. | |
| DLLEXPORT void | weakRef () |
| Increments the weak reference count for this object. | |
Public Member Functions inherited from AbstractQoreNode | |
| DLLEXPORT | AbstractQoreNode (const AbstractQoreNode &v) |
| copy constructor | |
| DLLEXPORT | AbstractQoreNode (qore_type_t t, bool n_value, bool n_needs_eval, bool n_there_can_be_only_one=false, bool n_custom_reference_handlers=false) |
| constructor takes the type | |
| virtual DLLEXPORT void | customDeref (ExceptionSink *xsink) |
| virtual DLLEXPORT void | customRef () const |
| special processing when the object's reference count transitions from 0-1 | |
| DLLEXPORT void | deref (ExceptionSink *xsink) |
| decrements the reference count and calls derefImpl() if there_can_be_only_one is false, otherwise does nothing | |
| DLLEXPORT QoreValue | eval (bool &needs_deref, ExceptionSink *xsink) const |
| optionally evaluates the argument | |
| DLLEXPORT QoreValue | eval (ExceptionSink *xsink) const |
| evaluates the object and returns a value (or 0) | |
| DLLEXPORT int64 | getAsBigInt () const |
| returns the 64-bit integer value of the object | |
| virtual DLLLOCAL int64 | getAsBigIntImpl () const |
| default implementation, returns 0 | |
| DLLEXPORT bool | getAsBool () const |
| returns the boolean value of the object | |
| DLLEXPORT double | getAsFloat () const |
| returns the float value of the object | |
| virtual DLLLOCAL double | getAsFloatImpl () const |
| default implementation, returns 0.0 | |
| DLLEXPORT int | getAsInt () const |
| returns the integer value of the object | |
| virtual DLLLOCAL int | getAsIntImpl () const |
| default implementation, returns 0 | |
| virtual DLLEXPORT class DateTime * | getDateTimeRepresentation (bool &del) const |
| returns the DateTime representation of this type (default implementation: returns ZeroDate, del = false) | |
| virtual DLLEXPORT void | getDateTimeRepresentation (DateTime &dt) const |
| assigns the date representation of a value to the DateTime reference passed, default implementation does nothing | |
| virtual DLLEXPORT QoreString * | getStringRepresentation (bool &del) const |
| returns the value of the type converted to a string, default implementation: returns the empty string | |
| virtual DLLEXPORT void | getStringRepresentation (QoreString &str) const |
| concatentates the value of the type to an existing QoreString reference, default implementation does nothing | |
| DLLLOCAL qore_type_t | getType () const |
| returns the data type | |
| DLLLOCAL bool | is_value () const |
| returns true if the node represents a value | |
| DLLLOCAL bool | isReferenceCounted () const |
| returns true if the object is reference-counted | |
| DLLLOCAL bool | needs_eval () const |
| returns true if the object needs evaluation to return a value, false if not | |
| DLLLOCAL AbstractQoreNode & | operator= (const AbstractQoreNode &) |
| this function is not implemented; it is here as a private function in order to prohibit it from being used | |
| DLLEXPORT void | ref () const |
| increments the reference count | |
| DLLEXPORT AbstractQoreNode * | refSelf () const |
| returns "this" with an incremented reference count | |
Public Member Functions inherited from QoreReferenceCounter | |
| DLLEXPORT | QoreReferenceCounter () |
| Creates the reference counter object. | |
| DLLEXPORT | QoreReferenceCounter (const QoreReferenceCounter &old) |
| Creates a new object with a reference count of 1. | |
| DLLEXPORT | ~QoreReferenceCounter () |
| destroys the reference counter object | |
| DLLEXPORT bool | is_unique () const |
| Returns true if the reference count is 1. | |
| DLLEXPORT bool | optRef () |
| Make a strong reference only if the object is valid. | |
| DLLEXPORT int | reference_count () const |
| Gets the reference count. | |
| DLLEXPORT bool | ROdereference () const |
| Atomically decrements the reference count. | |
| DLLEXPORT void | ROreference () const |
| Atomically increments the reference count. | |
Static Public Member Functions | |
| static DLLLOCAL const char * | getStaticTypeName () |
| returns true if the list does not contain any parse expressions, otherwise returns false | |
Protected Member Functions | |
| virtual DLLEXPORT | ~QoreListNode () |
| the destructor is protected so it cannot be called directly | |
| virtual DLLEXPORT bool | derefImpl (ExceptionSink *xsink) |
| dereferences all elements of the list | |
| virtual DLLLOCAL QoreValue | evalImpl (bool &needs_deref, ExceptionSink *xsink) const |
| optionally evaluates the argument | |
Protected Member Functions inherited from AbstractQoreNode | |
| virtual DLLEXPORT | ~AbstractQoreNode () |
| default destructor does nothing | |
Protected Attributes | |
| struct qore_list_private * | priv |
| this structure holds the private implementation for the type | |
Protected Attributes inherited from AbstractQoreNode | |
| bool | custom_reference_handlers: 1 |
| set to one for objects that need custom reference handlers | |
| bool | needs_eval_flag: 1 |
| if this is true then the type can be evaluated | |
| bool | there_can_be_only_one: 1 |
| if this is set to true, then reference counting is turned off for objects of this class | |
| qore_type_t | type: 11 |
| the type of the object | |
| bool | value: 1 |
| this is true for values, if false then either the type needs evaluation to produce a value or is a parse expression | |
Protected Attributes inherited from QoreReferenceCounter | |
This is the list container type in Qore, dynamically allocated only, reference counted.
it is both a value type and can hold parse expressions as well (in which case it needs to be evaluated) the first element in the list is element 0
|
protectedvirtual |
the destructor is protected so it cannot be called directly
use the deref(ExceptionSink) function to release the reference count
| DLLEXPORT QoreListNode * QoreListNode::copyListFrom | ( | size_t | index | ) | const |
performs a deep copy of the list starting from element "offset" and returns the new list
therefore element 0 of the new list is element "offset" in the source list
| index | the index of the element (first element is index 0) |
|
protectedvirtual |
dereferences all elements of the list
The ExceptionSink argument is needed for those types that could throw an exception when they are deleted (ex: QoreObject) - which could be contained in the list
| xsink | if an error occurs, the Qore-language exception information will be added here |
Reimplemented from AbstractQoreNode.
| DLLEXPORT bool QoreListNode::empty | ( | ) | const |
returns true if the list is empty
return true if the list is empty
Referenced by ConstListIterator::empty(), and ListIterator::empty().
|
protectedvirtual |
optionally evaluates the argument
return value requires a deref(xsink) if needs_deref is true
Implements AbstractQoreNode.
| DLLEXPORT QoreListNode * QoreListNode::evalList | ( | bool & | needs_deref, |
| ExceptionSink * | xsink ) const |
optionally evaluates the list
return value requires a deref(xsink) if needs_deref is true NOTE: if the list requires evaluation and there is an exception, 0 will be returned NOTE: do not use this function directly, use the QoreListNodeEvalOptionalRefHolder class instead
| needs_deref | this is an output parameter, if needs_deref is true then the value returned must be dereferenced |
| xsink | if an error occurs, the Qore-language exception information will be added here |
| DLLEXPORT QoreListNode * QoreListNode::evalList | ( | ExceptionSink * | xsink | ) | const |
evaluates the list and returns a value (or 0)
return value requires a deref(xsink) if the list does not require evaluation then "refSelf()" is used to return the same object with an incremented reference count NOTE: if the object requires evaluation and there is an exception, 0 will be returned
| xsink | if an error occurs, the Qore-language exception information will be added here |
| DLLEXPORT QoreListNode * QoreListNode::extract | ( | qore_offset_t | offset | ) |
truncates the list at position "offset" (first element is offset 0) and returns any elements removed from the list as a new list
| offset | the index of the element (first element is offset 0, negative offsets are offsets from the end of the list) |
| DLLEXPORT QoreListNode * QoreListNode::extract | ( | qore_offset_t | offset, |
| qore_offset_t | length ) |
removes "length" elements at position "offset" (first element is offset 0) and returns any elements removed from the list as a new list
| offset | the index of the element (first element is offset 0, negative offsets are offsets from the end of the list) |
| length | the number of elements to remove (negative numbers mean all except that many elements from the end) |
| DLLEXPORT QoreListNode * QoreListNode::extract | ( | qore_offset_t | offset, |
| qore_offset_t | length, | ||
| const QoreValue | l, | ||
| ExceptionSink * | xsink ) |
adds a single value or a list of values ("l") to list possition "offset", while removing "length" elements and returns any elements removed from the list as a new list
| offset | the index of the element (first element is offset 0, negative offsets are offsets from the end of the list) |
| length | the number of elements to remove (negative numbers mean all except that many elements from the end) |
| l | the value or list of values to insert |
| xsink | if an error occurs (ex: the type of value to be inserted in the list is not compatible with the list's declared type), the Qore-language exception information will be added here |
|
virtual |
returns false unless perl-boolean-evaluation is enabled, in which case it returns false only when empty
Reimplemented from AbstractQoreNode.
|
virtual |
returns a QoreString giving the verbose string representation of the List (including all contained values)
used for n and N printf formatting
| del | if this is true when the function returns, then the returned QoreString pointer should be deleted, if false, then it must not be |
| foff | for multi-line formatting offset, -1 = no line breaks |
| xsink | if an error occurs, the Qore-language exception information will be added here NOTE: Use the QoreNodeAsStringHelper class (defined in QoreStringNode.h) instead of using this function directly |
Implements AbstractQoreNode.
|
virtual |
concatenate the verbose string representation of the list (including all contained values) to an existing QoreString
used for n and N printf formatting
| str | the string representation of the type will be concatenated to this QoreString reference |
| foff | for multi-line formatting offset, -1 = no line breaks |
| xsink | if an error occurs, the Qore-language exception information will be added here |
Implements AbstractQoreNode.
| DLLEXPORT int QoreListNode::getEntryAsInt | ( | size_t | index | ) | const |
returns the value of element at "index" as an integer (first element is index 0)
| index | the index of the element (first element is index 0) |
| DLLEXPORT QoreValue QoreListNode::getReferencedEntry | ( | size_t | index | ) | const |
returns the element at "index" (first element is index 0), the caller owns the reference
| index | the index of the element (first element is index 0) |
| DLLEXPORT const QoreTypeInfo * QoreListNode::getTypeInfo | ( | ) | const |
returns the type info structure for the current value; also works for lists with a specific value type
| DLLEXPORT const QoreTypeInfo * QoreListNode::getValueTypeInfo | ( | ) | const |
returns the value type declaration (if set)
| DLLEXPORT int QoreListNode::insert | ( | QoreValue | val, |
| ExceptionSink * | xsink ) |
inserts a value in the first position of the list
|
virtual |
tests for equality ("deep compare" including all contained values) without type conversions (hard compare)
| v | the value to compare |
| xsink | if an error occurs, the Qore-language exception information will be added here |
Implements AbstractQoreNode.
|
virtual |
tests for equality ("deep compare" including all contained values) with possible type conversion (soft compare)
| v | the value to compare |
| xsink | if an error occurs, the Qore-language exception information will be added here |
Implements AbstractQoreNode.
| DLLEXPORT QoreValue QoreListNode::max | ( | const ResolvedCallReferenceNode * | fr, |
| ExceptionSink * | xsink ) const |
returns the element having the highest value (determined by calling the function reference passed to give lexical order)
| fr | the function reference to be executed for each comparison to give lexical order to the elements |
| xsink | if an error occurs, the Qore-language exception information will be added here |
| DLLEXPORT QoreValue QoreListNode::max | ( | ExceptionSink * | xsink | ) | const |
returns the element having the highest value (determined by calling OP_LOG_GT - the greater-than ">" operator)
so "soft" comparisons are made, meaning that the list can be made up of different types, and, as long as the comparisons are meaningful, the maximum value can be returned
| DLLEXPORT int QoreListNode::merge | ( | const QoreListNode * | list, |
| ExceptionSink * | xsink ) |
appends the elements of "list" to this list
| DLLEXPORT QoreValue QoreListNode::min | ( | const ResolvedCallReferenceNode * | fr, |
| ExceptionSink * | xsink ) const |
returns the element having the lowest value (determined by calling the function reference passed to give lexical order)
| fr | the function reference to be executed for each comparison to give lexical order to the elements |
| xsink | if an error occurs, the Qore-language exception information will be added here |
| DLLEXPORT QoreValue QoreListNode::min | ( | ExceptionSink * | xsink | ) | const |
returns the element having the lowest value (determined by calling OP_LOG_LT - the less-than "<" operator)
so "soft" comparisons are made, meaning that the list can be made up of different types, and, as long as the comparisons are meaningful, the minimum value can be returned
| DLLEXPORT QoreValue QoreListNode::pop | ( | ) |
returns the last element of the list, the length is decremented by one, caller owns the reference
if the list is empty the 0 is returned (NOTE: the last entry could also be 0 as well)
| DLLEXPORT int QoreListNode::push | ( | QoreValue | val, |
| ExceptionSink * | xsink ) |
adds a value to the list
|
virtual |
returns true if the list contains parse expressions and therefore needs evaluation to return a value, false if not
performs a deep copy of the list and returns the new list
Implements AbstractQoreNode.
| DLLEXPORT QoreValue QoreListNode::retrieveEntry | ( | size_t | index | ) |
returns the element at "index" (first element is index 0)
the value is not referenced for the caller
| index | the index of the element (first element is index 0) |
Referenced by get_hard_value_or_nothing_param(), get_hard_value_param(), get_param_value(), and test_reference_param().
| DLLEXPORT const QoreValue QoreListNode::retrieveEntry | ( | size_t | index | ) | const |
returns the element at "index" (first element is index 0)
the value is not referenced for the caller
| index | the index of the element (first element is index 0) |
| DLLEXPORT int QoreListNode::setEntry | ( | size_t | index, |
| QoreValue | val, | ||
| ExceptionSink * | xsink ) |
sets the value of a list element
if there is a value there already, it is dereferenced (hence "xsink" is needed to catch any exceptions)
| index | the index of the element (first element is index 0) |
| val | the value to set, must be already referenced for the assignment |
| xsink | if an error occurs, the Qore-language exception information will be added here |
| DLLEXPORT QoreValue QoreListNode::shift | ( | ) |
returns the first element of the list, all other entries are moved down to fill up the first position, caller owns the reference
if the list is empty the 0 is returned (NOTE: the first entry could also be 0 as well) with the current implementation the execution time for this function is O(n) where n is the length of the list
| DLLEXPORT size_t QoreListNode::size | ( | ) | const |
returns the number of elements in the list
return the number of elements in the list
Referenced by ConstListIterator::max(), ListIterator::max(), num_args(), and num_params().
| DLLEXPORT QoreListNode * QoreListNode::sort | ( | const ResolvedCallReferenceNode * | fr, |
| ExceptionSink * | xsink ) const |
returns a new list based on quicksorting the source list ("this") using the passed function reference to determine lexical order
| fr | the function reference to be executed for each comparison to give lexical order to the elements |
| xsink | if an error occurs, the Qore-language exception information will be added here |
| DLLEXPORT QoreListNode * QoreListNode::sort | ( | ExceptionSink * | xsink | ) | const |
returns a new list based on quicksorting the source list ("this")
"soft" comparisons are made using OP_LOG_LT, meaning that the list can be made up of different data types and still be sorted
| DLLEXPORT QoreListNode * QoreListNode::sortDescending | ( | const ResolvedCallReferenceNode * | fr, |
| ExceptionSink * | xsink ) const |
returns a new list based on quicksorting the source list ("this") in descending order, using the passed function reference to determine lexical order
| fr | the function reference to be executed for each comparison to give lexical order to the elements |
| xsink | if an error occurs, the Qore-language exception information will be added here |
| DLLEXPORT QoreListNode * QoreListNode::sortDescending | ( | ExceptionSink * | xsink | ) | const |
returns a new list based on quicksorting the source list ("this") in descending order
"soft" comparisons are made using OP_LOG_LT, meaning that the list can be made up of different data types and still be sorted
| DLLEXPORT QoreListNode * QoreListNode::sortDescendingStable | ( | const ResolvedCallReferenceNode * | fr, |
| ExceptionSink * | xsink ) const |
returns a new list based on executing mergesort on the source list ("this") in descending order, using the passed function reference to determine lexical order
| fr | the function reference to be executed for each comparison to give lexical order to the elements |
| xsink | if an error occurs, the Qore-language exception information will be added here |
| DLLEXPORT QoreListNode * QoreListNode::sortDescendingStable | ( | ExceptionSink * | xsink | ) | const |
returns a new list based on executing mergesort on the source list ("this") in descending order
"soft" comparisons are made using OP_LOG_LT, meaning that the list can be made up of different data types and still be sorted
| DLLEXPORT QoreListNode * QoreListNode::sortStable | ( | const ResolvedCallReferenceNode * | fr, |
| ExceptionSink * | xsink ) const |
returns a new list based on executing mergesort on the source list ("this") using the passed function reference to determine lexical order
| fr | the function reference to be executed for each comparison to give lexical order to the elements |
| xsink | if an error occurs, the Qore-language exception information will be added here |
| DLLEXPORT QoreListNode * QoreListNode::sortStable | ( | ExceptionSink * | xsink | ) | const |
returns a new list based on executing mergesort on the source list ("this")
"soft" comparisons are made using OP_LOG_LT, meaning that the list can be made up of different data types and still be sorted
| DLLEXPORT QoreListNode * QoreListNode::splice | ( | qore_offset_t | offset | ) |
truncates the list at position "offset" (first element is offset 0) and returns any elements removed from the list as a new list
| offset | the index of the element (first element is offset 0, negative offsets are offsets from the end of the list) |
| DLLEXPORT QoreListNode * QoreListNode::splice | ( | qore_offset_t | offset, |
| qore_offset_t | length ) |
removes "length" elements at position "offset" (first element is offset 0) and returns any elements removed from the list as a new list
| offset | the index of the element (first element is offset 0, negative offsets are offsets from the end of the list) |
| length | the number of elements to remove (negative numbers mean all except that many elements from the end) |
| DLLEXPORT QoreListNode * QoreListNode::splice | ( | qore_offset_t | offset, |
| qore_offset_t | length, | ||
| const QoreValue | l, | ||
| ExceptionSink * | xsink ) |
adds a single value or a list of values ("l") to list possition "offset", while removing "length" elements and returns any elements removed from the list as a new list
the "l" AbstractQoreNode (or each element if it is a QoreListNode) will be referenced for the assignment in the QoreListNode
| offset | the index of the element (first element is offset 0, negative offsets are offsets from the end of the list) |
| length | the number of elements to remove (negative numbers mean all except that many elements from the end) |
| l | the value or list of values to insert |
| xsink | if an error occurs (ex: the type of value to be inserted in the list is not compatible with the list's declared type), the Qore-language exception information will be added here |
| DLLEXPORT bool QoreListNode::weakDeref | ( | ) |
Decrements the weak reference count for this object.
true then the object was deleted| DLLEXPORT void QoreListNode::weakRef | ( | ) |
Increments the weak reference count for this object.
|
protected |
this structure holds the private implementation for the type
therefore changes to the implementation will not affect the C++ ABI