Changeset 3370 for code/trunk/src/core/LuaBind.h
- Timestamp:
- Jul 30, 2009, 2:10:44 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/resource (added) merged: 3328,3336-3340,3342-3350,3352-3366
- Property svn:mergeinfo changed
-
code/trunk/src/core/LuaBind.h
r3196 r3370 40 40 #include <cassert> 41 41 #include <string> 42 #include <vector> 42 43 extern "C" { 43 44 #include <lua.h> 44 45 } 45 46 47 #include "util/Singleton.h" 48 46 49 // tolua_begin 47 50 namespace orxonox 48 51 { 49 class _CoreExport LuaBind 52 class _CoreExport LuaBind : public Singleton<LuaBind> 50 53 { 54 // tolua_end 55 friend class Singleton<LuaBind>; 51 56 52 // tolua_end53 57 struct LoadS { 54 58 const char *s; … … 58 62 public: 59 63 LuaBind(); 60 inline ~LuaBind() { assert(singletonRef_s); LuaBind::singletonRef_s = NULL; };64 ~LuaBind(); 61 65 62 inline static LuaBind& getInstance() { assert(singletonRef_s); return *LuaBind::singletonRef_s; } // tolua_export66 static LuaBind& getInstance() { return Singleton<LuaBind>::getInstance(); } // tolua_export 63 67 64 68 void loadFile(const std::string& filename, bool luaTags); … … 83 87 { this->includePath_ = includepath; } 84 88 89 void addToluaInterface(int (*function)(lua_State*), const std::string& name); 90 void openToluaInterfaces(lua_State* state); 91 void closeToluaInterfaces(lua_State* state); 92 85 93 private: 86 static LuaBind* singleton Ref_s;94 static LuaBind* singletonPtr_s; 87 95 88 96 std::string luaSource_; … … 91 99 bool isRunning_; 92 100 std::string includePath_; 101 std::vector<std::pair<std::string, int (*)(lua_State *L)> > toluaInterfaces_; 93 102 94 103 }; // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.