#include <collection.h>
Inheritance diagram for databases::NameCollection:
Public Types | |
typedef containers::Hash< NameRecord *, char const * > | name_hash |
Type of the name hash. | |
typedef name_hashlist::iterator | niterator |
Normal name iterator type. | |
typedef name_hashlist::const_iterator | const_niterator |
Const name iterator type. | |
typedef name_hashlist::reverse_iterator | reverse_niterator |
Reverse name iterator type. | |
typedef name_hashlist::const_reverse_iterator | const_reverse_niterator |
Const reverse name iterator type. | |
Public Member Functions | |
NameCollection (name_hash &hash) | |
Constructor. | |
virtual bool | change_name (NameRecord *record, char const *newname) |
Notifies the collection that a record's name has changed. | |
niterator | nbegin () |
Returns an iterator for the beginning of the name collection. | |
niterator | nend () |
Returns an iterator to the end of the name collection. | |
const_niterator | nbegin () const |
Returns a const iterator for the beginning of the name collection. | |
const_niterator | nend () const |
Returns a const iterator to the end of the name collection. | |
reverse_niterator | nrbegin () |
Returns a reverse iterator to the beginning of the name collection. | |
reverse_niterator | nrend () |
Returns a reverse iterator to the end of the name collection. | |
const_reverse_niterator | nrbegin () const |
Returns a const reverse iterator to the beginning of the name collection. | |
const_reverse_niterator | nrend () const |
Returns a const reverse iterator to the end of the name collection. | |
virtual size_t | memory_usage () const |
Same as Collection::memory_usage(). | |
NameRecord * | nfind (char const *name) |
Finds a record in the collection, by name. | |
NameRecord const * | nfind (char const *name) const |
Const version of nfind(). | |
Protected Types | |
typedef containers::HashList< NameRecord *, char const *, name_hashsize > | name_hashlist |
Type of the name hash list. | |
Protected Member Functions | |
virtual bool | add_list (Record *record) |
Same as Collection::add_list(). | |
virtual void | remove_list (Record *record) |
Same as Collection::remove_list(). | |
virtual void | clear_list () |
Same as Collection::clear_list(). | |
Protected Attributes | |
name_hashlist | m_nmembers |
The collection members, searchable by names. | |
Static Protected Attributes | |
static uint32_t const | name_hashsize = NAME_HASH_SIZE |
Size of the name hash list. |
databases::NameCollection::NameCollection | ( | name_hash & | hash | ) | [inline, explicit] |
Constructor.
[in] | hash | The hash to use with the name hashlist. |
virtual bool databases::NameCollection::change_name | ( | NameRecord * | record, | |
char const * | newname | |||
) | [virtual] |
Notifies the collection that a record's name has changed. The collection will then update itself so that it can find the record through its new name.
[in] | record | The record, whose name() function should return its old name. If (record == newname) yields true, then the function won't do anything. |
[in] | newname | The new name of the record. |
NameRecord* databases::NameCollection::nfind | ( | char const * | name | ) |
Finds a record in the collection, by name.
[in] | name | The name of the record to find. |