codac 2.0.0
Loading...
Searching...
No Matches
codac2_BoolInterval.h File Reference
#include <ostream>
Include dependency graph for codac2_BoolInterval.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  codac2::BoolInterval { }
 Enumeration representing a boolean interval. More...
 

Functions

BoolInterval codac2::operator~ (BoolInterval x)
 Returns the complementary of a BoolInterval.
 
std::ostream & codac2::operator<< (std::ostream &os, const BoolInterval &x)
 Streams out a BoolInterval.
 

Detailed Description

Date
2024
Author
Simon Rohou
License: GNU Lesser General Public License (LGPL)

Enumeration Type Documentation

◆ BoolInterval

enum class codac2::BoolInterval
strong

Enumeration representing a boolean interval.

The logical operators & and | can be used to combine BoolInterval values.

Enumerator
EMPTY 

EMPTY is equivalent to the operation TRUE & FALSE.

UNKNOWN 

UNKNOWN is equivalent to the operation TRUE | FALSE.

23 {
24 FALSE = 0x01,
25 TRUE = 0x02,
27 EMPTY = 0x00,
29 UNKNOWN = 0x01 | 0x02
30 };
@ UNKNOWN
Definition codac2_BoolInterval.h:29
@ EMPTY
Definition codac2_BoolInterval.h:27

Function Documentation

◆ operator~()

BoolInterval codac2::operator~ ( BoolInterval x)
inline

Returns the complementary of a BoolInterval.

Parameters
xthe boolean interval
Returns
the complementary
45 {
46 switch(x)
47 {
48 case BoolInterval::FALSE:
49 return BoolInterval::TRUE;
50 case BoolInterval::TRUE:
51 return BoolInterval::FALSE;
52 default:
54 }
55 }

◆ operator<<()

std::ostream & codac2::operator<< ( std::ostream & os,
const BoolInterval & x )
inline

Streams out a BoolInterval.

Parameters
osthe stream to be updated
xthe boolean interval to stream out
Returns
a reference to the updated stream
65 {
66 switch(x)
67 {
69 os << "[ empty ]";
70 break;
71 case BoolInterval::FALSE:
72 os << "[ false ]";
73 break;
74 case BoolInterval::TRUE:
75 os << "[ true ]";
76 break;
78 os << "[ true, false ]";
79 break;
80 }
81 return os;
82 }