|
| basic_group () noexcept |
| Default constructor to use to create empty, invalid groups.
|
|
| basic_group (handler &ref) noexcept |
| Constructs a group from a set of storage classes.
|
|
const common_type & | handle () const noexcept |
| Returns the leading storage of a group.
|
|
template<typename Type > |
auto * | storage () const noexcept |
| Returns the storage for a given component type, if any.
|
|
template<std::size_t Index> |
auto * | storage () const noexcept |
| Returns the storage for a given index, if any.
|
|
size_type | size () const noexcept |
| Returns the number of entities that are part of the group.
|
|
size_type | capacity () const noexcept |
| Returns the number of elements that a group has currently allocated space for.
|
|
void | shrink_to_fit () |
| Requests the removal of unused capacity.
|
|
bool | empty () const noexcept |
| Checks whether a group is empty.
|
|
iterator | begin () const noexcept |
| Returns an iterator to the first entity of the group.
|
|
iterator | end () const noexcept |
| Returns an iterator that is past the last entity of the group.
|
|
reverse_iterator | rbegin () const noexcept |
| Returns an iterator to the first entity of the reversed group.
|
|
reverse_iterator | rend () const noexcept |
| Returns an iterator that is past the last entity of the reversed group.
|
|
entity_type | front () const noexcept |
| Returns the first entity of the group, if any.
|
|
entity_type | back () const noexcept |
| Returns the last entity of the group, if any.
|
|
iterator | find (const entity_type entt) const noexcept |
| Finds an entity.
|
|
entity_type | operator[] (const size_type pos) const |
| Returns the identifier that occupies the given position.
|
|
| operator bool () const noexcept |
| Checks if a group is properly initialized.
|
|
bool | contains (const entity_type entt) const noexcept |
| Checks if a group contains an entity.
|
|
template<typename Type , typename... Other> |
decltype(auto) | get (const entity_type entt) const |
| Returns the components assigned to the given entity.
|
|
template<std::size_t... Index> |
decltype(auto) | get (const entity_type entt) const |
| Returns the components assigned to the given entity.
|
|
template<typename Func > |
void | each (Func func) const |
| Iterates entities and components and applies the given function object to them.
|
|
iterable | each () const noexcept |
| Returns an iterable object to use to visit a group.
|
|
template<typename Type , typename... Other, typename Compare , typename Sort = std_sort, typename... Args> |
void | sort (Compare compare, Sort algo=Sort{}, Args &&...args) |
| Sort a group according to the given comparison function.
|
|
template<std::size_t... Index, typename Compare , typename Sort = std_sort, typename... Args> |
void | sort (Compare compare, Sort algo=Sort{}, Args &&...args) |
| Sort a group according to the given comparison function.
|
|
template<typename It > |
void | sort_as (It first, It last) const |
| Sort entities according to their order in a range.
|
|
void | sort_as (const common_type &other) const |
| Sort entities according to their order in a range.
|
|
template<typename... Get, typename... Exclude>
class entt::basic_group< owned_t<>, get_t< Get... >, exclude_t< Exclude... > >
Non-owning group.
A non-owning group returns all entities and only the entities that are at least in the given storage. Moreover, it's guaranteed that the entity list is tightly packed in memory for fast iterations.
Important
Iterators aren't invalidated if:
- New elements are added to the storage.
- The entity currently pointed is modified (for example, components are added or removed from it).
- The entity currently pointed is destroyed.
In all other cases, modifying the pools iterated by the group in any way invalidates all the iterators.
- Template Parameters
-
Get | Types of storage observed by the group. |
Exclude | Types of storage used to filter the group. |
Definition at line 285 of file group.hpp.
template<typename... Get, typename... Exclude>
template<typename Type , typename... Other, typename Compare , typename Sort = std_sort, typename... Args>
Sort a group according to the given comparison function.
The comparison function object must return true
if the first element is less than the second one, false
otherwise. The signature of the comparison function should be equivalent to one of the following:
bool(std::tuple<Type &...>, std::tuple<Type &...>);
bool(const Type &..., const Type &...);
bool(const Entity, const Entity);
Where Type
are such that they are iterated by the group.
Moreover, the comparison function object shall induce a strict weak ordering on the values.
The sort function object must offer a member function template operator()
that accepts three arguments:
- An iterator to the first element of the range to sort.
- An iterator past the last element of the range to sort.
- A comparison function to use to compare the elements.
- Template Parameters
-
Type | Optional type of component to compare. |
Other | Other optional types of components to compare. |
Compare | Type of comparison function object. |
Sort | Type of sort function object. |
Args | Types of arguments to forward to the sort function object. |
- Parameters
-
compare | A valid comparison function object. |
algo | A valid sort function object. |
args | Arguments to forward to the sort function object, if any. |
Definition at line 608 of file group.hpp.