Toast Engine
Loading...
Searching...
No Matches
lua_util.hpp
Go to the documentation of this file.
1
8
9#pragma once
10
11struct lua_State;
12
13namespace scripting {
14
15auto pcallTraceback(lua_State* state, int nargs, int nresults) noexcept -> int;
16
22class ScriptDepthGuard {
23public:
24 ScriptDepthGuard() noexcept;
25 ~ScriptDepthGuard();
26
27 ScriptDepthGuard(const ScriptDepthGuard&) = delete;
28 auto operator=(const ScriptDepthGuard&) -> ScriptDepthGuard& = delete;
29 ScriptDepthGuard(ScriptDepthGuard&&) = delete;
30 auto operator=(ScriptDepthGuard&&) -> ScriptDepthGuard& = delete;
31
33 [[nodiscard]]
34 auto allowed() const noexcept -> bool {
35 return m_allowed;
36 }
37
38private:
39 bool m_allowed;
40};
41
42}
auto allowed() const noexcept -> bool
False when the limit was reached; the caller must not enter Lua.
Definition lua_util.hpp:34