Rudiments
|
#include <collection.h>
Inherits object.
Inherited by arraycollection< valuetype >, dictionarycollection< keytype, valuetype >, dom, nodecollection< valuetype >, scalarcollection< valuetype >, and tablecollection< valuetype >.
The collection class is the parent class for all rudiments collections.
|
inline |
Creates an instance of the collection class.
|
inline |
Creates an instance of the collection class that is a copy of "c".
|
inlinevirtual |
Deletes this instance of the collection class.
Empties the collection.
Implemented in avltree< valuetype >, dictionary< keytype, valuetype >, dynamicarray< valuetype >, linkedlist< valuetype >, scalar< valuetype >, singlylinkedlist< valuetype >, staticarray< valuetype, count >, and table< valuetype >.
|
inlinevirtual |
Returns the block size for block-based implementations and 0 for monolithic implementations.
Returns 0 by default.
|
inline |
Returns the comparator used internally by the class. Returns whatever was previously set by setComparator() or an instance of the comparator class by default.
|
pure virtual |
Returns the number of elementes in the collection.
Implemented in avltree< valuetype >, dictionary< keytype, valuetype >, dynamicarray< valuetype >, linkedlist< valuetype >, scalarcollection< valuetype >, singlylinkedlist< valuetype >, staticarray< valuetype, count >, and tablecollection< valuetype >.
|
inlinevirtual |
Returns whether or not this instance of the collection class is configured to manage the arrays that are stored as the keys at each location in the collection.
Returns true if it is and false if it is not.
|
inlinevirtual |
Returns whether or not this instance of the collection class is configured to manage the arrays that are stored as the values at each location in the collection.
Returns true if it is and false if it is not.
Reimplemented in table< valuetype >.
|
inlinevirtual |
Returns whether or not this instance of the collection class is configured to manage the objects that are stored as the keys at each location in the collection.
See setManageKeys().
Returns true if it is and false if it is not.
|
inlinevirtual |
Returns whether or not this instance of the collection class is configured to manage the objects that are stored as the values at each location in the collection.
See setManageValues().
Returns true if it is and false if it is not.
Reimplemented in table< valuetype >.
Returns a string representing the base type of the collection, eg. list, dictionary, tree, etc.
Implemented in arraycollection< valuetype >, csvdom, dictionarycollection< keytype, valuetype >, dom, inidom, jsondom, listcollection< valuetype >, propdom, scalarcollection< valuetype >, tablecollection< valuetype >, treecollection< valuetype >, and xmldom.
|
inlinevirtual |
Returns true for block-based implementations and false for monolithic implementations.
Returns false by default.
|
inlinevirtual |
Returns true for read-only implementations and false for read-write implementations.
Returns false by default.
|
inlinevirtual |
Returns true for sequential-access implementations and false for random-access implementations.
Returns false by default.
|
inline |
Makes this instance of the collection class identical to "c".
|
inline |
Sets the comparator used by the class. Reverts to the default comparator if "newcomp" is NULL.
Indicates whether or not this instance should "manage" the keys that are stored at each location in the collection as arrays.
"manage" should only be set true if the keys stored in the collections are pointers to arrays of primitive types.
Defaults to "false".
If "manage" is set to true then:
If "manage" is set to false then:
To store managed arrays of non-primitive types as keys, consider using a managed collection of managed staticarrays. For example:
dictionary<staticarray< myobject * > *, uint32_t > d; d.setManageKeys(true); staticarray< myobject * > *s1= new staticarray< myobject * >(); s1.setManageKeys(true); s1[0]=new myobject(...); s1[1]=new myobject(...); s1[2]=new myobject(...); d.setValue(s1,1); staticarray< myobject * > *s2= new staticarray< myobject * >(); s2.setManageKeys(true); s2[0]=new myobject(...); s2[1]=new myobject(...); s2[2]=new myobject(...); d.setValue(s2,2); ...
Note that setting this true implies setManageKeys(false);
Indicates whether or not this instance should "manage" the values that are stored at each location in the collection as arrays.
"manage" should only be set true if the values stored in the collections are pointers to arrays of primitive types.
Defaults to "false".
If "manage" is set to true then:
If "manage" is set to false then:
To store managed arrays of non-primitive types as values, consider using a managed collection of managed staticarrays. For example:
linkedlist< staticarray< myobject * > *> l; l.setManageValues(true); staticarray< myobject * > *s1= new staticarray< myobject * >(); s1.setManageValues(true); s1[0]=new myobject(...); s1[1]=new myobject(...); s1[2]=new myobject(...); l.append(s1); staticarray< myobject * > *s2= new staticarray< myobject * >(); s2.setManageValues(true); s2[0]=new myobject(...); s2[1]=new myobject(...); s2[2]=new myobject(...); l.append(s2); ...
Note that setting this true implies setManageValues(false);
Reimplemented in table< valuetype >.
Indicates whether or not this instance should "manage" the keys that are stored at each location in the collection.
"manage" should only be set true if the keys stored in the collections are pointers to objects.
Defaults to "false".
If "manage" is set to true then:
If "manage" is set to false then:
Note that setting this true implies setManageArrayKeys(false);
Indicates whether or not this instance should "manage" the values that are stored at each location in the collection.
"manage" should only be set true if the values stored in the collections are pointers to objects.
Defaults to "false".
If "manage" is set to true then:
If "manage" is set to false then:
Note that setting this true implies setManageArrayValues(false);
Reimplemented in table< valuetype >.
|
pure virtual |
Writes a representation of the collection to standard output.
Implemented in arraycollection< valuetype >, dictionarycollection< keytype, valuetype >, dom, listcollection< valuetype >, scalarcollection< valuetype >, tablecollection< valuetype >, and treecollection< valuetype >.
Writes a representation of the collection to "out".
Implemented in arraycollection< valuetype >, dictionarycollection< keytype, valuetype >, dom, listcollection< valuetype >, scalarcollection< valuetype >, tablecollection< valuetype >, and treecollection< valuetype >.
|
pure virtual |
Writes a JSON representation of the collection to standard output.
Implemented in arraycollection< valuetype >, dictionarycollection< keytype, valuetype >, listcollection< valuetype >, scalarcollection< valuetype >, tablecollection< valuetype >, and treecollection< valuetype >.
Writes a JSON representation of the collection to standard output.
If "indent" is true, then the output is automatically indented. If "indent" is false, then the tree is written without indentation.
Implemented in arraycollection< valuetype >, dictionarycollection< keytype, valuetype >, listcollection< valuetype >, scalarcollection< valuetype >, tablecollection< valuetype >, and treecollection< valuetype >.
Writes a JSON representation of the collection to "out".
Implemented in arraycollection< valuetype >, dictionarycollection< keytype, valuetype >, listcollection< valuetype >, scalarcollection< valuetype >, tablecollection< valuetype >, and treecollection< valuetype >.
Writes a JSON representation of the collection to "out".
If "indent" is true, then the output is automatically indented. If "indent" is false, then the tree is written without indentation.
Implemented in arraycollection< valuetype >, dictionarycollection< keytype, valuetype >, listcollection< valuetype >, scalarcollection< valuetype >, tablecollection< valuetype >, and treecollection< valuetype >.