Skip to content

Engine → Scripting → dotnet_script_host.h

dotnet_script_host

Syntax

class CONJURE_API dotnet_script_host final : public script_host

Inheritance Hierarchy

script_host → dotnet_script_host

Constructors

AccessSignatureDescription
publicdotnet_script_host();

Destructors

AccessSignatureDescription
public~dotnet_script_host() override;

Variables

AccessNameTypeDefaultDescription
privatemManagedApiconjure_managed_api{}
privatemManagedDirectorystd::filesystem::path{}
privatemModehost_modehost_mode::FRAMEWORK_DEPENDENT
privatemNativeApiconjure_native_api *nullptr
privatemStatusscript_host_statusscript_host_status::UNINITIALISED

Functions

Public

backend

[[nodiscard]] script_backend backend() const noexcept override;

initialise

[[nodiscard]] core::result<void> initialise(
    const script_host_config &config,
    conjure_native_api &nativeApi) override;

Steps 1-10 of the hosting sequence: locate and load hostfxr, start (or attach to) the runtime, load Conjure.Managed into the default load context, resolve Initialize and hand it both tables. RUNTIME_NOT_FOUND, HOSTFXR_INCOMPATIBLE, RUNTIME_CONFIG_INVALID, MANAGED_SDK_MISSING, HOST_ALREADY_RUNNING, ABI_MISMATCH, WRONG_THREAD.

is_runtime_started

[[nodiscard]] static bool is_runtime_started() noexcept;

True once any host in this process started the CLR.

managed_api

[[nodiscard]] const conjure_managed_api &managed_api() const noexcept override;

managed_directory

[[nodiscard]] const std::filesystem::path &managed_directory() const noexcept;

The managed directory the process runtime was started from (meaningful once READY). A later host asking for another directory attaches to this one with a WARN.

mode

[[nodiscard]] host_mode mode() const noexcept;

The hosting mode the process runtime was started in (meaningful once READY).

shutdown

void shutdown() override;

managed.shutdown(): destroys instances, unloads the game load context. READY -> UNINITIALISED.

status

[[nodiscard]] script_host_status status() const noexcept override;