wibble  0.1.28
Public Member Functions | Protected Attributes
wibble::exception::Generic Class Reference

Base class for all exceptions. More...

#include <exception.h>

Inheritance diagram for wibble::exception::Generic:
Inheritance graph
[legend]
Collaboration diagram for wibble::exception::Generic:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Generic () throw ()
 Generic (const std::string &context) throw ()
virtual ~Generic () throw ()
virtual const char * type () const throw ()
 Get a string tag identifying the exception type.
virtual std::string desc () const throw ()
 Get a string describing what happened that threw the exception.
virtual const std::string & fullInfo () const throw ()
 Format in a string all available information about the exception.
virtual const char * what () const throw ()
- Public Member Functions inherited from wibble::exception::Context
 Context () throw ()
 Context (const std::string &context) throw ()
void addContext (const std::string &c) throw ()
std::string formatContext () const throw ()
const std::vector< std::string > & context () const throw ()

Protected Attributes

std::string m_formatted
- Protected Attributes inherited from wibble::exception::Context
std::vector< std::string > m_context

Detailed Description

Base class for all exceptions.

This is the base class for all exceptions used in the system. It provides an interface to get a (hopefully detailed) textual description of the exception, and a tag describing the type of exception. Further functionality will be provided by subclassers


Constructor & Destructor Documentation

wibble::exception::Generic::Generic ( ) throw ()
inline
wibble::exception::Generic::Generic ( const std::string &  context) throw ()
inline
virtual wibble::exception::Generic::~Generic ( ) throw ()
inlinevirtual

Member Function Documentation

virtual std::string wibble::exception::Generic::desc ( ) const throw ()
inlinevirtual
virtual const std::string& wibble::exception::Generic::fullInfo ( ) const throw ()
inlinevirtual

Format in a string all available information about the exception.

The formatted version is cached because this function is used to implement the default what() method, which needs to return a stable c_str() pointer.

References desc(), wibble::exception::Context::formatContext(), and m_formatted.

Referenced by TestException::badCast(), TestException::generic(), main(), TestException::system(), what(), and withCommands().

virtual const char* wibble::exception::Generic::type ( ) const throw ()
inlinevirtual
virtual const char* wibble::exception::Generic::what ( ) const throw ()
inlinevirtual

References fullInfo().


Member Data Documentation

std::string wibble::exception::Generic::m_formatted
mutableprotected

Referenced by fullInfo().


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