OpenMiner  0.0.1a
Voxel game engine
Static Public Member Functions | List of all members
sol::stack::getter< this_environment > Struct Template Reference

#include <sol.hpp>

Static Public Member Functions

static this_environment get (lua_State *L, int, record &tracking)
 

Member Function Documentation

§ get()

static this_environment sol::stack::getter< this_environment >::get ( lua_State *  L,
int  ,
record tracking 
)
inlinestatic
20748  {
20749  tracking.use(0);
20750  lua_Debug info;
20751  // Level 0 means current function (this C function, which may or may not be useful for us?)
20752  // Level 1 means next call frame up the stack. (Can be nothing if function called directly from C++ with lua_p/call)
20753  int pre_stack_size = lua_gettop(L);
20754  if (lua_getstack(L, 1, &info) != 1) {
20755  if (lua_getstack(L, 0, &info) != 1) {
20756  lua_settop(L, pre_stack_size);
20757  return this_environment();
20758  }
20759  }
20760  if (lua_getinfo(L, "f", &info) == 0) {
20761  lua_settop(L, pre_stack_size);
20762  return this_environment();
20763  }
20764 
20765  stack_reference f(L, -1);
20766  environment env(env_key, f);
20767  if (!env.valid()) {
20768  lua_settop(L, pre_stack_size);
20769  return this_environment();
20770  }
20771  return this_environment(std::move(env));
20772  }
const env_t env_key
Definition: sol.hpp:4703
basic_environment< reference > environment
Definition: sol.hpp:299

The documentation for this struct was generated from the following file: