OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
CPythonObjectBorrowed.h
Go to the documentation of this file.
1/*****************************************************************/
11#pragma once
12#include "CPythonObject.h"
13
15{
16public:
17 CPythonObjectBorrowed(PyObject* borrowedRef) : CPythonObject(borrowedRef)
18 {
19 Py_XINCREF(_ref);
20 }
21
23
24 void reset(PyObject* ref)
25 {
26 if (_ref != nullptr)
27 {
28 Py_XDECREF(_ref);
29 _ref = nullptr;
30 }
31 _ref = ref;
32 Py_XINCREF(_ref);
33 }
34};
Definition CPythonObjectBorrowed.h:15
void reset(PyObject *ref)
Definition CPythonObjectBorrowed.h:24
CPythonObjectBorrowed(PyObject *borrowedRef)
Definition CPythonObjectBorrowed.h:17
Definition CPythonObject.h:13
PyObject * _ref
Definition CPythonObject.h:70
void reset(CPythonObject &&other)
Definition CPythonObject.h:34