-
首页
-
C4D R23.110 C++ SDK
#include <weakref.h>
详细描述
template<typename REFERENCE>
class maxon::WeakRef< REFERENCE >
A
WeakRef
points to a target object as long as there are strong references which also point to it. When an object has no more strong references it will be destructed and all weak references to it will return a null reference from then on.
私有成员函数
|
const void *
|
锁
() const
|
void
|
Unlock
(const void *target) const
|
Static Private Member Functions
|
template<typename REFERENCETYPE >
|
static REFERENCETYPE::BaseRefType &
|
GetBaseRef
(const REFERENCETYPE &strongReference)
|
template<typename T , typename HANDLER >
|
static
BaseRef
< T, HANDLER > &
|
GetBaseRef
(const
BaseRef
< T, HANDLER > &strongReference)
|
构造函数 & 析构函数文档编制
◆
WeakRef()
[1/5]
◆
WeakRef()
[2/5]
Adds a weak reference. If memory allocation fails the weak reference will be nullptr.
-
参数
-
[in]
|
strongReference
|
BaseRef
with strong reference to an object.
|
◆
WeakRef()
[3/5]
Copy constructs a weak reference.
-
参数
-
[in]
|
src
|
Source weak reference.
|
◆
~WeakRef()
Removes a weak reference.
◆
WeakRef()
[4/5]
Moves a weak reference.
-
参数
-
[in]
|
src
|
Source weak reference, will be nulled.
|
◆
WeakRef()
[5/5]
成员函数文档编制
◆
operator=()
[1/3]
WeakRef
& operator=
|
(
|
const REFERENCE &
|
strongReference
|
)
|
|
Adds a strong reference.
-
参数
-
[in]
|
strongReference
|
BaseRef
with strong reference to an object.
|
-
返回
-
*this.
◆
operator=()
[2/3]
Copies a weak reference.
-
参数
-
[in]
|
src
|
Source weak reference.
|
-
返回
-
*this.
◆
MAXON_OPERATOR_MOVE_ASSIGNMENT()
MAXON_OPERATOR_MOVE_ASSIGNMENT
|
(
|
WeakRef
< REFERENCE >
|
|
)
|
|
Moves a weak reference.
-
参数
-
[in]
|
src
|
Source weak reference.
|
-
返回
-
*this.
◆
operator=()
[3/3]
WeakRef
& operator=
|
(
|
std::nullptr_t
|
t
|
)
|
|
◆
operator REFERENCE()
operator REFERENCE
|
(
|
|
)
|
const
|
Returns a strong reference. If the weak referenced object was already released a null reference will be returned.
-
返回
-
Strong reference to the target or null.
◆
GetReference()
REFERENCE GetReference
|
(
|
|
)
|
const
|
Returns a strong reference. If the weak referenced object was already released a null reference will be returned.
-
返回
-
Strong reference to the target or null.
◆
operator==()
Bool
operator==
|
(
|
const
WeakRef
< REFERENCE > &
|
other
|
)
|
const
|
Compares WeakRefs for equality.
-
参数
-
[in]
|
other
|
The other comparand.
|
-
返回
-
True if equal.
◆
operator!=()
Bool
operator!=
|
(
|
const
WeakRef
< REFERENCE > &
|
other
|
)
|
const
|
Compares WeakRefs for inequality.
-
参数
-
[in]
|
other
|
The other comparand.
|
-
返回
-
True if not equal.
◆
operator Bool()
Checks if the weak reference points to a strong reference (non-blocking check).
-
返回
-
True if there currently is a strong reference, otherwise false.
◆
IsEmpty()
Checks if the weak reference is empty.
-
返回
-
True if the weak reference is empty.
◆
IsPopulated()
Bool
IsPopulated
|
(
|
|
)
|
const
|
Checks if this weak reference contains anything.
-
返回
-
True if the weak reference points to an object.
◆
GetHashCode()
Compute hash code based on the targeted object. WeakRefs pointing to the same target will have the same hash code. When the target object is removed the hash code will change to 0, this means two WeakRefs which initially pointed to different objects will have the same hash code after the target objects were destructed.
-
返回
-
True if the weak reference points to an object.
◆
GetCurrent()
const void* GetCurrent
|
(
|
|
)
|
const
|
|
protected
|
◆
Lock()
const void* Lock
|
(
|
|
)
|
const
|
|
private
|
Locks the WeakRefTarget.
◆
Unlock()
void Unlock
|
(
|
const void *
|
target
|
)
|
const
|
|
private
|
Unlocks the WeakRefTarget.
◆
GetBaseRef()
[1/2]
static REFERENCETYPE::BaseRefType& GetBaseRef
|
(
|
const REFERENCETYPE &
|
strongReference
|
)
|
|
|
static
private
|
◆
GetBaseRef()
[2/2]
static
BaseRef
<T, HANDLER>& GetBaseRef
|
(
|
const
BaseRef
< T, HANDLER > &
|
strongReference
|
)
|
|
|
static
private
|