csSet< T, KeyHandler > Class Template Reference
This class implements a basic set for objects. More...
#include <csutil/hash.h>
Public Member Functions | |
csSet (int size=23, int grow_rate=5, int max_size=20000) | |
Construct a new empty set. | |
void | Add (const T &object) |
Add an object to this set. | |
void | AddNoTest (const T &object) |
Add an object to this set. | |
bool | In (const T &object) const |
Test if an object is in this set. | |
void | DeleteAll () |
Delete all elements in the set. | |
bool | Delete (const T &object) |
Delete an object from the set. | |
size_t | GetSize () const |
Get the number of elements in the set. | |
csHash< T, T, KeyHandler > * | GetHash () |
Return the hash map for this hash set. | |
GlobalIterator | GetIterator () const |
Return an iterator for the hash set, to iterate over all elements. |
Detailed Description
template<class T, class KeyHandler = csIntegralHashKeyHandler<T>>
class csSet< T, KeyHandler >
This class implements a basic set for objects.
You can basically use this to test for the occurrence of some object quickly.
Definition at line 578 of file hash.h.
Constructor & Destructor Documentation
|
Construct a new empty set. The given size will be passed to the hashmap. |
Member Function Documentation
|
Add an object to this set. This will do nothing if the object is already present. |
|
Add an object to this set. This function does not test if the object is already there. This is used for efficiency reasons. But use with care! |
|
Delete an object from the set. This function does nothing if the object is not in the set. Return true if the object was present. |
|
Delete all elements in the set.
|
|
Return the hash map for this hash set.
|
|
Return an iterator for the hash set, to iterate over all elements. Modifying the set while you have open iterators will cause undefined behaviour. |
|
Get the number of elements in the set.
|
|
Test if an object is in this set.
|
The documentation for this class was generated from the following file:
- csutil/hash.h
Generated for Crystal Space by doxygen 1.3.9.1