doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
idHashIndex Class Reference

#include <HashIndex.h>

Public Member Functions

 idHashIndex (void)
 
 idHashIndex (const int initialHashSize, const int initialIndexSize)
 
 ~idHashIndex (void)
 
size_t Allocated (void) const
 
size_t Size (void) const
 
idHashIndexoperator= (const idHashIndex &other)
 
void Add (const int key, const int index)
 
void Remove (const int key, const int index)
 
int First (const int key) const
 
int Next (const int index) const
 
void InsertIndex (const int key, const int index)
 
void RemoveIndex (const int key, const int index)
 
void Clear (void)
 
void Clear (const int newHashSize, const int newIndexSize)
 
void Free (void)
 
int GetHashSize (void) const
 
int GetIndexSize (void) const
 
void SetGranularity (const int newGranularity)
 
void ResizeIndex (const int newIndexSize)
 
int GetSpread (void) const
 
int GenerateKey (const char *string, bool caseSensitive=true) const
 
int GenerateKey (const idVec3 &v) const
 
int GenerateKey (const int n1, const int n2) const
 

Private Member Functions

void Init (const int initialHashSize, const int initialIndexSize)
 
void Allocate (const int newHashSize, const int newIndexSize)
 

Private Attributes

int hashSize
 
inthash
 
int indexSize
 
intindexChain
 
int granularity
 
int hashMask
 
int lookupMask
 

Static Private Attributes

static int INVALID_INDEX [1] = { -1 }
 

Detailed Description

Definition at line 44 of file HashIndex.h.

Constructor & Destructor Documentation

ID_INLINE idHashIndex::idHashIndex ( void  )

Definition at line 111 of file HashIndex.h.

ID_INLINE idHashIndex::idHashIndex ( const int  initialHashSize,
const int  initialIndexSize 
)

Definition at line 120 of file HashIndex.h.

ID_INLINE idHashIndex::~idHashIndex ( void  )

Definition at line 129 of file HashIndex.h.

Member Function Documentation

ID_INLINE void idHashIndex::Add ( const int  key,
const int  index 
)

Definition at line 193 of file HashIndex.h.

void idHashIndex::Allocate ( const int  newHashSize,
const int  newIndexSize 
)
private

Definition at line 56 of file HashIndex.cpp.

ID_INLINE size_t idHashIndex::Allocated ( void  ) const

Definition at line 138 of file HashIndex.h.

ID_INLINE void idHashIndex::Clear ( void  )

Definition at line 328 of file HashIndex.h.

ID_INLINE void idHashIndex::Clear ( const int  newHashSize,
const int  newIndexSize 
)

Definition at line 340 of file HashIndex.h.

ID_INLINE int idHashIndex::First ( const int  key) const

Definition at line 238 of file HashIndex.h.

void idHashIndex::Free ( void  )

Definition at line 75 of file HashIndex.cpp.

ID_INLINE int idHashIndex::GenerateKey ( const char *  string,
bool  caseSensitive = true 
) const

Definition at line 379 of file HashIndex.h.

ID_INLINE int idHashIndex::GenerateKey ( const idVec3 v) const

Definition at line 392 of file HashIndex.h.

ID_INLINE int idHashIndex::GenerateKey ( const int  n1,
const int  n2 
) const

Definition at line 401 of file HashIndex.h.

ID_INLINE int idHashIndex::GetHashSize ( void  ) const

Definition at line 351 of file HashIndex.h.

ID_INLINE int idHashIndex::GetIndexSize ( void  ) const

Definition at line 360 of file HashIndex.h.

int idHashIndex::GetSpread ( void  ) const

Definition at line 124 of file HashIndex.cpp.

void idHashIndex::Init ( const int  initialHashSize,
const int  initialIndexSize 
)
private

Definition at line 39 of file HashIndex.cpp.

ID_INLINE void idHashIndex::InsertIndex ( const int  key,
const int  index 
)

Definition at line 257 of file HashIndex.h.

ID_INLINE int idHashIndex::Next ( const int  index) const

Definition at line 247 of file HashIndex.h.

ID_INLINE idHashIndex & idHashIndex::operator= ( const idHashIndex other)

Definition at line 156 of file HashIndex.h.

ID_INLINE void idHashIndex::Remove ( const int  key,
const int  index 
)

Definition at line 213 of file HashIndex.h.

ID_INLINE void idHashIndex::RemoveIndex ( const int  key,
const int  index 
)

Definition at line 294 of file HashIndex.h.

void idHashIndex::ResizeIndex ( const int  newIndexSize)

Definition at line 92 of file HashIndex.cpp.

ID_INLINE void idHashIndex::SetGranularity ( const int  newGranularity)

Definition at line 369 of file HashIndex.h.

ID_INLINE size_t idHashIndex::Size ( void  ) const

Definition at line 147 of file HashIndex.h.

Member Data Documentation

int idHashIndex::granularity
private

Definition at line 96 of file HashIndex.h.

int* idHashIndex::hash
private

Definition at line 93 of file HashIndex.h.

int idHashIndex::hashMask
private

Definition at line 97 of file HashIndex.h.

int idHashIndex::hashSize
private

Definition at line 92 of file HashIndex.h.

int* idHashIndex::indexChain
private

Definition at line 95 of file HashIndex.h.

int idHashIndex::indexSize
private

Definition at line 94 of file HashIndex.h.

int idHashIndex::INVALID_INDEX = { -1 }
staticprivate

Definition at line 100 of file HashIndex.h.

int idHashIndex::lookupMask
private

Definition at line 98 of file HashIndex.h.


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