#include <nbooleans.h>
Public Member Functions | |
NBoolSet () | |
Creates a new empty set. | |
NBoolSet (bool member) | |
Creates a set containing a single member as given. | |
NBoolSet (const NBoolSet &cloneMe) | |
Creates a set equal to the given set. | |
NBoolSet (bool insertTrue, bool insertFalse) | |
Creates a set specifying whether true and/or false should be a member. | |
bool | hasTrue () const |
Determines if true is a member of this set. | |
bool | hasFalse () const |
Determines if false is a member of this set. | |
bool | contains (bool value) const |
Determines if the given boolean is a member of this set. | |
void | insertTrue () |
Inserts true into this set if it is not already present. | |
void | insertFalse () |
Inserts false into this set if it is not already present. | |
void | removeTrue () |
Removes true from this set if it is present. | |
void | removeFalse () |
Removes false from this set if it is present. | |
void | empty () |
Removes all elements from this set. | |
void | fill () |
Places both true and false into this set if they are not already present. | |
bool | operator== (const NBoolSet &other) const |
Determines if this set is equal to the given set. | |
bool | operator!= (const NBoolSet &other) const |
Determines if this set is not equal to the given set. | |
bool | operator< (const NBoolSet &other) const |
Determines if this set is a proper subset of the given set. | |
bool | operator> (const NBoolSet &other) const |
Determines if this set is a proper superset of the given set. | |
bool | operator<= (const NBoolSet &other) const |
Determines if this set is a subset of (possibly equal to) the given set. | |
bool | operator>= (const NBoolSet &other) const |
Determines if this set is a superset of (possibly equal to) the given set. | |
NBoolSet & | operator= (const NBoolSet &cloneMe) |
Sets this set to be identical to the given set. | |
NBoolSet & | operator= (bool member) |
Sets this set to the single member set containing the given element. | |
NBoolSet & | operator|= (const NBoolSet &other) |
Sets this set to be the union of this and the given set. | |
NBoolSet & | operator &= (const NBoolSet &other) |
Sets this set to be the intersection of this and the given set. | |
NBoolSet & | operator^= (const NBoolSet &other) |
Sets this set to be the symmetric difference of this and the given set. | |
NBoolSet | operator| (const NBoolSet &other) const |
Returns the union of this set with the given set. | |
NBoolSet | operator & (const NBoolSet &other) const |
Returns the intersection of this set with the given set. | |
NBoolSet | operator^ (const NBoolSet &other) const |
Returns the symmetric difference of this set and the given set. | |
NBoolSet | operator~ () const |
Returns the complement of this set. | |
unsigned char | getByteCode () const |
Returns the byte code representing this boolean set. | |
void | setByteCode (unsigned char code) |
Sets this boolean set to that represented by the given byte code. | |
Static Public Member Functions | |
static NBoolSet | fromByteCode (unsigned char code) |
Creates a boolean set from the given byte code. | |
Static Public Attributes | |
static const NBoolSet | sNone |
The empty set. | |
static const NBoolSet | sTrue |
The set containing only true . | |
static const NBoolSet | sFalse |
The set containing only false . | |
static const NBoolSet | sBoth |
The set containing both true and false . | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const NBoolSet &set) |
Writes the given boolean set to the given output stream. |
Note that there are only four possible such sets. NBoolSet objects are small enough to pass about by value instead of by reference.
|
Creates a new empty set.
|
|
Creates a set containing a single member as given.
|
|
Creates a set equal to the given set.
|
|
Creates a set specifying whether
|
|
Determines if the given boolean is a member of this set.
|
|
Removes all elements from this set.
|
|
Places both
|
|
Creates a boolean set from the given byte code. See getByteCode() for more information on byte codes.
|
|
Returns the byte code representing this boolean set. The byte code is sufficient to reconstruct the set and is thus a useful means for passing boolean sets to and from the engine.
The lowest order bit of the byte code is 1 if and only if
|
|
Determines if
|
|
Determines if
|
|
Inserts
|
|
Inserts
|
|
Returns the intersection of this set with the given set. The result is a set containing precisely the elements that belong to both original sets. This set is not changed.
|
|
Sets this set to be the intersection of this and the given set. The result is a set containing precisely the elements that belong to both original sets. Note that this set will be modified.
|
|
Determines if this set is not equal to the given set.
|
|
Determines if this set is a proper subset of the given set.
|
|
Determines if this set is a subset of (possibly equal to) the given set.
|
|
Sets this set to the single member set containing the given element.
|
|
Sets this set to be identical to the given set.
|
|
Determines if this set is equal to the given set.
|
|
Determines if this set is a proper superset of the given set.
|
|
Determines if this set is a superset of (possibly equal to) the given set.
|
|
Returns the symmetric difference of this set and the given set. The result is a set containing precisely the elements that belong to one but not both of the original sets. This set is not changed.
|
|
Sets this set to be the symmetric difference of this and the given set. The result is a set containing precisely the elements that belong to one but not both of the original sets. Note that this set will be modified.
|
|
Returns the union of this set with the given set. The result is a set containing precisely the elements that belong to either of the original sets. This set is not changed.
|
|
Sets this set to be the union of this and the given set. The result is a set containing precisely the elements that belong to either of the original sets. Note that this set will be modified.
|
|
Returns the complement of this set. The result is a set containing precisely the elements that this set does not contain. This set is not changed.
|
|
Removes
|
|
Removes
|
|
Sets this boolean set to that represented by the given byte code. See getByteCode() for more information on byte codes.
|
|
Writes the given boolean set to the given output stream.
The set will be written in the form
|
|
The set containing both
|
|
The set containing only
|
|
The empty set.
|
|
The set containing only
|