Engine → Modules → module_registry.h
module_registry
| Type | Class |
| Namespace | conjure::modules |
| Include File Path | engine/include/conjure/modules/module_registry.h |
| Source File Path | engine/src/modules/module_registry.cpp |
| API ↗ | Loading and managing modules |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | module_registry(); |
Important
Copy constructor and assignment has been deleted.
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~module_registry(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mState | std:: | {} |
Functions
Public
all
all[[nodiscard]] std::span<const module_id> all() const noexcept;Every registered module, in registration order.
binary_path
binary_path[[nodiscard]] const std::filesystem::path &binary_path(
module_id id) const noexcept;The derived binary path; empty for static and manifest-only modules.
dependencies
dependenciesLOADED modules the module depends on.
dependents
dependentsLOADED modules that depend on the module.
find
find[[nodiscard]] module_id find(
core::string_id name) const noexcept;The module registered under the name, or an invalid id.
forget_ownership
forget_ownershipvoid forget_ownership(
module_id owner);Drops every ownership entry of the module.
is_valid
is_valid[[nodiscard]] bool is_valid(
module_id id) const noexcept;True when the id refers to a registered module and its generation is current.
last_error
last_error[[nodiscard]] const core::error &last_error(
module_id id) const noexcept;The error of the last failed load or unload, or an empty error.
load_count
load_countNumber of times the module reached LOADED.
load_order
load_order[[nodiscard]] std::span<const module_id> load_order() const noexcept;The LOADED modules in the order they were loaded.
manifest
manifest[[nodiscard]] const module_manifest &manifest(
module_id id) const noexcept;note_ownership
note_ownershipvoid note_ownership(
core::string_id point,
core::string_id key,
module_id owner);Records that owner provided key under point (a component type name under "ecs.component", say) so the inspector can show "provided by". Called by consumers in attach(); the manager forgets a module's entries when it unloads.
owner_of
owner_of[[nodiscard]] module_id owner_of(
core::string_id point,
core::string_id key) const noexcept;The module that provided the key, or an invalid id.
registrations
registrations[[nodiscard]] const module_registration_set ®istrations(
module_id id) const noexcept;root_directory
root_directory[[nodiscard]] const std::filesystem::path &root_directory(
module_id id) const noexcept;The directory the manifest lives in; empty for static modules.
state
state[[nodiscard]] module_state state(
module_id id) const noexcept;Private
add_record
add_record[[nodiscard]] module_record &add_record(
core::string_id name);append_load_order
append_load_ordervoid append_load_order(
module_id id);record
record[[nodiscard]] module_record *record(
module_id id) noexcept;[[nodiscard]] const module_record *record(
module_id id) const noexcept;record_at
record_at[[nodiscard]] module_record &record_at(
u16 index) noexcept;remove_load_order
remove_load_ordervoid remove_load_order(
module_id id);retire_generation
retire_generationvoid retire_generation(
module_record &record);