csSet< T, Allocator > Class Template Reference
[Containers]
This class implements a basic set for objects. More...
#include <csutil/set.h>
Classes | |
class | GlobalIterator |
An iterator class for the set. More... | |
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. | |
void | Subtract (const csSet &otherSet) |
Subtract a set from this set and put the result in this set. | |
bool | TestIntersect (const csSet &other) const |
Test if this set intersects with another set (i.e. | |
void | Union (const csSet &otherSet) |
Calculate the union of two sets and put the result in this set. | |
Friends | |
csSet | Intersect (const csSet &s1, const csSet &s2) |
Calculate the intersection of two sets and put the result in a new set. | |
csSet | Subtract (const csSet &s1, const csSet &s2) |
Subtract two sets and return the result in a new set. | |
csSet | Union (const csSet &s1, const csSet &s2) |
Calculate the union of two sets and put the result in a new set. |
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
template<class T, class Allocator = CS::Memory::AllocatorMalloc>
void csSet< T, Allocator >::Add | ( | const T & | object | ) | [inline] |
template<class T, class Allocator = CS::Memory::AllocatorMalloc>
void csSet< T, Allocator >::AddNoTest | ( | const T & | object | ) | [inline] |
template<class T, class Allocator = CS::Memory::AllocatorMalloc>
bool csSet< T, Allocator >::Contains | ( | const T & | object | ) | const [inline] |
template<class T, class Allocator = CS::Memory::AllocatorMalloc>
bool csSet< T, Allocator >::Delete | ( | const T & | object | ) | [inline] |
template<class T, class Allocator = CS::Memory::AllocatorMalloc>
void csSet< T, Allocator >::DeleteAll | ( | ) | [inline] |
template<class T, class Allocator = CS::Memory::AllocatorMalloc>
void csSet< T, Allocator >::Empty | ( | ) | [inline] |
Delete all elements in the set. (Idiomatic alias for DeleteAll().).
template<class T, class Allocator = CS::Memory::AllocatorMalloc>
GlobalIterator csSet< T, Allocator >::GetIterator | ( | ) | const [inline] |
template<class T, class Allocator = CS::Memory::AllocatorMalloc>
size_t csSet< T, Allocator >::GetSize | ( | ) | const [inline] |
template<class T, class Allocator = CS::Memory::AllocatorMalloc>
bool csSet< T, Allocator >::In | ( | const T & | object | ) | const [inline] |
template<class T, class Allocator = CS::Memory::AllocatorMalloc>
bool csSet< T, Allocator >::IsEmpty | ( | ) | const [inline] |
Friends And Related Function Documentation
The documentation for this class was generated from the following file:
- csutil/set.h
Generated for Crystal Space 2.0 by doxygen 1.6.1