Engine → Modules → module_registrar.h
module_registrar
| Type | Class |
| Namespace | conjure::modules |
| Include File Path | engine/include/conjure/modules/module_registrar.h |
| Source File Path | engine/src/modules/module_registrar.cpp |
| API ↗ | Writing a module |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | explicit module_registrar(
module_registration_set &set) noexcept; |
Important
Copy constructor and assignment has been deleted.
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~module_registrar(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mSet | module_ | nullptr |
Functions
Public
fail
failvoid 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
register_extensiontemplate <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
register_managed_assemblyvoid 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
registrations[[nodiscard]] const module_registration_set ®istrations() const noexcept;The set being filled.
set_lifecycle
set_lifecyclevoid set_lifecycle(
const module_lifecycle &lifecycle) noexcept;Installs the lifecycle callbacks; the last call wins.
Private
append_extension
append_extensionvoid append_extension(
core::string_id point,
const void *data,
usize size,
usize alignment);