Cache for compile-time defined components.
More...
#include <component_cache.h>
|
|
| ComponentCache (ComponentCache &&)=delete |
| |
|
| ComponentCache (const ComponentCache &)=delete |
| |
|
ComponentCache & | operator= (ComponentCache &&)=delete |
| |
|
ComponentCache & | operator= (const ComponentCache &)=delete |
| |
| template<typename T > |
| GAIA_NODISCARD GAIA_FORCEINLINE const ComponentCacheItem & | add (Entity entity) |
| | Registers the component item for.
|
| |
| GAIA_NODISCARD const ComponentCacheItem * | find (detail::ComponentDescId compDescId) const noexcept |
| | Searches for the component cache item given the compDescId.
|
| |
| GAIA_NODISCARD const ComponentCacheItem & | get (detail::ComponentDescId compDescId) const noexcept |
| | Returns the component cache item given the compDescId.
|
| |
| GAIA_NODISCARD const ComponentCacheItem * | find (Entity entity) const noexcept |
| | Searches for the component cache item.
|
| |
| GAIA_NODISCARD const ComponentCacheItem & | get (Entity entity) const noexcept |
| | Returns the component cache item.
|
| |
| GAIA_NODISCARD const ComponentCacheItem * | find (const char *name, uint32_t len=0) const noexcept |
| | Searches for the component cache item. The provided string is NOT copied internally.
|
| |
| GAIA_NODISCARD const ComponentCacheItem & | get (const char *name, uint32_t len=0) const noexcept |
| | Returns the component cache item. The provided string is NOT copied internally.
|
| |
| template<typename T > |
| GAIA_NODISCARD const ComponentCacheItem * | find () const noexcept |
| | Searches for the component item for.
|
| |
| template<typename T > |
| GAIA_NODISCARD const ComponentCacheItem & | get () const noexcept |
| | Returns the component item for.
|
| |
|
void | diag () const |
| |
Cache for compile-time defined components.
◆ add()
Registers the component item for.
- Template Parameters
-
| T. | If it already exists it is returned. |
- Returns
- Component info
◆ find() [1/4]
Searches for the component item for.
- Template Parameters
-
- Warning
- It is expected the component already exists! Undefined behavior otherwise.
- Returns
- Component info or nullptr if not found.
◆ find() [2/4]
| GAIA_NODISCARD const ComponentCacheItem * gaia::ecs::ComponentCache::find |
( |
const char * |
name, |
|
|
uint32_t |
len = 0 |
|
) |
| const |
|
inlinenoexcept |
Searches for the component cache item. The provided string is NOT copied internally.
- Parameters
-
| name | A null-terminated string. |
| len | String length. If zero, the length is calculated. |
- Returns
- Component cache item if found, nullptr otherwise.
◆ find() [3/4]
| GAIA_NODISCARD const ComponentCacheItem * gaia::ecs::ComponentCache::find |
( |
detail::ComponentDescId |
compDescId | ) |
const |
|
inlinenoexcept |
Searches for the component cache item given the compDescId.
- Parameters
-
- Returns
- Component info or nullptr it not found.
◆ find() [4/4]
Searches for the component cache item.
- Parameters
-
| entity | Entity associated with the component item. |
- Returns
- Component cache item if found, nullptr otherwise.
◆ get() [1/4]
Returns the component item for.
- Template Parameters
-
- Warning
- It is expected the component already exists! Undefined behavior otherwise.
- Returns
- Component info
◆ get() [2/4]
| GAIA_NODISCARD const ComponentCacheItem & gaia::ecs::ComponentCache::get |
( |
const char * |
name, |
|
|
uint32_t |
len = 0 |
|
) |
| const |
|
inlinenoexcept |
Returns the component cache item. The provided string is NOT copied internally.
- Parameters
-
| name | A null-terminated string |
| len | String length. If zero, the length is calculated |
- Returns
- Component info.
- Warning
- It is expected the component item with the given name/length exists! Undefined behavior otherwise.
◆ get() [3/4]
| GAIA_NODISCARD const ComponentCacheItem & gaia::ecs::ComponentCache::get |
( |
detail::ComponentDescId |
compDescId | ) |
const |
|
inlinenoexcept |
Returns the component cache item given the compDescId.
- Parameters
-
- Returns
- Component info
- Warning
- It is expected the component item with the given id exists! Undefined behavior otherwise.
◆ get() [4/4]
Returns the component cache item.
- Parameters
-
| entity | Entity associated with the component item. |
- Returns
- Component info.
- Warning
- It is expected the component item with the given name/length exists! Undefined behavior otherwise.
The documentation for this class was generated from the following file: