HandleManyToManyMap Class Template
Stores associations from one handle domain to many handles. More...
Declaration
Public Member Functions Index
template <typename TOneEntity, typename TManyEntity> | |
| bool | bind (TOneEntity oneEntity, TManyEntity manyEntity) |
|
Binds two entities by their handle types. More... | |
template <typename TOneHandle, typename TManyHandle> | |
| bool | bind (const TOneHandle key, const TManyHandle value) |
|
Appends an association from key handle to value handle. More... | |
template <typename TOneHandle, typename TManyHandle> | |
| auto | values (const TOneHandle key) const noexcept -> std::span< const TManyHandle > |
|
Returns all values associated with a key handle. More... | |
template <typename TOneHandle, typename TManyHandle> | |
| void | clear () |
|
Removes all stored associations. More... | |
template <typename TOneHandle, typename TManyHandle> | |
| void | reserve (std::size_t keyCapacity) |
|
Reserves capacity for key-indexed storage. More... | |
Private Member Attributes Index
template <typename TOneHandle, typename TManyHandle> | |
| std::vector< std::vector< TManyHandle > > | values_ |
|
Dense storage: key entityId -> associated values. More... | |
Description
Stores associations from one handle domain to many handles.
- Template Parameters
-
TOneHandle Handle type used as association key.
TManyHandle Handle type stored as associated value.
Uses entityId as direct index into dense storage.
Definition at line 29 of file HandleManyToManyMap.ixx.
Public Member Functions
bind()
| inline |
Binds two entities by their handle types.
- Template Parameters
-
TOneEntity Entity type exposing TOneHandle.
TManyEntity Entity type exposing TManyHandle.
- Parameters
-
oneEntity Entity providing the key handle.
manyEntity Entity providing the associated value handle.
- Returns
true after the association was appended.
Definition at line 49 of file HandleManyToManyMap.ixx.
References helios::engine::core::container::HandleManyToManyMap< TOneHandle, TManyHandle >::bind and helios::engine::core::registerComponents.
Referenced by helios::engine::scene::SceneMemberVisibilityRegistry< TMemberHandle >::addCulledMember, helios::engine::scene::SceneMemberVisibilityRegistry< TMemberHandle >::addVisibleMember and helios::engine::core::container::HandleManyToManyMap< TOneHandle, TManyHandle >::bind.
bind()
| inline |
Appends an association from key handle to value handle.
- Parameters
-
key Key handle on the left side.
value Value handle on the right side.
- Returns
true after the association was appended.
Definition at line 60 of file HandleManyToManyMap.ixx.
Reference helios::engine::core::registerComponents.
clear()
| inline |
Removes all stored associations.
Definition at line 95 of file HandleManyToManyMap.ixx.
Referenced by helios::engine::scene::SceneMemberVisibilityRegistry< TMemberHandle >::clear.
reserve()
| inline |
Reserves capacity for key-indexed storage.
- Parameters
-
keyCapacity Expected number of key slots.
Definition at line 104 of file HandleManyToManyMap.ixx.
Reference helios::engine::core::registerComponents.
Referenced by helios::engine::scene::SceneMemberVisibilityRegistry< TMemberHandle >::SceneMemberVisibilityRegistry.
values()
| inline noexcept |
Returns all values associated with a key handle.
- Parameters
-
key Key handle to query.
- Returns
Read-only span of associated handles, or empty span if none exist.
Definition at line 81 of file HandleManyToManyMap.ixx.
Reference helios::engine::core::registerComponents.
Referenced by helios::engine::scene::SceneMemberVisibilityRegistry< TMemberHandle >::culledMembers and helios::engine::scene::SceneMemberVisibilityRegistry< TMemberHandle >::visibleMembers.
Private Member Attributes
values_
|
Dense storage: key entityId -> associated values.
Definition at line 34 of file HandleManyToManyMap.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.