Engine → Bindings → bindings_subsystem.h
scripting_bindings_subsystem
| Type | Class |
| Namespace | conjure::bindings |
| Include File Path | engine/include/conjure/bindings/bindings_subsystem.h |
| Source File Path | engine/src/bindings/bindings_subsystem.cpp |
| API ↗ | Scripting from C#: the bindings, The native table |
Syntax
Inheritance Hierarchy
engine::engine_subsystem → scripting_bindings_subsystem
Constructors
| Access | Signature | Description |
|---|---|---|
| public | scripting_bindings_subsystem(); |
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~scripting_bindings_subsystem() override; |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mContext | binding_context | {} | |
| private | mFilled | bool | false | |
| private | mResidency | script_residency | {} | |
| private | m | core::event_subscription | {} |
Functions
Public
active_residency
active_residency[[nodiscard]] static script_residency *active_residency() noexcept;The residency the active entries use (asset_load / asset_release), or nullptr when no subsystem started. Tests without an application install one with set_active_residency.
begin_frame
begin_framevoid begin_frame(
engine::engine_context &context) override;Re-installs the counting thunks and the query_end hook when a re-initialised script runtime dropped them (is_scope_hook_installed), clears the last-error buffer and the per-frame rate-limit bits of the entry failure logs, and applies the scene fixups a force-closed scope left behind.
context
context[[nodiscard]] const binding_context &context() const noexcept;The context the table was filled from (every pointer null before startup).
is_filled
is_filled[[nodiscard]] bool is_filled() const noexcept;True once startup filled the table (false when scripting was disabled).
name
name[[nodiscard]] std::string_view name() const noexcept override;"bindings".
post_startup
post_startup[[nodiscard]] core::result<void> post_startup(
engine::engine_context &context) override;Step 17, after scripting's post_startup filled the core entries: wraps them in counting thunks too (idempotent for the slots already wrapped at step 16).
residency
residency[[nodiscard]] script_residency &residency() noexcept;The handles scripts hold through asset_load.
set_active_residency
set_active_residencystatic void set_active_residency(
script_residency *residency) noexcept;Installs (or, with nullptr, removes) the residency the entries use.
shutdown
shutdownvoid shutdown(
engine::engine_context &context) override;Drops the residency and the subscription and forgets the active context. Safe after a failed or never attempted startup and when called twice.
startup
startup[[nodiscard]] core::result<void> startup(
engine::engine_context &context) override;Step 16: nothing to do without a script runtime; otherwise builds the binding_context from the engine_context, fills the owned slots, wraps every slot with counting thunks outside Distribution, verifies that no slot is null (TABLE_INCOMPLETE unwinds the startup) and subscribes to scene_manager::on_before_unload to clear the residency.