lsst.sphgeom g04536d8304+b0138be388
 
Loading...
Searching...
No Matches
lsst::sphgeom::TriState Class Reference

#include <TriState.h>

Public Member Functions

 TriState ()
 Construct value in unknown state.
 
 TriState (bool value)
 Construct value in a known state.
 
TriStateoperator= (TriState const &other)=default
 
bool operator== (TriState const &other) const
 Compare this tri-state value with other tri-state value.
 
bool operator!= (TriState const &other) const
 
bool operator== (bool value) const
 Compare this tri-state value with a boolean.
 
bool operator!= (bool value) const
 
TriState operator| (TriState const &other) const
 Compute the logical OR of two TriState values.
 
TriState operator& (TriState const &other) const
 Compute the logical AND of two TriState values.
 
TriState operator~ () const
 Compute the logical NOT of a TriState value.
 
bool known () const
 Check whether the state is known.
 

Detailed Description

TriState represents a boolean value with additional unknown state. Instances of this class can be compared to booleans true and false, when the state is unknown, comparisons will return false.

Member Function Documentation

◆ known()

bool lsst::sphgeom::TriState::known ( ) const
inline

Check whether the state is known.

Returns
True is returned when state is known.

◆ operator&()

TriState lsst::sphgeom::TriState::operator& ( TriState const & other) const
inline

Compute the logical AND of two TriState values.

Parameters
otherOther TriState value.
Returns
False if either operand is known to be false, true if both operands are known to be true, and unknown otherwise.

◆ operator==() [1/2]

bool lsst::sphgeom::TriState::operator== ( bool value) const
inline

Compare this tri-state value with a boolean.

Parameters
valueBoolean value to compare to.
Returns
True if the state is known to be equal to the given boolean.

◆ operator==() [2/2]

bool lsst::sphgeom::TriState::operator== ( TriState const & other) const
inline

Compare this tri-state value with other tri-state value.

Parameters
otherTri-state value to compare to.
Returns
True is returned when both states are unknown or when both states are known and values are equal, false returned otherwise.

◆ operator|()

TriState lsst::sphgeom::TriState::operator| ( TriState const & other) const
inline

Compute the logical OR of two TriState values.

Parameters
otherOther TriState value.
Returns
True if either operand is known to be true, false if both operands are known to be false, and unknown otherwise.

◆ operator~()

TriState lsst::sphgeom::TriState::operator~ ( ) const
inline

Compute the logical NOT of a TriState value.

Returns
True if the current state is known to be false, false if the current state is known to be true, and unknown otherwise.

The documentation for this class was generated from the following file: