UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Editor::DataStorage::Queries Namespace Reference

Namespaces

namespace  Private
 

Classes

class  Count
 
struct  FCachedQueryContext
 
struct  FColumnBase
 
class  FConditions
 
class  FDependency
 
class  FEditorStorageQueryConditionCompileContext
 
struct  FMockChainTerminator
 
struct  FObserver
 
struct  FPhaseAmble
 
struct  FProcessor
 
struct  FQueryCallbackType
 
class  FQueryConditionQuery
 
struct  FQueryContextForwarder
 
struct  FQueryContextMock
 
class  FSimpleQuery
 
struct  IContextCapability
 
struct  IContextContract
 
class  IQueryConditionCompileContext
 
struct  IQueryFunctionResponse
 
class  Select
 
class  TBatch
 
struct  TCapabilityStore
 
struct  TColumn
 
struct  TQueryContext
 
class  TQueryContextImpl
 
class  TQueryFunction
 
class  TQueryFunction< void >
 
class  TQueryFunctionBase
 
struct  TResult
 
struct  TResult< void >
 

Concepts

concept  ContextCapability
 
concept  FunctionType
 

Typedefs

template<typename T >
using TConstBatch = TBatch< const T >
 
using QueryContextMock = TQueryContextImpl< FQueryContextMock >
 

Enumerations

enum class  EOptional { No , Yes }
 
enum class  EContextCapabilityFlags { SupportsSingle = 1 << 0 , SupportsBatch = 1 << 1 }
 
enum class  EFlowControl { Continue , Break }
 
enum class  EFunctionCallConfig { None = 0 , VerifyColumns = 1 << 0 }
 

Functions

FConditions operator&& (const FConditions &Lhs, FColumnBase Rhs)
 
FConditions operator&& (const FConditions &Lhs, const FConditions &Rhs)
 
FConditions operator&& (FColumnBase Lhs, FColumnBase Rhs)
 
FConditions operator&& (FColumnBase Lhs, const FConditions &Rhs)
 
FConditions operator|| (const FConditions &Lhs, FColumnBase Rhs)
 
FConditions operator|| (const FConditions &Lhs, const FConditions &Rhs)
 
FConditions operator|| (FColumnBase Lhs, FColumnBase Rhs)
 
FConditions operator|| (FColumnBase Lhs, const FConditions &Rhs)
 
const UScriptStructType (FTopLevelAssetPath Name)
 
const UScriptStructTypeOptional (FTopLevelAssetPath Name)
 
const UScriptStructoperator""_Type (const char *Name, std::size_t NameSize)
 
const UScriptStructoperator""_TypeOptional (const char *Name, std::size_t NameSize)
 
bool MergeQueries (FQueryDescription &Destination, const FQueryDescription &Source, FText *OutErrorMessage)
 
template<typename Function >
DirectQueryCallback CreateDirectQueryCallbackBinding (Function &&Callback)
 
template<typename Function >
SubqueryCallback CreateSubqueryCallbackBinding (Function &&Callback)
 
template<auto Value, TEnumType EnumT = decltype(Value)>
FSimpleQueryAll ()
 
 ENUM_CLASS_FLAGS (EFunctionCallConfig)
 
template<typename Return , FunctionType Function>
TQueryFunction< Return > BuildQueryFunction (Function &&Callback)
 
template<typename Return , FunctionType Function>
TQueryFunction< voidBuildQueryFunction (TResult< Return > &Result, Function &&Callback)
 

Detailed Description

The TypedElementQueryBuilder allows for the construction of queries for use by the Typed Element Data Storage. There are two types of queries, simple and normal. Simple queries are guaranteed to be supported by the data storage backend and guaranteed to have no performance side effects. <Normal queries pending development.>

Queries are constructed with the following section:

  • Select A list of the data objects that are returned as the result of the query.
  • Count Counts the total number or rows that pass the filter.
  • Where A list of conditions that restrict what's accepted by the query.
  • DependsOn A list of systems outside the data storage that will be accessed by the query('s user).
  • Compile Compiles the query into its final form and can be used afterwards.

Calls to the sections become increasingly restrictive, e.g. after calling Where only DependsOn can be called again.

Arguments to the various functions take a pointer to a description of a UStruct. These can be provided in the follow ways:

  • By using the templated version, e.g. Any<FStructExample>()
  • By calling the static StaticStruct() function on the UStruct, e.g. FStructExample::StaticStruct();
  • By name using the Type or TypeOptional string operator, e.g. "/Script/ExamplePackage.FStructExample"_Type or "/Script/OptionalPackage.FStructOptional"_TypeOptional All functions allow for a single type to be added or a list of types, e.g. ReadOnly(Type<FStructExample>() or ReadOnly({ Type<FStructExample1>(), FStructExample2::StaticStruct(), "/Script/ExamplePackage.FStructExample3"_Type });

Some functions allow binding to a callback. In these cases the arguments to the provided callback are analyzed and added to the query automatically. Const arguments are added as ReadOnly, while non-const arguments are added as ReadWrite. Callbacks can be periodically called if constructed as a processor, in which case the callback is triggered repeatedly, usually once per frame and called for all row (ranges) that match the query. If constructed as an observer the provided target type is monitored for actions like addition or deletion into/from any table and will trigger the callback once if the query matches. The following function signatures are accepted by "Select":

  • void([const]Column&...)
  • void([const]Column*...)
  • void(RowHandle, [const]Column&...)
  • void(<Context>&, [const]Column&...)
  • void(<Context>&, RowHandle, [const]Column&...)
  • void(<Context>&, [const]Column*...)
  • void(<Context>&, const RowHandle*, [const]Column*...) Where <Context> is IQueryContext or FCachedQueryContext<...> e.g.: void( FCachedQueryContext<Subsystem1, const Subsystem2>& Context, RowHandle Row, ColumnType0& ColumnA, const ColumnType1& ColumnB) {...}

FCachedQueryContext can be used to store cached pointers to dependencies to reduce the overhead of retrieving these. The same const principle as for other arguments applies so dependencies marked as const can only be accessed as read-only or otherwise can be accessed as readwrite.

The following is a simplified example of these options combined together: FProcessor Info( EQueryTickPhase::FrameEnd, DataStorage->GetQueryTickGroupName(EQueryTickGroups::SyncExternalToDataStorage); Query = Select(FName(TEXT("Example Callback")), Info, [](FCachedQueryContext<Subsystem1, const Subsystem2>&, const FDataExample1&, FDataExample2&) {});

"Select" is constructed with:

  • ReadOnly: Indicates that the data object will only be read from
  • ReadWrite: Indicated that the data object will be read and written to.

"Count" does not have any construction options.

"Where" is constructed with:

  • All: The query will be accepted only if all the types listed here are present in a table.
  • Any: The query will be accepted if at least one of the listed types is present in a table.
  • Not: The query will be accepted if none of the listed types are present in a table. The above construction calls can be mixed and be called multiple times. All functions accept a nullptr for the type in which case the call will have no effect. This can be used to reference types in plugins that may not be loaded when using the TypeOptional string operator.

"DependsOn" is constructed with:

  • ReadOnly: Indicates that the external system will only be used to read data from.
  • ReadWrite: Indicates that the external system will be used to write data to.

Usage example: FQueryDescription Query = Select() .ReadWrite({ FDataExample1::StaticStruct() }) .ReadWrite<FDataExample2, FDataExample3>() .ReadOnly<FDataExample4>() .Where() .All<FTagExample1, FDataExample5>() .Any("/Script/ExamplePackage.FStructExample"_TypeOptional) .None(FTagExample2::StaticStruct()) .DependsOn() .ReadOnly<USystemExample1, USystemExample2>() .ReadWrite(USystemExample2::StaticClass()) .Compile();

Creating a query is expensive on the builder and the back-end side. It's therefore recommended to create a query and store its compiled form for repeated use instead of rebuilding the query on every update.

Typedef Documentation

◆ QueryContextMock

◆ TConstBatch

Enumeration Type Documentation

◆ EContextCapabilityFlags

Enumerator
SupportsSingle 
SupportsBatch 

◆ EFlowControl

Optional argument that allows controlling the flow of the query callback. This can be used to early out if for example a searched for value is found or if the number of processed rows has reached a predetermined limit.

Enumerator
Continue 
Break 

Continue processing with the next row/batch. Stop processing at the earliest possible breakpoint.

◆ EFunctionCallConfig

Enumerator
None 
VerifyColumns 

If not all columns could be retrieved, return the default value for the return type, if applicable, and don't call the function.

◆ EOptional

Enumerator
No 
Yes 

Function Documentation

◆ All()

template<auto Value, TEnumType EnumT = decltype(Value)>
FSimpleQuery & UE::Editor::DataStorage::Queries::All ( )

◆ BuildQueryFunction() [1/2]

template<typename Return , FunctionType Function>
TQueryFunction< Return > UE::Editor::DataStorage::Queries::BuildQueryFunction ( Function &&  Callback)

◆ BuildQueryFunction() [2/2]

template<typename Return , FunctionType Function>
TQueryFunction< void > UE::Editor::DataStorage::Queries::BuildQueryFunction ( TResult< Return > &  Result,
Function &&  Callback 
)

◆ CreateDirectQueryCallbackBinding()

template<typename Function >
DirectQueryCallback UE::Editor::DataStorage::Queries::CreateDirectQueryCallbackBinding ( Function &&  Callback)

◆ CreateSubqueryCallbackBinding()

template<typename Function >
SubqueryCallback UE::Editor::DataStorage::Queries::CreateSubqueryCallbackBinding ( Function &&  Callback)

◆ ENUM_CLASS_FLAGS()

UE::Editor::DataStorage::Queries::ENUM_CLASS_FLAGS ( EFunctionCallConfig  )

◆ MergeQueries()

TYPEDELEMENTFRAMEWORK_API bool UE::Editor::DataStorage::Queries::MergeQueries ( FQueryDescription Destination,
const FQueryDescription Source,
FText OutErrorMessage 
)

◆ operator""_Type()

TYPEDELEMENTFRAMEWORK_API const UScriptStruct * UE::Editor::DataStorage::Queries::operator""_Type ( const char Name,
std::size_t  NameSize 
)

◆ operator""_TypeOptional()

TYPEDELEMENTFRAMEWORK_API const UScriptStruct * UE::Editor::DataStorage::Queries::operator""_TypeOptional ( const char Name,
std::size_t  NameSize 
)

◆ operator&&() [1/4]

TYPEDELEMENTFRAMEWORK_API FConditions UE::Editor::DataStorage::Queries::operator&& ( const FConditions Lhs,
const FConditions Rhs 
)

◆ operator&&() [2/4]

TYPEDELEMENTFRAMEWORK_API FConditions UE::Editor::DataStorage::Queries::operator&& ( const FConditions Lhs,
FColumnBase  Rhs 
)

◆ operator&&() [3/4]

TYPEDELEMENTFRAMEWORK_API FConditions UE::Editor::DataStorage::Queries::operator&& ( FColumnBase  Lhs,
const FConditions Rhs 
)

◆ operator&&() [4/4]

TYPEDELEMENTFRAMEWORK_API FConditions UE::Editor::DataStorage::Queries::operator&& ( FColumnBase  Lhs,
FColumnBase  Rhs 
)

◆ operator||() [1/4]

TYPEDELEMENTFRAMEWORK_API FConditions UE::Editor::DataStorage::Queries::operator|| ( const FConditions Lhs,
const FConditions Rhs 
)

◆ operator||() [2/4]

TYPEDELEMENTFRAMEWORK_API FConditions UE::Editor::DataStorage::Queries::operator|| ( const FConditions Lhs,
FColumnBase  Rhs 
)

◆ operator||() [3/4]

TYPEDELEMENTFRAMEWORK_API FConditions UE::Editor::DataStorage::Queries::operator|| ( FColumnBase  Lhs,
const FConditions Rhs 
)

◆ operator||() [4/4]

TYPEDELEMENTFRAMEWORK_API FConditions UE::Editor::DataStorage::Queries::operator|| ( FColumnBase  Lhs,
FColumnBase  Rhs 
)

◆ Type()

TYPEDELEMENTFRAMEWORK_API const UScriptStruct * UE::Editor::DataStorage::Queries::Type ( FTopLevelAssetPath  Name)

◆ TypeOptional()

TYPEDELEMENTFRAMEWORK_API const UScriptStruct * UE::Editor::DataStorage::Queries::TypeOptional ( FTopLevelAssetPath  Name)