#ifndef LUA_WRAPER_H #define LUA_WRAPER_H #include #include #include #include #include extern "C" { #include "lua.h" #include "lauxlib.h" #include "lualib.h" } class LuaDelegate{ public: LuaDelegate(); int DoFile(QString); void Stop(); int DoString(QString); void pushstack() { // const std::type_info &t1 = std::bad_typeid(arg1); // std::cout << t1.name() << std::endl; } //单参数模板 template void pushstack(T arg1,Types... rest) { const std::type_info &t1 = typeid(arg1); qDebug() <//类的成员函数是模板 void CallFuntion(QString name,T... para){ int i = lua_getglobal(mVM,name.toStdString().c_str()); if(i < 0){ return ; } pushstack(para...); } void OnDataRecv(){ } ~LuaDelegate(); private: lua_State *mVM; QString mFile; }; void TestLua(); #endif // LUA_WRAPER_H