mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-12 14:29:42 -05:00
Cleanup for coding style
Add strict mode to check_style_guide script
This commit is contained in:
@@ -61,18 +61,18 @@ public:
|
||||
* \throw LuaRuntimeException If the creation of the new Lua state fails
|
||||
*/
|
||||
void initialize();
|
||||
|
||||
|
||||
/**
|
||||
* Cleans the internal Lua state and leaves the ScriptEngine in a state to be newly
|
||||
* initialize%d.
|
||||
*/
|
||||
void deinitialize();
|
||||
|
||||
|
||||
void initializeLuaState(lua_State* state);
|
||||
|
||||
void addLibrary(LuaLibrary library);
|
||||
bool hasLibrary(const std::string& name);
|
||||
|
||||
|
||||
bool runScript(const std::string& script);
|
||||
bool runScriptFile(const std::string& filename);
|
||||
|
||||
@@ -90,35 +90,35 @@ public:
|
||||
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);
|
||||
|
||||
|
||||
static std::string OpenSpaceLibraryName;
|
||||
|
||||
|
||||
private:
|
||||
bool registerLuaLibrary(lua_State* state, LuaLibrary& library);
|
||||
void addLibraryFunctions(lua_State* state, LuaLibrary& library, bool replace);
|
||||
|
||||
bool isLibraryNameAllowed(lua_State* state, const std::string& name);
|
||||
|
||||
|
||||
void addBaseLibrary();
|
||||
void remapPrintFunction();
|
||||
|
||||
|
||||
std::string generateJson() const override;
|
||||
|
||||
ghoul::lua::LuaState _state;
|
||||
std::vector<LuaLibrary> _registeredLibraries;
|
||||
|
||||
|
||||
|
||||
//sync variables
|
||||
std::mutex _mutex;
|
||||
std::vector<std::pair<std::string, bool>> _queuedScripts;
|
||||
std::vector<std::string> _receivedScripts;
|
||||
std::string _currentSyncedScript;
|
||||
|
||||
|
||||
//parallel variables
|
||||
//std::map<std::string, std::map<std::string, std::string>> _cachedScripts;
|
||||
//std::mutex _cachedScriptsMutex;
|
||||
|
||||
@@ -45,13 +45,12 @@ public:
|
||||
struct ScheduledScript {
|
||||
ScheduledScript() = default;
|
||||
ScheduledScript(const ghoul::Dictionary& dict);
|
||||
|
||||
|
||||
double time;
|
||||
std::string forwardScript;
|
||||
std::string backwardScript;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Load a schedule from a ghoul::Dictionary \p dictionary and adds the
|
||||
* ScheduledScript%s to the list of stored scripts.
|
||||
@@ -95,7 +94,7 @@ public:
|
||||
std::pair<
|
||||
std::vector<std::string>::const_iterator, std::vector<std::string>::const_iterator
|
||||
> progressTo(double newTime);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the the j2000 time value that the script scheduler is currently at
|
||||
*/
|
||||
@@ -108,17 +107,16 @@ public:
|
||||
|
||||
|
||||
static LuaLibrary luaLibrary();
|
||||
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
private:
|
||||
std::vector<double> _timings;
|
||||
std::vector<std::string> _forwardScripts;
|
||||
std::vector<std::string> _backwardScripts;
|
||||
|
||||
|
||||
int _currentIndex = 0;
|
||||
double _currentTime;
|
||||
|
||||
};
|
||||
|
||||
} // namespace openspace::scripting
|
||||
|
||||
Reference in New Issue
Block a user