Navigation
API > API/Runtime > API/Runtime/Core
Attribute object
| Name | TAttribute |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/Attribute.h |
| Include Path | #include "Misc/Attribute.h" |
Syntax
template<typename ObjectType>
class TAttribute
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TAttribute () |
Default constructor. | Misc/Attribute.h | |
TAttribute
(
const OtherType& InInitialValue |
Construct implicitly from an initial value | Misc/Attribute.h | |
TAttribute
(
ObjectType&& InInitialValue |
Construct implicitly from moving an initial value | Misc/Attribute.h | |
TAttribute
(
TSharedRef< SourceType > InUserObject, |
Constructs by binding an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
TAttribute
(
SourceType* InUserObject, |
Constructs by binding an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
TAttribute
(
const FGetter& InGetter, |
Special explicit constructor for TAttribute::Create() | Misc/Attribute.h | |
TAttribute
(
FGetter&& InGetter, |
Special explicit constructor for TAttribute::Create() | Misc/Attribute.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FGetter | TBaseDelegate_NoParams< ObjectType > | Attribute 'getter' delegate |
ObjectType GetValue() const | Misc/Attribute.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsSet | bool | True when this attribute was explicitly set by a consumer, false when the attribute's value is set to the default | Misc/Attribute.h | |
| Getter | FGetter | Bound member function for this attribute (may be NULL if no function is bound.) When set, all attempts to read the attribute's value will instead call this delegate to generate the value. | Misc/Attribute.h | |
| Value | ObjectType | Current value. | Misc/Attribute.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Bind
(
SourceType* InUserObject, |
Binds an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
void Bind
(
TSharedRef< SourceType > InUserObject, |
Binds an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
void Bind
(
FGetter&& InGetter |
Binds an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
void Bind
(
const FGetter& InGetter |
Binds an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
void BindLambda
(
LambdaType&& InCallable, |
Static: Binds a C++ lambda delegate technically this works for any functor types, but lambdas are the primary use case | Misc/Attribute.h | |
void BindRaw
(
SourceType* InUserObject, |
Binds an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
void BindSPLambda
(
const UserClass* InUserObject, |
Misc/Attribute.h | ||
void BindSPLambda
(
const TSharedRef< UserClass, Mode >& InUserObjectRef, |
Static: Binds a weak shared pointer C++ lambda delegate technically this works for any functor types, but lambdas are the primary use case | Misc/Attribute.h | |
void BindStatic
(
TIdentity_T< typename FGetter::template TFuncPtr< std::decay_t< VarTypes >... > > InFuncPtr, |
Binds an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
void BindUFunction
(
SourceType* InUserObject, |
Binds an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
void BindUObject
(
SourceType* InUserObject, |
Binds an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
void BindWeakLambda
(
UserClass* InUserObject, |
Static: Binds a weak object C++ lambda delegate technically this works for any functor types, but lambdas are the primary use case | Misc/Attribute.h | |
const ObjectType & Get
(
const ObjectType& DefaultValue |
Gets the attribute's current value. | Misc/Attribute.h | |
const ObjectType & Get () |
Gets the attribute's current value. Assumes that the attribute is set. | Misc/Attribute.h | |
const FGetter & GetBinding() |
Gets the attribute's 'getter' which can be bound or unbound | Misc/Attribute.h | |
bool IdenticalTo
(
const TAttribute& InOther |
Is this attribute identical to another TAttribute. | Misc/Attribute.h | |
bool IsBound() |
Checks to see if this attribute has a 'getter' function bound | Misc/Attribute.h | |
bool IsSet() |
Was this TAttribute ever assigned? | Misc/Attribute.h | |
void Set
(
const OtherType& InNewValue |
Sets the attribute's value | Misc/Attribute.h | |
void Set
(
ObjectType&& InNewValue |
Sets the attribute's value | Misc/Attribute.h | |
| Move the attribute's 'getter' or the attribute's `Value_ and reset the attribute. | Misc/Attribute.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TAttribute< ObjectType > Create
(
SourceType* InUserObject, |
Creates an attribute by binding an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
static TAttribute Create
(
const FGetter& InGetter |
Static: Creates an attribute that's pre-bound to the specified 'getter' delegate | Misc/Attribute.h | |
static TAttribute Create
(
FGetter&& InGetter |
Static: Creates an attribute that's pre-bound to the specified 'getter' delegate | Misc/Attribute.h | |
static TAttribute< ObjectType > Create
(
TFunction< ObjectType(void)>&& InLambda |
Misc/Attribute.h | ||
static TAttribute CreateLambda
(
LambdaType&& InCallable, |
Helper function for creating TAttributes from a lambda TAttribute |
Misc/Attribute.h | |
static TAttribute CreateRaw
(
const SourceType* InObject, |
Helper function for creating TAttributes from a const member function pointer, accessed through a raw pointer | Misc/Attribute.h | |
static TAttribute CreateSP
(
const SourceType* InObject, |
Helper function for creating TAttributes from a const member function pointer, accessed through a weak pointer to the shared object | Misc/Attribute.h | |
static TAttribute CreateSPLambda
(
UserClass* InUserObject, |
Misc/Attribute.h | ||
static TAttribute CreateSPLambda
(
const TSharedRef< UserClass, Mode >& InUserObjectRef, |
Helper function for creating TAttributes from a weak shared pointer C++ lambda delegate | Misc/Attribute.h | |
static TAttribute CreateStatic
(
FuncPtrType&& InFuncPtr, |
Creates an attribute by binding an arbitrary function that will be called to generate this attribute's value on demand. | Misc/Attribute.h | |
static TAttribute CreateWeakLambda
(
UserClass* InUserObject, |
Helper function for creating TAttributes from a weak object pointer C++ lambda delegate | Misc/Attribute.h |