ROOT
Version v6.32
master
v6.34
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
►
Functional Parts
►
Namespaces
►
All Classes
▼
Files
▼
File List
▼
bindings
▼
pyroot
▼
cppyy
►
cppyy
►
cppyy-backend
▼
CPyCppyy
▼
include
▼
CPyCppyy
►
API.h
►
CommonDefs.h
►
DispatchPtr.h
►
PyException.h
►
PyResult.h
►
Reflex.h
►
TPyArg.h
►
src
►
pythonizations
►
r
►
tpython
►
core
►
documentation
►
geom
►
graf2d
►
graf3d
►
gui
►
hist
►
html
►
io
►
main
►
math
►
montecarlo
►
net
►
proof
►
roofit
►
sql
►
tmva
►
tree
►
tutorials
►
v6-32-00-patches
►
File Members
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
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
#include <string>
32
33
// Bindings
34
#include "
CPyCppyy/CommonDefs.h
"
35
36
37
namespace
CPyCppyy
{
38
39
class
CPYCPPYY_CLASS_EXTERN
PyException
:
public
std::exception {
40
public
:
41
PyException
();
42
virtual
~PyException
()
noexcept
;
43
44
// give reason for raised exception
45
virtual
const
char
*
what
()
const
noexcept
;
46
47
// clear Python error, to allow full error handling C++ side
48
void
clear()
const
noexcept
;
49
50
private
:
51
std::string
fMsg
;
52
};
53
54
}
// namespace CPyCppyy
55
56
#endif
// !CPYCPPYY_PYEXCEPTION_H
CommonDefs.h
CPYCPPYY_CLASS_EXTERN
#define CPYCPPYY_CLASS_EXTERN
Definition
CommonDefs.h:29
CPyCppyy::PyException
Definition
PyException.h:39
CPyCppyy::PyException::fMsg
std::string fMsg
Definition
PyException.h:51
CPyCppyy
Definition
callcontext.h:10
what
static const char * what
Definition
stlLoader.cc:5
bindings
pyroot
cppyy
CPyCppyy
include
CPyCppyy
PyException.h
ROOT v6-32 - Reference Guide Generated on Wed Apr 2 2025 08:24:18 (GVA Time) using Doxygen 1.10.0