|
blocxx
|
The Bool class is an abstraction for the boolean data type. More...
#include <Bool.hpp>
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. | |
| Bool & | operator= (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::streambuf &ostrm) const |
| Write this object to an output stream. | |
| void | readObject (std::streambuf &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) |
| Not equal operator (friend function) | |
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.)
|
inline |
|
inline |
|
private |
|
inline |
|
inline |
|
inline |
Inequality operator.
| arg | The Bool object to compare this one with. |
Definition at line 107 of file Bool.hpp.
References BLOCXX_NAMESPACE::operator==().
|
inline |
Inequality operator.
| arg | bool value to compare this Bool object against. |
Definition at line 100 of file Bool.hpp.
References BLOCXX_NAMESPACE::operator==().
|
inline |
Assignment operator.
| arg | The Bool to assign to this one. |
Definition at line 79 of file Bool.hpp.
References m_val, and BLOCXX_NAMESPACE::operator==().
|
inline |
Equality operator.
| arg | The Bool object to compare this one with. |
Definition at line 93 of file Bool.hpp.
References BLOCXX_NAMESPACE::operator==().
|
inline |
Equality operator.
| arg | bool value to compare this Bool object against. |
Definition at line 86 of file Bool.hpp.
References BLOCXX_NAMESPACE::operator==().
Referenced by readObject(), and writeObject().
| void BLOCXX_NAMESPACE::Bool::readObject | ( | std::streambuf & | istrm | ) |
Read this object from an input stream.
| istrm | The input stream to read this object from. |
Definition at line 63 of file Bool.cpp.
References m_val, operator==(), and BLOCXX_NAMESPACE::BinarySerialization::read().
Referenced by BLOCXX_NAMESPACE::BinarySerialization::readBool().
| String BLOCXX_NAMESPACE::Bool::toString | ( | ) | const |
| void BLOCXX_NAMESPACE::Bool::writeObject | ( | std::streambuf & | ostrm | ) | const |
Write this object to an output stream.
| ostrm | The output stream to write this object to. |
Definition at line 56 of file Bool.cpp.
References m_val, operator==(), and BLOCXX_NAMESPACE::BinarySerialization::write().
|
private |
Definition at line 159 of file Bool.hpp.
Referenced by operator=(), readObject(), toString(), and writeObject().