OpenDaVINCI  4.16.0
odcore::exceptions::Exceptions Class Referenceabstract

#include <Exceptions.h>

Inheritance diagram for odcore::exceptions::Exceptions:
Inheritance graph

Public Member Functions

 Exceptions (const string &exceptionMessage, const string &fileName, const uint32_t &lineNumber)
 Exceptions (const Exceptions &obj)
virtual ~Exceptions () throw ()
Exceptionsoperator= (const Exceptions &obj)
const char * what () const throw ()
const string toString () const
virtual const string getExceptionName () const =0
const string getMessage () const
const string getFileName () const
uint32_t getLineNumber () const

Detailed Description

This is the base class for all exceptions. New exceptions are defined as follows:


Constructor & Destructor Documentation

odcore::exceptions::Exceptions::Exceptions ( const string &  exceptionMessage,
const string &  fileName,
const uint32_t &  lineNumber 

Constructor for the exception class.

The OPENDAVINCI_CORE_THROW_EXCEPTION macro uses this signature for adding file name and line number. Every exception derived from this class has to use the same signature:

class MyException : public exceptions::Exceptions {
MyException(const string &exceptionMessage, const string &fileName, const uint32_t &lineNumber) :
Exceptions(exceptionMessage, fileName, lineNumber) {};
exceptionMessageMessage for this exception.
fileNameFile name of the file where this exception occured.
lineNumberLine number.
odcore::exceptions::Exceptions::Exceptions ( const Exceptions obj)

Copy constructor.

objAnother exception.
odcore::exceptions::Exceptions::~Exceptions ( )
throw (

Member Function Documentation

virtual const string odcore::exceptions::Exceptions::getExceptionName ( ) const
pure virtual

This method returns the name of the Exception.

name of the exception.

Referenced by toString().

const string odcore::exceptions::Exceptions::getFileName ( ) const

This method returns the file name.

file name.

Referenced by operator=(), and toString().

uint32_t odcore::exceptions::Exceptions::getLineNumber ( ) const

This method returns the line number.

line number.

Referenced by operator=(), and toString().

const string odcore::exceptions::Exceptions::getMessage ( ) const

This method returns this exception's message.

This exception's message.

Referenced by operator=(), and toString().

Exceptions & odcore::exceptions::Exceptions::operator= ( const Exceptions obj)

Assignment operator.

objAnother exception.
Reference to this instance.

References getFileName(), getLineNumber(), getMessage(), and OPENDAVINCI_CORE_FREE_POINTER.

const string odcore::exceptions::Exceptions::toString ( ) const

This method returns a string representation.

String representation.

References getExceptionName(), getFileName(), getLineNumber(), and getMessage().

Referenced by odcontext::base::RuntimeControl::run(), and what().

const char * odcore::exceptions::Exceptions::what ( ) const
throw (

This method re-implements the same interface as the standard C++ exception for overriding the that method.

The exception's message.

References toString().