ROOT
v6-30
Reference Guide
Loading...
Searching...
No Matches
PyException.h
Go to the documentation of this file.
1
#ifndef CPYCPPYY_PYEXCEPTION_H
2
#define CPYCPPYY_PYEXCEPTION_H
3
4
//////////////////////////////////////////////////////////////////////////////
5
// //
6
// PyException //
7
// //
8
// Purpose: A C++ exception class for throwing python exceptions //
9
// through C++ code. //
10
// Created: Apr, 2004, Scott Snyder, from the version in D0's python_util. //
11
// //
12
// The situation is: //
13
// - We're calling C++ code from python. //
14
// - The C++ code can call back to python. //
15
// - What to do then if the python callback throws an exception? //
16
// //
17
// We need to get the control flow back to where CPyCppyy calls C++. //
18
// To do that we throw a TPyException. //
19
// We can then catch this exception when we do the C++ call. //
20
// //
21
// Note that we don't need to save any state in the exception -- it's //
22
// already in the python error info variables. //
23
// (??? Actually, if the program is multithreaded, this is dangerous //
24
// if the code has released and reacquired the lock along the call chain. //
25
// Punt on this for now, though.) //
26
// //
27
//////////////////////////////////////////////////////////////////////////////
28
29
// Standard
30
#include <exception>
31
32
// Bindings
33
#include "
CPyCppyy/CommonDefs.h
"
34
35
36
namespace
CPyCppyy
{
37
38
class
CPYCPPYY_CLASS_EXTERN
PyException
:
public
std::exception {
39
public
:
40
PyException
();
41
virtual
~PyException
()
noexcept
;
42
43
// give reason for raised exception
44
virtual
const
char
*
what
()
const
noexcept
;
45
};
46
47
}
// namespace CPyCppyy
48
49
#endif
// !CPYCPPYY_PYEXCEPTION_H
CommonDefs.h
CPYCPPYY_CLASS_EXTERN
#define CPYCPPYY_CLASS_EXTERN
Definition
CommonDefs.h:29
CPyCppyy::PyException
Definition
PyException.h:38
CPyCppyy
Set of helper functions that are invoked from the pythonizors, on the Python side.
Definition
TPyClassGenerator.cxx:31
what
static const char * what
Definition
stlLoader.cc:6
bindings
pyroot
cppyy
CPyCppyy
inc
CPyCppyy
PyException.h
ROOT v6-30 - Reference Guide Generated on Sun Dec 1 2024 05:17:12 (GVA Time) using Doxygen 1.9.8