Navigation
API > API/Editor > API/Editor/PropertyEditor
IStructureDataProvider - Used to provide struct data for a property node.
The IsPropertyIndirection() and GetValueBaseAddress() allow a struct provider to expose data to be edited that is not supported by the property system. When IsPropertyIndirection() returns true, GetValueBaseAddress() is called relative to the parent property node to retrieve pointer to the data to be edited.
In the following example, a struct provider is added via ParentProperty property handle. In this case "ParentProperty" is the parent property node, and the value passed into GetValueBaseAddress() of the provider is the value of the parent property. TSharedPtr
The GetValueBaseAddress() may get called on foreign objects too (e.g. object templates), and if property indirection is used it should not rely on other values cached in the provider. class FMyStructProvider : public IStructureDataProvider { public: ...
virtual bool IsPropertyIndirection() const override { return true; }
virtual uint8* GetValueBaseAddress(uint8* ParentValueAddress, const UStruct* ExpectedType) const override
{
if (ParentValueAddress)
{
// "ParentValueAddress" is pointer to a value of the type defined in "ParentProperty".
FMyStruct& Value = *reinterpret_cast
If IsPropertyIndirection() is false, there structures are expected to be standalone, and GetInstances() is used instead to retried the instance values. When indirection is not used and the struct provider is part of an another instance, the provider should return only one instance, since there is no to associate the provided value with an foreign object.
ExpectedType parameter: This is the type that e.g. the UI is currently initialized for (cached via GetBaseStructure()). It is possible that the provided data changes due to some property change callbacks, and the ExpectedType does not match the provided data type. In that case empty data should be returned so that the UI does not try to access incompatible data.
Multiple instances are supported when the provider is the root node (e.g. on Structure details view).
| Name | IStructureDataProvider |
| Type | class |
| Header File | /Engine/Source/Editor/PropertyEditor/Public/IStructureDataProvider.h |
| Include Path | #include "IStructureDataProvider.h" |
Syntax
class IStructureDataProvider
Derived Classes
- FInstancePropertyBagStructureDataProvider
- FStructOnScopeStructureDataProvider
- TInstancedPropertyBagStructureDataProvider
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~IStructureDataProvider() |
IStructureDataProvider.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const UStruct * GetBaseStructure() |
IStructureDataProvider.h | ||
virtual void GetInstances
(
TArray< TSharedPtr< FStructOnScope > >& OutInstances |
IStructureDataProvider.h | ||
void GetInstances
(
TArray< TSharedPtr< FStructOnScope > >& OutInstances, |
Returns instances to edit. Each provided struct should be compatible with ExpectedType. | IStructureDataProvider.h | |
virtual uint8 * GetValueBaseAddress
(
uint8* ParentValueAddress, |
Returns base address of provided struct based on parent property nodes value. | IStructureDataProvider.h | |
virtual bool IsPropertyIndirection() |
IStructureDataProvider.h | ||
bool IsValid() |
IStructureDataProvider.h |