Engine → Scene → guid_index.h
guid_index
| Type | Class |
| Namespace | conjure::scene |
| Include File Path | engine/include/conjure/scene/guid_index.h |
| Source File Path | engine/src/scene/guid_index.cpp |
| API ↗ | Scenes, hierarchy and prefabs, Scenes and the hierarchy |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | guid_index(); |
Important
Copy constructor and assignment has been deleted.
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~guid_index(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| public | INITIAL_ | static constexpr u32 | 1024 | Entries reserved by the constructor so small scenes never rehash. |
| private | mEntries | core:: | {} |
Functions
Public
capacity
capacity[[nodiscard]] usize capacity() const noexcept;Buckets of the underlying table (for the allocation tests).
clear
clearvoid clear() noexcept;Drops every mapping; the capacity stays.
contains
contains[[nodiscard]] bool contains(
const core::uuid &id) const noexcept;True when the guid is mapped.
erase
erasevoid erase(
const core::uuid &id,
ecs::entity expected) noexcept;Removes the mapping when it points at expected; any other mapping is left alone.
find
find[[nodiscard]] ecs::entity find(
const core::uuid &id) const noexcept;The entity mapped to the guid, or NULL_ENTITY.
insert
insert[[nodiscard]] bool insert(
const core::uuid &id,
ecs::entity target);Maps the guid to the entity. Returns false (and keeps the existing mapping) when the guid is already mapped; a null guid is never inserted.
rebind
rebindvoid rebind(
ecs::entity target,
const core::uuid &oldId,
const core::uuid &newId);Moves an entity from one guid to another: erases oldId when it maps to the entity and inserts newId (first mapping wins when newId is taken).
reserve
reservevoid reserve(
u32 count);Makes room for count mappings so the next insertions never rehash.