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

Namespaces

 overload_detail
 

Classes

struct  agnostic_lua_call_wrapper
 
struct  agnostic_lua_call_wrapper< bases< Args... >, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  agnostic_lua_call_wrapper< lua_CFunction, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  agnostic_lua_call_wrapper< lua_CFunction_ref, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  agnostic_lua_call_wrapper< no_construction, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  agnostic_lua_call_wrapper< no_prop, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  agnostic_lua_call_wrapper< std::reference_wrapper< T >, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  agnostic_lua_call_wrapper< var_wrapper< T >, false, is_variable, checked, boost, clean_stack, C >
 
struct  agnostic_lua_call_wrapper< var_wrapper< T >, true, is_variable, checked, boost, clean_stack, C >
 
struct  constructor_match
 
struct  is_var_bind
 
struct  is_var_bind< filter_wrapper< F, Filters... > >
 
struct  is_var_bind< no_prop >
 
struct  is_var_bind< property_wrapper< R, W > >
 
struct  is_var_bind< readonly_wrapper< T > >
 
struct  is_var_bind< T, std::enable_if_t< std::is_member_object_pointer< T >::value > >
 
struct  is_var_bind< var_wrapper< T > >
 
struct  lua_call_wrapper
 
struct  lua_call_wrapper< T, constructor_list< Args... >, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  lua_call_wrapper< T, constructor_wrapper< Cxs... >, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  lua_call_wrapper< T, destructor_wrapper< Fx >, is_index, is_variable, checked, boost, clean_stack, std::enable_if_t< std::is_void< Fx >::value > >
 
struct  lua_call_wrapper< T, destructor_wrapper< Fx >, is_index, is_variable, checked, boost, clean_stack, std::enable_if_t<!std::is_void< Fx >::value > >
 
struct  lua_call_wrapper< T, F, false, is_variable, checked, boost, clean_stack, std::enable_if_t< std::is_member_object_pointer< F >::value > >
 
struct  lua_call_wrapper< T, F, is_index, is_variable, checked, boost, clean_stack, std::enable_if_t< std::is_member_function_pointer< F >::value > >
 
struct  lua_call_wrapper< T, F, true, is_variable, checked, boost, clean_stack, std::enable_if_t< std::is_member_object_pointer< F >::value > >
 
struct  lua_call_wrapper< T, factory_wrapper< Fs... >, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  lua_call_wrapper< T, filter_wrapper< F, Filters... >, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  lua_call_wrapper< T, function_arguments< Sig, P >, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  lua_call_wrapper< T, overload_set< Fs... >, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  lua_call_wrapper< T, property_wrapper< R, W >, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  lua_call_wrapper< T, protect_t< V >, is_index, is_variable, checked, boost, clean_stack, C >
 
struct  lua_call_wrapper< T, readonly_wrapper< F >, false, is_variable, checked, boost, clean_stack, C >
 
struct  lua_call_wrapper< T, readonly_wrapper< F >, true, is_variable, checked, boost, clean_stack, C >
 
struct  void_call
 
struct  void_call< T, types< Args... > >
 

Functions

template<typename R , typename W >
auto & pick (std::true_type, property_wrapper< R, W > &f)
 
template<typename R , typename W >
auto & pick (std::false_type, property_wrapper< R, W > &f)
 
template<typename... Functions, typename Match , typename... Args>
int overload_match_arity (Match &&matchfx, lua_State *L, int fxarity, int start, Args &&... args)
 
template<typename... Functions, typename Match , typename... Args>
int overload_match (Match &&matchfx, lua_State *L, int start, Args &&... args)
 
template<typename T , typename... TypeLists, typename Match , typename... Args>
int construct_match (Match &&matchfx, lua_State *L, int fxarity, int start, Args &&... args)
 
template<typename T , bool checked, bool clean_stack, typename... TypeLists>
int construct_trampolined (lua_State *L)
 
template<typename T , bool checked, bool clean_stack, typename... TypeLists>
int construct (lua_State *L)
 
template<typename T , bool is_index, bool is_variable, int boost = 0, bool checked = detail::default_safe_function_calls, bool clean_stack = true, typename Fx , typename... Args>
int call_wrapped (lua_State *L, Fx &&fx, Args &&... args)
 
template<typename T , bool is_index, bool is_variable, typename F , int start = 1, bool checked = detail::default_safe_function_calls, bool clean_stack = true>
int call_user (lua_State *L)
 

Function Documentation

§ call_user()

template<typename T , bool is_index, bool is_variable, typename F , int start = 1, bool checked = detail::default_safe_function_calls, bool clean_stack = true>
int sol::call_detail::call_user ( lua_State *  L)
inline
13734  {
13735  auto& fx = stack::unqualified_get<user<F>>(L, upvalue_index(start));
13736  return call_wrapped<T, is_index, is_variable, 0, checked, clean_stack>(L, fx);
13737  }

§ call_wrapped()

template<typename T , bool is_index, bool is_variable, int boost = 0, bool checked = detail::default_safe_function_calls, bool clean_stack = true, typename Fx , typename... Args>
int sol::call_detail::call_wrapped ( lua_State *  L,
Fx &&  fx,
Args &&...  args 
)
inline
13729  {
13730  return lua_call_wrapper<T, meta::unqualified_t<Fx>, is_index, is_variable, checked, boost, clean_stack>{}.call(L, std::forward<Fx>(fx), std::forward<Args>(args)...);
13731  }

§ construct()

template<typename T , bool checked, bool clean_stack, typename... TypeLists>
int sol::call_detail::construct ( lua_State *  L)
inline
13232  {
13233  return detail::static_trampoline<&construct_trampolined<T, checked, clean_stack, TypeLists...>>(L);
13234  }
int static_trampoline(lua_State *L)
Definition: sol.hpp:5894
int construct_trampolined(lua_State *L)
Definition: sol.hpp:13212

§ construct_match()

template<typename T , typename... TypeLists, typename Match , typename... Args>
int sol::call_detail::construct_match ( Match &&  matchfx,
lua_State *  L,
int  fxarity,
int  start,
Args &&...  args 
)
inline
13206  {
13207  // use same overload resolution matching as all other parts of the framework
13208  return overload_match_arity<decltype(void_call<T, TypeLists>::call)...>(std::forward<Match>(matchfx), L, fxarity, start, std::forward<Args>(args)...);
13209  }
int call(lua_State *L)
Definition: sol.hpp:12872

§ construct_trampolined()

template<typename T , bool checked, bool clean_stack, typename... TypeLists>
int sol::call_detail::construct_trampolined ( lua_State *  L)
inline
13212  {
13213  static const auto& meta = usertype_traits<T>::metatable();
13214  int argcount = lua_gettop(L);
13215  call_syntax syntax = argcount > 0 ? stack::get_call_syntax(L, usertype_traits<T>::user_metatable(), 1) : call_syntax::dot;
13216  argcount -= static_cast<int>(syntax);
13217 
13218  T* obj = detail::usertype_allocate<T>(L);
13219  reference userdataref(L, -1);
13220  userdataref.pop();
13221 
13222  construct_match<T, TypeLists...>(constructor_match<T, checked, clean_stack>(obj), L, argcount, 1 + static_cast<int>(syntax));
13223 
13224  userdataref.push();
13225  stack::stack_detail::undefined_metatable<T> umf(L, &meta[0]);
13226  umf();
13227 
13228  return 1;
13229  }
call_syntax
Definition: sol.hpp:5133
basic_reference< false > reference
Definition: sol.hpp:267
call_syntax get_call_syntax(lua_State *L, const string_view &key, int index)
Definition: sol.hpp:11877
int construct_match(Match &&matchfx, lua_State *L, int fxarity, int start, Args &&... args)
Definition: sol.hpp:13206

§ overload_match()

template<typename... Functions, typename Match , typename... Args>
int sol::call_detail::overload_match ( Match &&  matchfx,
lua_State *  L,
int  start,
Args &&...  args 
)
inline
13200  {
13201  int fxarity = lua_gettop(L) - (start - 1);
13202  return overload_match_arity<Functions...>(std::forward<Match>(matchfx), L, fxarity, start, std::forward<Args>(args)...);
13203  }
int overload_match_arity(Match &&matchfx, lua_State *L, int fxarity, int start, Args &&... args)
Definition: sol.hpp:13195

§ overload_match_arity()

template<typename... Functions, typename Match , typename... Args>
int sol::call_detail::overload_match_arity ( Match &&  matchfx,
lua_State *  L,
int  fxarity,
int  start,
Args &&...  args 
)
inline
13195  {
13196  return overload_detail::overload_match_arity_single(types<Functions...>(), std::make_index_sequence<sizeof...(Functions)>(), std::index_sequence<>(), std::forward<Match>(matchfx), L, fxarity, start, std::forward<Args>(args)...);
13197  }
int overload_match_arity_single(types< Fx, Fx1, Fxs... >, std::index_sequence< I, I1, In... >, std::index_sequence< M... >, Match &&matchfx, lua_State *L, int fxarity, int start, Args &&... args)
Definition: sol.hpp:13175

§ pick() [1/2]

template<typename R , typename W >
auto& sol::call_detail::pick ( std::true_type  ,
property_wrapper< R, W > &  f 
)
inline
13096  {
13097  return f.read;
13098  }

§ pick() [2/2]

template<typename R , typename W >
auto& sol::call_detail::pick ( std::false_type  ,
property_wrapper< R, W > &  f 
)
inline
13101  {
13102  return f.write;
13103  }