25 #ifndef TASKOLIB_LUA_DETAILS_H_
26 #define TASKOLIB_LUA_DETAILS_H_
33 #include "sol/sol.hpp"
41 static_assert(std::is_same<LuaFloat, double>::value,
"Unexpected Lua-internal floating point type");
42 static_assert(std::is_same<LuaInteger, long long>::value,
"Unexpected Lua-internal integer type");
111 std::chrono::milliseconds timeout,
OptionalStepIndex step_idx,
const Context& context,
112 CommChannel* comm_channel, TimeoutTrigger* sequence_timeout);
125 void print_fct(sol::this_state, sol::variadic_args);
128 void sleep_fct(
double seconds, sol::this_state sol);
Declaration of the CommChannel struct.
Declaration of the Context and VariableValue types.
Logic to check if a timeout elapsed.
Namespace task contains all Taskolib functions and classes.
Definition: CommChannel.h:33
void open_safe_library_subset(sol::state &lua)
Definition: lua_details.cc:239
OptionalStepIndex get_step_idx_from_registry(lua_State *lua_state)
Get the index of the currently executed Step from the Lua registry.
Definition: lua_details.cc:160
void install_custom_commands(sol::state &lua)
Install implementations for some custom functions in the given Lua state.
Definition: lua_details.cc:215
void sleep_fct(double seconds, sol::this_state sol)
Definition: lua_details.cc:282
void abort_script_with_error(lua_State *lua_state, const std::string &msg)
Definition: lua_details.cc:59
LuaInteger get_ms_since_epoch(TimePoint t0, std::chrono::milliseconds dt)
Definition: lua_details.cc:176
void hook_abort_with_error(lua_State *lua_state, lua_Debug *)
Definition: lua_details.cc:205
void print_fct(sol::this_state sol, sol::variadic_args va)
Definition: lua_details.cc:258
LUA_INTEGER LuaInteger
The integer type used by the Lua interpreter.
Definition: Context.h:47
void check_script_timeout(lua_State *lua_state)
Definition: lua_details.cc:92
void install_timeout_and_termination_request_hook(sol::state &lua, TimePoint now, std::chrono::milliseconds timeout, OptionalStepIndex step_idx, const Context &context, CommChannel *comm_channel, TimeoutTrigger *sequence_timeout)
Definition: lua_details.cc:223
gul14::optional< StepIndex > OptionalStepIndex
An optional step index (gul14::optional<StepIndex>).
Definition: StepIndex.h:37
CommChannel * get_comm_channel_ptr_from_registry(lua_State *lua_state)
Retrieve a pointer to the used CommChannel from the Lua registry.
Definition: lua_details.cc:134
void check_immediate_termination_request(lua_State *lua_state)
Definition: lua_details.cc:74
const Context & get_context_from_registry(lua_State *lua_state)
Retrieve a reference to the used Context from the Lua registry.
Definition: lua_details.cc:146
std::chrono::time_point< Clock > TimePoint
Definition: time_types.h:34
void hook_check_timeout_and_termination_request(lua_State *lua_state, lua_Debug *)
Definition: lua_details.cc:196