Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

Classes | Namespaces | Defines | Functions
basics/exceptions.hh File Reference
#include <exception>
#include <iostream>
#include <string>
#include <cstdlib>
#include <sstream>
#include <new>
#include "outputOperator.hh"
Include dependency graph for exceptions.hh:

Go to the source code of this file.

Classes

class  concepts::Assertion
 Exception class for assertions. More...
class  concepts::DimensionMismatch
 Exception class to express dimensions not matching. More...
class  concepts::ExceptionBase
 Base class for exceptions. More...
class  concepts::IndexNotExisting
 Exception class to express that an index in a dynamic array does not exist. More...
class  concepts::MissingFeature
 Exception class to express a missing feature. More...
class  concepts::Stacktrace
 Dumps a stack trace using gdb. More...

Namespaces

namespace  concepts
 

Geometries and material constants for eddy current problems.


Defines

#define __PRETTY_FUNCTION__   "(unknown)"
#define CONCEPTS_SIMPLE_EXC(msg)
#define conceptsAssert(cond, exc)
#define conceptsAssert3(cond, exc, msg)
#define conceptsException(exc)
 Prepares an exception for throwing.
#define conceptsThrowSimpleE(msg)
 Throws a equivalent to conceptsAssert(false, exc)

Functions

template<class exc >
exc concepts::exception_set_fields (exc e, const std::string &file, const unsigned int line, const std::string &function, const std::string &excName)
 Sets fields on exception and throws it.
template<class exc >
void concepts::exception_throw_assert (const std::string &file, int line, const std::string &function, const std::string &exc_name, const std::string &cond, exc e)
 Sets the fields of an assertion and throws it.

Define Documentation

#define __PRETTY_FUNCTION__   "(unknown)"

Definition at line 251 of file exceptions.hh.

#define CONCEPTS_SIMPLE_EXC (   msg)
Value:
exception_set_fields(ExceptionBase(), std::string(__FILE__), __LINE__, \
           std::string(__PRETTY_FUNCTION__), std::string(msg))

Definition at line 303 of file exceptions.hh.

#define conceptsAssert (   cond,
  exc 
)
Value:
{ \
    if (!(cond)) { \
      std::stringstream errorMsg; \
      errorMsg << "by violating condition <" << #cond << ">"; \
      exception_throw_assert(std::string(__FILE__), __LINE__, \
           std::string(__PRETTY_FUNCTION__), \
                             std::string(#exc), errorMsg.str(), exc); \
    } \
  }
Examples:
hpFEM2d.cc, linearFEM1d-simple.cc, and linearFEM1d.cc.

Definition at line 351 of file exceptions.hh.

#define conceptsAssert3 (   cond,
  exc,
  msg 
)
Value:
{ \
    if (!(cond)) { \
      std::stringstream errorMsg; \
      errorMsg << "by violating condition <" << #cond << ">, " << msg; \
      exception_throw_assert(std::string(__FILE__), __LINE__, \
           std::string(__PRETTY_FUNCTION__), \
                             std::string(#exc), errorMsg.str(), exc); \
    } \
  }

Definition at line 399 of file exceptions.hh.

#define conceptsException (   exc)
Value:
exception_set_fields(exc, std::string(__FILE__), __LINE__, \
           std::string(__PRETTY_FUNCTION__), std::string(#exc))

Prepares an exception for throwing.

This is the main routine in the exception mechanism for production mode error checking. See the ExceptionBase class for more information.

Parameters:
excException to be thrown
See also:
ExceptionBase
Test:
test::ExceptionTest
Author:
Philipp Frauenfelder, 2000
Examples:
hpFEM2d.cc, and hpFEM3d-EV.cc.

Definition at line 299 of file exceptions.hh.


Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)