Shiboken::AutoDecRef Struct
struct Shiboken::AutoDecRefAutoDecRef holds a PyObject pointer and decrements its reference counter when destroyed. More...
| Header: | #include <autodecref.h> |
Public Functions
| AutoDecRef() | |
| AutoDecRef(PyObject *pyObj) | |
| AutoDecRef(SbkObject *pyObj) | |
| AutoDecRef(const Shiboken::AutoDecRef &) | |
| ~AutoDecRef() | |
| PyObject * | object() const |
| void | reset(PyObject *other) |
| Shiboken::AutoDecRef & | operator=(const Shiboken::AutoDecRef &) |
Detailed Description
Member Function Documentation
[constexpr noexcept default] AutoDecRef::AutoDecRef()
Constructs an empty AutoDecRef, to be used later with reset().
[explicit noexcept] AutoDecRef::AutoDecRef(PyObject *pyObj)
Constructs an AutoDecRef taking ownership of the borrowed reference to the Python object pyObj.
[explicit noexcept] AutoDecRef::AutoDecRef(SbkObject *pyObj)
Constructs an AutoDecRef taking ownership of the borrowed reference to the wrapped Python object pyObj.
[delete] AutoDecRef::AutoDecRef(const Shiboken::AutoDecRef &)
Copy-constructs an instance of AutoDecRef. This function is deleted.
[noexcept] AutoDecRef::~AutoDecRef()
Decrements the reference count of the borrowed python reference.
PyObject *AutoDecRef::object() const
Returns the pointer of the Python object being held.
void AutoDecRef::reset(PyObject *other)
Decrements the reference count of the currently held Python object and takes ownership of other.
[delete] Shiboken::AutoDecRef &AutoDecRef::operator=(const Shiboken::AutoDecRef &)
Copy-assigns other to this AutoDecRef instance. This function is deleted.