25 #ifndef __I6ENGINE_API_SCRIPTINGFACADE_H__
26 #define __I6ENGINE_API_SCRIPTINGFACADE_H__
33 #if ISIXE_SCRIPTING == SCRIPTING_LUA
35 #elif ISIXE_SCRIPTING == SCRIPTING_PYTHON
43 #if ISIXE_SCRIPTING == SCRIPTING_LUA
45 #elif ISIXE_SCRIPTING == SCRIPTING_PYTHON
56 void loadAllScripts()
const;
58 #if ISIXE_SCRIPTING != SCRIPTING_NONE
62 template<
typename Ret,
typename... args>
63 typename std::enable_if<std::is_void<Ret>::value, Ret>::type callScript(
const std::string & file,
const std::string & func, args... B) {
64 _manager->callScript<Ret>(file, func, B...);
70 template<
typename Ret,
typename... args>
71 typename std::enable_if<!std::is_void<Ret>::value, std::shared_ptr<utils::Future<Ret>>>::type callScript(
const std::string & file,
const std::string & func, args... B) {
72 return _manager->callScript<Ret>(file, func, B...);
78 template<
typename Ret,
typename... args>
79 typename std::enable_if<std::is_void<Ret>::value, Ret>::type callFunction(
const std::string & func, args... B) {
80 _manager->callFunction<Ret>(func, B...);
86 template<
typename Ret,
typename... args>
87 typename std::enable_if<!std::is_void<Ret>::value, std::shared_ptr<utils::Future<Ret>>>::type callFunction(
const std::string & func, args... B) {
88 return _manager->callFunction<Ret>(func, B...);
94 template<
typename Ret,
typename... args>
95 typename std::enable_if<std::is_void<Ret>::value, Ret>::type callScriptWithCallback(
const std::string & file,
const std::string & func,
const std::function<
void(
void)> & callback, args... B) {
96 _manager->callScriptWithCallback<Ret>(file, func, callback, B...);
102 template<
typename Ret,
typename... args>
103 typename std::enable_if<!std::is_void<Ret>::value, std::shared_ptr<utils::Future<Ret>>>::type callScriptWithCallback(
const std::string & file,
const std::string & func,
const std::function<
void(
void)> & callback, args... B) {
104 return _manager->callScriptWithCallback<Ret>(file, func, callback, B...);
110 template<
typename Ret,
typename... args>
111 typename std::enable_if<std::is_void<Ret>::value, Ret>::type callFunctionWithCallback(
const std::string & func,
const std::function<
void(
void)> & callback, args... B) {
112 _manager->callFunctionWithCallback<Ret>(func, callback, B...);
118 template<
typename Ret,
typename... args>
119 typename std::enable_if<!std::is_void<Ret>::value, std::shared_ptr<utils::Future<Ret>>>::type callFunctionWithCallback(
const std::string & func,
const std::function<
void(
void)> & callback, args... B) {
120 return _manager->callFunction<Ret>(func, callback, B...);
127 typename std::enable_if<std::is_pointer<T>::value>::type setGlobalVariable(
const std::string & name, T value) {
128 _manager->setGlobalVariable(name, value);
135 void resetSubSystem();
138 #if ISIXE_SCRIPTING == SCRIPTING_LUA
139 modules::LuaScriptingManager * _manager;
140 #elif ISIXE_SCRIPTING == SCRIPTING_PYTHON
141 modules::PythonScriptingManager * _manager;
147 ScriptingFacade(
const ScriptingFacade &) =
delete;
152 ScriptingFacade & operator=(
const ScriptingFacade &) =
delete;
#define ISIXE_MODULES_API