Mantid
|
Exception for a call to an abstract class function. More...
#include <Exception.h>
Public Member Functions | |
AbsObjMethod (const AbsObjMethod &A) | |
Copy constructor. More... | |
AbsObjMethod (std::string) | |
Constructor. More... | |
AbsObjMethod & | operator= (const AbsObjMethod &A) |
Assignment operator. More... | |
const char * | what () const noexcept override |
Writes out the range and limits. More... | |
Private Attributes | |
const std::string | objectName |
The name of the search object. More... | |
std::string | outMessage |
The message returned by what() More... | |
Exception for a call to an abstract class function.
For a method virtual abstract class exists that needs to have instance because of interation over a base class pointer. e.g vector<AbsBase*> Vec; for(vc=Vec.begin();vc!=Vec.end();vc++) (*vc)->method();
but: X=new AbsBase() is forbidden by the compiler but it always possible to obtain a pure AbsBase pointer by casting and this exception is to be placed in these sorts of methods in the Abstract class.
It is a runtime error constructed a runtime reinterpret cast.
Anyone has a better way of doing this ? Please let me know!!! – Note: I believe this was tabled for Cx00 but rejected (why?)
Definition at line 202 of file Exception.h.
Mantid::Kernel::Exception::AbsObjMethod::AbsObjMethod | ( | std::string | ObjectName | ) |
Constructor.
ObjectName | :: The name of the search object |
Definition at line 133 of file Exception.cpp.
References objectName, and outMessage.
Mantid::Kernel::Exception::AbsObjMethod::AbsObjMethod | ( | const AbsObjMethod & | A | ) |
Copy constructor.
Definition at line 138 of file Exception.cpp.
AbsObjMethod & Mantid::Kernel::Exception::AbsObjMethod::operator= | ( | const AbsObjMethod & | A | ) |
Assignment operator.
|
overridenoexcept |
Writes out the range and limits.
Definition at line 143 of file Exception.cpp.
References outMessage.
|
private |
The name of the search object.
Definition at line 205 of file Exception.h.
Referenced by AbsObjMethod().
|
private |
The message returned by what()
Definition at line 207 of file Exception.h.
Referenced by AbsObjMethod(), and what().