![]() |
Public API Reference |
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. | |
This class implements a basic set for objects.
You can basically use this to test for the occurrence of some object quickly.
| void csSet< T, Allocator >::Empty | ( | ) | [inline] |
Delete all elements in the set. (Idiomatic alias for DeleteAll().)
| GlobalIterator csSet< T, Allocator >::GetIterator | ( | ) | const [inline] |
| bool csSet< T, Allocator >::TestIntersect | ( | const csSet< T, Allocator > & | other | ) | const [inline] |