Skip to content

Engine → Modules → module_registrar.h

module_registrar

Syntax

class CONJURE_API module_registrar

Constructors

AccessSignatureDescription
publicexplicit module_registrar( module_registration_set &set) noexcept;

Important

Copy constructor and assignment has been deleted.

Destructors

AccessSignatureDescription
public~module_registrar();

Variables

AccessNameTypeDefaultDescription
privatemSetmodule_registration_set *nullptr

Functions

Public

fail

void fail(
    std::string_view reason);

Records a reason the module cannot load. Reasons accumulate; one is enough to reject the load after the entry returns.

register_extension

template <typename DescType> void register_extension(
    const DescType &desc);

Stores a trivially copyable descriptor under DescType::EXTENSION_POINT. The consuming area defines the descriptor; strings inside may point at module literals, consumers copy what they keep.

register_managed_assembly

void register_managed_assembly(
    std::string_view relativePath);

Adds a managed assembly path relative to the module root. Duplicates are ignored. A path that leaves the root (a ".." segment, a leading separator, a drive) asserts and is recorded as a failure, like fail(), so the load is rejected.

registrations

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

The set being filled.

set_lifecycle

void set_lifecycle(
    const module_lifecycle &lifecycle) noexcept;

Installs the lifecycle callbacks; the last call wins.

Private

append_extension

void append_extension(
    core::string_id point,
    const void *data,
    usize size,
    usize alignment);