Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
CPPExcInstance.h
Go to the documentation of this file.
1#ifndef CPYCPPYY_CPPEXCINSTANCE_H
2#define CPYCPPYY_CPPEXCINSTANCE_H
3
4//////////////////////////////////////////////////////////////////////////////
5// //
6// CpyCppyy::CPPExceptionInstance //
7// //
8// Python-side proxy, encapsulaties a C++ exception object. //
9// //
10//////////////////////////////////////////////////////////////////////////////
11
12namespace CPyCppyy {
13
15public:
16 PyBaseExceptionObject fBase;
19};
20
21
22//- object proxy type and type verification ----------------------------------
24
25template<typename T>
26inline bool CPPExcInstance_Check(T* object)
27{
28 return object && PyObject_TypeCheck(object, &CPPExcInstance_Type);
29}
30
31template<typename T>
32inline bool CPPExcInstance_CheckExact(T* object)
33{
34 return object && Py_TYPE(object) == &CPPExcInstance_Type;
35}
36
37} // namespace CPyCppyy
38
39#endif // !CPYCPPYY_CPPEXCINSTANCE_H
#define Py_TYPE(ob)
Definition CPyCppyy.h:217
_object PyObject
#define CPYCPPYY_IMPORT
Definition CommonDefs.h:26
PyBaseExceptionObject fBase
Set of helper functions that are invoked from the pythonizors, on the Python side.
PyTypeObject CPPExcInstance_Type
bool CPPExcInstance_Check(T *object)
bool CPPExcInstance_CheckExact(T *object)