CS::Utility::StringSet< Tag, Locked > Class Template Reference
The string set is a collection of unique strings. More...
#include <csutil/strset.h>
Public Member Functions | |
void | Clear () |
Remove all stored strings. | |
bool | Contains (CS::StringID< Tag > id) const |
Check if the set contains a string with a particular ID. | |
bool | Contains (char const *s) const |
Check if the set contains a particular string. | |
bool | Delete (CS::StringID< Tag > 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 set which iterates over all strings. | |
size_t | GetSize () const |
Get the number of elements in the hash. | |
bool | IsEmpty () const |
Return true if the hash is empty. | |
StringSet & | operator= (StringSet const &s) |
Assignment operator. | |
char const * | Request (CS::StringID< Tag > id) const |
Request the string corresponding to the given ID. | |
CS::StringID< Tag > | Request (const char *s) |
Request the numeric ID for the given string. | |
StringSet (StringSet const &s) | |
Copy constructor. | |
StringSet (size_t size=23) | |
Constructor. | |
~StringSet () | |
Destructor. |
Detailed Description
template<typename Tag, bool Locked = false>
class CS::Utility::StringSet< Tag, Locked >
The string set is a collection of unique strings.
Each string has an ID number. The most important operation is to request a string, which means to return the ID for the string, adding it to the collection if not already present. This is useful when you need to work with strings but want the performance characteristics of simple numeric comparisons. Rather than performing string comparisons, you instead compare the numeric string ID's.
If Locked is true operations on an instance of the set are locked are for concurrent accesses.
- See also:
- csStringHash
- iStringSet
Definition at line 48 of file strset.h.
Constructor & Destructor Documentation
template<typename Tag, bool Locked = false>
CS::Utility::StringSet< Tag, Locked >::StringSet | ( | size_t | size = 23 |
) | [inline] |
template<typename Tag, bool Locked = false>
CS::Utility::StringSet< Tag, Locked >::StringSet | ( | StringSet< Tag, Locked > const & | s | ) | [inline] |
template<typename Tag, bool Locked = false>
CS::Utility::StringSet< Tag, Locked >::~StringSet | ( | ) | [inline] |
Member Function Documentation
template<typename Tag, bool Locked = false>
void CS::Utility::StringSet< Tag, Locked >::Clear | ( | ) | [inline] |
Remove all stored strings.
- Deprecated:
- Deprecated in 1.3. Use Empty() instead.
template<typename Tag, bool Locked = false>
bool CS::Utility::StringSet< Tag, Locked >::Contains | ( | CS::StringID< Tag > | id | ) | const [inline] |
template<typename Tag, bool Locked = false>
bool CS::Utility::StringSet< Tag, Locked >::Contains | ( | char const * | s | ) | const [inline] |
template<typename Tag, bool Locked = false>
bool CS::Utility::StringSet< Tag, Locked >::Delete | ( | CS::StringID< Tag > | id | ) | [inline] |
template<typename Tag, bool Locked = false>
bool CS::Utility::StringSet< Tag, Locked >::Delete | ( | char const * | s | ) | [inline] |
template<typename Tag, bool Locked = false>
void CS::Utility::StringSet< Tag, Locked >::Empty | ( | ) | [inline] |
template<typename Tag, bool Locked = false>
GlobalIterator CS::Utility::StringSet< Tag, Locked >::GetIterator | ( | ) | const [inline] |
template<typename Tag, bool Locked = false>
size_t CS::Utility::StringSet< Tag, Locked >::GetSize | ( | ) | const [inline] |
template<typename Tag, bool Locked = false>
bool CS::Utility::StringSet< Tag, Locked >::IsEmpty | ( | ) | const [inline] |
template<typename Tag, bool Locked = false>
StringSet& CS::Utility::StringSet< Tag, Locked >::operator= | ( | StringSet< Tag, Locked > const & | s | ) | [inline] |
template<typename Tag, bool Locked = false>
char const* CS::Utility::StringSet< Tag, Locked >::Request | ( | CS::StringID< Tag > | id | ) | const [inline] |
template<typename Tag, bool Locked = false>
CS::StringID<Tag> CS::Utility::StringSet< Tag, Locked >::Request | ( | const char * | s | ) | [inline] |
The documentation for this class was generated from the following file:
- csutil/strset.h
Generated for Crystal Space 2.0 by doxygen 1.6.1