![]() |
Public API Reference |
A csStringHash providing a reverse hash for fast string lookups when given an ID. More...
#include <csutil/strhashr.h>
Public Member Functions | |
| csStringHashReversible (size_t size=23) | |
| Constructor. | |
| csStringHashReversible (csStringHashReversible const &h) | |
| Copy constructor. | |
| bool | Delete (char const *s) |
| Remove specified string. | |
| bool | Delete (csStringID id) |
| Remove a string with the specified ID. | |
| void | Empty () |
| Remove all stored strings. | |
| csStringHashReversible & | operator= (csStringHashReversible const &h) |
| Assignment operator. | |
| const char * | Register (const char *s, csStringID id=0) |
| Register a string with an ID. | |
| csStringID | Request (const char *s) const |
| Request the ID for the given string. | |
| const char * | Request (csStringID id) const |
| Request the string for a given ID. | |
| csArray< const char * > | RequestAll (csStringID id) const |
| Request all strings for a given ID. | |
| ~csStringHashReversible () | |
| Destructor. | |
A csStringHash providing a reverse hash for fast string lookups when given an ID.
Definition at line 29 of file strhashr.h.
| csStringHashReversible::csStringHashReversible | ( | size_t | size = 23 | ) |
Constructor.
| csStringHashReversible::csStringHashReversible | ( | csStringHashReversible const & | h | ) | [inline] |
Copy constructor.
Definition at line 39 of file strhashr.h.
Destructor.
| bool csStringHashReversible::Delete | ( | char const * | s | ) |
Remove specified string.
Reimplemented from CS::Utility::StringHash< Tag >.
| bool csStringHashReversible::Delete | ( | csStringID | id | ) |
Remove a string with the specified ID.
| void csStringHashReversible::Empty | ( | ) |
Remove all stored strings.
Reimplemented from CS::Utility::StringHash< Tag >.
| csStringHashReversible& csStringHashReversible::operator= | ( | csStringHashReversible const & | h | ) | [inline] |
Assignment operator.
Definition at line 43 of file strhashr.h.
| const char* csStringHashReversible::Register | ( | const char * | s, |
| csStringID | id = 0 |
||
| ) |
Register a string with an ID.
| s | The string with which to associate the ID. |
| id | A numeric value with which to identify this string. |
id. To find out if a string is contained in the set, invoke Contains(). The same functionality can be accomplished via csStringSet, however csStringSet is more heavyweight because it also maintains a reverse-mapping from ID to string. Omitting the id makes for a good alternative to csStringSet when you do not require its extra bulk. | csStringID csStringHashReversible::Request | ( | const char * | s | ) | const [inline] |
Request the ID for the given string.
Reimplemented from CS::Utility::StringHash< Tag >.
Definition at line 71 of file strhashr.h.
| const char* csStringHashReversible::Request | ( | csStringID | id | ) | const |
Request the string for a given ID.
| csArray<const char*> csStringHashReversible::RequestAll | ( | csStringID | id | ) | const [inline] |
Request all strings for a given ID.
Definition at line 86 of file strhashr.h.