csSet< T, KeyHandler > Class Template Reference
This class implements a basic set for objects. More...
#include <hash.h>
Public Methods | |
csSet (int size=257, int grow_rate=64, 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. | |
int | 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 538 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. Definition at line 578 of file hash.h. References csSet< T, KeyHandler >::AddNoTest(), and csSet< T, KeyHandler >::In(). |
|
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! Definition at line 590 of file hash.h. References csHash< T, K, KeyHandler >::Put(). Referenced by csSet< T, KeyHandler >::Add(). |
|
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. Definition at line 616 of file hash.h. References csHash< T, K, KeyHandler >::Delete(). |
|
Delete all elements in the set.
Definition at line 606 of file hash.h. References csHash< T, K, KeyHandler >::DeleteAll(). |
|
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.
Definition at line 622 of file hash.h. References csHash< T, K, KeyHandler >::GetSize(). |
|
Test if an object is in this set.
Definition at line 598 of file hash.h. References csHash< T, K, KeyHandler >::In(). Referenced by csSet< T, KeyHandler >::Add(). |
The documentation for this class was generated from the following file:
- csutil/hash.h
Generated for Crystal Space by doxygen 1.2.18