TwiceAsNice  2019-02-18
Classes | Namespaces | Macros | Functions
Exception.h File Reference
#include <string>
#include <sstream>
#include <Nice/Log/Object.h>
#include <Nice/Log.h>
Include dependency graph for Exception.h:

Classes

struct  Nice::ExceptionRaiser
 
struct  Nice::ExceptionRaiserImpl< Type >
 
class  Nice::Exception
 
Helper Class and Makros for throwing exceptions with a exception stack. More...
 
struct  Nice::UnknownException
 

Namespaces

 Nice
 

 

Macros

#define E_THROW(...)   E_THROW_IMPL(__VA_ARGS__, 3, 2, 1)
 
#define E_THROW_IMPL(_1, _2, _3, N, ...)   E_THROW##N(_1, _2, _3)
 
#define E_THROW1(y, ...)
 
#define E_THROW2(z, y, ...)
 
#define E_THROW3(z, x, y)
 
#define A_THROW(...)   A_THROW_IMPL(__VA_ARGS__, 3, 2, 1)
 
#define A_THROW_IMPL(_1, _2, _3, N, ...)   A_THROW##N(_1, _2, _3)
 
#define A_THROW1(y, ...)
 
#define A_THROW2(z, y, ...)
 
#define A_THROW3(z, x, y)
 
#define F_THROW(...)   F_THROW_IMPL(__VA_ARGS__, 3, 2, 1)
 
#define F_THROW_IMPL(_1, _2, _3, N, ...)   F_THROW##N(_1, _2, _3)
 
#define F_THROW1(y, ...)
 
#define F_THROW2(z, y, ...)
 
#define F_THROW3(z, x, y)
 
#define E_ASSERT_THROW(...)   E_ASSERT_THROW_IMPL(__VA_ARGS__, 3, 2, 1)
 
#define E_ASSERT_THROW_IMPL(_0, _1, _2, _3, N, ...)   E_ASSERT_THROW##N(_0, _1, _2, _3)
 
#define E_ASSERT_THROW1(b, y, ...)   if(b) E_THROW(y)
 
#define E_ASSERT_THROW2(b, z, y, ...)   if(b) E_THROW(z, y)
 
#define E_ASSERT_THROW3(b, z, x, y)   if(b) E_THROW(z, x, y)
 

Functions

std::ostream & Nice::operator<< (std::ostream &ostr, const Exception &x)
 
template<class T >
Nice::createException (Nice::LEVEL _type, const char *_file, int _line, const char *_func, const std::string &_log)
 
template<class T >
Nice::createException (Nice::LEVEL _type, const char *_file, int _line, const char *_func, const std::string &_log, const Nice::Exception &_ex)
 
template<class T >
Nice::createException (Nice::LEVEL _type, const char *_file, int _line, const char *_func, const std::string &_log, const Nice::SeqLoggerObject &_stack)
 

Macro Definition Documentation

◆ A_THROW

#define A_THROW (   ...)    A_THROW_IMPL(__VA_ARGS__, 3, 2, 1)

◆ A_THROW1

#define A_THROW1 (   y,
  ... 
)
Value:
{::std::ostringstream os; os << "Nice::Exception:" << y; \
throw Nice::createException<Nice::Exception>(Nice::LALERT, __FILE__, __LINE__, __PRETTY_FUNCTION__, os.str()); }
int y
Definition: lutinvert.py:13
Definition: LoggerObject.h:53

◆ A_THROW2

#define A_THROW2 (   z,
  y,
  ... 
)
Value:
{::std::ostringstream os; os << #z": " << y; \
throw Nice::createException<z>(Nice::LALERT, __FILE__, __LINE__, __PRETTY_FUNCTION__, os.str()); }
int y
Definition: lutinvert.py:13
Definition: LoggerObject.h:53

◆ A_THROW3

#define A_THROW3 (   z,
  x,
 
)
Value:
{ ::std::ostringstream os; os << #z": " << y; \
throw Nice::createException<z>(Nice::LALERT, __FILE__, __LINE__, __PRETTY_FUNCTION__, os.str(), x); }
int y
Definition: lutinvert.py:13
x
Definition: meteoRRD_updater.py:125
Definition: LoggerObject.h:53

◆ A_THROW_IMPL

#define A_THROW_IMPL (   _1,
  _2,
  _3,
  N,
  ... 
)    A_THROW##N(_1, _2, _3)

◆ E_ASSERT_THROW

#define E_ASSERT_THROW (   ...)    E_ASSERT_THROW_IMPL(__VA_ARGS__, 3, 2, 1)

◆ E_ASSERT_THROW1

#define E_ASSERT_THROW1 (   b,
  y,
  ... 
)    if(b) E_THROW(y)

◆ E_ASSERT_THROW2

#define E_ASSERT_THROW2 (   b,
  z,
  y,
  ... 
)    if(b) E_THROW(z, y)

◆ E_ASSERT_THROW3

#define E_ASSERT_THROW3 (   b,
  z,
  x,
 
)    if(b) E_THROW(z, x, y)

◆ E_ASSERT_THROW_IMPL

#define E_ASSERT_THROW_IMPL (   _0,
  _1,
  _2,
  _3,
  N,
  ... 
)    E_ASSERT_THROW##N(_0, _1, _2, _3)

◆ E_THROW

#define E_THROW (   ...)    E_THROW_IMPL(__VA_ARGS__, 3, 2, 1)

◆ E_THROW1

#define E_THROW1 (   y,
  ... 
)
Value:
{::std::ostringstream os; os << "Nice::Exception:" << y; \
throw Nice::createException<Nice::Exception>(Nice::LERROR, __FILE__, __LINE__, __PRETTY_FUNCTION__, os.str()); }
int y
Definition: lutinvert.py:13
Definition: LoggerObject.h:55

◆ E_THROW2

#define E_THROW2 (   z,
  y,
  ... 
)
Value:
{::std::ostringstream os; os << #z": " << y; \
throw Nice::createException<z>(Nice::LERROR, __FILE__, __LINE__, __PRETTY_FUNCTION__, os.str()); }
int y
Definition: lutinvert.py:13
Definition: LoggerObject.h:55

◆ E_THROW3

#define E_THROW3 (   z,
  x,
 
)
Value:
{ ::std::ostringstream os; os << #z": " << y; \
throw Nice::createException<z>(Nice::LERROR, __FILE__, __LINE__, __PRETTY_FUNCTION__, os.str(), x); }
int y
Definition: lutinvert.py:13
x
Definition: meteoRRD_updater.py:125
Definition: LoggerObject.h:55

◆ E_THROW_IMPL

#define E_THROW_IMPL (   _1,
  _2,
  _3,
  N,
  ... 
)    E_THROW##N(_1, _2, _3)

◆ F_THROW

#define F_THROW (   ...)    F_THROW_IMPL(__VA_ARGS__, 3, 2, 1)

◆ F_THROW1

#define F_THROW1 (   y,
  ... 
)
Value:
{::std::ostringstream os; os << "Nice::Exception:" << y; \
throw Nice::createException<Nice::Exception>(Nice::LFATAL, __FILE__, __LINE__, __PRETTY_FUNCTION__, os.str()); }
int y
Definition: lutinvert.py:13
Definition: LoggerObject.h:52

◆ F_THROW2

#define F_THROW2 (   z,
  y,
  ... 
)
Value:
{::std::ostringstream os; os << #z": " << y; \
throw Nice::createException<z>(Nice::LFATAL, __FILE__, __LINE__, __PRETTY_FUNCTION__, os.str()); }
int y
Definition: lutinvert.py:13
Definition: LoggerObject.h:52

◆ F_THROW3

#define F_THROW3 (   z,
  x,
 
)
Value:
{ ::std::ostringstream os; os << #z": " << y; \
throw Nice::createException<z>(Nice::LFATAL, __FILE__, __LINE__, __PRETTY_FUNCTION__, os.str(), x); }
int y
Definition: lutinvert.py:13
x
Definition: meteoRRD_updater.py:125
Definition: LoggerObject.h:52

◆ F_THROW_IMPL

#define F_THROW_IMPL (   _1,
  _2,
  _3,
  N,
  ... 
)    F_THROW##N(_1, _2, _3)