Templated class, defined and implimented in file: hzTmplArray.h
The hzArray class template facilitates an array of objects. The objects are not stored in an actual array (of continuous memory) but in a tree of blocks based on absolute positioning. On the highest level the data blocks comprise only an array of HZ_ARRAY_NODESIZE objects while on the inner levels the index blocks comprise nothing but HZ_ARRAY_NODESIZE pointers to the blocks above. With a population of 0 the root of the tree is null and the hzArray has a level of zero. With a population between 1 and HZ_ARRAY_NODESIZE, the root points to a single data block and the hzArray now has 1 level. As the population rises above HZ_ARRAY_NODESIZE the level goes up to 2 and from now on the root is an index node. A new level is created when the root splits into two nodes, which happens when the population goes above HZ_ARRAY_NODESIZE to the power of the current level. Note that hzArray does not support an Insert() or a Delete() method. It is intended only to be aggregated to by a series of appends and then accesses by the [] operator. The hzArray is thus an unordered collection.
This class employes the folowing private sub-classes
_array_ca
_hz_ar_data
_hz_ar_indx
Constructors/Detructors
| hzArray* | hzArray | (hzArray& op) | |
| hzArray* | hzArray | (void) | |
| hzArray* | hzArray | (bool bLock) | |
| void | ~hzArray | (void) |
Public Methods:
| hzEcode | Add | (OBJ& obj) | Add (append) an object to the end of the collection |
| void | Clear | (void) | Clear all nodes |
| uint32_t | Count | (void) | |
| uint32_t | Factor | (void) | |
| OBJ* | InSitu | (uint32_t nPosn) | Return pointer to object |
| uint32_t | Level | (void) | |
| void | SetDefault | (OBJ dflt) | |
| void | _clear | (void* pN)uint32_t nLevel, uint32_t maxLevel, | Clear the array |
| uint32_t | dBlocks | (void) | |
| uint32_t | iBlocks | (void) |
Overloaded operators:
| hzArray& | operator= | (hzArray& op) | |
| OBJ& | operator[] | (uint32_t nPosn) | Return actual in-situ object |
Member Variables:
| hzArray::_array_ca* | mx | The actual array |