mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-04 10:40:09 -06:00
made functions for script sharing public for now, temporary fix
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <ghoul/lua/ghoul_lua.h>
|
||||
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
/**
|
||||
* \defgroup LuaScripts Lua Scripts
|
||||
@@ -89,9 +90,16 @@ public:
|
||||
void preSynchronization();
|
||||
|
||||
void queueScript(const std::string &script);
|
||||
|
||||
std::vector<std::string> cachedScripts();
|
||||
|
||||
std::vector<std::string> allLuaFunctions() const;
|
||||
|
||||
//parallel functions
|
||||
bool parseLibraryAndFunctionNames(std::string &library, std::string &function, const std::string &script);
|
||||
bool shouldScriptBeSent(const std::string &library, const std::string &function);
|
||||
void cacheScript(const std::string &library, const std::string &function, const std::string &script);
|
||||
|
||||
private:
|
||||
bool registerLuaLibrary(lua_State* state, const LuaLibrary& library);
|
||||
void addLibraryFunctions(lua_State* state, const LuaLibrary& library, bool replace);
|
||||
@@ -100,8 +108,6 @@ private:
|
||||
|
||||
void addBaseLibrary();
|
||||
void remapPrintFunction();
|
||||
|
||||
bool findLibraryAndFunction(std::string &library, std::string &function, const std::string &script);
|
||||
|
||||
lua_State* _state;
|
||||
std::set<LuaLibrary> _registeredLibraries;
|
||||
@@ -112,6 +118,10 @@ private:
|
||||
std::vector<std::string> _receivedScripts;
|
||||
std::string _currentSyncedScript;
|
||||
|
||||
//parallel variables
|
||||
std::map<std::string, std::map<std::string, std::string>> _cachedScripts;
|
||||
std::mutex _cachedScriptsMutex;
|
||||
|
||||
};
|
||||
|
||||
} // namespace scripting
|
||||
|
||||
Reference in New Issue
Block a user