Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::Kernel::Exception::AbsObjMethod Class Reference

Exception for a call to an abstract class function. More...

#include <Exception.h>

Inheritance diagram for Mantid::Kernel::Exception::AbsObjMethod:

Public Member Functions

 AbsObjMethod (const AbsObjMethod &A)
 Copy constructor. More...
 
 AbsObjMethod (std::string)
 Constructor. More...
 
AbsObjMethodoperator= (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AbsObjMethod() [1/2]

Mantid::Kernel::Exception::AbsObjMethod::AbsObjMethod ( std::string  ObjectName)

Constructor.

Parameters
ObjectName:: The name of the search object

Definition at line 133 of file Exception.cpp.

References objectName, and outMessage.

◆ AbsObjMethod() [2/2]

Mantid::Kernel::Exception::AbsObjMethod::AbsObjMethod ( const AbsObjMethod A)

Copy constructor.

Definition at line 138 of file Exception.cpp.

Member Function Documentation

◆ operator=()

AbsObjMethod & Mantid::Kernel::Exception::AbsObjMethod::operator= ( const AbsObjMethod A)

Assignment operator.

◆ what()

const char * Mantid::Kernel::Exception::AbsObjMethod::what ( ) const
overridenoexcept

Writes out the range and limits.

Returns
a char array of foramtted error information

Definition at line 143 of file Exception.cpp.

References outMessage.

Member Data Documentation

◆ objectName

const std::string Mantid::Kernel::Exception::AbsObjMethod::objectName
private

The name of the search object.

Definition at line 205 of file Exception.h.

Referenced by AbsObjMethod().

◆ outMessage

std::string Mantid::Kernel::Exception::AbsObjMethod::outMessage
private

The message returned by what()

Definition at line 207 of file Exception.h.

Referenced by AbsObjMethod(), and what().


The documentation for this class was generated from the following files: