OpenMiner  0.0.1a
Voxel game engine
Public Types | Public Member Functions | Static Public Member Functions | List of all members
sol::function_detail::upvalue_member_function< T, Function, is_yielding > Struct Template Reference

#include <sol.hpp>

Public Types

typedef std::remove_pointer_t< std::decay_t< Function > > function_type
 
typedef lua_bind_traits< function_typetraits_type
 

Public Member Functions

int operator() (lua_State *L)
 

Static Public Member Functions

static int real_call (lua_State *L) noexcept(traits_type::is_noexcept)
 
static int call (lua_State *L)
 

Member Typedef Documentation

§ function_type

template<typename T, typename Function, bool is_yielding>
typedef std::remove_pointer_t<std::decay_t<Function> > sol::function_detail::upvalue_member_function< T, Function, is_yielding >::function_type

§ traits_type

template<typename T, typename Function, bool is_yielding>
typedef lua_bind_traits<function_type> sol::function_detail::upvalue_member_function< T, Function, is_yielding >::traits_type

Member Function Documentation

§ call()

template<typename T, typename Function, bool is_yielding>
static int sol::function_detail::upvalue_member_function< T, Function, is_yielding >::call ( lua_State *  L)
inlinestatic
13943  {
13944  int nr = detail::typed_static_trampoline<decltype(&real_call), (&real_call)>(L);
13945  if (is_yielding) {
13946  return lua_yield(L, nr);
13947  }
13948  else {
13949  return nr;
13950  }
13951  }

§ operator()()

template<typename T, typename Function, bool is_yielding>
int sol::function_detail::upvalue_member_function< T, Function, is_yielding >::operator() ( lua_State *  L)
inline
13953  {
13954  return call(L);
13955  }
static int call(lua_State *L)
Definition: sol.hpp:13943

§ real_call()

template<typename T, typename Function, bool is_yielding>
static int sol::function_detail::upvalue_member_function< T, Function, is_yielding >::real_call ( lua_State *  L)
inlinestaticnoexcept
13930  {
13931  // Layout:
13932  // idx 1...n: verbatim data of member function pointer
13933  // idx n + 1: is the object's void pointer
13934  // We don't need to store the size, because the other side is templated
13935  // with the same member function pointer type
13936  auto memberdata = stack::stack_detail::get_as_upvalues<function_type>(L);
13937  auto objdata = stack::stack_detail::get_as_upvalues<T*>(L, memberdata.second);
13938  function_type& memfx = memberdata.first;
13939  auto& item = *objdata.first;
13940  return call_detail::call_wrapped<T, true, false, -1>(L, memfx, item);
13941  }
std::remove_pointer_t< std::decay_t< Function > > function_type
Definition: sol.hpp:13927
int call_wrapped(lua_State *L, Fx &&fx, Args &&... args)
Definition: sol.hpp:13729

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