Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
script_dispatch.hpp
Go to the documentation of this file.
1
12
13
#pragma once
14
15
#include <cstddef>
16
#include <functional>
17
#include <
toast/export.hpp
>
18
19
namespace
scripting {
20
21
class
TOAST_API
ScriptDispatch
{
22
public
:
24
static
void
enqueue
(
size_t
vm_index, std::move_only_function<
void
()> job);
25
29
[[nodiscard]]
30
static
auto
mustQueue
(
size_t
vm_index)
noexcept
-> bool;
31
33
[[nodiscard]]
34
static
auto
pending
()
noexcept
-> size_t;
35
42
static
auto
deliver
(
int
max_rounds = 4) -> size_t;
43
45
static
void
clear
()
noexcept
;
46
};
47
48
}
scripting::ScriptDispatch
Definition
script_dispatch.hpp:21
scripting::ScriptDispatch::deliver
static auto deliver(int max_rounds=4) -> size_t
Runs the queued work.
Definition
script_dispatch.cpp:92
scripting::ScriptDispatch::clear
static void clear() noexcept
Drops everything that is still queued without running it; used when the world is torn down.
Definition
script_dispatch.cpp:155
scripting::ScriptDispatch::pending
static auto pending() noexcept -> size_t
Number of jobs waiting for delivery.
Definition
script_dispatch.cpp:88
scripting::ScriptDispatch::mustQueue
static auto mustQueue(size_t vm_index) noexcept -> bool
True when a call from this thread into the interpreter vm_index has to join the queue instead of runn...
Definition
script_dispatch.cpp:80
scripting::ScriptDispatch::enqueue
static void enqueue(size_t vm_index, std::move_only_function< void()> job)
Queues job which runs while the interpreter vm_index is owned.
Definition
script_dispatch.cpp:70
export.hpp
engine
src
toast
scripting
script_dispatch.hpp
Generated by
1.17.0