PUMA Library Reference Manual
Loading...
Searching...
No Matches
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.
 
StrHashKeyempty () const
 Get the empty hash table item used for comparison purposes.
 
StrHashKeyinsert (const char *str)
 Add a string to the hash table.
 
void clear ()
 Clear the hash table and free all copied strings.
 

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.