OpenMiner  0.0.1a
Voxel game engine
Public Member Functions | Public Attributes | List of all members
sol::stack::stack_detail::metatable_setup< T, is_shim > Struct Template Reference

#include <sol.hpp>

Public Member Functions

 metatable_setup (lua_State *L)
 
void operator() ()
 

Public Attributes

lua_State * L
 

Constructor & Destructor Documentation

§ metatable_setup()

template<typename T, bool is_shim = false>
sol::stack::stack_detail::metatable_setup< T, is_shim >::metatable_setup ( lua_State *  L)
inline
17986  : L(L) {
17987  }
lua_State * L
Definition: sol.hpp:17983

Member Function Documentation

§ operator()()

template<typename T, bool is_shim = false>
void sol::stack::stack_detail::metatable_setup< T, is_shim >::operator() ( )
inline
17989  {
17990  typedef container_usertype_metatable<std::conditional_t<is_shim,
17991  as_container_t<std::remove_pointer_t<T>>,
17992  std::remove_pointer_t<T>>>
17993  meta_cumt;
17994  static const char* metakey = is_shim ? &usertype_traits<as_container_t<std::remove_pointer_t<T>>>::metatable()[0] : &usertype_traits<T>::metatable()[0];
17995  static const std::array<luaL_Reg, 19> reg = { {
17996  { "__pairs", &meta_cumt::pairs_call },
17997  { "__ipairs", &meta_cumt::ipairs_call },
17998  { "__len", &meta_cumt::length_call },
17999  { "__index", &meta_cumt::index_call },
18000  { "__newindex", &meta_cumt::new_index_call },
18001  { "pairs", &meta_cumt::pairs_call },
18002  { "next", &meta_cumt::next_call },
18003  { "at", &meta_cumt::at_call },
18004  { "get", &meta_cumt::get_call },
18005  { "set", &meta_cumt::set_call },
18006  { "size", &meta_cumt::length_call },
18007  { "empty", &meta_cumt::empty_call },
18008  { "clear", &meta_cumt::clear_call },
18009  { "insert", &meta_cumt::insert_call },
18010  { "add", &meta_cumt::add_call },
18011  { "find", &meta_cumt::find_call },
18012  { "erase", &meta_cumt::erase_call },
18013  std::is_pointer<T>::value ? luaL_Reg{ nullptr, nullptr } : luaL_Reg{ "__gc", &detail::usertype_alloc_destruct<T> },
18014  { nullptr, nullptr }
18015  } };
18016 
18017  if (luaL_newmetatable(L, metakey) == 1) {
18018  luaL_setfuncs(L, reg.data(), 0);
18019  }
18020  lua_setmetatable(L, -2);
18021  }
static const std::string & metatable()
Definition: sol.hpp:6173
lua_State * L
Definition: sol.hpp:17983

Member Data Documentation

§ L

template<typename T, bool is_shim = false>
lua_State* sol::stack::stack_detail::metatable_setup< T, is_shim >::L

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