Regina Calculation Engine
|
A three-way extension of the boolean type. More...
#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 | |
static const NTriBool | True |
A global instance of the true value. | |
static const NTriBool | False |
A global instance of the false value. | |
static const NTriBool | Unknown |
A global instance of the unknown value. |
A three-way extension of the boolean type.
Three-way booleans can be true, false or unknown.
regina::NTriBool::NTriBool | ( | ) | [inline] |
Creates a new three-way boolean initialised to the unknown value.
regina::NTriBool::NTriBool | ( | const NTriBool & | cloneMe | ) | [inline] |
Creates a copy of the given three-way boolean.
cloneMe | the three-way boolean to clone. |
regina::NTriBool::NTriBool | ( | bool | value | ) | [inline] |
Creates a new three-way boolean whose initial value is the given standard boolean.
value | the value (true or false) to assign to the new three-way boolean. |
bool regina::NTriBool::isFalse | ( | ) | const [inline] |
Is the value of this three-way boolean equal to false?
bool regina::NTriBool::isKnown | ( | ) | const [inline] |
Does this three-way boolean take one of the explicit values true or false?
Note that this routine is the negation of isUnknown().
bool regina::NTriBool::isTrue | ( | ) | const [inline] |
Is the value of this three-way boolean equal to true?
bool regina::NTriBool::isUnknown | ( | ) | const [inline] |
Is the value of this three-way boolean equal to unknown?
bool regina::NTriBool::operator!= | ( | const NTriBool & | other | ) | const [inline] |
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.
other | the three-way boolean to compare with this. |
true
if and only if this and the given value are different. bool regina::NTriBool::operator!= | ( | bool | other | ) | const [inline] |
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.
other | the standard boolean to compare with this. |
true
if and only if this and the given value are different. 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.
other | the value to combine with this value. |
NTriBool regina::NTriBool::operator& | ( | bool | other | ) | const [inline] |
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.
other | the value to combine with this value. |
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.
other | the value to combine with this value. |
NTriBool & regina::NTriBool::operator&= | ( | bool | other | ) | [inline] |
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.
other | the value to combine with this value. |
Sets this three-way boolean to be identical to the given three-way boolean.
cloneMe | the value to assign to this object. |
NTriBool & regina::NTriBool::operator= | ( | bool | cloneMe | ) | [inline] |
Sets this three-way boolean to be identical to the given standard boolean.
cloneMe | the value to assign to this object. |
bool regina::NTriBool::operator== | ( | const NTriBool & | other | ) | const [inline] |
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.
other | the three-way boolean to compare with this. |
true
if and only if this and the given value are equal. bool regina::NTriBool::operator== | ( | bool | other | ) | const [inline] |
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.
other | the standard boolean to compare with this. |
true
if and only if this and the given value are equal. 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.
other | the value to combine with this value. |
NTriBool regina::NTriBool::operator| | ( | bool | other | ) | const [inline] |
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.
other | the value to combine with this value. |
NTriBool & regina::NTriBool::operator|= | ( | bool | other | ) | [inline] |
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.
other | the value to combine with this value. |
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.
other | the value to combine with this value. |
NTriBool regina::NTriBool::operator~ | ( | ) | const [inline] |
Returns the negation of this value.
The negation of unknown is unknown.
void regina::NTriBool::setFalse | ( | ) | [inline] |
Sets this three-way boolean to false.
void regina::NTriBool::setTrue | ( | ) | [inline] |
Sets this three-way boolean to true.
void regina::NTriBool::setUnknown | ( | ) | [inline] |
Sets this three-way boolean to unknown.
const NTriBool regina::NTriBool::False [static] |
A global instance of the false value.
const NTriBool regina::NTriBool::True [static] |
A global instance of the true value.
const NTriBool regina::NTriBool::Unknown [static] |
A global instance of the unknown value.