A three-way extension of the boolean type.
More...
#include <utilities/nbooleans.h>
A three-way extension of the boolean type.
Three-way booleans can be true, false or unknown.
- Deprecated:
- NTriBool has now been replaced with native (two-way) bool throughout Regina, and will be removed in some future release.
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.
- Parameters
-
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.
- Parameters
-
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?
- Returns
- whether or not this object has the value of 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().
- Returns
- whether or not this object has an explicit true or false value.
bool regina::NTriBool::isTrue |
( |
| ) |
const |
|
inline |
Is the value of this three-way boolean equal to true?
- Returns
- whether or not this object has the value of true.
bool regina::NTriBool::isUnknown |
( |
| ) |
const |
|
inline |
Is the value of this three-way boolean equal to unknown?
- Returns
- whether or not this object has the value of 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.
- Parameters
-
other | the three-way boolean to compare with this. |
- Returns
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.
- Python:
- Not present, to avoid accidental integer conversions in Python.
- Parameters
-
other | the standard boolean to compare with this. |
- Returns
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.
- Parameters
-
other | the value to combine with this value. |
- Returns
- the conjunction of this and the given 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.
- Python:
- Not present, to avoid accidental integer conversions in Python.
- Parameters
-
other | the value to combine with this value. |
- Returns
- the conjunction of this and the given 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.
- Parameters
-
other | the value to combine with this value. |
- Returns
- a reference to this object.
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.
- Python:
- Not present, to avoid accidental integer conversions in Python.
- Parameters
-
other | the value to combine with this value. |
- Returns
- a reference to this object.
Sets this three-way boolean to be identical to the given three-way boolean.
- Parameters
-
cloneMe | the value to assign to this object. |
- Returns
- a reference to this object.
NTriBool & regina::NTriBool::operator= |
( |
bool |
cloneMe | ) |
|
|
inline |
Sets this three-way boolean to be identical to the given standard boolean.
- Python:
- Not present, to avoid accidental integer conversions in Python.
- Parameters
-
cloneMe | the value to assign to this object. |
- Returns
- a reference 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.
- Parameters
-
other | the three-way boolean to compare with this. |
- Returns
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.
- Python:
- Not present, to avoid accidental integer conversions in Python.
- Parameters
-
other | the standard boolean to compare with this. |
- Returns
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.
- Parameters
-
other | the value to combine with this value. |
- Returns
- the disjunction of this and the given 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.
- Python:
- Not present, to avoid accidental integer conversions in Python.
- Parameters
-
other | the value to combine with this value. |
- Returns
- the disjunction of this and the given 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.
- Parameters
-
other | the value to combine with this value. |
- Returns
- a reference to this object.
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.
- Python:
- Not present, to avoid accidental integer conversions in Python.
- Parameters
-
other | the value to combine with this value. |
- Returns
- a reference to this object.
NTriBool regina::NTriBool::operator~ |
( |
| ) |
const |
|
inline |
Returns the negation of this value.
The negation of unknown is unknown.
- Returns
- the negation of this value.
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.
A global instance of the false value.
A global instance of the true value.
const NTriBool regina::NTriBool::Unknown |
|
static |
A global instance of the unknown value.
The documentation for this class was generated from the following file: