Rudiments
|
Inherits object.
Inherited by arraycollection< valuetype >, dictionarycollection< keytype, valuetype >, dom, nodecollection< valuetype >, scalarcollection< valuetype >, and tablecollection< valuetype >.
Public Member Functions | |
collection () | |
collection (collection &c) | |
collection & | operator= (collection &c) |
virtual | ~collection () |
virtual const char * | getType ()=0 |
virtual uint64_t | getCount ()=0 |
comparator * | getComparator () |
void | setComparator (comparator *newcomp) |
virtual bool | isReadOnly () |
virtual bool | isBlockBased () |
virtual uint64_t | getBlockSize () |
virtual bool | isSequentialAccess () |
virtual void | setManageValues (bool manage) |
virtual bool | getManageValues () |
virtual void | setManageArrayValues (bool manage) |
virtual bool | getManageArrayValues () |
virtual void | setManageKeys (bool manage) |
virtual bool | getManageKeys () |
virtual void | setManageArrayKeys (bool manage) |
virtual bool | getManageArrayKeys () |
virtual bool | clear ()=0 |
virtual ssize_t | write ()=0 |
virtual ssize_t | write (output *out)=0 |
virtual ssize_t | writeJson ()=0 |
virtual ssize_t | writeJson (bool indent)=0 |
virtual ssize_t | writeJson (output *out)=0 |
virtual ssize_t | writeJson (output *out, bool indent)=0 |
Public Member Functions inherited from object | |
virtual | ~object () |
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.
|
pure virtual |
Empties the collection.
Implemented in table< valuetype >, staticarray< valuetype, count >, singlylinkedlist< valuetype >, scalar< valuetype >, linkedlist< valuetype >, dynamicarray< valuetype >, dictionary< keytype, valuetype >, and avltree< 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 tablecollection< valuetype >, staticarray< valuetype, count >, singlylinkedlist< valuetype >, scalarcollection< valuetype >, linkedlist< valuetype >, dynamicarray< valuetype >, dictionary< keytype, valuetype >, and avltree< 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 >.
|
pure virtual |
Returns a string representing the base type of the collection, eg. list, dictionary, tree, etc.
Implemented in xmldom, treecollection< valuetype >, tablecollection< valuetype >, scalarcollection< valuetype >, propdom, listcollection< valuetype >, jsondom, inidom, dom, dictionarycollection< keytype, valuetype >, csvdom, and arraycollection< valuetype >.
|
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.
|
inlinevirtual |
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);
|
inlinevirtual |
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 >.
|
inlinevirtual |
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);
|
inlinevirtual |
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 treecollection< valuetype >, tablecollection< valuetype >, scalarcollection< valuetype >, listcollection< valuetype >, dom, dictionarycollection< keytype, valuetype >, and arraycollection< valuetype >.
|
pure virtual |
Writes a representation of the collection to "out".
Implemented in treecollection< valuetype >, tablecollection< valuetype >, scalarcollection< valuetype >, listcollection< valuetype >, dom, dictionarycollection< keytype, valuetype >, and arraycollection< valuetype >.
|
pure virtual |
Writes a JSON representation of the collection to standard output.
Implemented in treecollection< valuetype >, tablecollection< valuetype >, scalarcollection< valuetype >, listcollection< valuetype >, dictionarycollection< keytype, valuetype >, and arraycollection< valuetype >.
|
pure virtual |
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 treecollection< valuetype >, tablecollection< valuetype >, scalarcollection< valuetype >, listcollection< valuetype >, dictionarycollection< keytype, valuetype >, and arraycollection< valuetype >.
|
pure virtual |
Writes a JSON representation of the collection to "out".
Implemented in treecollection< valuetype >, tablecollection< valuetype >, scalarcollection< valuetype >, listcollection< valuetype >, dictionarycollection< keytype, valuetype >, and arraycollection< 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 treecollection< valuetype >, tablecollection< valuetype >, scalarcollection< valuetype >, listcollection< valuetype >, dictionarycollection< keytype, valuetype >, and arraycollection< valuetype >.