Changeset 10916 for code/branches/cpp11_v2/src/libraries/core/LuaState.cc
- Timestamp:
- Dec 2, 2015, 11:22:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/LuaState.cc
r10852 r10916 326 326 /*static*/ bool LuaState::addToluaInterface(int (*function)(lua_State*), const std::string& name) 327 327 { 328 for (const auto & interface: getToluaInterfaces())329 { 330 if ( interface.first == name || interface.second == function)328 for (const auto& mapEntry : getToluaInterfaces()) 329 { 330 if (mapEntry.first == name || mapEntry.second == function) 331 331 { 332 332 orxout(internal_warning, context::lua) << "Trying to add a Tolua interface with the same name or function." << endl; … … 337 337 338 338 // Open interface in all LuaStates 339 for ( const auto &state : getInstances())339 for (LuaState* state : getInstances()) 340 340 (*function)(state->luaState_); 341 341 … … 354 354 355 355 // Close interface in all LuaStates 356 for ( const auto &state : getInstances())356 for (LuaState* state : getInstances()) 357 357 { 358 358 lua_pushnil(state->luaState_); … … 369 369 /*static*/ void LuaState::openToluaInterfaces(lua_State* state) 370 370 { 371 for (const auto & interface: getToluaInterfaces())372 ( interface.second)(state);371 for (const auto& mapEntry : getToluaInterfaces()) 372 (mapEntry.second)(state); 373 373 } 374 374 375 375 /*static*/ void LuaState::closeToluaInterfaces(lua_State* state) 376 376 { 377 for (const auto & interface: getToluaInterfaces())377 for (const auto& mapEntry : getToluaInterfaces()) 378 378 { 379 379 lua_pushnil(state); 380 lua_setglobal(state, interface.first.c_str());380 lua_setglobal(state, mapEntry.first.c_str()); 381 381 } 382 382 }
Note: See TracChangeset
for help on using the changeset viewer.