csStringHash Class Reference
A string-to-ID hash table. More...
#include <csutil/strhash.h>
Public Types | |
typedef HashType::GlobalIterator | GlobalIterator |
Public Member Functions | |
void | Clear () |
Delete all stored strings. | |
bool | Contains (csStringID id) const |
Check if the hash contains a string with a particular ID. | |
bool | Contains (char const *s) const |
Check if the hash contains a particular string. | |
csStringHash (csStringHash const &h) | |
Copy constructor. | |
csStringHash (size_t size=23) | |
Constructor. | |
bool | Delete (csStringID id) |
Remove a string with the specified ID. | |
bool | Delete (char const *s) |
Remove specified string. | |
void | Empty () |
Remove all stored strings. | |
GlobalIterator | GetIterator () const |
Return an iterator for the string hash which iterates over all elements. | |
size_t | GetSize () const |
Get the number of elements in the hash. | |
bool | IsEmpty () const |
Return true if the hash is empty. | |
csStringHash & | operator= (csStringHash const &h) |
Assignment operator. | |
const char * | Register (const char *s, csStringID id=0) |
Register a string with an ID. | |
const char * | Request (csStringID id) const |
Request the string for a given ID. | |
csStringID | Request (const char *s) const |
Request the ID for the given string. | |
~csStringHash () | |
Destructor. |
Detailed Description
A string-to-ID hash table.Useful when you need to work with strings but want the performance characteristics of simple numeric comparisons. Register a string with a unique numeric ID and then compare ID's rather than comparing strings. You can fetch a string's ID via Request().
- See also:
- csStringSet
Definition at line 38 of file strhash.h.
Constructor & Destructor Documentation
|
Constructor.
|
|
Copy constructor.
|
|
Destructor.
|
Member Function Documentation
|
Delete all stored strings.
|
|
Check if the hash contains a string with a particular ID.
|
|
Check if the hash contains a particular string.
Definition at line 105 of file strhash.h. References csInvalidStringID. |
|
Remove a string with the specified ID.
|
|
Remove specified string.
|
|
Remove all stored strings.
|
|
Return an iterator for the string hash which iterates over all elements.
|
|
Get the number of elements in the hash.
|
|
Return true if the hash is empty.
|
|
Assignment operator.
|
|
Register a string with an ID.
|
|
Request the string for a given ID.
|
|
Request the ID for the given string.
|
The documentation for this class was generated from the following file:
- csutil/strhash.h
Generated for Crystal Space by doxygen 1.4.4