dlvhex  2.5.0
DynamicVector< K, T > Class Template Reference

Dynamically extended vector using custom index and value types. More...

#include <include/dlvhex2/DynamicVector.h>

Inheritance diagram for DynamicVector< K, T >:
Collaboration diagram for DynamicVector< K, T >:

Public Member Functions

std::vector< T >::iterator find (K index)
 Returns an iterator to an element of the DynamicVector.
void erase (K index)
 Erases an element from the DynamicVector.
T & operator[] (K index)
 Accesses and element of the DynamicVector.

Private Attributes

bm::bvector stored
 Storage of all valid indexes; K must be convertible to integer.

Detailed Description

template<typename K, typename T>
class DynamicVector< K, T >

Dynamically extended vector using custom index and value types.

Definition at line 46 of file DynamicVector.h.


Member Function Documentation

template<typename K, typename T>
void DynamicVector< K, T >::erase ( index) [inline]

Erases an element from the DynamicVector.

Parameters:
indexIndex of the element to erase.

Definition at line 62 of file DynamicVector.h.

Referenced by OrderedSet< IDAddress, SimpleHashIDAddress >::erase().

template<typename K, typename T>
std::vector<T>::iterator DynamicVector< K, T >::find ( index) [inline]

Returns an iterator to an element of the DynamicVector.

Parameters:
indexIndex to check.
Returns:
Iterator to the element index if valid, and the end() iterator otherwise.

Definition at line 55 of file DynamicVector.h.

Referenced by OrderedSet< IDAddress, SimpleHashIDAddress >::renumber().

template<typename K, typename T>
T& DynamicVector< K, T >::operator[] ( index) [inline]

Accesses and element of the DynamicVector.

Parameters:
indexIndex of the element to access.
Returns:
Reference to the accessed element.

Definition at line 69 of file DynamicVector.h.

Referenced by DynamicVector< T, long >::operator[]().


Field Documentation

template<typename K, typename T>
bm::bvector DynamicVector< K, T >::stored [private]

Storage of all valid indexes; K must be convertible to integer.

Definition at line 50 of file DynamicVector.h.

Referenced by DynamicVector< T, long >::erase(), DynamicVector< T, long >::find(), and DynamicVector< T, long >::operator[]().


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