ClassException
Exception class that automatically includes the class name.
Defined in Rodin/Alert/ClassException.h
template < class T> class ClassException;
| Template parameters | |
|---|---|
| T | The class type where the exception occurred. |
Specialized exception class that prepends the class name to the error message. Uses Boost.TypeIndex to automatically extract and format the class name with proper coloring and emphasis.
The following example illustrates usage. ClassException(*this) << "Invalid state detected" << Raise;
This produces output of the following form. "Error: In class MyClass. Invalid state detected"
Inherits from
| Base class | Responsibility |
|---|---|
ExceptionpublicFull typeException
| Exception class with formatted output capabilities. |
Inherited interface
| Declared in | Members |
|---|---|
Message | |
Exception |
Constructors, destructors, conversion operators
- ClassException(const T& instance)
- Constructs a ClassException for the given class instance.
Function documentation
ClassException(const T& instance)
Constructs a ClassException for the given class instance.
| Parameters | |
|---|---|
| instance | Class instance used to deduce the class type; its value is unused. |
Automatically extracts the class name using Boost.TypeIndex and prepends it to the exception message with appropriate formatting.