Showing the changes to libraries/script-engine/src/Scriptable.cpp (1 of 38 files). Show all
Unified · Split
| @@ -0,0 +1,24 @@ | |||
| 1 | // | ||
| 2 | // Scriptable.cpp | ||
| 3 | // libraries/script-engine/src | ||
| 4 | // | ||
| 5 | // Created by Heather Anderson on 5/22/21. | ||
| 6 | // Copyright 2021 Vircadia contributors. | ||
| 7 | // | ||
| 8 | // Distributed under the Apache License, Version 2.0. | ||
| 9 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | ||
| 10 | // | ||
| 11 | |||
| 12 | #include "Scriptable.h" | ||
| 13 | |||
| 14 | #include <QtCore/QThreadStorage> | ||
| 15 | |||
| 16 | static QThreadStorage<ScriptContext*> ScriptContextStore; | ||
| 17 | |||
| 18 | ScriptContext* Scriptable::context() { | ||
| 19 | return ScriptContextStore.localData(); | ||
| 20 | } | ||
| 21 | |||
| 22 | void Scriptable::setContext(ScriptContext* context) { | ||
| 23 | ScriptContextStore.setLocalData(context); | ||
| 24 | } | ||