class
ecs::TMultiStorageViewCommon
template<u32 IncludedTypeCount, u32 ExcludedTypeCount, bool InPlaceDelete>Provides helper functionality for a view containing multiple (more than one) included or excluded types.
Template parameters
IncludedTypeCount | Number of types in the included type filter. |
|---|---|
ExcludedTypeCount | Number of types in the excluded type filter. |
InPlaceDelete | True if the storages support in-place delete policy. |
Public
Methods
GetLeadingTypeStorage
Returns pointer to the storage that is considered the leading storage.
Leading storage is the storage that's primarily iterated over when looking for elements matching the view filter.
GetSizeEstimate
Returns a rough number of elements in the view, based on the number of elements in the leading storage.
Begin
Iterator to the first entity matching the view filter.
End
Iterator past the last entity matching the view filter.
Front
Reference to the first entity matching the view filter, or null if none matches.
Back
Reference to the last entity matching the view filter, or null if none matches.
Find
Returns an iterator to the entity in the view, or End() iterator if no entity is found.
Contains
Returns true if the provided entity matches the view filter.
IsValid
Returns true if all included and excluded storage pointer are initializes.
View is not usable unless this returns true.
begin
end
Protected
Constructors
TMultiStorageViewCommon<IncludedTypeCount, ExcludedTypeCount, InPlaceDelete>
TMultiStorageViewCommon<IncludedTypeCount, ExcludedTypeCount, InPlaceDelete>
Methods
RefreshLeadingTypeIndex
Scans the included type storage list for smallest storage, and marks it as the leading storage.
RefreshLeadingTypeIndexIfNeeded
Refreshes the leading type index, but only if all included type storage pointers were assigned.
GetIncludedTypeStorage
Returns the included type storage pointer at the provided index.
SetIncludedTypeStorage
Assigns the included type storage pointer at the provided index.
You must assign all storages before using the view.
GetExcludedTypeStorage
Returns the excluded type storage pointer at the provided index.
SetExcludedTypeStorage
Assigns the excluded type storage pointer at the provided index.
If excluded type storage is unassigned, it will be ignored by the view filter.
SetExplicitLeadingTypeIndex
Sets leading type index explicitly to the specific included type index.
By default the smallest storage is used.
GetLeadingTypeStorageSize
Returns the number of elements in the leading storage.
If leading storage uses in-place deletion policy, this number will also contain invalid elements.
staticGetPlaceholderStorage
Returns empty storage that can be used for excluded type filter when no storage is assigned yet.