-
首页
-
C4D R23.110 C++ SDK
DelegateBase Class Reference
#include <delegate.h>
详细描述
Delegate
base class which can be used for
DataType
.
公共成员函数
|
|
DelegateBase
()
|
|
~DelegateBase
()
|
template<typename STUBPTR >
|
|
DelegateBase
(void *objectPtr, STUBPTR stubPtr,
Callback
callback)
|
template<typename FN , typename STUBPTR >
|
|
DelegateBase
(FN &&fn, STUBPTR stub,
Callback
callback)
|
|
DelegateBase
(const
DelegateBase
&)=delete
|
|
DelegateBase
(
DelegateBase
&&
src
)
|
|
MAXON_OPERATOR_MOVE_ASSIGNMENT
(
DelegateBase
)
|
void
|
重置
()
|
ResultMem
|
CopyFrom
(const
DelegateBase
&
src
)
|
template<typename FN , typename STUBPTR >
|
ResultMem
|
CopyFrom
(FN &&f, STUBPTR stub,
Callback
callback)
|
template<typename OBJ , typename STUBPTR >
|
ResultMem
|
CopyFrom
(OBJ &&object, STUBPTR stub)
|
Bool
|
IsEmpty
() const
|
Bool
|
IsPopulated
() const
|
Bool
|
IsStaticFunctionPointer
() const
|
template<typename FUNCTIONPTR >
|
FUNCTIONPTR
|
GetStaticFunctionPointer
() const
|
template<typename STUBPTR >
|
STUBPTR
|
GetStubPointer
() const
|
Member Typedef Documentation
◆
Callback
Member Enumeration Documentation
◆
CALLBACKMODE
Enumerator
|
ALLOC
|
Allocates memory for an object.
|
DESTRUCT_AND_RELEASE
|
Destructs the object to which dst points and releases the memory.
|
COPY
|
Copies the object from src to dst and returns the size on success (0 on failure).
|
MOVE_AND_DESTRUCT
|
Moves the object from src to dst and returns the size (only used for internal storage, cannot fail).
|
构造函数 & 析构函数文档编制
◆
DelegateBase()
[1/5]
◆
~DelegateBase()
◆
DelegateBase()
[2/5]
Constructs a delegate using object, stub and utility callback pointer.
-
Template Parameters
-
STUBPTR
|
The stub pointer type.
|
-
参数
-
[in]
|
objectPtr
|
Self pointer of the object. Might be nullptr if the method has been inlined into the stub.
|
[in]
|
stubPtr
|
Stub method pointer (which forward the call to the callable).
|
[in]
|
callback
|
Utility callback which handles copy, move and destruction of the object. Nullptr for a static function.
|
◆
DelegateBase()
[3/5]
Assign when T is not a
Delegate
, but a function pointer, ptmf or a PTMFWrapper<OBJECT*, RESULT (OBJECT::*)(ARGS...)>.
◆
DelegateBase()
[4/5]
◆
DelegateBase()
[5/5]
成员函数文档编制
◆
MAXON_ENUM_ORDERED_LIST_CLASS()
◆
MAXON_OPERATOR_MOVE_ASSIGNMENT()
◆
Reset()
◆
CopyFrom()
[1/3]
-
参数
-
[in]
|
src
|
Source delegate.
|
-
返回
-
OK on success.
◆
CopyFrom()
[2/3]
Assign when T is not a
Delegate
, but a function pointer, ptmf or a PTMFWrapper<OBJECT*, RESULT (OBJECT::*)(ARGS...)>.
◆
CopyFrom()
[3/3]
ResultMem
CopyFrom
|
(
|
OBJ &&
|
object
,
|
|
|
STUBPTR
|
stub
|
|
)
|
|
|
Copies or moves #object into the
Delegate
and sets #stub as the handler for delegate calls. #stub will receive a pointer to the object held by the
Delegate
in its first parameter.
-
参数
-
[in]
|
object
|
The object to move or copy.
|
[in]
|
stub
|
The call handler.
|
-
返回
-
OK on success.
◆
IsEmpty()
◆
IsPopulated()
Bool
IsPopulated
|
(
|
|
)
|
const
|
◆
IsStaticFunctionPointer()
Bool
IsStaticFunctionPointer
|
(
|
|
)
|
const
|
◆
GetStaticFunctionPointer()
FUNCTIONPTR GetStaticFunctionPointer
|
(
|
|
)
|
const
|
◆
GetStubPointer()
STUBPTR GetStubPointer
|
(
|
|
)
|
const
|
◆
GetReferenceUtilityStub()
[1/2]
static
Callback
GetReferenceUtilityStub
|
(
|
void *
|
|
)
|
|
|
static
protected
|
◆
GetReferenceUtilityStub()
[2/2]
◆
PTMFUtilityStub()
A dummy stub for inlined PTMF which does nothing.
◆
UtilityStub()
Destructs, copies or moves an object with operator ()().
◆
ReferenceUtilityStub()
Destructs, copies or moves a reference with operator ()(). This treats _storage[0] as if it was not just a pointer, but a REFERENCE.
Member Data Documentation
◆
_storage
void* _storage[5]
|
protected
|
◆
_objectPtr
void* _objectPtr
|
protected
|
◆
_stubPtr
void(* _stubPtr()
|
protected
|
◆
_callback