#include <PY_OpaqueObject.h>
Definition at line 24 of file PY_OpaqueObject.h.
PY_OpaqueObject::PY_OpaqueObject |
( |
| ) |
|
|
inlinenoexcept |
PY_OpaqueObject::PY_OpaqueObject |
( |
std::nullptr_t |
| ) |
|
|
inlinenoexcept |
PY_OpaqueObject::PY_OpaqueObject |
( |
void * |
opaque_py_object, |
|
|
bool |
new_ref = false |
|
) |
| |
|
inlineexplicitnoexcept |
Construct instances of this class with an opaque PY_PyObject pointer (which may be null). On destruction, the reference counter will be decremented. By default, opaque_py_object will have its reference count incremented on construction. To avoid this, set new_ref=true to signify that we are being passed ownership of a new object.
Definition at line 36 of file PY_OpaqueObject.h.
PY_OpaqueObject::~PY_OpaqueObject |
( |
| ) |
|
|
inline |
bool PY_OpaqueObject::equalsOpaqueObject |
( |
void * |
opaque_py_object | ) |
const |
|
noexcept |
The comparison operators and equalsOpaqueObject compare using the eq operator.
void* PY_OpaqueObject::opaqueObject |
( |
| ) |
const |
|
inlinenoexcept |
Return a borrowed reference to our opaque PyObject *. If the caller will hold a reference to this object after the PY_OpaqueObject has been deleted, it is up to the caller to increment the reference count.
Definition at line 92 of file PY_OpaqueObject.h.
PY_OpaqueObject::operator bool |
( |
| ) |
const |
|
inlineexplicitnoexcept |
Return true if *this owns an object (ie. != nullptr)
Definition at line 134 of file PY_OpaqueObject.h.
The comparison operators and equalsOpaqueObject compare using the eq operator.
Definition at line 128 of file PY_OpaqueObject.h.
bool PY_OpaqueObject::operator== |
( |
const PY_OpaqueObject & |
opaque_object | ) |
const |
|
inlinenoexcept |
The comparison operators and equalsOpaqueObject compare using the eq operator.
Definition at line 126 of file PY_OpaqueObject.h.
Return a borrowed reference as a PyObject *.
Using this method requires that the caller includes PY_CPythonAPI.h, only call this in a .C file to avoid polluting Python header symbols into rest of the codebase.
Definition at line 108 of file PY_OpaqueObject.h.
void* PY_OpaqueObject::releaseOpaqueObject |
( |
| ) |
|
|
inlinenoexcept |
Releases ownership of the managed object as a void *, and resets.
Definition at line 96 of file PY_OpaqueObject.h.
Releases ownership of the managed object as PY_Object *, and resets.
Using this method requires that the caller includes PY_CPythonAPI.h, only call this in a .C file to avoid polluting Python header symbols into rest of the codebase.
Definition at line 116 of file PY_OpaqueObject.h.
void PY_OpaqueObject::reset |
( |
| ) |
|
|
noexcept |
Releases ownership and sets to nullptr.
void PY_OpaqueObject::reset |
( |
void * |
opaque_py_object, |
|
|
bool |
new_ref |
|
) |
| |
|
noexcept |
Release ownerhsip of old ptr and assign a new PY_PyObject. If !new_ref (aka borrowed), opaque_py_object's refcount is incremented
void PY_OpaqueObject::resetToNone |
( |
| ) |
|
The documentation for this class was generated from the following file: