Changeset 8729 for code/trunk/src/libraries/core/LuaState.h
- Timestamp:
- Jul 4, 2011, 2:47:44 AM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/libraries/core/LuaState.h
r8351 r8729 48 48 #include <vector> 49 49 #include <boost/shared_ptr.hpp> 50 #include <loki/ScopeGuard.h>51 52 #include "ToluaInterface.h"53 50 54 51 namespace orxonox // tolua_export … … 121 118 122 119 typedef std::map<std::string, int (*)(lua_State *L)> ToluaInterfaceMap; 123 static ToluaInterfaceMap toluaInterfaces_s;124 static std::vector<LuaState*> instances_s;120 static ToluaInterfaceMap& getToluaInterfaces(); 121 static std::vector<LuaState*>& getInstances(); 125 122 }; // tolua_export 123 124 125 //! Helper class that registers/unregisters tolua bindings 126 class ToluaBindingsHelper 127 { 128 public: 129 ToluaBindingsHelper(int (*function)(lua_State*), const std::string& libraryName) 130 : libraryName_(libraryName) 131 { 132 LuaState::addToluaInterface(function, libraryName_); 133 } 134 ~ToluaBindingsHelper() 135 { 136 LuaState::removeToluaInterface(libraryName_); 137 } 138 private: 139 std::string libraryName_; 140 }; 126 141 } // tolua_export 127 142
Note: See TracChangeset
for help on using the changeset viewer.