Alexandria
2.25.0
SDC-CH common library for the Euclid project
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Pyston
Pyston
ExceptionRaiser.h
Go to the documentation of this file.
1
19
#ifndef PYSTON_EXCEPTIONRAISER_H
20
#define PYSTON_EXCEPTIONRAISER_H
21
22
#include "
Pyston/Graph/Node.h
"
23
#include "
Pyston/PythonExceptions.h
"
24
#include <boost/python/errors.hpp>
25
#include <memory>
26
#include <string>
27
28
namespace
Pyston {
29
36
template
<
typename
T>
37
class
ExceptionRaiser
{
38
public
:
46
ExceptionRaiser
(
const
std::string
& msg,
bool
recoverable) :
m_msg
{msg},
m_recoverable
{recoverable} {}
47
53
void
operator()
(
const
std::shared_ptr
<
Node<T>
>&) {
54
if
(
m_recoverable
)
55
throw
RecoverableError
(
m_msg
.
c_str
());
56
else
57
throw
UnrecoverableError
(
m_msg
.
c_str
());
58
}
59
60
private
:
61
std::string
m_msg
;
62
bool
m_recoverable
;
63
};
64
65
}
// end of namespace Pyston
66
67
#endif // PYSTON_EXCEPTIONRAISER_H
PythonExceptions.h
std::shared_ptr
Node.h
Pyston::ExceptionRaiser::operator()
void operator()(const std::shared_ptr< Node< T >> &)
Definition:
ExceptionRaiser.h:53
std::string
STL class.
Pyston::ExceptionRaiser::m_recoverable
bool m_recoverable
Definition:
ExceptionRaiser.h:62
Pyston::RecoverableError
Definition:
PythonExceptions.h:48
Pyston::ExceptionRaiser
Definition:
ExceptionRaiser.h:37
Pyston::ExceptionRaiser::ExceptionRaiser
ExceptionRaiser(const std::string &msg, bool recoverable)
Definition:
ExceptionRaiser.h:46
Pyston::ExceptionRaiser::m_msg
std::string m_msg
Definition:
ExceptionRaiser.h:61
Pyston::Node
Definition:
Node.h:105
std::string::c_str
T c_str(T...args)
Pyston::UnrecoverableError
Definition:
PythonExceptions.h:30
Generated by
1.8.5