OSB_LIB::BaseError Class Reference

Inheritance diagram for OSB_LIB::BaseError:

Inheritance graph
[legend]
Collaboration diagram for OSB_LIB::BaseError:

Collaboration graph
[legend]
List of all members.

Detailed Description

BaseError, abstract base for all errors and exceptions.

The class provides most of the functionality needed to create an error and to convert it into a meaningful message.

Definition at line 55 of file osberror.h.

Public Types

Public Member Functions

Add an argument to the error.
Each of the folloing output operators adds an argument to the error.

Static Public Attributes

Protected Member Functions

Protected Attributes

Private Attributes


Member Typedef Documentation

typedef std::vector<std::string> OSB_LIB::BaseError::Args

STL container to store the error arguments.

Definition at line 60 of file osberror.h.

typedef long OSB_LIB::BaseError::ErrorNo

The datatype used as error number.

Definition at line 58 of file osberror.h.


Constructor & Destructor Documentation

OSB_LIB::BaseError::BaseError ( ErrorNo  e  )  [inline, explicit]

Constructor with error number.

Parameters:
e Error number, use noError_ to indicate success, i.e., no error.

Definition at line 362 of file osberror.h.

OSB_LIB::BaseError::BaseError ( ErrorNo  no,
const Args args 
) [inline]

Constructor with error number and arguments.

Definition at line 367 of file osberror.h.

OSB_LIB::BaseError::~BaseError (  )  [inline, virtual]

Empty virtual destructor.

Definition at line 391 of file osberror.h.

OSB_LIB::BaseError::BaseError ( const BaseError rhs  )  [inline, protected]

Copying for derived classes only.

Definition at line 375 of file osberror.h.


Member Function Documentation

const Args& OSB_LIB::BaseError::args (  )  const

Access to the individual error arguments.

std::string OSB_LIB::BaseError::code (  )  const

Get to error code and number.

virtual const std::string& OSB_LIB::BaseError::fileName (  )  const [pure virtual]

Get the name of the file with the error texts.

Implemented in OSB_LIB::OsbBaseError.

bool OSB_LIB::BaseError::isError (  )  const [inline]

Really an error?

Returns:
true if error number is not noError_.

Definition at line 401 of file osberror.h.

References errorNo_, and noError_.

const std::string OSB_LIB::BaseError::msg (  )  const

Get the error message.

Returns:
The message string from the message file with the arguments replaced.

ErrorNo OSB_LIB::BaseError::no (  )  const

Get the error number.

bool OSB_LIB::BaseError::noError (  )  const [inline]

Not an error?

Returns:
true if error number is noError_.
Remarks:
Intentionally no operator bool() is provided: the error would be automatically converted when written to an ostream.

Definition at line 396 of file osberror.h.

References errorNo_, and noError_.

template<typename T>
BaseError & OSB_LIB::BaseError::operator<< ( const T &  t  )  [inline]

Create and add argument from an arbitrary type.

An output operator for t to an std::ostringstring must exist.

Reimplemented in OSB_LIB::DefException.

Definition at line 419 of file osberror.h.

References args_.

BaseError & OSB_LIB::BaseError::operator<< ( const std::string &  s  )  [inline]

Create and add argument from std::string.

Definition at line 412 of file osberror.h.

References args_.

BaseError & OSB_LIB::BaseError::operator<< ( const char *  s  )  [inline]

Create and add argument from char*.

Definition at line 406 of file osberror.h.

References args_.

BaseError & OSB_LIB::BaseError::operator= ( const BaseError rhs  )  [inline, protected]

Assignment for derived classes only.

Definition at line 382 of file osberror.h.

References args_, and errorNo_.

Referenced by OSB_LIB::OsbBaseError::operator=().

virtual const char* const OSB_LIB::BaseError::prefix (  )  const [pure virtual]

The error prefix.

This is a 3-letter code that identifies the error type and the message file that contains the description.

Implemented in OSB_LIB::OsbError, and OSB_LIB::OsbException.

const std::string OSB_LIB::BaseError::what (  )  const

Get the full error message string.

Returns:
The error code followed by the message string: code(): msg().


Member Data Documentation

Args OSB_LIB::BaseError::args_ [protected]

Error argument.

Definition at line 167 of file osberror.h.

Referenced by operator<<(), and operator=().

ErrorNo OSB_LIB::BaseError::errorNo_ [private]

Unique error number.

Definition at line 164 of file osberror.h.

Referenced by isError(), noError(), and operator=().

const ErrorNo OSB_LIB::BaseError::noError_ = 0 [static]

Error number to indicate no error, i.e., success.

Definition at line 62 of file osberror.h.

Referenced by isError(), and noError().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:11:55 2006 for OSB Library by  doxygen 1.4.7