Simpact Cyan
Population based event driven simulation using mNRM
Public Member Functions | List of all members
bool_t Class Reference

Type to return true/false with error description. More...

#include <booltype.h>

Public Member Functions

 bool_t (bool f=true)
 Just set true or false, but leave the error description undefined in case of 'false'.
 
 bool_t (const char *pStr)
 Set the return value to 'false', and the error string to the specified value.
 
 bool_t (const std::string &err)
 Set the return value to 'false', and the error string to the specified value.
 
 bool_t (const bool_t &b)
 Copy constructor.
 
bool_toperator= (const bool_t &b)
 Assignment operator.
 
std::string getErrorString () const
 Returns a description of the error.
 
 operator bool () const
 Returns true or false, depending on the contents of this object.
 

Detailed Description

Type to return true/false with error description.

This type is intended to be used as a return value of functions, which return true on success and false on failure. Additionally, when an error is returned, an error description can be set. The error description can be retrieved using the bool_t::getErrorString member function.

To make it easier to use, you can just return an error description, in which case the boolean value of the type will automatically be 'false'.


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