2#ifndef LIBSBX_SCRIPTING_MANAGED_RUNTIME_HPP_
3#define LIBSBX_SCRIPTING_MANAGED_RUNTIME_HPP_
9#include <libsbx/scripting/managed/core.hpp>
10#include <libsbx/scripting/managed/object.hpp>
11#include <libsbx/scripting/managed/message_type.hpp>
12#include <libsbx/scripting/managed/assembly.hpp>
14namespace sbx::scripting::managed {
16using message_callback_fn = std::function<void(std::string_view, message_level)>;
17using exception_callback_fn = std::function<void(std::string_view)>;
20 std::string backend_path;
22 message_callback_fn message_callback;
23 message_level message_filter = message_level::all;
25 exception_callback_fn exception_callback;
28enum class runtime_status {
43 auto shutdown() -> void;
51 auto load_host_fxr()
const -> bool;
53 auto initialize_managed() -> bool;
55 auto load_functions() -> void;
57 auto load_managed_function_ptr(
const std::filesystem::path& assembly_path,
const char_type* type_name,
const char_type* method_name,
const char_type* delegate_type = SBX_SCRIPTING_UNMANAGED_CALLERS_ONLY)
const ->
void*;
59 template<
typename Function>
60 auto load_managed_function_ptr(
const char_type* type_name,
const char_type* method_name,
const char_type* delegate_type = SBX_SCRIPTING_UNMANAGED_CALLERS_ONLY)
const -> Function {
61 return reinterpret_cast<Function
>(load_managed_function_ptr(_managed_assembly_path, type_name, method_name, delegate_type));
67 std::filesystem::path _managed_assembly_path;
68 void* _host_fxr_context =
nullptr;
69 bool _initialized =
false;
Definition: assembly.hpp:63
Definition: runtime.hpp:35
Definition: runtime.hpp:19