SheafSystem  0.0.0.0
sheaf::tern Class Reference

A three state "bool". Does not provide the operations of ternary logic and is intended for use mostly as a convenient, three-way input argument. Can not be used as a base class since it does not have a virtual destructor. More...

#include <tern.h>

Public Types

enum  state_type { TRUE, FALSE, NEITHER }
 The three possible values. More...
 

Public Member Functions

 tern ()
 Default constructor. More...
 
 tern (const tern &xother)
 Copy constructor. More...
 
 ~tern ()
 /// Conversion from boolean. More...
 
ternoperator= (const tern &xother)
 Assignment operator. More...
 
 operator bool () const
 /// Assignment operator More...
 
bool is_true () const
 True if thi has value true. More...
 
bool is_false () const
 True if this has value false. More...
 
bool is_neither () const
 True if this is neither true nor false. More...
 
 tern (state_type xstate)
 Creates instance with state xstate. More...
 

Detailed Description

A three state "bool". Does not provide the operations of ternary logic and is intended for use mostly as a convenient, three-way input argument. Can not be used as a base class since it does not have a virtual destructor.

Definition at line 45 of file tern.h.

Member Enumeration Documentation

◆ state_type

The three possible values.

Definition at line 107 of file tern.h.

Constructor & Destructor Documentation

◆ tern() [1/3]

sheaf::tern::tern ( )

Default constructor.

Hack:
Something in the AIX xlC environment is defining TRUE and FALSE. Until we find a workaround, undefine them.

Definition at line 44 of file tern.cc.

Referenced by is_neither().

◆ tern() [2/3]

sheaf::tern::tern ( const tern xother)

Copy constructor.

Definition at line 64 of file tern.cc.

References ~tern().

◆ ~tern()

sheaf::tern::~tern ( )

/// Conversion from boolean.

Destructor.

Definition at line 104 of file tern.cc.

References operator=().

Referenced by tern().

◆ tern() [3/3]

sheaf::tern::tern ( state_type  xstate)

Creates instance with state xstate.

Definition at line 209 of file tern.cc.

Member Function Documentation

◆ is_false()

bool sheaf::tern::is_false ( ) const

True if this has value false.

Definition at line 194 of file tern.cc.

References is_neither().

Referenced by is_true().

◆ is_neither()

bool sheaf::tern::is_neither ( ) const

True if this is neither true nor false.

Definition at line 202 of file tern.cc.

References tern().

Referenced by is_false().

◆ is_true()

bool sheaf::tern::is_true ( ) const

True if thi has value true.

Definition at line 186 of file tern.cc.

References is_false().

Referenced by operator bool().

◆ operator bool()

sheaf::tern::operator bool ( ) const

/// Assignment operator

Conversion to bool.

Postcondition

Definition at line 163 of file tern.cc.

References is_true().

◆ operator=()

sheaf::tern & sheaf::tern::operator= ( const tern xother)

Assignment operator.

Definition at line 124 of file tern.cc.

Referenced by ~tern().


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