mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-10 12:41:35 -10:00
This adds a mechanism for running generic operations at specific points of the frame execution. This can be used by any part of the code an not just Lua since it simply executes std::functions. It also adds an "execution context" concept that specifies in which situation an operation should be executed. This is then used by the Lua Coroutines code for resuming coroutines at specific points instead of always when the awaited promise resolves.
27 lines
455 B
C++
27 lines
455 B
C++
|
|
#pragma once
|
|
|
|
#include "executor/Executor.h"
|
|
#include "scripting/ade_api.h"
|
|
|
|
namespace scripting {
|
|
namespace api {
|
|
|
|
class executor_h {
|
|
public:
|
|
executor_h();
|
|
executor_h(std::shared_ptr<executor::Executor> executor);
|
|
|
|
bool isValid();
|
|
|
|
const std::shared_ptr<executor::Executor>& getExecutor() const;
|
|
|
|
private:
|
|
std::shared_ptr<executor::Executor> m_executor;
|
|
};
|
|
|
|
DECLARE_ADE_OBJ(l_Executor, executor_h);
|
|
|
|
} // namespace api
|
|
} // namespace scripting
|