class ecs::TGroup

Non-owning group specialization.

Acts similarly to a TView but ensures that entities are tightly packed for fast iteration, and allows sorting of entities.

Template parameters

IncludedStorageTypes

List of storage types that the entity must be a part of to be included in the group.

ExcludedStorageTypes

List of storage types that the entity must not be a part of to be included in the group.

Public

Constructors

TGroup<b3d::ecs::TOwnedTypes<>, TIncludedTypes<type-parameter-0-0...>, TExcludedTypes<type-parameter-0-1...> >

TGroup<ecs::TOwnedTypes<>, TIncludedTypes<type-parameter-0-0...>, TExcludedTypes<type-parameter-0-1...>>() = default

TGroup<b3d::ecs::TOwnedTypes<>, TIncludedTypes<type-parameter-0-0...>, TExcludedTypes<type-parameter-0-1...> >

TGroup<ecs::TOwnedTypes<>, TIncludedTypes<type-parameter-0-0...>, TExcludedTypes<type-parameter-0-1...>>(GroupInternalsType &internals)

TGroup<TOwnedTypes<type-parameter-0-0...>, TIncludedTypes<type-parameter-0-1...>, TExcludedTypes<type-parameter-0-2...> >

TGroup<TOwnedTypes<type-parameter-0-0...>, TIncludedTypes<type-parameter-0-1...>, TExcludedTypes<type-parameter-0-2...>>() = default

TGroup<TOwnedTypes<type-parameter-0-0...>, TIncludedTypes<type-parameter-0-1...>, TExcludedTypes<type-parameter-0-2...> >

TGroup<TOwnedTypes<type-parameter-0-0...>, TIncludedTypes<type-parameter-0-1...>, TExcludedTypes<type-parameter-0-2...>>(GroupInternalsType &internals)

Methods

GetLeadingStorage

const SparseSet &GetLeadingStorage() const

Returns a reference 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 group filter.

GetSize

u64 GetSize() const

Returns the number of entities that the group will iterate over.

GetCapacity

u64 GetCapacity() const

Returns the reserved capacity of the group's leading storage.

IsEmpty

bool IsEmpty() const

Returns true if no entities pass the group filter.

Shrink

void Shrink()

Reduces the leading storage capacity to match the current number of entities.

Begin

Iterator Begin() const

Iterator to the first entity matching the group filter.

End

Iterator End() const

Iterator past the last entity matching the group filter.

Rbegin

ReverseIterator Rbegin() const

Iterator to the last entity matching the group filter.

Rend

ReverseIterator Rend() const

Iterator before the first entity matching the group filter.

Front

Entity Front() const

Reference to the first entity matching the group filter, or null if none matches.

Back

Entity Back() const

Reference to the last entity matching the group filter, or null if none matches.

Find

Iterator Find(Entity entity)

Returns an iterator to the entity in the group, or End() iterator if no entity is found.

Contains

bool Contains(Entity entity)

Returns true if the provided entity matches the group filter.

Each

IteratorRange Each() const

Allows easy iteration over all components in the group using a range for loop.

This is the fastest way to iterate all entries in a group.

staticTypeId

static u64 TypeId()

Returns type ID that uniquely identifies the type of this group.

begin

iterator begin() const

end

iterator end() const

rbegin

reverse_iterator rbegin() const

rend

reverse_iterator rend() const

GetLeadingStorage

const SparseSet &GetLeadingStorage() const

Returns a reference to the storage that is considered the leading storage.

Leading storage is the owned storage that's primarily iterated over when looking for elements matching the group filter.

GetSize

u64 GetSize() const

Returns the number of entities in the group.

IsEmpty

bool IsEmpty() const

Returns true if there are no entities in the group or the group was not initialized.

Begin

Iterator Begin() const

Iterator to the first entity matching the group filter.

End

Iterator End() const

Iterator past the last entity matching the group filter.

Rbegin

ReverseIterator Rbegin() const

Iterator to the last entity matching the group filter.

Rend

ReverseIterator Rend() const

Iterator before the first entity matching the group filter.

Front

Entity Front() const

Reference to the first entity matching the group filter, or null if none matches.

Back

Entity Back() const

Reference to the last entity matching the group filter, or null if none matches.

Find

Iterator Find(Entity entity)

Returns an iterator to the entity in the group, or End() iterator if no entity is found.

Contains

bool Contains(Entity entity)

Returns true if the provided entity matches the group filter.

Each

IteratorRange Each() const

Allows easy iteration over all components in the group using a range for loop.

This is the fastest way to iterate all entries in a group.

staticTypeId

static u64 TypeId()

Returns type ID that uniquely identifies the type of this group.

begin

iterator begin() const

end

iterator end() const

rbegin

iterator rbegin() const

rend

iterator rend() const

Operators

operator[]

Entity operator[](u64 index) const

operator[]

Entity operator[](u64 index) const

Private

Fields

mInternals

GroupInternalsType * mInternals

mInternals

GroupInternalsType * mInternals