Skip to content

Engine → Bindings → bindings_subsystem.h

scripting_bindings_subsystem

Syntax

class CONJURE_API scripting_bindings_subsystem final : public engine::engine_subsystem

Inheritance Hierarchy

engine::engine_subsystem → scripting_bindings_subsystem

Constructors

AccessSignatureDescription
publicscripting_bindings_subsystem();

Destructors

AccessSignatureDescription
public~scripting_bindings_subsystem() override;

Variables

AccessNameTypeDefaultDescription
privatemContextbinding_context{}
privatemFilledboolfalse
privatemResidencyscript_residency{}
privatemUnloadSubscriptioncore::event_subscription{}

Functions

Public

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

void 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

[[nodiscard]] const binding_context &context() const noexcept;

The context the table was filled from (every pointer null before startup).

is_filled

[[nodiscard]] bool is_filled() const noexcept;

True once startup filled the table (false when scripting was disabled).

name

[[nodiscard]] std::string_view name() const noexcept override;

"bindings".

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

[[nodiscard]] script_residency &residency() noexcept;

The handles scripts hold through asset_load.

set_active_residency

static void set_active_residency(
    script_residency *residency) noexcept;

Installs (or, with nullptr, removes) the residency the entries use.

shutdown

void 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

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