OWBI1::Bool Class Reference

The Bool class is an abstraction for the boolean data type. More...

#include <OWBI1_Bool.hpp>

List of all members.

Public Member Functions

 Bool ()
 Create an Bool object initialized to false.
 Bool (bool val)
 Create an Bool object initialized to a given boolean value.
 Bool (const Bool &arg)
 Copy constructor.
Booloperator= (const Bool &arg)
 Assignment operator.
bool operator== (const bool arg) const
 Equality operator.
bool operator== (const Bool &arg) const
 Equality operator.
bool operator!= (const bool arg) const
 Inequality operator.
bool operator!= (const Bool &arg) const
 Inequality operator.
 operator bool () const
bool operator! () const
 Negation operator.
String toString () const
void writeObject (std::ostream &ostrm) const
 Write this object to an output stream.
void readObject (std::istream &istrm)
 Read this object from an input stream.

Private Member Functions

 Bool (const void *)
 Bool (void *)
 Bool (volatile const void *)
 Bool (volatile void *)

Private Attributes

bool m_val

Friends

bool operator< (const Bool &b1, const Bool &b2)
 Less than operator (friend function).
bool operator!= (bool b1, Bool b2)


Detailed Description

The Bool class is an abstraction for the boolean data type.

It's not meant to be a replacement for bool. Use it if you need a type that supports toString(), readObject(), or writeObject(). It's also useful for preventing implicit conversion of char*->bool. Using it can make overloading functions safer (ie it'll be less likely the compiler will pick the wrong overload.)

Definition at line 53 of file OWBI1_Bool.hpp.


Constructor & Destructor Documentation

OWBI1::Bool::Bool  )  [inline]
 

Create an Bool object initialized to false.

Definition at line 60 of file OWBI1_Bool.hpp.

OWBI1::Bool::Bool bool  val  )  [inline]
 

Create an Bool object initialized to a given boolean value.

Parameters:
val The boolean value to initialize this Bool to

Definition at line 65 of file OWBI1_Bool.hpp.

OWBI1::Bool::Bool const Bool arg  )  [inline]
 

Copy constructor.

Parameters:
arg The Bool to make this object a copy of.

Definition at line 70 of file OWBI1_Bool.hpp.

OWBI1::Bool::Bool const void *   )  [private]
 

OWBI1::Bool::Bool void *   )  [private]
 

OWBI1::Bool::Bool volatile const void *   )  [private]
 

OWBI1::Bool::Bool volatile void *   )  [private]
 


Member Function Documentation

OWBI1::Bool::operator bool  )  const [inline]
 

Returns:
The bool value of this Bool object.

Definition at line 108 of file OWBI1_Bool.hpp.

bool OWBI1::Bool::operator!  )  const [inline]
 

Negation operator.

Returns:
true if this Bool operator has a value of false.

Definition at line 113 of file OWBI1_Bool.hpp.

bool OWBI1::Bool::operator!= const Bool arg  )  const [inline]
 

Inequality operator.

Parameters:
arg The Bool object to compare this one with.
Returns:
true If the given Bool object is not equal to this one. Otherwise false

Definition at line 104 of file OWBI1_Bool.hpp.

References m_val.

bool OWBI1::Bool::operator!= const bool  arg  )  const [inline]
 

Inequality operator.

Parameters:
arg bool value to compare this Bool object against.
Returns:
true If the given bool value is not equal to this one. Otherwise false

Definition at line 97 of file OWBI1_Bool.hpp.

Bool& OWBI1::Bool::operator= const Bool arg  )  [inline]
 

Assignment operator.

Parameters:
arg The Bool to assign to this one.
Returns:
A reference to this object after the assignment has been made.

Definition at line 76 of file OWBI1_Bool.hpp.

References m_val.

bool OWBI1::Bool::operator== const Bool arg  )  const [inline]
 

Equality operator.

Parameters:
arg The Bool object to compare this one with.
Returns:
true If the given Bool object is equal to this one. Otherwise false

Definition at line 90 of file OWBI1_Bool.hpp.

References m_val.

bool OWBI1::Bool::operator== const bool  arg  )  const [inline]
 

Equality operator.

Parameters:
arg bool value to compare this Bool object against.
Returns:
true If the given bool value is equal to this one. Otherwise false

Definition at line 83 of file OWBI1_Bool.hpp.

void OWBI1::Bool::readObject std::istream &  istrm  ) 
 

Read this object from an input stream.

Parameters:
istrm The input stream to read this object from.

String OWBI1::Bool::toString  )  const
 

Returns:
The string representation of this object. If this object contains a true value, the "true" is returned. Otherwise "false" is returned.

Definition at line 70 of file OWBI1_Bool.cpp.

References m_val.

Referenced by OWBI1::StringBuffer::operator+=().

void OWBI1::Bool::writeObject std::ostream &  ostrm  )  const
 

Write this object to an output stream.

Parameters:
ostrm The output stream to write this object to.


Friends And Related Function Documentation

bool operator!= bool  b1,
Bool  b2
[friend]
 

Definition at line 139 of file OWBI1_Bool.hpp.

bool operator< const Bool b1,
const Bool b2
[friend]
 

Less than operator (friend function).

Parameters:
b1 The first Bool object to use in the comparison.
b2 The second Bool object to use in the comparison.
Returns:
true if b1 is less than b2. Otherwise false.

Definition at line 135 of file OWBI1_Bool.hpp.


Member Data Documentation

bool OWBI1::Bool::m_val [private]
 

Definition at line 150 of file OWBI1_Bool.hpp.

Referenced by operator!=(), operator=(), operator==(), and toString().


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:18:24 2006 for openwbem by  doxygen 1.4.6