#include <EnumSet.hxx>
Public Member Functions | |
| EnumSet () | |
| EnumSet (const EnumSet< T > &that) | |
| EnumSet (const T &that) | |
| bool | operator== (const EnumSet< T > &that) const |
| bool | operator!= (const EnumSet< T > &that) const |
| EnumSet< T > & | operator= (const EnumSet< T > &that) |
| EnumSet< T > & | operator|= (const EnumSet< T > &that) |
| EnumSet< T > & | operator &= (const EnumSet< T > &that) |
| EnumSet< T > & | operator^= (const EnumSet< T > &that) |
| EnumSet | operator| (const EnumSet< T > &that) const |
| EnumSet | operator & (const EnumSet< T > &that) const |
| EnumSet | operator^ (const EnumSet< T > &that) const |
| EnumSet | operator~ () const |
| bool | lacks (const EnumSet< T > &that) const |
| operator int BoolConversionSupport::* () const | |
Data Structures | |
| struct | BoolConversionSupport |
This is a simply horrible hack. It started as a workaround for the fact that enums do not provide type-preserving bit sets, because (a|b) yields int rather than the underlying enumeration type. What we do here is to define EnumSet over an underlying arithmetic type. If you instantiate it over an enum, it will only permit initializers over that enum, which will have the desired effect that the enumerands can serve as bit labels for purposes of documentation.
That isn't hard to fix, except that you can run out of enumeration values -- it is surprising how many bit sets turn out to require 33 bits on a 32-bit machine.
DO NOT attempt to instantiate one of these over an underlying integral type. It will produce an error in the template expander because of the non-member overloading of the binary operators on the underlying types! I need to do some template magic to make that overloading more selective, and I haven't had time yet.
Definition at line 69 of file EnumSet.hxx.
| sherpa::EnumSet< T >::EnumSet | ( | ) | [inline] |
Definition at line 92 of file EnumSet.hxx.
| sherpa::EnumSet< T >::EnumSet | ( | const EnumSet< T > & | that | ) | [inline] |
| sherpa::EnumSet< T >::EnumSet | ( | const T & | that | ) | [inline] |
Definition at line 103 of file EnumSet.hxx.
| bool sherpa::EnumSet< T >::lacks | ( | const EnumSet< T > & | that | ) | const [inline] |
| EnumSet sherpa::EnumSet< T >::operator & | ( | const EnumSet< T > & | that | ) | const [inline] |
Definition at line 162 of file EnumSet.hxx.
| EnumSet<T>& sherpa::EnumSet< T >::operator &= | ( | const EnumSet< T > & | that | ) | [inline] |
| sherpa::EnumSet< T >::operator int BoolConversionSupport::* | ( | ) | const [inline] |
Definition at line 231 of file EnumSet.hxx.
| bool sherpa::EnumSet< T >::operator!= | ( | const EnumSet< T > & | that | ) | const [inline] |
| EnumSet<T>& sherpa::EnumSet< T >::operator= | ( | const EnumSet< T > & | that | ) | [inline] |
| bool sherpa::EnumSet< T >::operator== | ( | const EnumSet< T > & | that | ) | const [inline] |
| EnumSet sherpa::EnumSet< T >::operator^ | ( | const EnumSet< T > & | that | ) | const [inline] |
Definition at line 170 of file EnumSet.hxx.
| EnumSet<T>& sherpa::EnumSet< T >::operator^= | ( | const EnumSet< T > & | that | ) | [inline] |
| EnumSet sherpa::EnumSet< T >::operator| | ( | const EnumSet< T > & | that | ) | const [inline] |
Definition at line 154 of file EnumSet.hxx.
| EnumSet<T>& sherpa::EnumSet< T >::operator|= | ( | const EnumSet< T > & | that | ) | [inline] |
| EnumSet sherpa::EnumSet< T >::operator~ | ( | ) | const [inline] |
1.4.7