PUMA Library Reference Manual
Puma::StrHashTable Class Reference

#include <Puma/StrHashTable.h>

Description

String hash table backed by a fixed size array of single-linked chains.

Public Member Functions

 StrHashTable ()
 Construct a new empty hash table. More...
 
StrHashKeyempty () const
 Get the empty hash table item used for comparison purposes. More...
 
StrHashKeyinsert (const char *str)
 Add a string to the hash table. More...
 
void clear ()
 Clear the hash table and free all copied strings. More...
 

Constructor & Destructor Documentation

◆ StrHashTable()

Puma::StrHashTable::StrHashTable ( )
inline

Construct a new empty hash table.

Member Function Documentation

◆ clear()

void Puma::StrHashTable::clear ( )

Clear the hash table and free all copied strings.

◆ empty()

StrHashKey* Puma::StrHashTable::empty ( ) const
inline

Get the empty hash table item used for comparison purposes.

Returns
The empty hash table item.

◆ insert()

StrHashKey* Puma::StrHashTable::insert ( const char *  str)

Add a string to the hash table.

Does not add strings twice. Added strings are copied.

Parameters
strThe string to add.
Returns
The hash table item for the string.