aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
exceptions.h File Reference

Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org. More...

#include <iomanip>
#include <iostream>
#include <string>
#include <agrum/tools/core/types.h>
+ Include dependency graph for exceptions.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gum::Exception
 Base class for all aGrUM's exceptions. More...
 

Namespaces

 gum
 Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.
 

Macros

#define GUM_ERROR_IN_EXPR(type, msg)   throw(type(msg))
 
#define GUM_ERROR(type, msg)
 
#define GUM_SHOWERROR(e)
 
#define GUM_MAKE_ERROR(TYPE, SUPERCLASS, MSG)
 
#define GUM_SYNTAX_ERROR(msg, line, column)
 

Detailed Description

Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/. aGrUM's exceptions

Author
Pierre-Henri WUILLEMIN() & Christophe GONZALES()

Definition in file exceptions.h.

Macro Definition Documentation

◆ GUM_ERROR

#define GUM_ERROR (   type,
  msg 
)
Value:
{ \
std::ostringstream error_stream; \
error_stream << __FILE__ << ":" << __LINE__ << ": " << msg; \
throw(type(error_stream.str())); \
}

Definition at line 51 of file exceptions.h.

◆ GUM_ERROR_IN_EXPR

#define GUM_ERROR_IN_EXPR (   type,
  msg 
)    throw(type(msg))

Definition at line 38 of file exceptions.h.

◆ GUM_MAKE_ERROR

#define GUM_MAKE_ERROR (   TYPE,
  SUPERCLASS,
  MSG 
)
Value:
class TYPE: public SUPERCLASS { \
public: \
explicit TYPE(const std::string& aMsg, const std::string& aType = MSG) : \
SUPERCLASS(aMsg, aType){}; \
TYPE(const TYPE& src) : SUPERCLASS(src){}; \
};

Definition at line 82 of file exceptions.h.

◆ GUM_SHOWERROR

#define GUM_SHOWERROR (   e)
Value:
{ \
std::cout << std::endl \
<< __FILE__ << ":" << __LINE__ << " " << (e).errorType() << " from " \
<< std::endl \
<< (e).errorContent() << std::endl; \
}

Definition at line 57 of file exceptions.h.

◆ GUM_SYNTAX_ERROR

#define GUM_SYNTAX_ERROR (   msg,
  line,
  column 
)
Value:
{ \
std::ostringstream error_stream; \
error_stream << msg; \
throw(gum::SyntaxError(error_stream.str(), line, column)); \
}

Definition at line 90 of file exceptions.h.