#include <dynArray.hh>
Public Member Functions | |
DynArray (uint htblsz=2, uint pgsz=2) | |
DynArray (uint htblsz, uint pgsz, const T &dflt) | |
DynArray (const DynArray &d) | |
Copy constructor. | |
T & | operator[] (uint i) |
const T & | operator[] (uint i) const |
bool | isElm (uint i) |
const bool | isElm (uint i) const |
float | memory () const |
Approximate memory consumption in bytes. | |
void | reset () |
Clears the array. | |
uint | max () const |
Maximal referenced index + 1. | |
uint | min () const |
Minimal referenced index. | |
Protected Member Functions | |
virtual std::ostream & | info (std::ostream &os) const |
Returns information in an output stream. | |
Protected Attributes | |
bool | init_ |
bool | empty_ |
uint | max_ |
uint | min_ |
uint | npg_ |
const uint | htblsz_ |
Size of the hash table function (how many bits of the page number) | |
const uint | htblmsk_ |
Hash table mask. | |
const uint | pgsz_ |
Size of a page in number of entries. | |
const uint | pgmsk_ |
Container class: a dynamic array.
The entries of the array are managed in chunks of fixed size (so called pages). The access is done over a hash function.
Definition at line 105 of file dynArray.hh.
|
inline |
Constructor.
The entries of the array are managed in pages of size pgsz. The larger the page size, the larger the probably unused space. The smaller the page size, the higher the cost of management.
The have fast access to the pages, a simple hash table algorithm is implemented. The hash function is the last htblsz bits of the page number.
htblsz | Size of the hash table, ie. how many bits of the page number. |
pgsz | Page size in number of entries. |
Definition at line 162 of file dynArray.hh.
|
inline |
Definition at line 170 of file dynArray.hh.
|
inline |
Copy constructor.
Definition at line 178 of file dynArray.hh.
|
inline |
Definition at line 187 of file dynArray.hh.
|
protectedvirtual |
Returns information in an output stream.
Reimplemented from concepts::DynArrayBase.
Definition at line 336 of file dynArray.hh.
bool concepts::DynArray< T >::isElm | ( | uint | i | ) |
Checks if the element is not equal to the default element
Definition at line 265 of file dynArray.hh.
const bool concepts::DynArray< T >::isElm | ( | uint | i | ) | const |
Definition at line 289 of file dynArray.hh.
|
inlineinherited |
Maximal referenced index + 1.
Definition at line 37 of file dynArray.hh.
|
inline |
Approximate memory consumption in bytes.
Definition at line 315 of file dynArray.hh.
|
inlineinherited |
Minimal referenced index.
Definition at line 40 of file dynArray.hh.
T & concepts::DynArray< T >::operator[] | ( | uint | i | ) |
Index operator for the container.
If an item is not existing, it is created, inserted into the array and then returned.
Definition at line 201 of file dynArray.hh.
const T & concepts::DynArray< T >::operator[] | ( | uint | i | ) | const |
Index operator for the container.
Definition at line 233 of file dynArray.hh.
void concepts::DynArray< T >::reset | ( | ) |
Clears the array.
Definition at line 322 of file dynArray.hh.
|
protectedinherited |
Definition at line 43 of file dynArray.hh.
|
protectedinherited |
Hash table mask.
Definition at line 52 of file dynArray.hh.
|
protectedinherited |
Size of the hash table function (how many bits of the page number)
Definition at line 49 of file dynArray.hh.
|
protectedinherited |
Definition at line 42 of file dynArray.hh.
|
protectedinherited |
Definition at line 44 of file dynArray.hh.
|
protectedinherited |
Definition at line 45 of file dynArray.hh.
|
protectedinherited |
Definition at line 46 of file dynArray.hh.
|
protectedinherited |
Definition at line 56 of file dynArray.hh.
|
protectedinherited |
Size of a page in number of entries.
Definition at line 55 of file dynArray.hh.