#include <coherence/lang/throwable_spec.hpp>
Inherits class_spec< T, E, I >.
It addition to the features auto-generated by the class_spec<> helper template throwable_spec<> auto-generates an implementation of "raise() const" which (re)throws the exception as a View.
A normal throwable class definition would be:
class MyException : public throwable_spec<MyException, extends<SomeOtherException, std::exception> > { // add support for auto-generated static create methods friend class factory<MyException>; protected: // Constructors are defined as protected, and access via // auto-generated create methods, with matching signatures MyException(String::View vsMessage = String::null_string, Exception::View vCause = NULL) : super(vsMessage, vCause) { } };
The extends template class for throwables is used to define an alias exception in the std::exception hierarchy, via a second template parameter. When thrown the resulting throwable can be caught by its View type hierarchy or by its std::exception hierarchy. This parameter is optional and defaults to the alias type of the parent exception.
Public Types | |
typedef throwable_spec | this_spec |
Specification definition. | |
typedef throwable_spec | super |
Definition T's parent class. | |
typedef class_spec < T, E, I > | super_spec |
Definition of the spec's parent class. | |
typedef E::alias | alias |
Alias into std::exception hierarchy. | |
typedef class_spec < T, E, I >::View | View |
View definition. | |
Public Member Functions | |
virtual void | raise () const |
Protected Member Functions | |
throwable_spec () | |
Generate a set of proxy constructors matching the signatures of the parent class's constructors. | |
Classes | |
class | bridge |
bridge joins two hierarchy types into a single type. More... | |
class | hierarchy |
The hierarchy class wraps the Coherence C++ Exception classes in a object that preserves their hierarchical structure. More... |
throwable_spec | ( | ) | [inline, protected] |
Generate a set of proxy constructors matching the signatures of the parent class's constructors.
NOTE: Compilation errors referencing this line likely indicate that class being defined by this spec makes calls a "super" constructor supplying a set of parameters for which there is no exact match on the parent class.