wibble 1.1
|
Exception thrown when index checking fails. More...
#include <exception.h>
Public Member Functions | |
ValOutOfRange (const std::string &var_desc, C val, C inf, C sup, const std::string &context) throw () | |
Construct the exception; minBound and maxBound are the bounds of the valid index range (inclusive). | |
Methods used to get informations about the index and its bounds | |
virtual C | val () const throw () |
Get the value that caused the index to go out-of-bounds. | |
virtual C | inf () const throw () |
Get the minimum allowed value for this index. | |
virtual C | sup () const throw () |
Get the maximum allowed value for this index. | |
virtual const char * | type () const throw () |
Get the value that caused the index to go out-of-bounds. | |
virtual std::string | desc () const throw () |
Get the value that caused the index to go out-of-bounds. | |
![]() | |
OutOfRange (const std::string &var_desc, const std::string &context) throw () | |
~OutOfRange () throw () | |
virtual std::string | var_desc () const throw () |
Get a short description of the variable that has been checked. | |
![]() | |
Consistency (const std::string &context, const std::string &error=std::string()) throw () | |
~Consistency () throw () | |
![]() | |
Generic () throw () | |
Generic (const std::string &context) throw () | |
virtual | ~Generic () throw () |
virtual const std::string & | fullInfo () const throw () |
Format in a string all available information about the exception. | |
virtual const char * | what () const throw () |
![]() | |
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 | |
C | m_val |
C | m_inf |
C | m_sup |
![]() | |
std::string | m_var_desc |
![]() | |
std::string | m_formatted |
![]() | |
std::vector< std::string > | m_context |
Exception thrown when index checking fails.
This exception is to be thrown when an index checking fails, providing informations on the acceptable index range and on the offending value. The context should be a description of the index, possibly preceeded by a description of in what context did the index checking happen.
Example:
|
inline |
Construct the exception; minBound and maxBound are the bounds of the valid index range (inclusive).
|
virtual |
Get the value that caused the index to go out-of-bounds.
Reimplemented from wibble::exception::OutOfRange.
|
inlinevirtual |
Get the minimum allowed value for this index.
References wibble::exception::ValOutOfRange< C >::m_inf.
|
inlinevirtual |
Get the maximum allowed value for this index.
References wibble::exception::ValOutOfRange< C >::m_sup.
|
inlinevirtual |
Get the value that caused the index to go out-of-bounds.
Reimplemented from wibble::exception::OutOfRange.
|
inlinevirtual |
Get the value that caused the index to go out-of-bounds.
References wibble::exception::ValOutOfRange< C >::m_val.
|
protected |
Referenced by wibble::exception::ValOutOfRange< C >::inf().
|
protected |
Referenced by wibble::exception::ValOutOfRange< C >::sup().
|
protected |
Referenced by wibble::exception::ValOutOfRange< C >::val().