Simbody
|
This class provides an efficient implementation of a set for storing values of an enumerated type defined with Enumeration. More...
#include <Enumeration.h>
Classes | |
class | EnumerationSetRep |
This class is the internal implementation of EnumerationSet. More... | |
class | iterator |
This class provides an interface for iterating over the content of an EnumerationSet. More... | |
Public Member Functions | |
EnumerationSet () | |
Create an empty EnumerationSet. | |
EnumerationSet (const Enumeration< T > &value) | |
Create an EnumerationSet which contains a single value. | |
EnumerationSet (const EnumerationSet< T > &set) | |
Create an EnumerationSet which contains the same values as another set. | |
~EnumerationSet () | |
int | size () const |
Get the number of elements in this set. | |
bool | empty () const |
Check whether this set is empty. | |
bool | contains (const Enumeration< T > &value) const |
Determine whether this set contains a particular value. | |
bool | containsAll (const EnumerationSet< T > &set) const |
Determine whether this set contains all of the values in another set. | |
bool | containsAny (const EnumerationSet< T > &set) const |
Determine wheter this set contains any value which is in another set. | |
bool | operator== (const EnumerationSet< T > &set) const |
Determine whether this set has identical contents to another one. | |
bool | operator!= (const EnumerationSet< T > &set) const |
Determine whether this set has identical contents to another one. | |
void | clear () |
Remove all elements from the set. | |
iterator | begin () |
Get an iterator pointing to the start of the set. | |
iterator | end () |
Get an iterator pointing to the end of the set. | |
EnumerationSet< T > & | operator= (const EnumerationSet< T > &set) |
EnumerationSet< T > & | operator-= (const Enumeration< T > &value) |
EnumerationSet< T > & | operator-= (const EnumerationSet< T > &set) |
EnumerationSet< T > | operator- (const Enumeration< T > &value) const |
EnumerationSet< T > | operator- (const EnumerationSet< T > &set) const |
EnumerationSet< T > & | operator|= (const EnumerationSet< T > &set) |
EnumerationSet< T > | operator| (const EnumerationSet< T > &set) const |
EnumerationSet< T > & | operator&= (const EnumerationSet< T > &set) |
EnumerationSet< T > | operator& (const EnumerationSet< T > &set) const |
EnumerationSet< T > & | operator^= (const EnumerationSet< T > &set) |
EnumerationSet< T > | operator^ (const EnumerationSet< T > &set) const |
EnumerationSet< T > | operator~ () const |
This class provides an efficient implementation of a set for storing values of an enumerated type defined with Enumeration.
The set is represented internally with bit flags, so storage, assignment, and lookup are all extremely efficient.
This class supports all the standard bitwise operators, like &, |, ^, and ~. This allows you to manipulate sets exactly as if they were ints. It also supports the - operator, which represents the difference between two sets.
For example, if a method expects an EnumerationSet<Color> as an argument, you could pass any of the following values:
Color::Red // a set containing Red Color::Green | Color::Blue // a set containing Green and Blue EnumerationSet<Color>() // an empty set ~EnumerationSet<Color>() // the set of all possible values
SimTK::EnumerationSet< T >::EnumerationSet | ( | ) | [inline] |
Create an empty EnumerationSet.
SimTK::EnumerationSet< T >::EnumerationSet | ( | const Enumeration< T > & | value | ) | [inline] |
Create an EnumerationSet which contains a single value.
SimTK::EnumerationSet< T >::EnumerationSet | ( | const EnumerationSet< T > & | set | ) | [inline] |
Create an EnumerationSet which contains the same values as another set.
SimTK::EnumerationSet< T >::~EnumerationSet | ( | ) | [inline] |
int SimTK::EnumerationSet< T >::size | ( | ) | const [inline] |
Get the number of elements in this set.
bool SimTK::EnumerationSet< T >::empty | ( | ) | const [inline] |
Check whether this set is empty.
bool SimTK::EnumerationSet< T >::contains | ( | const Enumeration< T > & | value | ) | const [inline] |
Determine whether this set contains a particular value.
bool SimTK::EnumerationSet< T >::containsAll | ( | const EnumerationSet< T > & | set | ) | const [inline] |
Determine whether this set contains all of the values in another set.
bool SimTK::EnumerationSet< T >::containsAny | ( | const EnumerationSet< T > & | set | ) | const [inline] |
Determine wheter this set contains any value which is in another set.
bool SimTK::EnumerationSet< T >::operator== | ( | const EnumerationSet< T > & | set | ) | const [inline] |
Determine whether this set has identical contents to another one.
bool SimTK::EnumerationSet< T >::operator!= | ( | const EnumerationSet< T > & | set | ) | const [inline] |
Determine whether this set has identical contents to another one.
void SimTK::EnumerationSet< T >::clear | ( | ) | [inline] |
Remove all elements from the set.
iterator SimTK::EnumerationSet< T >::begin | ( | ) | [inline] |
Get an iterator pointing to the start of the set.
iterator SimTK::EnumerationSet< T >::end | ( | ) | [inline] |
Get an iterator pointing to the end of the set.
EnumerationSet<T>& SimTK::EnumerationSet< T >::operator= | ( | const EnumerationSet< T > & | set | ) | [inline] |
EnumerationSet<T>& SimTK::EnumerationSet< T >::operator-= | ( | const Enumeration< T > & | value | ) | [inline] |
EnumerationSet<T>& SimTK::EnumerationSet< T >::operator-= | ( | const EnumerationSet< T > & | set | ) | [inline] |
EnumerationSet<T> SimTK::EnumerationSet< T >::operator- | ( | const Enumeration< T > & | value | ) | const [inline] |
EnumerationSet<T> SimTK::EnumerationSet< T >::operator- | ( | const EnumerationSet< T > & | set | ) | const [inline] |
EnumerationSet<T>& SimTK::EnumerationSet< T >::operator|= | ( | const EnumerationSet< T > & | set | ) | [inline] |
EnumerationSet<T> SimTK::EnumerationSet< T >::operator| | ( | const EnumerationSet< T > & | set | ) | const [inline] |
EnumerationSet<T>& SimTK::EnumerationSet< T >::operator&= | ( | const EnumerationSet< T > & | set | ) | [inline] |
EnumerationSet<T> SimTK::EnumerationSet< T >::operator& | ( | const EnumerationSet< T > & | set | ) | const [inline] |
EnumerationSet<T>& SimTK::EnumerationSet< T >::operator^= | ( | const EnumerationSet< T > & | set | ) | [inline] |
EnumerationSet<T> SimTK::EnumerationSet< T >::operator^ | ( | const EnumerationSet< T > & | set | ) | const [inline] |
EnumerationSet<T> SimTK::EnumerationSet< T >::operator~ | ( | ) | const [inline] |