Files
UnrealEngineUWP/Engine/Source/Runtime/FieldNotification/Public/IFieldNotificationClassDescriptor.h
marc audy 6381600309 Move UMG/FieldNotification files to the FieldNotification module.
#jira UE-130880
#rb yohann.dossantos
#preflight 64259ab69834526476306f92, 642aee5a6a37fb35e9ba9926

[CL 24905939 by marc audy in ue5-main branch]
2023-04-03 22:29:35 -04:00

44 lines
833 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "FieldNotificationId.h"
namespace UE::FieldNotification
{
struct IClassDescriptor
{
enum
{
Max_IndexOf_ = 0,
};
/** Find the FieldId by name. Returns an invalid FFIeldId if not found. */
FFieldId GetField(const UClass* Class, FName InFieldName) const
{
FFieldId FoundId;
ForEachField(Class, [&FoundId, InFieldName](const FFieldId Other)
{
if (Other.GetName() == InFieldName)
{
FoundId = Other;
return false;
}
return true;
});
return FoundId;
}
/** Execute the callback for every FieldId in the ClassDescriptor. */
virtual void ForEachField(const UClass* Class, TFunctionRef<bool(FFieldId FielId)> Callback) const
{
}
/** */
virtual ~IClassDescriptor() = default;
};
} // namespace