Engine → Assets → asset_type_registry.h
asset_type_registry
| Type | Class |
| Namespace | conjure::assets |
| Include File Path | engine/include/conjure/assets/asset_type_registry.h |
| Source File Path | engine/src/assets/asset_type_registry.cpp |
| API ↗ | Database, importers and hot reload, Assets |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | asset_type_registry(); |
Important
Copy constructor and assignment has been deleted.
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~asset_type_registry(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mHooks | asset_ | {} | |
| private | mIndexById | core:: | {} | |
| private | mTypes | std:: | {} | |
| private | mView | std:: | {} |
Functions
Public
find
find[[nodiscard]] const asset_type_desc *find(
asset_type_id id) const noexcept;[[nodiscard]] const asset_type_desc *find(
std::string_view name) const noexcept;find_loader
find_loader[[nodiscard]] const asset_loader *find_loader(
asset_type_id id) const noexcept;register_type
register_type[[nodiscard]] core::result<void> register_type(
asset_type_desc desc);Main thread, before systems run. Fails with TYPE_DUPLICATE if the id is taken, with INVALID_ARGUMENT for an INVALID id, a name whose hash is not the id, or a missing loader whose type differs from the id, and with OUT_OF_RANGE past MAX_ASSET_TYPES.
set_hooks
set_hooksvoid set_hooks(
asset_type_registry_hooks hooks);Installs the manager's callbacks. Engine plumbing, not for general use.
size
size[[nodiscard]] usize size() const noexcept;types
types[[nodiscard]] std::span<const asset_type_desc *const> types() const noexcept;Every registered type in registration order. The span is valid until the next registration or removal; the descriptions it points at follow the find() rule.
unregister_type
unregister_type[[nodiscard]] core::result<void> unregister_type(
asset_type_id id);Plugin unload. TYPE_UNKNOWN for an unregistered id; INVALID_STATE while any slot of the type is loaded or in flight. Only pointers to the removed description die.
Private
rebuild_index
rebuild_indexvoid rebuild_index();