Skip to content

Engine → Modules → module_registry.h

module_registry

Syntax

class CONJURE_API module_registry

Constructors

AccessSignatureDescription
publicmodule_registry();

Important

Copy constructor and assignment has been deleted.

Destructors

AccessSignatureDescription
public~module_registry();

Variables

AccessNameTypeDefaultDescription
privatemStatestd::unique_ptr<registry_state>{}

Functions

Public

all

[[nodiscard]] std::span<const module_id> all() const noexcept;

Every registered module, in registration order.

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

[[nodiscard]] std::span<const module_id> dependencies(
    module_id id) const noexcept;

LOADED modules the module depends on.

dependents

[[nodiscard]] std::span<const module_id> dependents(
    module_id id) const noexcept;

LOADED modules that depend on the module.

find

[[nodiscard]] module_id find(
    core::string_id name) const noexcept;

The module registered under the name, or an invalid id.

forget_ownership

void forget_ownership(
    module_id owner);

Drops every ownership entry of the module.

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

[[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

[[nodiscard]] u32 load_count(
    module_id id) const noexcept;

Number of times the module reached LOADED.

load_order

[[nodiscard]] std::span<const module_id> load_order() const noexcept;

The LOADED modules in the order they were loaded.

manifest

[[nodiscard]] const module_manifest &manifest(
    module_id id) const noexcept;

note_ownership

void 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

[[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

[[nodiscard]] const module_registration_set &registrations(
    module_id id) const noexcept;

root_directory

[[nodiscard]] const std::filesystem::path &root_directory(
    module_id id) const noexcept;

The directory the manifest lives in; empty for static modules.

size

[[nodiscard]] usize size() const noexcept;

Number of registered modules.

state

[[nodiscard]] module_state state(
    module_id id) const noexcept;

Private

add_record

[[nodiscard]] module_record &add_record(
    core::string_id name);

append_load_order

void append_load_order(
    module_id id);

record

[[nodiscard]] module_record *record(
    module_id id) noexcept;
[[nodiscard]] const module_record *record(
    module_id id) const noexcept;

record_at

[[nodiscard]] module_record &record_at(
    u16 index) noexcept;

remove_load_order

void remove_load_order(
    module_id id);

retire_generation

void retire_generation(
    module_record &record);