KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
List of all members
Kratos::Exception Class Reference

Extends the std::exception class with more information about error location. More...

#include <exception.h>

Inheritance diagram for Kratos::Exception:
Collaboration diagram for Kratos::Exception:

Public Member Functions

Life Cycle
 Exception ()
 Default constructor. More...
 
 Exception (const std::string &rWhat)
 
 Exception (const std::string &rWhat, const CodeLocation &Location)
 
 Exception (Exception const &Other)
 Copy constructor. More...
 
 ~Exception () noexcept override
 Destructor. More...
 
Operators
Exceptionoperator= (Exception const &rOther)=delete
 Assignment operator is deleted. More...
 
Exceptionoperator<< (CodeLocation const &TheLocation)
 Code Location stream function to add callers to call stack. More...
 
template<class StreamValueType >
Exceptionoperator<< (StreamValueType const &rValue)
 string stream function More...
 
Exceptionoperator<< (std::ostream &(*pf)(std::ostream &))
 Manipulator stream function. More...
 
Exceptionoperator<< (const char *rString)
 char stream function More...
 
Operations
void append_message (std::string const &rMessage)
 
void add_to_call_stack (CodeLocation const &TheLocation)
 
Access
const char * what () const noexcept override
 The override of the base class what method. More...
 
const std::string & message () const
 
const CodeLocation where () const
 
Input and output
virtual std::string Info () const
 Turn back information as a string. More...
 
virtual void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
virtual void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 

Detailed Description

Extends the std::exception class with more information about error location.

This class extends the std::exception providing the where method which gives the location of the error. In order to have such information it is recommended to use it via KRATOS_ERROR macro.

Author
Pooyan Dadvand

Constructor & Destructor Documentation

◆ Exception() [1/4]

Kratos::Exception::Exception ( )

Default constructor.

◆ Exception() [2/4]

Kratos::Exception::Exception ( const std::string &  rWhat)
explicit

◆ Exception() [3/4]

Kratos::Exception::Exception ( const std::string &  rWhat,
const CodeLocation Location 
)

◆ Exception() [4/4]

Kratos::Exception::Exception ( Exception const &  Other)

Copy constructor.

◆ ~Exception()

Kratos::Exception::~Exception ( )
overridenoexcept

Destructor.

Member Function Documentation

◆ add_to_call_stack()

void Kratos::Exception::add_to_call_stack ( CodeLocation const &  TheLocation)

◆ append_message()

void Kratos::Exception::append_message ( std::string const &  rMessage)

◆ Info()

std::string Kratos::Exception::Info ( ) const
virtual

Turn back information as a string.

Reimplemented in Kratos::TestSkippedException.

◆ message()

const std::string & Kratos::Exception::message ( ) const

◆ operator<<() [1/4]

Exception & Kratos::Exception::operator<< ( CodeLocation const &  TheLocation)

Code Location stream function to add callers to call stack.

◆ operator<<() [2/4]

Exception & Kratos::Exception::operator<< ( const char *  rString)

char stream function

◆ operator<<() [3/4]

Exception & Kratos::Exception::operator<< ( std::ostream &(*)(std::ostream &)  pf)

Manipulator stream function.

◆ operator<<() [4/4]

template<class StreamValueType >
Exception& Kratos::Exception::operator<< ( StreamValueType const &  rValue)
inline

string stream function

◆ operator=()

Exception& Kratos::Exception::operator= ( Exception const &  rOther)
delete

Assignment operator is deleted.

◆ PrintData()

void Kratos::Exception::PrintData ( std::ostream &  rOStream) const
virtual

Print object's data.

Reimplemented in Kratos::TestSkippedException.

◆ PrintInfo()

void Kratos::Exception::PrintInfo ( std::ostream &  rOStream) const
virtual

Print information about this object.

Reimplemented in Kratos::TestSkippedException.

◆ what()

const char * Kratos::Exception::what ( ) const
overridenoexcept

The override of the base class what method.

This method returns the entire message with where information

◆ where()

const CodeLocation Kratos::Exception::where ( ) const

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