6#include <condition_variable>
22 bool siteImport{
true };
24 std::vector<std::string>
argv;
36 [[nodiscard]]
static bool nowRunning() {
return instance_().state_.load() != State::idle; }
41 MRPYTHON_API
static bool runString( std::string pythonString, std::function<
void(
bool success )> onDoneAsync =
nullptr );
43 MRPYTHON_API
static bool runScript(
const std::filesystem::path& path );
45 MRPYTHON_API
static bool isPythonScript(
const std::filesystem::path& path );
53 void ensureInterpreterThreadIsRunning_();
56 bool available_ =
false;
57 bool shutdownCalled_ =
false;
66 std::atomic<State> state_ = State::idle;
67 std::string queuedSource_;
68 bool lastRunSuccessful_ =
false;
69 std::function<void(
bool success )> onDoneAsync_;
71 std::condition_variable cv_;
79 std::thread interpreterThread_;
81 std::atomic_bool stopInterpreterThread_ =
false;
Definition MREmbeddedPython.h:18
static MRPYTHON_API void shutdown()
static MRPYTHON_API bool isAvailable()
static MRPYTHON_API bool runScript(const std::filesystem::path &path)
static MRPYTHON_API bool isPythonScript(const std::filesystem::path &path)
static bool nowRunning()
Definition MREmbeddedPython.h:36
static MRPYTHON_API bool runString(std::string pythonString, std::function< void(bool success)> onDoneAsync=nullptr)
static MRPYTHON_API Config pythonConfig
Definition MREmbeddedPython.h:26
Definition MREmbeddedPython.h:21
std::string home
Definition MREmbeddedPython.h:23
std::vector< std::string > argv
Definition MREmbeddedPython.h:24