ATLAS Offline Software
|
#include <IdentifierHashTable.h>
Public Types | |
typedef T::IdentifierType | IdType |
define the type IdType More... | |
typedef T::HashType | HashType |
define the type HashType More... | |
Public Member Functions | |
IdentifierHashTable () | |
Default constructor makes empty hash table with default idFields object. More... | |
IdentifierHashTable (const T &idFields) | |
Make empty hash table initialised with idFields object. More... | |
void | clear () |
Clear the hashtable. More... | |
unsigned int | size () const |
Number of hashes in the table. More... | |
bool | checkValidity () const |
Check that the table is internally consistent. More... | |
HashType | addEntry (const IdType &id) |
Add an identifier to the table. More... | |
HashType | getHash (const IdType &id) const |
Get hash from 0 to size()-1. More... | |
IdType | getIdentifier (const HashType &hash) const |
Get identifier from hash. More... | |
void | dump (std::ostream &os=std::cout) const |
Dump complete table to output stream. More... | |
std::string | dumpToString () const |
Dump complete table into a string. More... | |
Static Public Member Functions | |
static HashType | defaultHashValue () |
Helper function to get a properly initialised hash. More... | |
Private Attributes | |
IdentifierToHash< T > | m_idToHash |
std::vector< IdType > | m_hashToId |
Definition at line 37 of file IdentifierHashTable.h.
typedef T::HashType IdentifierHashTable< T >::HashType |
define the type HashType
Definition at line 45 of file IdentifierHashTable.h.
typedef T::IdentifierType IdentifierHashTable< T >::IdType |
define the type IdType
Definition at line 43 of file IdentifierHashTable.h.
IdentifierHashTable< T >::IdentifierHashTable | ( | ) |
Default constructor makes empty hash table with default idFields object.
|
explicit |
Make empty hash table initialised with idFields object.
HashType IdentifierHashTable< T >::addEntry | ( | const IdType & | id | ) |
Add an identifier to the table.
Return the assigned hash. If adding the entry fails, a default HashType is returned.
bool IdentifierHashTable< T >::checkValidity | ( | ) | const |
Check that the table is internally consistent.
An empty table will return false.
void IdentifierHashTable< T >::clear | ( | ) |
Clear the hashtable.
|
inlinestatic |
Helper function to get a properly initialised hash.
Definition at line 47 of file IdentifierHashTable.h.
void IdentifierHashTable< T >::dump | ( | std::ostream & | os = std::cout | ) | const |
Dump complete table to output stream.
std::string IdentifierHashTable< T >::dumpToString | ( | ) | const |
Dump complete table into a string.
HashType IdentifierHashTable< T >::getHash | ( | const IdType & | id | ) | const |
Get hash from 0 to size()-1.
Returns invalid hash if id is not in table.
IdType IdentifierHashTable< T >::getIdentifier | ( | const HashType & | hash | ) | const |
Get identifier from hash.
Returns invalid identifier if hash is out of range.
unsigned int IdentifierHashTable< T >::size | ( | ) | const |
Number of hashes in the table.
|
private |
Definition at line 76 of file IdentifierHashTable.h.
|
private |
Definition at line 75 of file IdentifierHashTable.h.