Alexandria
2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
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
Node.h
PythonExceptions.h
std::string
std::string::c_str
T c_str(T... args)
Pyston::ExceptionRaiser
Definition
ExceptionRaiser.h:37
Pyston::ExceptionRaiser::m_recoverable
bool m_recoverable
Definition
ExceptionRaiser.h:62
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::ExceptionRaiser::operator()
void operator()(const std::shared_ptr< Node< T > > &)
Definition
ExceptionRaiser.h:53
Pyston::Node
Definition
Node.h:105
Pyston::RecoverableError
Definition
PythonExceptions.h:48
Pyston::UnrecoverableError
Definition
PythonExceptions.h:30
Pyston
Definition
ExceptionRaiser.h:28
std::shared_ptr
Generated by
1.9.8