csSet< T, Allocator > Class Template Reference
[Containers]
This class implements a basic set for objects.
More...
#include <csutil/set.h>
Public Types | |
typedef csHash< bool, T, Allocator > | HashType |
Public Member Functions | |
void | Add (const T &object) |
Add an object to this set. | |
void | AddNoTest (const T &object) |
Add an object to this set. | |
bool | Contains (const T &object) const |
Test if an object is in this set. | |
csSet (int size=23, int grow_rate=5, int max_size=20000) | |
Construct a new empty set. | |
bool | Delete (const T &object) |
Delete an object from the set. | |
void | DeleteAll () |
Delete all elements in the set. | |
void | Empty () |
Delete all elements in the set. (Idiomatic alias for DeleteAll().). | |
GlobalIterator | GetIterator () const |
Return an iterator for the set which iterates over all elements. | |
size_t | GetSize () const |
Get the number of elements in the set. | |
bool | In (const T &object) const |
Test if an object is in this set. | |
bool | IsEmpty () const |
Return true if the set is empty. | |
Friends | |
class | GlobalIterator |
Classes | |
class | GlobalIterator |
An iterator class for the set. More... |
Detailed Description
template<class T, class Allocator = CS::Memory::AllocatorMalloc>
class csSet< T, Allocator >
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 37 of file set.h.
Constructor & Destructor Documentation
Member Function Documentation
void csSet< T, Allocator >::Add | ( | const T & | object | ) | [inline] |
void csSet< T, Allocator >::AddNoTest | ( | const T & | object | ) | [inline] |
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 103 of file set.h.
Referenced by csSet< csPtrKey< iMeshWrapper > >::Add().
bool csSet< T, Allocator >::Contains | ( | const T & | object | ) | const [inline] |
Test if an object is in this set.
Definition at line 111 of file set.h.
Referenced by csSet< csPtrKey< iMeshWrapper > >::Add(), and csSet< csPtrKey< iMeshWrapper > >::In().
bool csSet< T, Allocator >::Delete | ( | const T & | object | ) | [inline] |
void csSet< T, Allocator >::DeleteAll | ( | ) | [inline] |
Delete all elements in the set.
Definition at line 127 of file set.h.
Referenced by csSet< csPtrKey< iMeshWrapper > >::Empty().
void csSet< T, Allocator >::Empty | ( | ) | [inline] |
Delete all elements in the set. (Idiomatic alias for DeleteAll().).
GlobalIterator csSet< T, Allocator >::GetIterator | ( | ) | const [inline] |
size_t csSet< T, Allocator >::GetSize | ( | ) | const [inline] |
Get the number of elements in the set.
Definition at line 146 of file set.h.
Referenced by csSet< csPtrKey< iMeshWrapper > >::IsEmpty().
bool csSet< T, Allocator >::In | ( | const T & | object | ) | const [inline] |
bool csSet< T, Allocator >::IsEmpty | ( | ) | const [inline] |
The documentation for this class was generated from the following file:
- csutil/set.h
Generated for Crystal Space by doxygen 1.4.7