Classes which derive from this base class need to define a constructor which takes an ExcpError* as its only parameter. This constructor should set the _equal variable to True if the the ExcpError pointed to by the parameter is of the type of the object being constructed. This is not pretty, but it is the only way for the catch clauses to work. Also, don't forget to copy any other members if the types match.
rtti_dcl_init(DummyError); class DummyError : public ExcpError { public: DummyError() {} DummyError(ExcpError *excp); ~AipsError() {} rtti_dcl_mbrf_p1(DummyError,ExcpError); };In the source file (.cc):
rtti_imp_init(DummyError); rtti_imp_mbrf(DummyError); DummyError::DummyError(ExcpError *excp) : ExcpError(excp) { DummyError *tmp; PCAST(tmp,DummyError,excp); if (tmp) { _equal = True; //!!! COPY MEMBERS HERE !!! } else { _equal = False; } }
This constructor can be used to store a exception number for the current exception. However this is being taken out.
Construct an ExcpError.
Does nothing