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 72 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 88 of file PyROOTModule.cxx.
|
inline |
Definition at line 90 of file PyROOTModule.cxx.
|
inline |
Definition at line 92 of file PyROOTModule.cxx.
|
inline |
Definition at line 100 of file PyROOTModule.cxx.
|
inline |
Definition at line 94 of file PyROOTModule.cxx.
|
inline |
Definition at line 106 of file PyROOTModule.cxx.
|
inlineprivate |
Definition at line 75 of file PyROOTModule.cxx.
|
private |
Definition at line 73 of file PyROOTModule.cxx.