OpenMiner  0.0.1a
Voxel game engine
Classes | Functions
sol::function_detail Namespace Reference

Classes

struct  c_call_matcher
 
struct  call_indicator
 
struct  class_indicator
 
struct  functor_function
 
struct  member_function
 
struct  member_variable
 
struct  overloaded_function
 
struct  upvalue_free_function
 
struct  upvalue_member_function
 
struct  upvalue_member_variable
 
struct  upvalue_member_variable< T, readonly_wrapper< Function >, is_yielding >
 
struct  upvalue_this_member_function
 
struct  upvalue_this_member_variable
 
struct  upvalue_this_member_variable< T, readonly_wrapper< Function >, is_yielding >
 

Functions

template<typename Fx , int start = 1, bool is_yielding = false>
int call (lua_State *L)
 
int no_construction_error (lua_State *L)
 
template<typename F , F fx>
int call_wrapper_variable (std::false_type, lua_State *L)
 
template<typename R , typename V , V , typename T >
int call_set_assignable (std::false_type, T &&, lua_State *L)
 
template<typename R , typename V , V variable, typename T >
int call_set_assignable (std::true_type, lua_State *L, T &&mem)
 
template<typename R , typename V , V , typename T >
int call_set_variable (std::false_type, lua_State *L, T &&)
 
template<typename R , typename V , V variable, typename T >
int call_set_variable (std::true_type, lua_State *L, T &&mem)
 
template<typename V , V variable>
int call_wrapper_variable (std::true_type, lua_State *L)
 
template<typename F , F fx>
int call_wrapper_function (std::false_type, lua_State *L)
 
template<typename F , F fx>
int call_wrapper_function (std::true_type, lua_State *L)
 
template<typename F , F fx>
int call_wrapper_entry (lua_State *L) noexcept(meta::bind_traits< F >::is_noexcept)
 
template<typename F , F fx>
int c_call_raw (std::true_type, lua_State *L)
 
template<typename F , F fx>
int c_call_raw (std::false_type, lua_State *L)
 

Function Documentation

§ c_call_raw() [1/2]

template<typename F , F fx>
int sol::function_detail::c_call_raw ( std::true_type  ,
lua_State *  L 
)
inline
13846  {
13847  return fx(L);
13848  }

§ c_call_raw() [2/2]

template<typename F , F fx>
int sol::function_detail::c_call_raw ( std::false_type  ,
lua_State *  L 
)
inline
13851  {
13852 #ifdef __clang__
13853  return detail::trampoline(L, function_detail::call_wrapper_entry<F, fx>);
13854 #else
13855  return detail::typed_static_trampoline<decltype(&function_detail::call_wrapper_entry<F, fx>), (&function_detail::call_wrapper_entry<F, fx>)>(L);
13856 #endif // fuck you clang :c
13857  }
int trampoline(lua_State *L, Fx &&f, Args &&... args)
Definition: sol.hpp:5946

§ call()

template<typename Fx , int start = 1, bool is_yielding = false>
int sol::function_detail::call ( lua_State *  L)
inline
12872  {
12873  Fx& fx = stack::get<user<Fx>>(L, upvalue_index(start));
12874  int nr = fx(L);
12875  if (is_yielding) {
12876  return lua_yield(L, nr);
12877  }
12878  else {
12879  return nr;
12880  }
12881  }

§ call_set_assignable() [1/2]

template<typename R , typename V , V , typename T >
int sol::function_detail::call_set_assignable ( std::false_type  ,
T &&  ,
lua_State *  L 
)
inline
13782  {
13783  return luaL_error(L, "cannot write to this type: copy assignment/constructor not available");
13784  }

§ call_set_assignable() [2/2]

template<typename R , typename V , V variable, typename T >
int sol::function_detail::call_set_assignable ( std::true_type  ,
lua_State *  L,
T &&  mem 
)
inline
13787  {
13788  (mem.*variable) = stack::get<R>(L, 2);
13789  return 0;
13790  }

§ call_set_variable() [1/2]

template<typename R , typename V , V , typename T >
int sol::function_detail::call_set_variable ( std::false_type  ,
lua_State *  L,
T &&   
)
inline
13793  {
13794  return luaL_error(L, "cannot write to a const variable");
13795  }

§ call_set_variable() [2/2]

template<typename R , typename V , V variable, typename T >
int sol::function_detail::call_set_variable ( std::true_type  ,
lua_State *  L,
T &&  mem 
)
inline
13798  {
13799  return call_set_assignable<R, V, variable>(std::is_assignable<std::add_lvalue_reference_t<R>, R>(), L, std::forward<T>(mem));
13800  }

§ call_wrapper_entry()

template<typename F , F fx>
int sol::function_detail::call_wrapper_entry ( lua_State *  L)
noexcept
13832  {
13833  return call_wrapper_function<F, fx>(std::is_member_function_pointer<meta::unqualified_t<F>>(), L);
13834  }

§ call_wrapper_function() [1/2]

template<typename F , F fx>
int sol::function_detail::call_wrapper_function ( std::false_type  ,
lua_State *  L 
)
inline
13822  {
13823  return call_wrapper_variable<F, fx>(std::is_member_object_pointer<F>(), L);
13824  }

§ call_wrapper_function() [2/2]

template<typename F , F fx>
int sol::function_detail::call_wrapper_function ( std::true_type  ,
lua_State *  L 
)
inline
13827  {
13828  return call_detail::call_wrapped<void, false, false>(L, fx);
13829  }

§ call_wrapper_variable() [1/2]

template<typename F , F fx>
int sol::function_detail::call_wrapper_variable ( std::false_type  ,
lua_State *  L 
)
inline
13774  {
13775  typedef meta::bind_traits<meta::unqualified_t<F>> traits_type;
13776  typedef typename traits_type::args_list args_list;
13777  typedef meta::tuple_types<typename traits_type::return_type> return_type;
13778  return stack::call_into_lua(return_type(), args_list(), L, 1, fx);
13779  }
int call_into_lua(types< Ret0, Ret... >, types< Args... > ta, lua_State *L, int start, Fx &&fx, FxArgs &&... fxargs)
Definition: sol.hpp:11855

§ call_wrapper_variable() [2/2]

template<typename V , V variable>
int sol::function_detail::call_wrapper_variable ( std::true_type  ,
lua_State *  L 
)
inline
13803  {
13804  typedef meta::bind_traits<meta::unqualified_t<V>> traits_type;
13805  typedef typename traits_type::object_type T;
13806  typedef typename traits_type::return_type R;
13807  auto& mem = stack::get<T>(L, 1);
13808  switch (lua_gettop(L)) {
13809  case 1: {
13810  decltype(auto) r = (mem.*variable);
13811  stack::push_reference(L, std::forward<decltype(r)>(r));
13812  return 1;
13813  }
13814  case 2:
13815  return call_set_variable<R, V, variable>(meta::neg<std::is_const<R>>(), L, mem);
13816  default:
13817  return luaL_error(L, "incorrect number of arguments to member variable function call");
13818  }
13819  }
int call(lua_State *L)
Definition: sol.hpp:12872
int push_reference(lua_State *L, Arg &&arg, Args &&... args)
Definition: sol.hpp:7786
boolean<!T::value > neg
Definition: sol.hpp:1293
int call_set_variable(std::true_type, lua_State *L, T &&mem)
Definition: sol.hpp:13798
unsafe_function function
Definition: sol.hpp:323

§ no_construction_error()

int sol::function_detail::no_construction_error ( lua_State *  L)
inline
13088  {
13089  return luaL_error(L, "sol: cannot call this constructor (tagged as non-constructible)");
13090  }