#include <nindexedarray.h>
Public Types | |
typedef ObjectArray::value_type | value_type |
See the C++ standard. | |
typedef ObjectArray::pointer | pointer |
See the C++ standard. | |
typedef ObjectArray::const_reference | const_reference |
See the C++ standard. | |
typedef ObjectArray::size_type | size_type |
See the C++ standard. | |
typedef ObjectArray::difference_type | difference_type |
See the C++ standard. | |
typedef ObjectArray::const_iterator | iterator |
See the C++ standard. | |
typedef ObjectArray::const_iterator | const_iterator |
See the C++ standard. | |
typedef ObjectArray::const_reverse_iterator | reverse_iterator |
See the C++ standard. | |
typedef ObjectArray::const_reverse_iterator | const_reverse_iterator |
See the C++ standard. | |
Public Member Functions | |
NIndexedArray () | |
See the C++ standard. | |
NIndexedArray (size_type n) | |
See the C++ standard. | |
NIndexedArray (size_type n, const Data &t) | |
See the C++ standard. | |
NIndexedArray (const NIndexedArray< Data, HashFcn, EqualTo > &array) | |
See the C++ standard. | |
template<class InputIterator> | NIndexedArray (InputIterator first, InputIterator last) |
See the C++ standard. | |
~NIndexedArray () | |
See the C++ standard. | |
iterator | begin () |
See the C++ standard. | |
iterator | end () |
See the C++ standard. | |
const_iterator | begin () const |
See the C++ standard. | |
const_iterator | end () const |
See the C++ standard. | |
reverse_iterator | rbegin () |
See the C++ standard. | |
reverse_iterator | rend () |
See the C++ standard. | |
const_reverse_iterator | rbegin () const |
See the C++ standard. | |
const_reverse_iterator | rend () const |
See the C++ standard. | |
size_type | size () const |
See the C++ standard. | |
size_type | max_size () const |
See the C++ standard. | |
bool | empty () const |
See the C++ standard. | |
const_reference | operator[] (size_type n) const |
See the C++ standard. | |
NIndexedArray< Data, HashFcn > & | operator= (const NIndexedArray< Data, HashFcn, EqualTo > &array) |
See the C++ standard. | |
const_reference | front () const |
See the C++ standard. | |
const_reference | back () const |
See the C++ standard. | |
void | push_back (const Data &item) |
See the C++ standard. | |
void | pop_back () |
See the C++ standard. | |
void | swap (NIndexedArray< Data, HashFcn > &array) |
See the C++ standard. | |
iterator | insert (iterator pos, const Data &x) |
See the C++ standard. | |
template<class InputIterator> void | insert (iterator pos, InputIterator first, InputIterator last) |
See the C++ standard. | |
void | insert (iterator pos, size_type n, const Data &x) |
See the C++ standard. | |
iterator | erase (iterator pos) |
See the C++ standard. | |
iterator | erase (iterator first, iterator last) |
See the C++ standard. | |
void | clear () |
See the C++ standard. | |
void | resize (size_type n) |
See the C++ standard. | |
void | resize (size_type n, const Data &t) |
See the C++ standard. | |
difference_type | index (const_reference value) const |
Finds the index of the given value in the array. | |
void | erase (const_reference value) |
Erases all copies of the given object from the array. | |
bool | validate (bool silent=false) const |
Checks the structural integrity of this array. |
The fast object-to-index lookup is achieved by using a hashed dictionary mapping objects to array indices. See routine index() for further details.
This class satisfies all of the requirements of a random access container and a back insertion sequence in the C++ standard, with the exception that once an object has been inserted into the container it cannot be modified. Thus all routines returning a reference
instead of a const_reference
have been removed, and type iterator
is the same as type const_iterator
(and similarly for reverse iterators).
Additional routines beyond the C++ standard requirements include index(), erase(const_reference) and validate().
Template parameter HashFcn
will be used to generate hash values for array elements. Template parameter EqualTo
will be used to compare array elements when looking up the corresponding array index.
HashFcn
satisfies the requirements of a hash function (with argument type Data
) according to the Standard Template Library.
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
Erases all copies of the given object from the array. This routine is made quite fast through use of the internal hashed dictionary.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
Finds the index of the given value in the array. This routine is made quite fast through use of the internal hashed dictionary. If the given value is stored more than once in the array, one of its indices will be returned but there is no guarantee as to which of these indices it will be.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
See the C++ standard.
|
|
Checks the structural integrity of this array. The internal hashed dictionary is compared with the internal array to ensure they are consistent with one another.
Any inconsistencies are written to standard error (unless parameter silent is passed as
|