HPCToolkit
HashTable Class Reference

#include <HashTable.hpp>

Inheritance diagram for HashTable:

Public Member Functions

 HashTable ()
 
virtual ~HashTable ()
 
void Create (const uint entrySize, uint initialSize, HashFunctFunctPtr const HashFunctCallback, RehashFunctFunctPtr const RehashFunctCallback, EntryCompareFunctPtr const EntryCompareCallback, EntryCleanupFunctPtr const EntryCleanupCallback)
 
void Destroy ()
 
bool operator== (HashTable &rhsTab)
 
void AddEntry (void *entry, AddEntryFunctPtr const AddEntryCallback=0,...)
 
void DeleteEntry (void *entry, DeleteEntryFunctPtr const DeleteEntryCallback=0,...)
 
void * QueryEntry (const void *entry) const
 
int GetEntryIndex (const void *entry) const
 
void * GetEntryByIndex (const uint index) const
 
uint NumberOfEntries () const
 
void Dump ()
 

Protected Member Functions

void Create (const uint entrySize, uint initialSize)
 
virtual uint HashFunct (const void *entry, const uint size)
 
virtual uint RehashFunct (const uint oldHashValue, const uint size)
 
virtual int EntryCompare (const void *entry1, const void *entry2)
 
virtual void EntryCleanup (void *entry)
 
HashTableoperator= (const HashTable &rhs)
 

Private Member Functions

int QueryIndexSet (const void *entry, const bool expand) const
 
void OverflowIndexSet ()
 
void OverflowEntries ()
 
void FailureToCreateError () const
 
void FailureToDestroyError () const
 

Private Attributes

const ulong id
 
uint numSlots
 
uint nextSlot
 
uint entrySize
 
void * entries
 
uint indexSetSize
 
int * indexSet
 
bool hashTableCreated
 
HashFunctFunctPtr HashFunctCallback
 
RehashFunctFunctPtr RehashFunctCallback
 
EntryCompareFunctPtr EntryCompareCallback
 
EntryCleanupFunctPtr EntryCleanupCallback
 

Friends

class HashTableIterator
 

Detailed Description

Definition at line 309 of file HashTable.hpp.

Constructor & Destructor Documentation

◆ HashTable()

HashTable::HashTable ( )

Definition at line 107 of file HashTable.cpp.

Here is the call graph for this function:

◆ ~HashTable()

HashTable::~HashTable ( )
virtual

Definition at line 129 of file HashTable.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ AddEntry()

void HashTable::AddEntry ( void *  entry,
AddEntryFunctPtr const  AddEntryCallback = 0,
  ... 
)

Definition at line 250 of file HashTable.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Create() [1/2]

void HashTable::Create ( const uint  entrySize,
uint  initialSize,
HashFunctFunctPtr const  HashFunctCallback,
RehashFunctFunctPtr const  RehashFunctCallback,
EntryCompareFunctPtr const  EntryCompareCallback,
EntryCleanupFunctPtr const  EntryCleanupCallback 
)

Definition at line 139 of file HashTable.cpp.

Here is the caller graph for this function:

◆ Create() [2/2]

void HashTable::Create ( const uint  entrySize,
uint  initialSize 
)
protected

Definition at line 495 of file HashTable.cpp.

◆ DeleteEntry()

void HashTable::DeleteEntry ( void *  entry,
DeleteEntryFunctPtr const  DeleteEntryCallback = 0,
  ... 
)

Definition at line 296 of file HashTable.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Destroy()

void HashTable::Destroy ( )

Definition at line 205 of file HashTable.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dump()

void HashTable::Dump ( )

Definition at line 475 of file HashTable.cpp.

Here is the call graph for this function:

◆ EntryCleanup()

void HashTable::EntryCleanup ( void *  entry)
protectedvirtual

Definition at line 565 of file HashTable.cpp.

Here is the caller graph for this function:

◆ EntryCompare()

int HashTable::EntryCompare ( const void *  entry1,
const void *  entry2 
)
protectedvirtual

Reimplemented in WordSet.

Definition at line 558 of file HashTable.cpp.

Here is the caller graph for this function:

◆ FailureToCreateError()

void HashTable::FailureToCreateError ( ) const
private

Definition at line 779 of file HashTable.cpp.

Here is the caller graph for this function:

◆ FailureToDestroyError()

void HashTable::FailureToDestroyError ( ) const
private

Definition at line 786 of file HashTable.cpp.

Here is the caller graph for this function:

◆ GetEntryByIndex()

void * HashTable::GetEntryByIndex ( const uint  index) const

Definition at line 444 of file HashTable.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetEntryIndex()

int HashTable::GetEntryIndex ( const void *  entry) const

Definition at line 426 of file HashTable.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HashFunct()

uint HashTable::HashFunct ( const void *  entry,
const uint  size 
)
protectedvirtual

Reimplemented in WordSet.

Definition at line 544 of file HashTable.cpp.

Here is the caller graph for this function:

◆ NumberOfEntries()

uint HashTable::NumberOfEntries ( ) const

Definition at line 460 of file HashTable.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

HashTable & HashTable::operator= ( const HashTable rhs)
protected

Definition at line 235 of file HashTable.cpp.

◆ operator==()

bool HashTable::operator== ( HashTable rhsTab)

Definition at line 243 of file HashTable.cpp.

◆ OverflowEntries()

void HashTable::OverflowEntries ( )
private

Definition at line 747 of file HashTable.cpp.

Here is the caller graph for this function:

◆ OverflowIndexSet()

void HashTable::OverflowIndexSet ( )
private

Definition at line 695 of file HashTable.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QueryEntry()

void * HashTable::QueryEntry ( const void *  entry) const

Definition at line 396 of file HashTable.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QueryIndexSet()

int HashTable::QueryIndexSet ( const void *  entry,
const bool  expand 
) const
private

Definition at line 574 of file HashTable.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RehashFunct()

uint HashTable::RehashFunct ( const uint  oldHashValue,
const uint  size 
)
protectedvirtual

Definition at line 551 of file HashTable.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ HashTableIterator

friend class HashTableIterator
friend

Definition at line 338 of file HashTable.hpp.

Member Data Documentation

◆ entries

void* HashTable::entries
private

Definition at line 356 of file HashTable.hpp.

◆ EntryCleanupCallback

EntryCleanupFunctPtr HashTable::EntryCleanupCallback
private

Definition at line 365 of file HashTable.hpp.

◆ EntryCompareCallback

EntryCompareFunctPtr HashTable::EntryCompareCallback
private

Definition at line 364 of file HashTable.hpp.

◆ entrySize

uint HashTable::entrySize
private

Definition at line 355 of file HashTable.hpp.

◆ HashFunctCallback

HashFunctFunctPtr HashTable::HashFunctCallback
private

Definition at line 362 of file HashTable.hpp.

◆ hashTableCreated

bool HashTable::hashTableCreated
private

Definition at line 360 of file HashTable.hpp.

◆ id

const ulong HashTable::id
private

Definition at line 352 of file HashTable.hpp.

◆ indexSet

int* HashTable::indexSet
private

Definition at line 358 of file HashTable.hpp.

◆ indexSetSize

uint HashTable::indexSetSize
private

Definition at line 357 of file HashTable.hpp.

◆ nextSlot

uint HashTable::nextSlot
private

Definition at line 354 of file HashTable.hpp.

◆ numSlots

uint HashTable::numSlots
private

Definition at line 353 of file HashTable.hpp.

◆ RehashFunctCallback

RehashFunctFunctPtr HashTable::RehashFunctCallback
private

Definition at line 363 of file HashTable.hpp.


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