![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <Attribute.h>
Public Member Functions | |
| DECLARE_DELEGATE_RetVal (ObjectType, FGetter) | |
| TAttribute () | |
| template<typename OtherType > | |
| TAttribute (const OtherType &InInitialValue) | |
| TAttribute (ObjectType &&InInitialValue) | |
| template<class SourceType > | |
| TAttribute (TSharedRef< SourceType > InUserObject, typename FGetter::template TConstMethodPtr< SourceType > InMethodPtr) | |
| template<class SourceType > | |
| TAttribute (SourceType *InUserObject, typename FGetter::template TConstMethodPtr< SourceType > InMethodPtr) | |
| template<typename OtherType > | |
| void | Set (const OtherType &InNewValue) |
| void | Set (ObjectType &&InNewValue) |
| bool | IsSet () const |
| const ObjectType & | Get () const |
| const ObjectType & | Get (const ObjectType &DefaultValue) const |
| void | Bind (const FGetter &InGetter) |
| void | Bind (FGetter &&InGetter) |
| template<typename... VarTypes> | |
| void | BindStatic (TIdentity_T< typename FGetter::template TFuncPtr< std::decay_t< VarTypes >... > > InFuncPtr, VarTypes &&... Vars) |
| template<class SourceType , typename... VarTypes> | |
| void | BindRaw (SourceType *InUserObject, typename FGetter::template TConstMethodPtr< SourceType, std::decay_t< VarTypes >... > InMethodPtr, VarTypes &&... Vars) |
| template<class SourceType , typename... VarTypes> | |
| void | Bind (TSharedRef< SourceType > InUserObject, typename FGetter::template TConstMethodPtr< SourceType, std::decay_t< VarTypes >... > InMethodPtr, VarTypes &&... Vars) |
| template<class SourceType , typename... VarTypes> | |
| void | Bind (SourceType *InUserObject, typename FGetter::template TConstMethodPtr< SourceType, std::decay_t< VarTypes >... > InMethodPtr, VarTypes &&... Vars) |
| template<class SourceType , typename... VarTypes> | |
| void | BindUObject (SourceType *InUserObject, typename FGetter::template TConstMethodPtr< SourceType, std::decay_t< VarTypes >... > InMethodPtr, VarTypes &&... Vars) |
| template<class SourceType > | |
| void | BindUFunction (SourceType *InUserObject, const FName &InFunctionName) |
| template<typename LambdaType , typename... PayloadTypes> | |
| void | BindLambda (LambdaType &&InCallable, PayloadTypes &&... InputPayload) |
| template<typename UserClass , ESPMode Mode, typename LambdaType , typename... PayloadTypes> | |
| void | BindSPLambda (const TSharedRef< UserClass, Mode > &InUserObjectRef, LambdaType &&InCallable, PayloadTypes &&... InputPayload) |
| template<typename UserClass , typename LambdaType , typename... PayloadTypes> | |
| void | BindSPLambda (const UserClass *InUserObject, LambdaType &&InCallable, PayloadTypes &&... InputPayload) |
| template<typename UserClass , typename LambdaType , typename... PayloadTypes> | |
| void | BindWeakLambda (UserClass *InUserObject, LambdaType &&InCallable, PayloadTypes &&... InputPayload) |
| bool | IsBound () const |
| const FGetter & | GetBinding () const |
| TVariant< ObjectType, FGetter > | Steal () |
| bool | IdenticalTo (const TAttribute &InOther) const |
Friends | |
| template<class OtherType > | |
| class | TAttribute |
Attribute object
|
inline |
Default constructor.
|
inline |
Construct implicitly from an initial value
| InInitialValue | The value for this attribute |
|
inline |
Construct implicitly from moving an initial value
| InInitialValue |
|
inline |
Constructs by binding an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InUserObject | Shared Pointer to the instance of the class that contains the member function you want to bind. The attribute will only retain a weak pointer to this class. |
| InMethodPtr | Member function to bind. The function's structure (return value, arguments, etc) must match IBoundAttributeDelegate's definition. |
|
inline |
Constructs by binding an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InUserObject | Shared Pointer to the instance of the class that contains the member function you want to bind. The attribute will only retain a weak pointer to this class. |
| InMethodPtr | Member function to bind. The function's structure (return value, arguments, etc) must match IBoundAttributeDelegate's definition. |
|
inline |
Binds an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InGetter | The delegate object with your function binding |
|
inline |
Binds an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InGetter | The delegate object with your function binding |
|
inline |
Binds an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InUserObject | Shared Pointer to the instance of the class that contains the member function you want to bind. The attribute will only retain a weak pointer to this class. |
| InMethodPtr | Member function to bind. The function's structure (return value, arguments, etc) must match IBoundAttributeDelegate's definition. |
|
inline |
Binds an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InUserObject | Shared Pointer to the instance of the class that contains the member function you want to bind. The attribute will only retain a weak pointer to this class. |
| InMethodPtr | Member function to bind. The function's structure (return value, arguments, etc) must match IBoundAttributeDelegate's definition. |
|
inline |
Static: Binds a C++ lambda delegate technically this works for any functor types, but lambdas are the primary use case
|
inline |
Binds an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InUserObject | Instance of the class that contains the member function you want to bind. |
| InMethodPtr | Member function to bind. The function's structure (return value, arguments, etc) must match IBoundAttributeDelegate's definition. |
|
inline |
Static: Binds a weak shared pointer C++ lambda delegate technically this works for any functor types, but lambdas are the primary use case
|
inline |
|
inline |
Binds an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InFuncPtr | Function to bind. The function's structure (return value, arguments, etc) must match IBoundAttributeDelegate's definition. |
|
inline |
Binds an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InUserObject | Instance of the class that contains the member function you want to bind. |
| InFunctionName | Member function name to bind. |
|
inline |
Binds an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InUserObject | Instance of the class that contains the member function you want to bind. |
| InMethodPtr | Member function to bind. The function's structure (return value, arguments, etc) must match IBoundAttributeDelegate's definition. |
|
inline |
Static: Binds a weak object C++ lambda delegate technically this works for any functor types, but lambdas are the primary use case
|
inlinestatic |
Static: Creates an attribute that's pre-bound to the specified 'getter' delegate
| InGetter | Delegate to bind |
|
inlinestatic |
Static: Creates an attribute that's pre-bound to the specified 'getter' delegate
| InGetter | Delegate to bind |
|
inlinestatic |
Creates an attribute by binding an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InUserObject | Instance of the class that contains the member function you want to bind. |
| InFunctionName | Member function name to bind. |
|
inlinestatic |
|
inlinestatic |
Helper function for creating TAttributes from a lambda TAttribute<float> FloatAttribute = TAttribute<float>::CreateLambda([]{ return 10.f; });
|
inlinestatic |
Helper function for creating TAttributes from a const member function pointer, accessed through a raw pointer
|
inlinestatic |
Helper function for creating TAttributes from a const member function pointer, accessed through a weak pointer to the shared object
|
inlinestatic |
Helper function for creating TAttributes from a weak shared pointer C++ lambda delegate
|
inlinestatic |
|
inlinestatic |
Creates an attribute by binding an arbitrary function that will be called to generate this attribute's value on demand. After binding, the attribute will no longer have a value that can be accessed directly, and instead the bound function will always be called to generate the value.
| InFuncPtr | Member function to bind. The function's structure (return value, arguments, etc) must match IBoundAttributeDelegate's definition. |
|
inlinestatic |
Helper function for creating TAttributes from a weak object pointer C++ lambda delegate
| TAttribute< ObjectType >::DECLARE_DELEGATE_RetVal | ( | ObjectType | , |
| FGetter | |||
| ) |
Attribute 'getter' delegate
ObjectType GetValue() const
|
inline |
Gets the attribute's current value. Assumes that the attribute is set.
|
inline |
Gets the attribute's current value. The attribute may not be set, in which case use the default value provided. Shorthand for the boilerplate code: MyAttribute.IsSet() ? MyAttribute.Get() : DefaultValue
|
inline |
Gets the attribute's 'getter' which can be bound or unbound
|
inline |
Is this attribute identical to another TAttribute.
| InOther | The other attribute to compare with. |
|
inline |
Checks to see if this attribute has a 'getter' function bound
|
inline |
Was this TAttribute ever assigned?
|
inline |
Sets the attribute's value
| InNewValue | The value to set the attribute to |
|
inline |
Sets the attribute's value
| InNewValue | The value to set the attribute to |
|
inline |
Move the attribute's 'getter' or the attribute's Value and reset the attribute. The attribute needs to be set.
Value