-
首页
-
C4D R23.110 C++ SDK
CPyInterface Class Reference
#include <cpython_ref.h>
详细描述
Interface class for CPyRefs which removes the need for manual reference counting. The internally stored PyObject can be disconnected from this wrapper class by calling
CPyInterface::Disconnect
.
@MAXON_ANNOTATION{refclass=false}
成员函数文档编制
◆
MAXON_INTERFACE()
◆
CreateRef27()
Creates a
CPyRef
reference by a given
NativePyObject
from a Python 2.7 virtual machine. GIL must be held.
-
参数
-
[in]
|
lib
|
The
NativePyObject
's library origin.
|
[in]
|
refType
|
Ref count handler information.
|
-
返回
-
Returns a new wrapper reference.
◆
CreateRef36()
Creates a
CPyRef
reference by a given
NativePyObject
from a Python 3.6 virtual machine. GIL must be held.
-
参数
-
[in]
|
lib
|
The
NativePyObject
's library origin.
|
[in]
|
refType
|
Ref count handler information.
|
-
返回
-
Returns a new wrapper reference.
◆
CreateRef()
Creates a
CPyRef
reference by a given
NativePyObject
. GIL must be held. The library version is detected by using the library, is slightly slower than CreateRef27 or CreateRef36.
-
参数
-
[in]
|
lib
|
The
NativePyObject
's library origin.
|
[in]
|
refType
|
Ref count handler information.
|
-
返回
-
Returns a new wrapper reference.
◆
CreateConstRef()
Creates a immutable
CPyConstRef
reference by a given
NativePyObject
. GIL must be held.
-
参数
-
[in]
|
lib
|
The
NativePyObject
's library origin.
|
[in]
|
refType
|
Ref count handler information.
|
-
返回
-
Returns a new wrapper reference.
◆
CreateTempRef()
Creates a temporary
CPyTempRef
reference by a given
NativePyObject
. GIL must be held.
-
参数
-
-
返回
-
Returns a new wrapper reference.
◆
Init()
Initializes the wrapper reference. GIL must be held.
-
参数
-
[in]
|
lib
|
The
NativePyObject
's library origin.
|
[in]
|
refType
|
Ref count handler information.
|
◆
Incref()
Increments the reference count. Instance must be already initialized. GIL must be held.
◆
Decref()
Decrements the reference count. Instance must be already initialized. GIL must be held.
◆
GetRefCount()
Decrements the reference count. Instance must be already initialized. GIL must be held.
-
返回
-
Reference count.
◆
GetLibrary()
Returns the library pointer with which the instance got initialized.
◆
GetTypeRef()
Returns the type object of the wrapped
NativePyObject
. GIL must be held.
-
返回
-
Type reference.
◆
GetPyObject()
Returns the internal
NativePyObject
with which the instance got initialized. No reference count change is performed.
-
返回
-
Internal
NativePyObject
◆
Disconnect()
Returns the internal
NativePyObject
with which the instance got initialized. Objects reference count needs to be decremented if not used anymore. The wrapper reference becomes invalid, no other function should be called, and it should be deleted soon as possible. GIL must be held.
-
返回
-
Internal
NativePyObject
◆
Get()
Returns the internal
NativePyObject
cast to a target type. GIL must be held. No check is performed if the cast is valid or not. No reference count change is performed.
-
返回
-
Internal
NativePyObject
casted.
◆
GetAndIncref()
Returns the internal
NativePyObject
cast to a target type. No check is performed if the cast is valid or not. Reference count is incremented before function returns. The wrapper reference stays valid. GIL must be held.
-
返回
-
Internal
NativePyObject
casted.