Container class: a dynamic array. More...
#include <dynArray.hh>


Public Member Functions | |
| DynArray (uint htblsz=2, uint pgsz=2) | |
| Constructor. | |
| DynArray (uint htblsz, uint pgsz, const T &dflt) | |
| DynArray (const DynArray &d) | |
| Copy constructor. | |
| const bool | isElm (uint i) const |
| bool | isElm (uint i) |
| Checks if the element is not equal to the default element. | |
| uint | max () const |
| Maximal referenced index + 1. | |
| float | memory () const |
| Approximate memory consumption in bytes. | |
| uint | min () const |
| Minimal referenced index. | |
| T & | operator[] (uint i) |
| Index operator for the container. | |
| const T & | operator[] (uint i) const |
| Index operator for the container. | |
| void | reset () |
| Clears the array. | |
| ~DynArray () | |
Protected Member Functions | |
| virtual std::ostream & | info (std::ostream &os) const |
| Returns information in an output stream. | |
Protected Attributes | |
| bool | empty_ |
| const uint | htblmsk_ |
| Hash table mask. | |
| const uint | htblsz_ |
| Size of the hash table function (how many bits of the page number) | |
| bool | init_ |
| uint | max_ |
| uint | min_ |
| uint | npg_ |
| const uint | pgmsk_ |
| const uint | pgsz_ |
| Size of a page in number of entries. | |
Private Attributes | |
| T | dflt_ |
| DynArrayPage< T > ** | htbl_ |
| DynArrayPage< T > * | lru_ |
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 103 of file dynArray.hh.
| concepts::DynArray< T >::DynArray | ( | uint | htblsz = 2, |
| uint | pgsz = 2 |
||
| ) | [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 160 of file dynArray.hh.
| concepts::DynArray< T >::DynArray | ( | uint | htblsz, |
| uint | pgsz, | ||
| const T & | dflt | ||
| ) | [inline] |
Definition at line 168 of file dynArray.hh.
| concepts::DynArray< T >::DynArray | ( | const DynArray< T > & | d | ) | [inline] |
Copy constructor.
Definition at line 176 of file dynArray.hh.
| concepts::DynArray< T >::~DynArray | ( | ) | [inline] |
| std::ostream & concepts::DynArray< T >::info | ( | std::ostream & | os | ) | const [protected, virtual] |
Returns information in an output stream.
Reimplemented from concepts::DynArrayBase.
Definition at line 334 of file dynArray.hh.

| const bool concepts::DynArray< T >::isElm | ( | uint | i | ) | const |
| bool concepts::DynArray< T >::isElm | ( | uint | i | ) |
Checks if the element is not equal to the default element.
Definition at line 263 of file dynArray.hh.

| uint concepts::DynArrayBase::max | ( | ) | const [inline, inherited] |
Maximal referenced index + 1.
Definition at line 35 of file dynArray.hh.
| float concepts::DynArray< T >::memory | ( | ) | const [inline] |
Approximate memory consumption in bytes.
Definition at line 313 of file dynArray.hh.
| uint concepts::DynArrayBase::min | ( | ) | const [inline, inherited] |
Minimal referenced index.
Definition at line 38 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 199 of file dynArray.hh.

| const T & concepts::DynArray< T >::operator[] | ( | uint | i | ) | const |
Index operator for the container.
Definition at line 231 of file dynArray.hh.

| void concepts::DynArray< T >::reset | ( | ) |
Clears the array.
Definition at line 320 of file dynArray.hh.

T concepts::DynArray< T >::dflt_ [private] |
Definition at line 156 of file dynArray.hh.
bool concepts::DynArrayBase::empty_ [protected, inherited] |
Definition at line 41 of file dynArray.hh.
DynArrayPage<T>** concepts::DynArray< T >::htbl_ [private] |
Definition at line 154 of file dynArray.hh.
const uint concepts::DynArrayBase::htblmsk_ [protected, inherited] |
Hash table mask.
Definition at line 50 of file dynArray.hh.
const uint concepts::DynArrayBase::htblsz_ [protected, inherited] |
Size of the hash table function (how many bits of the page number)
Definition at line 47 of file dynArray.hh.
bool concepts::DynArrayBase::init_ [protected, inherited] |
Definition at line 40 of file dynArray.hh.
DynArrayPage<T>* concepts::DynArray< T >::lru_ [private] |
Definition at line 155 of file dynArray.hh.
uint concepts::DynArrayBase::max_ [protected, inherited] |
Definition at line 42 of file dynArray.hh.
uint concepts::DynArrayBase::min_ [protected, inherited] |
Definition at line 43 of file dynArray.hh.
uint concepts::DynArrayBase::npg_ [protected, inherited] |
Definition at line 44 of file dynArray.hh.
const uint concepts::DynArrayBase::pgmsk_ [protected, inherited] |
Definition at line 54 of file dynArray.hh.
const uint concepts::DynArrayBase::pgsz_ [protected, inherited] |
Size of a page in number of entries.
Definition at line 53 of file dynArray.hh.