Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Delegates > API/Runtime/Core/Delegates/FDefaultDelegateUserPolicy
Type
typedef IDelegateInstance FDelegateInstanceExtras
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Delegates/DelegateBase.h |
| Include | #include "Delegates/DelegateBase.h" |
Remarks
To extend delegates, you should implement a policy struct like this and pass it as the second template argument to TDelegate and TMulticastDelegate. This policy struct containing three classes called:
FDelegateInstanceExtras:
- Must publicly inherit IDelegateInstance.
- Should contain any extra data and functions injected into a binding (the object which holds and is able to invoke the binding passed to FMyDelegate::CreateSP, FMyDelegate::CreateLambda etc.).
- This binding is not available through the public API of the delegate, but is accessible to FDelegateExtras.
FDelegateExtras:
- Must publicly inherit TDelegateBase
. - Should contain any extra data and functions injected into a delegate (the object which holds an FDelegateInstance-derived object, above).
- Public data members and member functions are accessible directly through the TDelegate object.
- Typically member functions in this class will forward calls to the inner FDelegateInstanceExtras, by downcasting the result of a call to GetDelegateInstanceProtected().
FMulticastDelegateExtras:
- Must publicly inherit TMulticastDelegateBase
. - Should contain any extra data and functions injected into a multicast delegate (the object which holds an array of FDelegateExtras-derived objects which is the invocation list).
- Public data members and member functions are accessible directly through the TMulticastDelegate object.