#include <nbooleans.h>
Public Member Functions | |
NTriBool () | |
Creates a new three-way boolean initialised to the unknown value. | |
NTriBool (const NTriBool &cloneMe) | |
Creates a copy of the given three-way boolean. | |
NTriBool (bool value) | |
Creates a new three-way boolean whose initial value is the given standard boolean. | |
bool | isTrue () const |
Is the value of this three-way boolean equal to true? | |
bool | isFalse () const |
Is the value of this three-way boolean equal to false? | |
bool | isUnknown () const |
Is the value of this three-way boolean equal to unknown? | |
bool | isKnown () const |
Does this three-way boolean take one of the explicit values true or false? | |
void | setTrue () |
Sets this three-way boolean to true. | |
void | setFalse () |
Sets this three-way boolean to false. | |
void | setUnknown () |
Sets this three-way boolean to unknown. | |
bool | operator== (const NTriBool &other) const |
Determines whether this and the given three-way boolean are equal. | |
bool | operator== (bool other) const |
Determines whether this and the given standard boolean are equal. | |
bool | operator!= (const NTriBool &other) const |
Determines whether this and the given three-way boolean are different. | |
bool | operator!= (bool other) const |
Determines whether this and the given standard boolean are different. | |
NTriBool & | operator= (const NTriBool &cloneMe) |
Sets this three-way boolean to be identical to the given three-way boolean. | |
NTriBool & | operator= (bool cloneMe) |
Sets this three-way boolean to be identical to the given standard boolean. | |
NTriBool & | operator|= (const NTriBool &other) |
Sets this to be the disjunction of this and the given value. | |
NTriBool & | operator|= (bool other) |
Sets this to be the disjunction of this and the given value. | |
NTriBool & | operator &= (const NTriBool &other) |
Sets this to be the conjunction of this and the given value. | |
NTriBool & | operator &= (bool other) |
Sets this to be the conjunction of this and the given value. | |
NTriBool | operator| (const NTriBool &other) const |
Returns the disjunction of this and the given value. | |
NTriBool | operator| (bool other) const |
Returns the disjunction of this and the given value. | |
NTriBool | operator & (const NTriBool &other) const |
Returns the conjunction of this and the given value. | |
NTriBool | operator & (bool other) const |
Returns the conjunction of this and the given value. | |
NTriBool | operator~ () const |
Returns the negation of this value. | |
Static Public Attributes | |
const NTriBool | True |
A global instance of the true value. | |
const NTriBool | False |
A global instance of the false value. | |
const NTriBool | Unknown |
A global instance of the unknown value. |
Three-way booleans can be true, false or unknown.
|
Creates a new three-way boolean initialised to the unknown value.
|
|
Creates a copy of the given three-way boolean.
|
|
Creates a new three-way boolean whose initial value is the given standard boolean.
|
|
Is the value of this three-way boolean equal to false?
|
|
Does this three-way boolean take one of the explicit values true or false? Note that this routine is the negation of isUnknown().
|
|
Is the value of this three-way boolean equal to true?
|
|
Is the value of this three-way boolean equal to unknown?
|
|
Returns the conjunction of this and the given value. Unknown is handled in the intuitive way. For instance, (unknown and true) is unknown, and (unknown and false) is false.
|
|
Returns the conjunction of this and the given value. Unknown is handled in the intuitive way. For instance, (unknown and true) is unknown, and (unknown and false) is false.
|
|
Sets this to be the conjunction of this and the given value. Unknown is handled in the intuitive way. For instance, (unknown and true) is unknown, and (unknown and false) is false.
|
|
Sets this to be the conjunction of this and the given value. Unknown is handled in the intuitive way. For instance, (unknown and true) is unknown, and (unknown and false) is false.
|
|
Determines whether this and the given standard boolean are different. This routine makes a straightforward comparison of states. That is, true is equal to true and false is equal to false. Unknown is equal to neither true nor false.
|
|
Determines whether this and the given three-way boolean are different. This routine makes a straightforward comparison of states. That is, true is equal to true, false is equal to false and unknown is equal to unknown.
|
|
Sets this three-way boolean to be identical to the given standard boolean.
|
|
Sets this three-way boolean to be identical to the given three-way boolean.
|
|
Determines whether this and the given standard boolean are equal. This routine makes a straightforward comparison of states. That is, true is equal to true and false is equal to false. Unknown is equal to neither true nor false.
|
|
Determines whether this and the given three-way boolean are equal. This routine makes a straightforward comparison of states. That is, true is equal to true, false is equal to false and unknown is equal to unknown.
|
|
Returns the disjunction of this and the given value. Unknown is handled in the intuitive way. For instance, (unknown or true) is true, and (unknown or false) is unknown.
|
|
Returns the disjunction of this and the given value. Unknown is handled in the intuitive way. For instance, (unknown or true) is true, and (unknown or false) is unknown.
|
|
Sets this to be the disjunction of this and the given value. Unknown is handled in the intuitive way. For instance, (unknown or true) is true, and (unknown or false) is unknown.
|
|
Sets this to be the disjunction of this and the given value. Unknown is handled in the intuitive way. For instance, (unknown or true) is true, and (unknown or false) is unknown.
|
|
Returns the negation of this value. The negation of unknown is unknown.
|
|
Sets this three-way boolean to false.
|
|
Sets this three-way boolean to true.
|
|
Sets this three-way boolean to unknown.
|
|
A global instance of the false value.
|
|
A global instance of the true value.
|
|
A global instance of the unknown value.
|