Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
concepts::DynArray< T > Class Template Reference

Container class: a dynamic array. More...

#include <dynArray.hh>

Inheritance diagram for concepts::DynArray< T >:
Inheritance graph
[legend]
Collaboration diagram for concepts::DynArray< T >:
Collaboration graph
[legend]

List of all members.

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

dflt_
DynArrayPage< T > ** htbl_
DynArrayPage< T > * lru_

Detailed Description

template<class T>
class concepts::DynArray< T >

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.


Constructor & Destructor Documentation

template<class T >
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.

Parameters:
htblszSize of the hash table, ie. how many bits of the page number.
pgszPage size in number of entries.

Definition at line 160 of file dynArray.hh.

template<class T>
concepts::DynArray< T >::DynArray ( uint  htblsz,
uint  pgsz,
const T &  dflt 
) [inline]

Definition at line 168 of file dynArray.hh.

template<class T>
concepts::DynArray< T >::DynArray ( const DynArray< T > &  d) [inline]

Copy constructor.

Definition at line 176 of file dynArray.hh.

template<class T >
concepts::DynArray< T >::~DynArray ( ) [inline]

Definition at line 185 of file dynArray.hh.

Here is the call graph for this function:


Member Function Documentation

template<class T >
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.

Here is the call graph for this function:

template<class T >
const bool concepts::DynArray< T >::isElm ( uint  i) const

Definition at line 287 of file dynArray.hh.

Here is the call graph for this function:

template<class T >
bool concepts::DynArray< T >::isElm ( uint  i)

Checks if the element is not equal to the default element.

Returns:
1: element not equal to default, 0: element equal to default

Definition at line 263 of file dynArray.hh.

Here is the call graph for this function:

uint concepts::DynArrayBase::max ( ) const [inline, inherited]

Maximal referenced index + 1.

Definition at line 35 of file dynArray.hh.

template<class T >
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.

template<class T >
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.

Returns:
The ith element of the array.

Definition at line 199 of file dynArray.hh.

Here is the call graph for this function:

template<class T >
const T & concepts::DynArray< T >::operator[] ( uint  i) const

Index operator for the container.

Returns:
The ith element of the array.

Definition at line 231 of file dynArray.hh.

Here is the call graph for this function:

template<class T >
void concepts::DynArray< T >::reset ( )

Clears the array.

Definition at line 320 of file dynArray.hh.

Here is the call graph for this function:


Member Data Documentation

template<class T>
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.

template<class T>
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.

template<class T>
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.


The documentation for this class was generated from the following file:

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)