A reference-counted set. More...
#include <RefSet.h++>

Public Member Functions | |
| RefSet () | |
| Construct a new RefSet. | |
| ~RefSet () throw () | |
| Destructor. | |
| bool | add (T value) |
| Add a value to the set. | |
| bool | remove (T value) |
| Remove a value from the set. | |
| bool | contains (T value) const |
| Determine if a value is present in the set. | |
| int | refCount (T value) const |
| Get the reference count for a given value. | |
A reference-counted set.
The set allows duplicate values, but it reference counts them, so that a value must be removed the same number of times that it was added in order to actually be removed from the set. RefSet is a subclass of std::map<T, int>.
| ~RefSet | ( | ) | throw () |
Destructor.
| bool add | ( | T | value | ) |
Add a value to the set.
If the value is already in the set, its reference count is incremented.
| value | The value to add. |
| bool contains | ( | T | value | ) | const |
Determine if a value is present in the set.
| value | The value. |
| int refCount | ( | T | value | ) | const |
Get the reference count for a given value.
| value | The value. |
| bool remove | ( | T | value | ) |
Remove a value from the set.
Decrements the reference count for the value, and removes the value from the set if the reference count has reached 0.
| value | The value to remove. |
1.6.3