15 #ifndef __PY_OpaqueObject_h__
16 #define __PY_OpaqueObject_h__
38 reset(opaque_py_object, new_ref);
49 reset(opaque_object.myOpaqueObject,
false);
53 if (
this != &opaque_object)
54 reset(opaque_object.myOpaqueObject,
false);
62 : myOpaqueObject(opaque_object.myOpaqueObject)
64 opaque_object.myOpaqueObject =
nullptr;
68 reset(opaque_object.myOpaqueObject,
true);
69 opaque_object.myOpaqueObject =
nullptr;
80 void reset() noexcept;
84 void reset(
void *opaque_py_object,
bool new_ref) noexcept;
92 void *opaqueObject() const noexcept
93 {
return myOpaqueObject; }
98 auto ptr = opaqueObject();
99 myOpaqueObject =
nullptr;
109 {
return static_cast<PY_PyObject*
>(myOpaqueObject); }
118 auto ptr = pyObject();
119 myOpaqueObject =
nullptr;
127 {
return equalsOpaqueObject(opaque_object.myOpaqueObject); }
130 bool equalsOpaqueObject(
void *opaque_py_object)
const noexcept;
134 explicit operator bool() const noexcept
135 {
return myOpaqueObject !=
nullptr; }
140 return opaque_object.myOpaqueObject ==
nullptr;
145 return opaque_object.myOpaqueObject ==
nullptr;
150 return opaque_object.myOpaqueObject !=
nullptr;
155 return opaque_object.myOpaqueObject !=
nullptr;
159 void *myOpaqueObject =
nullptr;
bool operator==(const PY_OpaqueObject &opaque_object) const noexcept
PY_OpaqueObject(PY_OpaqueObject &&opaque_object) noexcept
bool operator!=(const PY_OpaqueObject &opaque_object) const noexcept
friend bool operator!=(const PY_OpaqueObject &opaque_object, std::nullptr_t) noexcept
PY_OpaqueObject() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void * releaseOpaqueObject() noexcept
Releases ownership of the managed object as a void *, and resets.
friend bool operator==(const PY_OpaqueObject &opaque_object, std::nullptr_t) noexcept
PY_PyObject * releasePyObject() noexcept
PY_OpaqueObject & operator=(std::nullptr_t) noexcept
PY_OpaqueObject & operator=(PY_OpaqueObject &&opaque_object) noexcept
PY_OpaqueObject & operator=(const PY_OpaqueObject &opaque_object) noexcept
PY_OpaqueObject(const PY_OpaqueObject &opaque_object) noexcept
PY_OpaqueObject(void *opaque_py_object, bool new_ref=false) noexcept
friend bool operator==(std::nullptr_t, const PY_OpaqueObject &opaque_object) noexcept
friend bool operator!=(std::nullptr_t, const PY_OpaqueObject &opaque_object) noexcept
PY_OpaqueObject(std::nullptr_t) noexcept
PY_PyObject * pyObject() const noexcept