|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Specialization of Entities for a single required component with no exclusions. More...
#include <GREM/execution/EntityRegistry.hpp>
Public Types | |
| using | MutableComponents = meta::type_list_concat_t<typename detail::entities_extract_components<ComponentsAndExclusions>::MutableComponents...> |
| List of non-const components required by the range, provided as a meta::TypeList. | |
| using | ImmutableComponents = meta::type_list_concat_t<typename detail::entities_extract_components<ComponentsAndExclusions>::ImmutableComponents...> |
| List of const components required by the range, provided as a meta::TypeList. | |
| using | IncludedComponents = meta::type_list_concat_t<typename detail::entities_extract_components<ComponentsAndExclusions>::IncludedComponents...> |
| List of components required by the range, provided as a meta::TypeList. | |
| using | ExcludedComponents = meta::type_list_concat_t<typename detail::entities_extract_components<ComponentsAndExclusions>::ExcludedComponents...> |
| List of components excluded by the range, provided as a meta::TypeList. | |
| using | iterator = detail::SingleComponentIterator<Component> |
| using | sentinel = detail::SingleComponentSentinel |
| using | value_type = typename iterator::value_type |
| using | reference = typename iterator::reference |
| using | size_type = size_t |
| using | difference_type = ptrdiff_t |
Public Member Functions | |
| GREM_ALWAYS_INLINE constexpr | Entities () noexcept=default |
| Construct an empty entity range. | |
| GREM_ALWAYS_INLINE constexpr | Entities (const iterator &first, const iterator &last) noexcept |
| Construct an entity subrange from an iterator pair. | |
| GREM_ALWAYS_INLINE constexpr | Entities (const iterator &first, const iterator &last) noexcept |
| Construct an entity subrange from an iterator pair. | |
| GREM_ALWAYS_INLINE constexpr iterator | begin () const noexcept |
| GREM_ALWAYS_INLINE constexpr sentinel | end () const noexcept |
| GREM_ALWAYS_INLINE constexpr Component * | data () const noexcept |
| GREM_ALWAYS_INLINE constexpr size_type | size () const noexcept |
| GREM_ALWAYS_INLINE constexpr bool | empty () const noexcept |
| GREM_ALWAYS_INLINE constexpr size_t | getCandidateCount () const noexcept |
| Get an upper bound estimate on the number of entities in the range, which is equal to the exact number of entities in this single-component case. | |
| GREM_ALWAYS_INLINE constexpr bool | containsEntity (EntityID id) const |
| Check if the range contains a specific entity. | |
| GREM_ALWAYS_INLINE constexpr reference | operator[] (EntityID id) const |
| template<component T> | |
| GREM_ALWAYS_INLINE bool | hasComponent (EntityID id) const noexcept |
| Check if the range contains a specific entity with a specific component. | |
| template<component T> | |
| GREM_ALWAYS_INLINE auto & | getComponent (EntityID id) const |
| Get a specific component of a specific entity in the range. | |
| template<component T, typename U> | |
| GREM_ALWAYS_INLINE auto | getComponentOr (EntityID id, U &&defaultValue) const |
| Get a specific component of a specific entity in the range, with a default value in case the entity doesn't exist or doesn't have the specified component. | |
| template<component T> | |
| GREM_ALWAYS_INLINE auto * | findComponent (EntityID id) const noexcept |
| Try to get a specific component of a specific entity in the range. | |
| GREM_ALWAYS_INLINE EntityID | getEntityIDAtEntityIndexUnsafe (EntityID::Index slotIndex) const |
| Get the entity handle of the entity in a specific slot of the underlying EntityRegistry. | |
| template<component T> | |
| GREM_ALWAYS_INLINE auto & | getComponentAtEntityIndexUnsafe (EntityID::Index slotIndex) const |
| Get a specific component of the entity in a specific slot of the underlying EntityRegistry. | |
Friends | |
| template<typename... KnownComponents> | |
| class | EntityRegistry |
| Entity registry used by a Simulation. | |
Specialization of Entities for a single required component with no exclusions.
| ComponentsAndExclusions | component and component exclusion types (e.g. Exclude<Component>) that specify which entities are part of the range. |
| using grem::execution::Entities< ComponentsAndExclusions... >::MutableComponents = meta::type_list_concat_t<typename detail::entities_extract_components<ComponentsAndExclusions>::MutableComponents...> |
List of non-const components required by the range, provided as a meta::TypeList.
| using grem::execution::Entities< ComponentsAndExclusions... >::ImmutableComponents = meta::type_list_concat_t<typename detail::entities_extract_components<ComponentsAndExclusions>::ImmutableComponents...> |
List of const components required by the range, provided as a meta::TypeList.
| using grem::execution::Entities< ComponentsAndExclusions... >::IncludedComponents = meta::type_list_concat_t<typename detail::entities_extract_components<ComponentsAndExclusions>::IncludedComponents...> |
List of components required by the range, provided as a meta::TypeList.
| using grem::execution::Entities< ComponentsAndExclusions... >::ExcludedComponents = meta::type_list_concat_t<typename detail::entities_extract_components<ComponentsAndExclusions>::ExcludedComponents...> |
List of components excluded by the range, provided as a meta::TypeList.
| using grem::execution::Entities< ComponentsAndExclusions... >::iterator = detail::SingleComponentIterator<Component> |
| using grem::execution::Entities< ComponentsAndExclusions... >::sentinel = detail::SingleComponentSentinel |
| using grem::execution::Entities< ComponentsAndExclusions... >::value_type = typename iterator::value_type |
| using grem::execution::Entities< ComponentsAndExclusions... >::reference = typename iterator::reference |
| using grem::execution::Entities< ComponentsAndExclusions... >::size_type = size_t |
| using grem::execution::Entities< ComponentsAndExclusions... >::difference_type = ptrdiff_t |
|
constexprdefaultnoexcept |
Construct an empty entity range.
|
inlineconstexprnoexcept |
Construct an entity subrange from an iterator pair.
| first | begin iterator of the subrange. |
| last | past-the-end iterator of the subrange. |
|
inlineconstexprnoexcept |
Construct an entity subrange from an iterator pair.
| first | begin iterator of the subrange. |
| last | past-the-end iterator of the subrange. |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
Get an upper bound estimate on the number of entities in the range, which is equal to the exact number of entities in this single-component case.
|
inlinenodiscardconstexpr |
Check if the range contains a specific entity.
| id | entity handle to check. |
|
inlinenodiscardconstexpr |
|
inlinenodiscardnoexcept |
Check if the range contains a specific entity with a specific component.
| T | component type to check for. Must be one of the component types required by this entity range. |
| id | entity handle to check. |
|
inlinenodiscard |
Get a specific component of a specific entity in the range.
| T | component type to get. Must be one of the component types required by this entity range. |
| id | entity handle of the entity to get the component from. |
| std::out_of_range | if the given handle does not correspond to a valid entity in this range that has the specified component. |
|
inlinenodiscard |
Get a specific component of a specific entity in the range, with a default value in case the entity doesn't exist or doesn't have the specified component.
| T | component type to get. Must be one of the component types required by this entity range. |
| id | entity handle of the entity to get the component from. |
| defaultValue | default value to return in case the given handle does not correspond to a valid entity with the specified component. |
|
inlinenodiscardnoexcept |
Try to get a specific component of a specific entity in the range.
| T | component type to get. Must be one of the component types required by this entity range. |
| id | entity handle of the entity to get the component from. |
|
inlinenodiscard |
Get the entity handle of the entity in a specific slot of the underlying EntityRegistry.
| slotIndex | index of the entity slot in the underlying EntityRegistry to get the entity handle of. Must be a valid slot index corresponding to an entity that is currently valid, e.g. the result of a previous call to id.getIndex() on a valid entity handle id that has not since been invalidated. |
|
inlinenodiscard |
Get a specific component of the entity in a specific slot of the underlying EntityRegistry.
| T | component type to get. Must be one of the component types required by this entity range. |
| slotIndex | index of the entity slot in the underlying EntityRegistry to get the entity handle of. Must be a valid slot index corresponding to an entity that is currently valid and has the specified component, e.g. the result of a previous call to id.getIndex() on a valid entity handle id that is known to have the specified component, and has not since been invalidated. |
|
friend |
Entity registry used by a Simulation.
| N | number of dimensions of the world space (must be 2 or 3). |