DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Util::OptionalBool Class Reference

Data type which stores an optional bool value (unknown, false, true). The type evaluates to bool while an unknown value is considered false. More...

Public Types

enum class  Values { Unknown , False , True }
 Possible values. Values::Unknown evaluates to false. More...
 

Public Member Functions

constexpr OptionalBool () noexcept
 Contructs an instance holding Values::Unknown. More...
 
constexpr OptionalBool (Values Value) noexcept
 Contructs an instance holding Value. More...
 
constexpr OptionalBool (bool b) noexcept
 Contructs an instance holding b. More...
 
constexpr OptionalBool (const OptionalBool &Other) noexcept
 Contructs a copy of Other. More...
 
constexpr OptionalBooloperator= (Values Value) noexcept
 Assigns Value, returns reference to this. More...
 
constexpr OptionalBooloperator= (bool b) noexcept
 Assigns b, returns reference to this. More...
 
constexpr OptionalBooloperator= (OptionalBool &Other) noexcept
 Assigns value of Other, returns reference to this. More...
 
constexpr bool operator== (Values Value) const noexcept
 Returns true when Value matches stored value, false otherwise. More...
 
constexpr bool operator!= (Values Value) const noexcept
 Returns false when Value matches stored value, true otherwise. More...
 
constexpr operator bool () const noexcept
 Converts internal value to bool. More...
 
constexpr Values Get () const noexcept
 Returns internal value. More...
 

Private Attributes

Values Value
 Internal value. More...
 

Detailed Description

Data type which stores an optional bool value (unknown, false, true). The type evaluates to bool while an unknown value is considered false.

Definition at line 548 of file Util.h.

Member Enumeration Documentation

◆ Values

Possible values. Values::Unknown evaluates to false.

Enumerator
Unknown 
False 
True 

Definition at line 554 of file Util.h.

Constructor & Destructor Documentation

◆ OptionalBool() [1/4]

constexpr Util::OptionalBool::OptionalBool ( )
inlineconstexprnoexcept

Contructs an instance holding Values::Unknown.

Definition at line 556 of file Util.h.

◆ OptionalBool() [2/4]

constexpr Util::OptionalBool::OptionalBool ( Values  Value)
inlineconstexprnoexcept

Contructs an instance holding Value.

Definition at line 557 of file Util.h.

◆ OptionalBool() [3/4]

constexpr Util::OptionalBool::OptionalBool ( bool  b)
inlineconstexprnoexcept

Contructs an instance holding b.

Definition at line 558 of file Util.h.

◆ OptionalBool() [4/4]

constexpr Util::OptionalBool::OptionalBool ( const OptionalBool Other)
inlineconstexprnoexcept

Contructs a copy of Other.

Definition at line 559 of file Util.h.

Member Function Documentation

◆ Get()

constexpr Values Util::OptionalBool::Get ( ) const
inlineconstexprnoexcept

Returns internal value.

Definition at line 569 of file Util.h.

◆ operator bool()

constexpr Util::OptionalBool::operator bool ( ) const
inlineconstexprnoexcept

Converts internal value to bool.

Definition at line 568 of file Util.h.

◆ operator!=()

constexpr bool Util::OptionalBool::operator!= ( Values  Value) const
inlineconstexprnoexcept

Returns false when Value matches stored value, true otherwise.

Definition at line 566 of file Util.h.

◆ operator=() [1/3]

constexpr OptionalBool& Util::OptionalBool::operator= ( bool  b)
inlineconstexprnoexcept

Assigns b, returns reference to this.

Definition at line 562 of file Util.h.

◆ operator=() [2/3]

constexpr OptionalBool& Util::OptionalBool::operator= ( OptionalBool Other)
inlineconstexprnoexcept

Assigns value of Other, returns reference to this.

Definition at line 563 of file Util.h.

◆ operator=() [3/3]

constexpr OptionalBool& Util::OptionalBool::operator= ( Values  Value)
inlineconstexprnoexcept

Assigns Value, returns reference to this.

Definition at line 561 of file Util.h.

◆ operator==()

constexpr bool Util::OptionalBool::operator== ( Values  Value) const
inlineconstexprnoexcept

Returns true when Value matches stored value, false otherwise.

Definition at line 565 of file Util.h.

Member Data Documentation

◆ Value

Values Util::OptionalBool::Value
private

Internal value.

Definition at line 572 of file Util.h.


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