Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

xboolean Class Reference

The "extended boolean" class. More...

#include <XBOOL.H>

Inheritance diagram for xboolean:

Inheritance graph
[legend]

Public Types

enum  xbool { Unknown = -1, False = false, True = true }

Public Member Functions

 xboolean (xbool xb=Unknown)
 xboolean (bool b)
 xboolean (const xboolean &xb)
virtual void CalculateValue (void)
virtual void CalculateValue (void) const
virtual xbool GetValue (void)
virtual xbool GetValue (void) const
virtual wxString GetValueString (void)
bool IsFalse (void)
bool IsTrue (void)
bool IsUnknown (void)
xboolean operator! (void)
xbooleanoperator= (const xboolean &xb)
xbooleanoperator= (bool &b)
xboolean operator== (bool &b)
xboolean operator!= (xboolean &xb)
xboolean operator!= (bool &b)

Data Fields

enum xboolean::xbool value

Friends

xboolean operator && (xboolean &xbL, xboolean &xbR)
xboolean operator && (bool &bL, xboolean &xbR)
xboolean operator && (xboolean &xbL, bool &bR)
xboolean operator|| (xboolean &xbL, xboolean &xbR)
xboolean operator|| (bool &bL, xboolean &xbR)
xboolean operator|| (xboolean &xbL, bool &bR)
xboolean operator== (xboolean &xbL, xboolean &xbR)

Detailed Description

The "extended boolean" class.

This class implements the special kind "extended boolean". It extends the usual "boolean" class with value and functionality "unknown" and defines logical constans and operations. It is upwards compatible with the usual "boolean" class and functionality. The 'extended boolean' class is the anchestor of the 'generic rule' class, but it can also be used alone. The "truth tables" are shown below.

Document Title

Logical negation (unary).
(NOT)
!A
A
UFT
UTF

Logical AND (binary).
(AND)
A && B
A
UFT
B UUF U
FFFF
TUFT

Logical OR (binary).
(OR)
A || B
A
UFT
B UUUT
FUFT
TTTT

Logical equivalence (binary).
(EQUALS)
A == B
A
UFT
B UUU U
FUTF
TUFT

For easier readability, the notations AND, OR, NOT have been introduced and used, both in the source files and the manual, for the logical operators &&, || and !.

Note that the objects wxXXX are parts of the multiplatform package wxWindows, their detailed description is given there.


Member Enumeration Documentation

enum xboolean::xbool
 

Defines the allowed values for the 3-state logic.

Enumeration values:
Unknown 
False 
True 


Constructor & Destructor Documentation

xboolean::xboolean xbool  xb = Unknown  )  [inline]
 

(default) Constructor (using xbool). Initializes xboolean::value from xb.

Parameters:
xb the generating xbool

xboolean::xboolean bool  b  )  [inline]
 

Constructor (using bool). Initializes xboolean::value from b.

Parameters:
b the generating bool

xboolean::xboolean const xboolean xb  )  [inline]
 

Copy constructor. Copies function xboolean::value from xb.value.

Parameters:
xb the generating xboolean


Member Function Documentation

virtual void xboolean::CalculateValue void   )  const [inline, virtual]
 

Must be overridden. It calculates a fresh function value and saves it in xboolean::value.

virtual void xboolean::CalculateValue void   )  [inline, virtual]
 

Must be overridden. It calculates a fresh function value and saves it in xboolean::value.

Reimplemented in xpRuleGeneric.

virtual xbool xboolean::GetValue void   )  const [inline, virtual]
 

Calls xboolean::CalculateValue and returns the new value.

Returns:
xboolean::value, after recalculating it

virtual xbool xboolean::GetValue void   )  [inline, virtual]
 

Calls xboolean::CalculateValue and returns the new value.

Returns:
xboolean::value, after recalculating it

virtual wxString xboolean::GetValueString void   )  [inline, virtual]
 

Returns a one-character string, according to the result returned by xboolean::IsTrue, xboolean::IsFalse, xboolean::IsUnknown

Returns:
char, corresponding to the value

Reimplemented in xpRuleGeneric.

bool xboolean::IsFalse void   )  [inline]
 

Calls xboolean::GetValue and return 'true' if the xboolean::value is False.

Returns:
true if the value is exactly False

bool xboolean::IsTrue void   )  [inline]
 

Calls xboolean::GetValue and return 'true' if the xboolean::value is True.

Returns:
true if the value is exactly True

bool xboolean::IsUnknown void   )  [inline]
 

Calls xboolean::GetValue and return 'true' if the xboolean::value is Unknown.

Returns:
true if the value is exactly Unknown

xboolean xboolean::operator! void   )  [inline]
 

! (negation) operator. It calls xboolean::GetValue and returns the negated value

Returns:
result of logical negation for the extended boolean

Reimplemented in xpRuleGeneric.

xboolean xboolean::operator!= bool &  b  )  [inline]
 

Parameters:
!= logical non-identity operator calls xboolean::GetValue for this and return the result of their NOT EQUAL relation
b the operand
Returns:
result of non-identity check for the extended boolean and a boolean

xboolean xboolean::operator!= xboolean xb  )  [inline]
 

Parameters:
!= logical non-identity operator. It calls xboolean::GetValue for both this and xb and return the result of their NOT EQUAL relation
xb the operand
Returns:
result of non-identity check for the extended booleans

xboolean& xboolean::operator= bool &  b  )  [inline]
 

= (assign) operator. It assigns the value of b to this

Parameters:
b : the assigning bool
Returns:
the extended boolean, set by a bool

xboolean& xboolean::operator= const xboolean xb  )  [inline]
 

Parameters:
= (assign) operator. It calls xboolean::CalculateValue and assigns the value to this
xb : the assigning xboolean
Returns:
the extended boolean, set by xboolean

xboolean xboolean::operator== bool &  b  )  [inline]
 

Parameters:
== (logical identity) operator. It calls xboolean::GetValue for this and return the result of their EQUAL relation
b the operand
Returns:
result of identity check for an extended booleans and a boolean


Friends And Related Function Documentation

xboolean operator && xboolean xbL,
bool &  bR
[friend]
 

Parameters:
&& logical AND operator. It calls xboolean::GetValue for xbL and returns the result of the AND relation with bR
xbL the first (left) operand
bR the second (right) operand
Returns:
result of AND for an extended boolean and a boolean

xboolean operator && bool &  bL,
xboolean xbR
[friend]
 

Parameters:
&& logical AND operator calls xboolean::GetValue for xbR and return the result of the AND relation with bL
bL the first (left) operand
xbR the second (right) operand
Returns:
result of AND for a boolean and an extended boolean

xboolean operator && xboolean xbL,
xboolean xbR
[friend]
 

Parameters:
&& (logical AND) operator. It calls xboolean::GetValue for both xbL and xbR and returns the result of their AND relation
xbL the first (left) operand
xbR the second (right) operand
Returns:
result of AND for the extended booleans

xboolean operator== xboolean xbL,
xboolean xbR
[friend]
 

Parameters:
== logical identity operator. It calls xboolean::GetValue for both bL and xbR and returns the result of their EQUAL relation
xbL the first (left) operand
xbR the second (right) operand
Returns:
result of identity check for the extended booleans

xboolean operator|| xboolean xbL,
bool &  bR
[friend]
 

Parameters:
|| logical OR operator. It calls xboolean::GetValue for xbL and returns the result of the OR relation with bR
xbL the first (left) operand
bR the second (right) operand
Returns:
result of OR for the extended boolean and a boolean

xboolean operator|| bool &  bL,
xboolean xbR
[friend]
 

Parameters:
|| logical OR operator. It calls xboolean::GetValue for xbR and return the result of the OR relation with bL
bL the first (left) operand
xbR the second (right) operand
Returns:
result of OR for a boolean and an extended boolean

xboolean operator|| xboolean xbL,
xboolean xbR
[friend]
 

Parameters:
|| logical OR operator. It calls xboolean::GetValue for both xbL and xbR and return the result of their OR relation
xbL the first (left) operand
xbR the second (right) operand
Returns:
result of OR for the extended booleans


Field Documentation

enum xboolean::xbool xboolean::value
 

Stores the actual value.


The documentation for this class was generated from the following file:
Generated on Tue Dec 23 10:24:35 2003 for xps4xps by doxygen 1.3.5