A PyObject wrapper to track reference counting of external objects.
This wrapper can be useful in shared ownership scenarios when a C++ object is created on the Python side and there is no easy way to track its ownership on the C++ side. If multiple instances of this class are given the same Python proxy, they will increase/decrease its reference counting following Python rules and ensure proper destruction of the underlying C++ object when no other Python objects are referencing it.
Definition at line 47 of file PyROOTModule.cxx.
Public Member Functions | |
| PyObjRefCounter (const PyObjRefCounter &other) | |
| PyObjRefCounter (PyObject *object) | |
| PyObjRefCounter (PyObjRefCounter &&other) | |
| ~PyObjRefCounter () | |
| PyObjRefCounter & | operator= (const PyObjRefCounter &other) |
| PyObjRefCounter & | operator= (PyObjRefCounter &&other) |
Private Member Functions | |
| void | Reset (PyObject *object) |
Private Attributes | |
| PyObject * | fObject {nullptr} |
|
inline |
Definition at line 63 of file PyROOTModule.cxx.
|
inline |
Definition at line 65 of file PyROOTModule.cxx.
|
inline |
Definition at line 67 of file PyROOTModule.cxx.
|
inline |
Definition at line 75 of file PyROOTModule.cxx.
|
inline |
Definition at line 69 of file PyROOTModule.cxx.
|
inline |
Definition at line 81 of file PyROOTModule.cxx.
|
inlineprivate |
Definition at line 50 of file PyROOTModule.cxx.
|
private |
Definition at line 48 of file PyROOTModule.cxx.