6#include <condition_variable>
22 bool siteImport{
true };
24 std::vector<std::string>
argv;
32 [[nodiscard]]
static bool nowRunning() {
return instance_().state_.load() != State::idle; }
37 static MRPYTHON_API
bool runString( std::string pythonString, std::function<
void(
bool success )> onDoneAsync =
nullptr );
39 static MRPYTHON_API
bool runScript(
const std::filesystem::path& path );
41 static MRPYTHON_API
bool isPythonScript(
const std::filesystem::path& path );
49 void ensureInterpreterThreadIsRunning_();
52 bool available_{
false };
61 std::atomic<State> state_ = State::idle;
62 std::string queuedSource_;
63 bool lastRunSuccessful_ =
false;
64 std::function<void(
bool success )> onDoneAsync_;
66 std::condition_variable cv_;
74 std::thread interpreterThread_;
76 std::atomic_bool stopInterpreterThread_ =
false;
Definition MREmbeddedPython.h:18
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:32
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 MRCameraOrientationPlugin.h:8
Definition MREmbeddedPython.h:21
std::string home
Definition MREmbeddedPython.h:23
std::vector< std::string > argv
Definition MREmbeddedPython.h:24