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

Namespaces

 stack_detail
 

Classes

struct  check_getter
 
struct  check_getter< lua_thread_state >
 
struct  check_getter< T, std::enable_if_t< is_lua_reference< T >::value > >
 
struct  check_getter< T, std::enable_if_t< std::is_enum< T >::value &&!meta::any_same< T, meta_function, type >::value > >
 
struct  check_getter< T, std::enable_if_t< std::is_floating_point< T >::value > >
 
struct  check_getter< T, std::enable_if_t< std::is_integral< T >::value &&lua_type_of< T >::value==type::number > >
 
struct  checker
 
struct  checker< as_container_t< T >, type::userdata, C >
 
struct  checker< basic_environment< E >, type::poly, C >
 
struct  checker< basic_userdata< B >, type::userdata, C >
 
struct  checker< c_closure, type::function, C >
 
struct  checker< detail::as_pointer_tag< T >, type::userdata, C >
 
struct  checker< detail::as_value_tag< T >, type::userdata, C >
 
struct  checker< detail::non_lua_nil_t, type::poly, C >
 
struct  checker< env_t, type::poly, C >
 
struct  checker< lua_CFunction, type::function, C >
 
struct  checker< lua_nil_t, expected, C >
 
struct  checker< metatable_t, expected, C >
 
struct  checker< non_null< T >, type::userdata, C >
 
struct  checker< nullopt_t, expected, C >
 
struct  checker< optional< T >, type::poly, C >
 
struct  checker< std::pair< A, B >, type::poly, C >
 
struct  checker< std::reference_wrapper< T >, type::userdata, C >
 
struct  checker< std::remove_pointer_t< lua_CFunction >, type::function, C >
 
struct  checker< std::tuple< Args... >, type::poly, C >
 
struct  checker< T *, type::userdata, C >
 
struct  checker< T, type::function, C >
 
struct  checker< T, type::lightuserdata, C >
 
struct  checker< T, type::number, std::enable_if_t< std::is_floating_point< T >::value > >
 
struct  checker< T, type::number, std::enable_if_t< std::is_integral< T >::value > >
 
struct  checker< T, type::poly, C >
 
struct  checker< T, type::table, C >
 
struct  checker< T, type::userdata, C >
 
struct  checker< this_environment, type::poly, C >
 
struct  checker< this_main_state, type::poly, C >
 
struct  checker< this_state, type::poly, C >
 
struct  checker< type, type::poly, C >
 
struct  checker< user< T >, type::userdata, C >
 
struct  checker< userdata_value, type::userdata, C >
 
struct  checker< variadic_args, type::poly, C >
 
struct  checker< X, type::userdata, std::enable_if_t< is_unique_usertype< X >::value > >
 
struct  extensible
 
struct  field_getter
 
struct  field_getter< env_t, b, raw, C >
 
struct  field_getter< metatable_t, b, raw, C >
 
struct  field_getter< std::pair< A, B >, b, raw, C >
 
struct  field_getter< std::tuple< Args... >, b, raw, C >
 
struct  field_getter< T, false, false, std::enable_if_t< meta::is_c_str< T >::value > >
 
struct  field_getter< T, false, true, std::enable_if_t< std::is_integral< T >::value &&!std::is_same< bool, T >::value > >
 
struct  field_getter< T, global, true, C >
 
struct  field_getter< T, true, raw, std::enable_if_t< meta::is_c_str< T >::value > >
 
struct  field_setter
 
struct  field_setter< metatable_t, b, raw, C >
 
struct  field_setter< std::pair< A, B >, b, raw, C >
 
struct  field_setter< std::tuple< Args... >, b, raw, C >
 
struct  field_setter< T, b, true, C >
 
struct  field_setter< T, false, false, std::enable_if_t< meta::is_c_str< T >::value > >
 
struct  field_setter< T, false, true, std::enable_if_t< std::is_integral< T >::value &&!std::is_same< bool, T >::value > >
 
struct  field_setter< T, true, raw, std::enable_if_t< meta::is_c_str< T >::value > >
 
struct  getter
 
struct  getter< as_container_t< T > * >
 
struct  getter< as_container_t< T > >
 
struct  getter< as_table_t< std::forward_list< T, Al > > >
 
struct  getter< as_table_t< T > >
 
struct  getter< basic_string_view< char, Traits > >
 
struct  getter< bool >
 
struct  getter< c_closure >
 
struct  getter< char >
 
struct  getter< char16_t >
 
struct  getter< char32_t >
 
struct  getter< const char * >
 
struct  getter< const void * >
 
struct  getter< detail::as_pointer_tag< T > >
 
struct  getter< detail::as_value_tag< T > >
 
struct  getter< env_t >
 
struct  getter< error >
 
struct  getter< light< T > >
 
struct  getter< lightuserdata_value >
 
struct  getter< lua_CFunction >
 
struct  getter< lua_nil_t >
 
struct  getter< lua_thread_state >
 
struct  getter< meta_function >
 
struct  getter< metatable_t >
 
struct  getter< nested< T >, std::enable_if_t< meta::all< is_container< T >, meta::has_key_value_pair< meta::unqualified_t< T > > >::value > >
 
struct  getter< nested< T >, std::enable_if_t< meta::all< is_container< T >, meta::neg< meta::has_key_value_pair< meta::unqualified_t< T > > > >::value > >
 
struct  getter< nested< T >, std::enable_if_t<!is_container< T >::value > >
 
struct  getter< non_null< T * > >
 
struct  getter< nullopt_t >
 
struct  getter< optional< T > >
 
struct  getter< stack_proxy >
 
struct  getter< stack_proxy_base >
 
struct  getter< std::basic_string< char16_t, Traits, Al > >
 
struct  getter< std::basic_string< char32_t, Traits, Al > >
 
struct  getter< std::basic_string< wchar_t, Traits, Al > >
 
struct  getter< std::function< Signature > >
 
struct  getter< std::nullptr_t >
 
struct  getter< std::pair< A, B > >
 
struct  getter< std::reference_wrapper< T > >
 
struct  getter< std::string >
 
struct  getter< std::tuple< Tn... > >
 
struct  getter< T & >
 
struct  getter< T * >
 
struct  getter< T, std::enable_if_t< is_lua_reference< T >::value > >
 
struct  getter< T, std::enable_if_t< is_unique_usertype< T >::value > >
 
struct  getter< T, std::enable_if_t< std::is_enum< T >::value > >
 
struct  getter< T, std::enable_if_t< std::is_floating_point< T >::value > >
 
struct  getter< T, std::enable_if_t< std::is_integral< T >::value > >
 
struct  getter< this_environment >
 
struct  getter< this_main_state >
 
struct  getter< this_state >
 
struct  getter< type >
 
struct  getter< user< T * > >
 
struct  getter< user< T > >
 
struct  getter< userdata_value >
 
struct  getter< variadic_args >
 
struct  getter< void * >
 
struct  getter< wchar_t >
 
struct  popper
 
struct  popper< T, std::enable_if_t< is_stack_based< meta::unqualified_t< T > >::value > >
 
struct  probe
 
struct  probe_field_getter
 
struct  probe_field_getter< std::pair< A, B >, P, b, raw, C >
 
struct  probe_field_getter< std::tuple< Args... >, P, b, raw, C >
 
struct  push_popper
 
struct  push_popper< false, T, std::enable_if_t< std::is_base_of< stack_reference, meta::unqualified_t< T > >::value > >
 
struct  push_popper< true, T, C >
 
struct  push_popper_at
 
struct  push_popper_n
 
struct  push_popper_n< true >
 
struct  pusher
 
struct  pusher< absolute_index >
 
struct  pusher< as_args_t< T > >
 
struct  pusher< as_container_t< T * > >
 
struct  pusher< as_container_t< T > >
 
struct  pusher< as_returns_t< T > >
 
struct  pusher< as_table_t< T >, std::enable_if_t< is_container< std::remove_pointer_t< meta::unwrap_unqualified_t< T > > >::value > >
 
struct  pusher< as_table_t< T >, std::enable_if_t<!is_container< std::remove_pointer_t< meta::unwrap_unqualified_t< T > > >::value > >
 
struct  pusher< basic_string_view< Ch, Traits > >
 
struct  pusher< bool >
 
struct  pusher< c_closure >
 
struct  pusher< char * >
 
struct  pusher< char >
 
struct  pusher< char16_t * >
 
struct  pusher< char16_t >
 
struct  pusher< char16_t[N]>
 
struct  pusher< char32_t * >
 
struct  pusher< char32_t >
 
struct  pusher< char32_t[N]>
 
struct  pusher< char[N]>
 
struct  pusher< closure< Arg, Args... > >
 
struct  pusher< const char * >
 
struct  pusher< const char16_t * >
 
struct  pusher< const char32_t * >
 
struct  pusher< const void * >
 
struct  pusher< const wchar_t * >
 
struct  pusher< constructor_list< L0, Lists... > >
 
struct  pusher< constructor_wrapper< F, Fxs... > >
 
struct  pusher< destructor_wrapper< Fx > >
 
struct  pusher< detail::as_pointer_tag< T > >
 
struct  pusher< detail::as_reference_tag >
 
struct  pusher< detail::as_table_tag< T > >
 
struct  pusher< detail::as_value_tag< T > >
 
struct  pusher< detail::tagged< T, constructor_list< Lists... > > >
 
struct  pusher< detail::tagged< T, constructor_wrapper< Fxs... > > >
 
struct  pusher< detail::tagged< T, destructor_wrapper< Fx > > >
 
struct  pusher< detail::tagged< T, destructor_wrapper< void > > >
 
struct  pusher< factory_wrapper< Functions... > >
 
struct  pusher< filter_wrapper< F, Filters... > >
 
struct  pusher< function_arguments< T, Args... > >
 
struct  pusher< function_sig< Sigs... > >
 
struct  pusher< light< T > >
 
struct  pusher< lightuserdata_value >
 
struct  pusher< lua_CFunction >
 
struct  pusher< lua_nil_t >
 
struct  pusher< lua_thread_state >
 
struct  pusher< meta_function >
 
struct  pusher< metatable_t >
 
struct  pusher< nested< T >, std::enable_if_t< is_container< std::remove_pointer_t< meta::unwrap_unqualified_t< T > > >::value > >
 
struct  pusher< nested< T >, std::enable_if_t<!is_container< std::remove_pointer_t< meta::unwrap_unqualified_t< T > > >::value > >
 
struct  pusher< new_table >
 
struct  pusher< no_construction >
 
struct  pusher< nullopt_t >
 
struct  pusher< optional< O > >
 
struct  pusher< overload_set< Functions... > >
 
struct  pusher< property_wrapper< F, G >, std::enable_if_t<!std::is_void< F >::value &&!std::is_void< G >::value > >
 
struct  pusher< property_wrapper< F, void > >
 
struct  pusher< property_wrapper< void, F > >
 
struct  pusher< protect_t< T > >
 
struct  pusher< protected_function_result >
 
struct  pusher< proxy< Table, Key > >
 
struct  pusher< raw_index >
 
struct  pusher< ref_index >
 
struct  pusher< Signature, std::enable_if_t< meta::all< std::is_function< std::remove_pointer_t< Signature > >, meta::neg< std::is_same< Signature, lua_CFunction > >, meta::neg< std::is_same< Signature, std::remove_pointer_t< lua_CFunction > > > >::value > >
 
struct  pusher< Signature, std::enable_if_t< std::is_member_pointer< Signature >::value > >
 
struct  pusher< simple_usertype_metatable< T > >
 
struct  pusher< stack_count >
 
struct  pusher< stack_proxy >
 
struct  pusher< stack_proxy_base >
 
struct  pusher< std::basic_string< Ch, Traits, Al >, std::enable_if_t<!std::is_same< Ch, char >::value > >
 
struct  pusher< std::basic_string< char, Traits, Al > >
 
struct  pusher< std::function< Signature > >
 
struct  pusher< std::initializer_list< T > >
 
struct  pusher< std::nullptr_t >
 
struct  pusher< std::pair< A, B > >
 
struct  pusher< std::reference_wrapper< T > >
 
struct  pusher< std::remove_pointer_t< lua_CFunction > >
 
struct  pusher< std::tuple< Args... > >
 
struct  pusher< T *, meta::disable_if_t< meta::any< is_container< meta::unqualified_t< T > >, std::is_function< meta::unqualified_t< T > >, is_lua_reference< meta::unqualified_t< T > > >::value > >
 
struct  pusher< T *, std::enable_if_t< meta::all< is_container< meta::unqualified_t< T > >, meta::neg< is_lua_reference< meta::unqualified_t< T > > > >::value > >
 
struct  pusher< T, std::enable_if_t< is_lua_reference< T >::value > >
 
struct  pusher< T, std::enable_if_t< is_unique_usertype< T >::value > >
 
struct  pusher< T, std::enable_if_t< meta::all< is_container< meta::unqualified_t< T > >, meta::neg< is_lua_reference< meta::unqualified_t< T > > > >::value > >
 
struct  pusher< T, std::enable_if_t< std::is_enum< T >::value > >
 
struct  pusher< T, std::enable_if_t< std::is_floating_point< T >::value > >
 
struct  pusher< T, std::enable_if_t< std::is_integral< T >::value > >
 
struct  pusher< this_main_state >
 
struct  pusher< this_state >
 
struct  pusher< unsafe_function_result >
 
struct  pusher< user< T > >
 
struct  pusher< userdata_value >
 
struct  pusher< usertype< T > >
 
struct  pusher< usertype_metatable< T, std::index_sequence< I... >, Args... > >
 
struct  pusher< var_wrapper< T > >
 
struct  pusher< variadic_args >
 
struct  pusher< variadic_results >
 
struct  pusher< void * >
 
struct  pusher< wchar_t * >
 
struct  pusher< wchar_t >
 
struct  pusher< wchar_t[N]>
 
struct  pusher< yielding_t< T > >
 
struct  qualified_check_getter
 
struct  qualified_checker
 
struct  qualified_checker< X, type::userdata, std::enable_if_t< is_container< meta::unqualified_t< X > >::value &&!std::is_reference< X >::value > >
 
struct  qualified_getter
 
struct  qualified_getter< T, std::enable_if_t< !std::is_reference< T >::value &&is_container< meta::unqualified_t< T > >::value &&std::is_default_constructible< meta::unqualified_t< T > >::value &&!is_lua_primitive< T >::value &&!is_transparent_argument< T >::value > >
 
struct  record
 
struct  userdata_checker
 
struct  userdata_getter
 
struct  userdata_getter< U >
 

Functions

void remove (lua_State *L, int rawindex, int count)
 
template<bool top_level = false, typename T >
push_popper< top_level, Tpush_pop (T &&x)
 
template<typename T >
push_popper_at push_pop_at (T &&x)
 
template<bool top_level = false>
push_popper_n< top_level > pop_n (lua_State *L, int x)
 
bool maybe_indexable (lua_State *L, int index=-1)
 
int top (lua_State *L)
 
bool is_main_thread (lua_State *L)
 
void coroutine_create_guard (lua_State *L)
 
template<typename T , typename... Args>
int push (lua_State *L, T &&t, Args &&... args)
 
template<typename T , typename Arg , typename... Args, typename = std::enable_if_t<!std::is_same<T, Arg>::value>>
int push (lua_State *L, Arg &&arg, Args &&... args)
 
template<typename T , typename... Args>
int push_reference (lua_State *L, T &&t, Args &&... args)
 
template<typename T , typename Arg , typename... Args>
int push_reference (lua_State *L, Arg &&arg, Args &&... args)
 
int multi_push (lua_State *)
 
template<typename T , typename... Args>
int multi_push (lua_State *L, T &&t, Args &&... args)
 
int multi_push_reference (lua_State *)
 
template<typename T , typename... Args>
int multi_push_reference (lua_State *L, T &&t, Args &&... args)
 
template<typename T , typename Handler >
bool check (lua_State *L, int index, Handler &&handler, record &tracking)
 
template<typename T , typename Handler >
bool check (lua_State *L, int index, Handler &&handler)
 
template<typename T >
bool check (lua_State *L, int index=-lua_size< meta::unqualified_t< T >>::value)
 
template<typename T , typename Handler >
bool unqualified_check (lua_State *L, int index, Handler &&handler, record &tracking)
 
template<typename T , typename Handler >
bool unqualified_check (lua_State *L, int index, Handler &&handler)
 
template<typename T >
bool unqualified_check (lua_State *L, int index=-lua_size< meta::unqualified_t< T >>::value)
 
template<typename T , typename Handler >
bool check_usertype (lua_State *L, int index, Handler &&handler, record &tracking)
 
template<typename T , typename Handler >
bool check_usertype (lua_State *L, int index, Handler &&handler)
 
template<typename T >
bool check_usertype (lua_State *L, int index=-lua_size< meta::unqualified_t< T >>::value)
 
template<typename T , typename Handler >
decltype(auto) unqualified_check_get (lua_State *L, int index, Handler &&handler, record &tracking)
 
template<typename T , typename Handler >
decltype(auto) unqualified_check_get (lua_State *L, int index, Handler &&handler)
 
template<typename T >
decltype(auto) unqualified_check_get (lua_State *L, int index=-lua_size< meta::unqualified_t< T >>::value)
 
template<typename T , typename Handler >
decltype(auto) check_get (lua_State *L, int index, Handler &&handler, record &tracking)
 
template<typename T , typename Handler >
decltype(auto) check_get (lua_State *L, int index, Handler &&handler)
 
template<typename T >
decltype(auto) check_get (lua_State *L, int index=-lua_size< meta::unqualified_t< T >>::value)
 
template<bool b, typename... Args, typename Handler >
bool multi_check (lua_State *L, int index, Handler &&handler, record &tracking)
 
template<bool b, typename... Args, typename Handler >
bool multi_check (lua_State *L, int index, Handler &&handler)
 
template<bool b, typename... Args>
bool multi_check (lua_State *L, int index)
 
template<typename... Args, typename Handler >
bool multi_check (lua_State *L, int index, Handler &&handler, record &tracking)
 
template<typename... Args, typename Handler >
bool multi_check (lua_State *L, int index, Handler &&handler)
 
template<typename... Args>
bool multi_check (lua_State *L, int index)
 
template<typename T >
decltype(auto) get_usertype (lua_State *L, int index, record &tracking)
 
template<typename T >
decltype(auto) get_usertype (lua_State *L, int index=-lua_size< meta::unqualified_t< T >>::value)
 
template<typename T >
decltype(auto) unqualified_get (lua_State *L, int index, record &tracking)
 
template<typename T >
decltype(auto) unqualified_get (lua_State *L, int index=-lua_size< meta::unqualified_t< T >>::value)
 
template<typename T >
decltype(auto) get (lua_State *L, int index, record &tracking)
 
template<typename T >
decltype(auto) get (lua_State *L, int index=-lua_size< meta::unqualified_t< T >>::value)
 
template<typename T >
decltype(auto) pop (lua_State *L)
 
template<bool global = false, bool raw = false, typename Key >
void get_field (lua_State *L, Key &&key)
 
template<bool global = false, bool raw = false, typename Key >
void get_field (lua_State *L, Key &&key, int tableindex)
 
template<bool global = false, typename Key >
void raw_get_field (lua_State *L, Key &&key)
 
template<bool global = false, typename Key >
void raw_get_field (lua_State *L, Key &&key, int tableindex)
 
template<bool global = false, bool raw = false, typename C = detail::non_lua_nil_t, typename Key >
probe probe_get_field (lua_State *L, Key &&key)
 
template<bool global = false, bool raw = false, typename C = detail::non_lua_nil_t, typename Key >
probe probe_get_field (lua_State *L, Key &&key, int tableindex)
 
template<bool global = false, typename C = detail::non_lua_nil_t, typename Key >
probe probe_raw_get_field (lua_State *L, Key &&key)
 
template<bool global = false, typename C = detail::non_lua_nil_t, typename Key >
probe probe_raw_get_field (lua_State *L, Key &&key, int tableindex)
 
template<bool global = false, bool raw = false, typename Key , typename Value >
void set_field (lua_State *L, Key &&key, Value &&value)
 
template<bool global = false, bool raw = false, typename Key , typename Value >
void set_field (lua_State *L, Key &&key, Value &&value, int tableindex)
 
template<bool global = false, typename Key , typename Value >
void raw_set_field (lua_State *L, Key &&key, Value &&value)
 
template<bool global = false, typename Key , typename Value >
void raw_set_field (lua_State *L, Key &&key, Value &&value, int tableindex)
 
template<typename T , typename F >
void modify_unique_usertype_as (const stack_reference &obj, F &&f)
 
template<typename F >
void modify_unique_usertype (const stack_reference &obj, F &&f)
 
int push_environment_of (lua_State *L, int index=-1)
 
template<typename T >
int push_environment_of (const T &target)
 
template<typename T >
int set_ref (lua_State *L, T &&arg, int tableindex=-2)
 
template<bool check_args = detail::default_safe_function_calls, typename R , typename... Args, typename Fx , typename... FxArgs, typename = std::enable_if_t<!std::is_void<R>::value>>
decltype(auto) call (types< R > tr, types< Args... > ta, lua_State *L, int start, Fx &&fx, FxArgs &&... args)
 
template<bool check_args = detail::default_safe_function_calls, typename R , typename... Args, typename Fx , typename... FxArgs, typename = std::enable_if_t<!std::is_void<R>::value>>
decltype(auto) call (types< R > tr, types< Args... > ta, lua_State *L, Fx &&fx, FxArgs &&... args)
 
template<bool check_args = detail::default_safe_function_calls, typename... Args, typename Fx , typename... FxArgs>
void call (types< void > tr, types< Args... > ta, lua_State *L, int start, Fx &&fx, FxArgs &&... args)
 
template<bool check_args = detail::default_safe_function_calls, typename... Args, typename Fx , typename... FxArgs>
void call (types< void > tr, types< Args... > ta, lua_State *L, Fx &&fx, FxArgs &&... args)
 
template<bool check_args = detail::default_safe_function_calls, typename R , typename... Args, typename Fx , typename... FxArgs, typename = std::enable_if_t<!std::is_void<R>::value>>
decltype(auto) call_from_top (types< R > tr, types< Args... > ta, lua_State *L, Fx &&fx, FxArgs &&... args)
 
template<bool check_args = detail::default_safe_function_calls, typename... Args, typename Fx , typename... FxArgs>
void call_from_top (types< void > tr, types< Args... > ta, lua_State *L, Fx &&fx, FxArgs &&... args)
 
template<bool check_args = detail::default_safe_function_calls, bool clean_stack = true, typename... Args, typename Fx , typename... FxArgs>
int call_into_lua (types< void > tr, types< Args... > ta, lua_State *L, int start, Fx &&fx, FxArgs &&... fxargs)
 
template<bool check_args = detail::default_safe_function_calls, bool clean_stack = true, typename Ret0 , typename... Ret, typename... Args, typename Fx , typename... FxArgs, typename = std::enable_if_t<meta::neg<std::is_void<Ret0>>::value>>
int call_into_lua (types< Ret0, Ret... >, types< Args... > ta, lua_State *L, int start, Fx &&fx, FxArgs &&... fxargs)
 
template<bool check_args = detail::default_safe_function_calls, bool clean_stack = true, typename Fx , typename... FxArgs>
int call_lua (lua_State *L, int start, Fx &&fx, FxArgs &&... fxargs)
 
call_syntax get_call_syntax (lua_State *L, const string_view &key, int index)
 
void script (lua_State *L, const string_view &code, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
void script_file (lua_State *L, const std::string &filename, load_mode mode=load_mode::any)
 
void luajit_exception_handler (lua_State *L, int(*handler)(lua_State *, lua_CFunction)=detail::c_trampoline)
 
void luajit_exception_off (lua_State *L)
 

Function Documentation

§ call() [1/4]

template<bool check_args = detail::default_safe_function_calls, typename R , typename... Args, typename Fx , typename... FxArgs, typename = std::enable_if_t<!std::is_void<R>::value>>
decltype(auto) sol::stack::call ( types< R >  tr,
types< Args... >  ta,
lua_State *  L,
int  start,
Fx &&  fx,
FxArgs &&...  args 
)
inline
11812  {
11813  typedef std::make_index_sequence<sizeof...(Args)> args_indices;
11814  return stack_detail::call<check_args>(tr, ta, args_indices(), L, start, std::forward<Fx>(fx), std::forward<FxArgs>(args)...);
11815  }

§ call() [2/4]

template<bool check_args = detail::default_safe_function_calls, typename R , typename... Args, typename Fx , typename... FxArgs, typename = std::enable_if_t<!std::is_void<R>::value>>
decltype(auto) sol::stack::call ( types< R >  tr,
types< Args... >  ta,
lua_State *  L,
Fx &&  fx,
FxArgs &&...  args 
)
inline
11818  {
11819  return call<check_args>(tr, ta, L, 1, std::forward<Fx>(fx), std::forward<FxArgs>(args)...);
11820  }

§ call() [3/4]

template<bool check_args = detail::default_safe_function_calls, typename... Args, typename Fx , typename... FxArgs>
void sol::stack::call ( types< void >  tr,
types< Args... >  ta,
lua_State *  L,
int  start,
Fx &&  fx,
FxArgs &&...  args 
)
inline
11823  {
11824  typedef std::make_index_sequence<sizeof...(Args)> args_indices;
11825  stack_detail::call<check_args>(tr, ta, args_indices(), L, start, std::forward<Fx>(fx), std::forward<FxArgs>(args)...);
11826  }

§ call() [4/4]

template<bool check_args = detail::default_safe_function_calls, typename... Args, typename Fx , typename... FxArgs>
void sol::stack::call ( types< void >  tr,
types< Args... >  ta,
lua_State *  L,
Fx &&  fx,
FxArgs &&...  args 
)
inline
11829  {
11830  call<check_args>(tr, ta, L, 1, std::forward<Fx>(fx), std::forward<FxArgs>(args)...);
11831  }

§ call_from_top() [1/2]

template<bool check_args = detail::default_safe_function_calls, typename R , typename... Args, typename Fx , typename... FxArgs, typename = std::enable_if_t<!std::is_void<R>::value>>
decltype(auto) sol::stack::call_from_top ( types< R >  tr,
types< Args... >  ta,
lua_State *  L,
Fx &&  fx,
FxArgs &&...  args 
)
inline
11834  {
11835  typedef meta::count_for_pack<lua_size, Args...> expected_count;
11836  return call<check_args>(tr, ta, L, (std::max)(static_cast<int>(lua_gettop(L) - expected_count::value), static_cast<int>(0)), std::forward<Fx>(fx), std::forward<FxArgs>(args)...);
11837  }

§ call_from_top() [2/2]

template<bool check_args = detail::default_safe_function_calls, typename... Args, typename Fx , typename... FxArgs>
void sol::stack::call_from_top ( types< void >  tr,
types< Args... >  ta,
lua_State *  L,
Fx &&  fx,
FxArgs &&...  args 
)
inline
11840  {
11841  typedef meta::count_for_pack<lua_size, Args...> expected_count;
11842  call<check_args>(tr, ta, L, (std::max)(static_cast<int>(lua_gettop(L) - expected_count::value), static_cast<int>(0)), std::forward<Fx>(fx), std::forward<FxArgs>(args)...);
11843  }

§ call_into_lua() [1/2]

template<bool check_args = detail::default_safe_function_calls, bool clean_stack = true, typename... Args, typename Fx , typename... FxArgs>
int sol::stack::call_into_lua ( types< void >  tr,
types< Args... >  ta,
lua_State *  L,
int  start,
Fx &&  fx,
FxArgs &&...  fxargs 
)
inline
11846  {
11847  call<check_args>(tr, ta, L, start, std::forward<Fx>(fx), std::forward<FxArgs>(fxargs)...);
11848  if (clean_stack) {
11849  lua_settop(L, 0);
11850  }
11851  return 0;
11852  }

§ call_into_lua() [2/2]

template<bool check_args = detail::default_safe_function_calls, bool clean_stack = true, typename Ret0 , typename... Ret, typename... Args, typename Fx , typename... FxArgs, typename = std::enable_if_t<meta::neg<std::is_void<Ret0>>::value>>
int sol::stack::call_into_lua ( types< Ret0, Ret... >  ,
types< Args... >  ta,
lua_State *  L,
int  start,
Fx &&  fx,
FxArgs &&...  fxargs 
)
inline
11855  {
11856  decltype(auto) r = call<check_args>(types<meta::return_type_t<Ret0, Ret...>>(), ta, L, start, std::forward<Fx>(fx), std::forward<FxArgs>(fxargs)...);
11857  typedef meta::unqualified_t<decltype(r)> R;
11858  typedef meta::any<is_stack_based<R>,
11859  std::is_same<R, absolute_index>,
11860  std::is_same<R, ref_index>,
11861  std::is_same<R, raw_index>>
11862  is_stack;
11863  if (clean_stack && !is_stack::value) {
11864  lua_settop(L, 0);
11865  }
11866  return push_reference(L, std::forward<decltype(r)>(r));
11867  }
int call(lua_State *L)
Definition: sol.hpp:12872
int push_reference(lua_State *L, Arg &&arg, Args &&... args)
Definition: sol.hpp:7786
typename unqualified< T >::type unqualified_t
Definition: sol.hpp:485
typename return_type< Args... >::type return_type_t
Definition: sol.hpp:1414

§ call_lua()

template<bool check_args = detail::default_safe_function_calls, bool clean_stack = true, typename Fx , typename... FxArgs>
int sol::stack::call_lua ( lua_State *  L,
int  start,
Fx &&  fx,
FxArgs &&...  fxargs 
)
inline
11870  {
11871  typedef lua_bind_traits<meta::unqualified_t<Fx>> traits_type;
11872  typedef typename traits_type::args_list args_list;
11873  typedef typename traits_type::returns_list returns_list;
11874  return call_into_lua<check_args, clean_stack>(returns_list(), args_list(), L, start, std::forward<Fx>(fx), std::forward<FxArgs>(fxargs)...);
11875  }

§ check() [1/3]

template<typename T , typename Handler >
bool sol::stack::check ( lua_State *  L,
int  index,
Handler &&  handler,
record tracking 
)
7815  {
7816  qualified_checker<T> c;
7817  // VC++ has a bad warning here: shut it up
7818  (void)c;
7819  return c.check(L, index, std::forward<Handler>(handler), tracking);
7820  }

§ check() [2/3]

template<typename T , typename Handler >
bool sol::stack::check ( lua_State *  L,
int  index,
Handler &&  handler 
)
7823  {
7824  record tracking{};
7825  return check<T>(L, index, std::forward<Handler>(handler), tracking);
7826  }

§ check() [3/3]

template<typename T >
bool sol::stack::check ( lua_State *  L,
int  index = -lua_size<meta::unqualified_t<T>>::value 
)
7829  {
7830  auto handler = no_panic;
7831  return check<T>(L, index, handler);
7832  }
int no_panic(lua_State *, int, type, type, const char *=nullptr) noexcept
Definition: sol.hpp:6402

§ check_get() [1/3]

template<typename T , typename Handler >
decltype(auto) sol::stack::check_get ( lua_State *  L,
int  index,
Handler &&  handler,
record tracking 
)
inline
7894  {
7895  qualified_check_getter<T> cg{};
7896  (void)cg;
7897  return cg.get(L, index, std::forward<Handler>(handler), tracking);
7898  }

§ check_get() [2/3]

template<typename T , typename Handler >
decltype(auto) sol::stack::check_get ( lua_State *  L,
int  index,
Handler &&  handler 
)
inline
7901  {
7902  record tracking{};
7903  return check_get<T>(L, index, handler, tracking);
7904  }

§ check_get() [3/3]

template<typename T >
decltype(auto) sol::stack::check_get ( lua_State *  L,
int  index = -lua_size<meta::unqualified_t<T>>::value 
)
inline
7907  {
7908  auto handler = no_panic;
7909  return check_get<T>(L, index, handler);
7910  }
int no_panic(lua_State *, int, type, type, const char *=nullptr) noexcept
Definition: sol.hpp:6402

§ check_usertype() [1/3]

template<typename T , typename Handler >
bool sol::stack::check_usertype ( lua_State *  L,
int  index,
Handler &&  handler,
record tracking 
)
7856  {
7857  type indextype = type_of(L, index);
7858  return stack_detail::check_usertype<T>(std::is_pointer<T>(), L, index, indextype, std::forward<Handler>(handler), tracking);
7859  }
type
Definition: sol.hpp:5173
type type_of()
Definition: sol.hpp:5770

§ check_usertype() [2/3]

template<typename T , typename Handler >
bool sol::stack::check_usertype ( lua_State *  L,
int  index,
Handler &&  handler 
)
7862  {
7863  record tracking{};
7864  return check_usertype<T>(L, index, std::forward<Handler>(handler), tracking);
7865  }

§ check_usertype() [3/3]

template<typename T >
bool sol::stack::check_usertype ( lua_State *  L,
int  index = -lua_size<meta::unqualified_t<T>>::value 
)
7868  {
7869  auto handler = no_panic;
7870  return check_usertype<T>(L, index, handler);
7871  }
int no_panic(lua_State *, int, type, type, const char *=nullptr) noexcept
Definition: sol.hpp:6402

§ coroutine_create_guard()

void sol::stack::coroutine_create_guard ( lua_State *  L)
inline
7753  {
7754  if (is_main_thread(L)) {
7755  return;
7756  }
7757  int stacksize = lua_gettop(L);
7758  if (stacksize < 1) {
7759  return;
7760  }
7761  if (type_of(L, 1) != type::function) {
7762  return;
7763  }
7764  // well now we're screwed...
7765  // we can clean the stack and pray it doesn't destroy anything?
7766  lua_pop(L, stacksize);
7767  }
bool is_main_thread(lua_State *L)
Definition: sol.hpp:7747
type type_of()
Definition: sol.hpp:5770
unsafe_function function
Definition: sol.hpp:323

§ get() [1/2]

template<typename T >
decltype(auto) sol::stack::get ( lua_State *  L,
int  index,
record tracking 
)
inline
8053  {
8054  return stack_detail::tagged_get(types<T>(), L, index, tracking);
8055  }
decltype(auto) tagged_get(types< T >, lua_State *L, int index, record &tracking)
Definition: sol.hpp:7964

§ get() [2/2]

template<typename T >
decltype(auto) sol::stack::get ( lua_State *  L,
int  index = -lua_size<meta::unqualified_t<T>>::value 
)
inline
8058  {
8059  record tracking{};
8060  return get<T>(L, index, tracking);
8061  }

§ get_call_syntax()

call_syntax sol::stack::get_call_syntax ( lua_State *  L,
const string_view key,
int  index 
)
inline
11877  {
11878  if (lua_gettop(L) == 0) {
11879  return call_syntax::dot;
11880  }
11881  luaL_getmetatable(L, key.data());
11882  auto pn = pop_n(L, 1);
11883  if (lua_compare(L, -1, index, LUA_OPEQ) != 1) {
11884  return call_syntax::dot;
11885  }
11886  return call_syntax::colon;
11887  }
push_popper_n< top_level > pop_n(lua_State *L, int x)
Definition: sol.hpp:6671

§ get_field() [1/2]

template<bool global = false, bool raw = false, typename Key >
void sol::stack::get_field ( lua_State *  L,
Key &&  key 
)
8069  {
8070  field_getter<meta::unqualified_t<Key>, global, raw>{}.get(L, std::forward<Key>(key));
8071  }

§ get_field() [2/2]

template<bool global = false, bool raw = false, typename Key >
void sol::stack::get_field ( lua_State *  L,
Key &&  key,
int  tableindex 
)
8074  {
8075  field_getter<meta::unqualified_t<Key>, global, raw>{}.get(L, std::forward<Key>(key), tableindex);
8076  }

§ get_usertype() [1/2]

template<typename T >
decltype(auto) sol::stack::get_usertype ( lua_State *  L,
int  index,
record tracking 
)
inline
8027  {
8028 #if defined(SOL_SAFE_GETTER) && SOL_SAFE_GETTER
8029  return stack_detail::tagged_get(types<std::conditional_t<std::is_pointer<T>::value, detail::as_pointer_tag<std::remove_pointer_t<T>>, detail::as_value_tag<T>>>(), L, index, tracking);
8030 #else
8031  return stack_detail::unchecked_get<std::conditional_t<std::is_pointer<T>::value, detail::as_pointer_tag<std::remove_pointer_t<T>>, detail::as_value_tag<T>>>(L, index, tracking);
8032 #endif
8033  }
decltype(auto) tagged_get(types< T >, lua_State *L, int index, record &tracking)
Definition: sol.hpp:7964

§ get_usertype() [2/2]

template<typename T >
decltype(auto) sol::stack::get_usertype ( lua_State *  L,
int  index = -lua_size<meta::unqualified_t<T>>::value 
)
inline
8036  {
8037  record tracking{};
8038  return get_usertype<T>(L, index, tracking);
8039  }

§ is_main_thread()

bool sol::stack::is_main_thread ( lua_State *  L)
inline
7747  {
7748  int ismainthread = lua_pushthread(L);
7749  lua_pop(L, 1);
7750  return ismainthread == 1;
7751  }

§ luajit_exception_handler()

void sol::stack::luajit_exception_handler ( lua_State *  L,
int(*)(lua_State *, lua_CFunction)  handler = detail::c_trampoline 
)
inline
11903  {
11904 #if defined(SOL_LUAJIT) && !defined(SOL_EXCEPTIONS_SAFE_PROPAGATION)
11905  if (L == nullptr) {
11906  return;
11907  }
11908  lua_pushlightuserdata(L, (void*)handler);
11909  auto pn = pop_n(L, 1);
11910  luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC | LUAJIT_MODE_ON);
11911 #else
11912  (void)L;
11913  (void)handler;
11914 #endif
11915  }
push_popper_n< top_level > pop_n(lua_State *L, int x)
Definition: sol.hpp:6671

§ luajit_exception_off()

void sol::stack::luajit_exception_off ( lua_State *  L)
inline
11917  {
11918 #if defined(SOL_LUAJIT)
11919  if (L == nullptr) {
11920  return;
11921  }
11922  luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC | LUAJIT_MODE_OFF);
11923 #else
11924  (void)L;
11925 #endif
11926  }

§ maybe_indexable()

bool sol::stack::maybe_indexable ( lua_State *  L,
int  index = -1 
)
inline
7738  {
7739  type t = type_of(L, index);
7740  return t == type::userdata || t == type::table;
7741  }
type
Definition: sol.hpp:5173
basic_userdata< reference > userdata
Definition: sol.hpp:351
table_core< false > table
Definition: sol.hpp:291
type type_of()
Definition: sol.hpp:5770

§ modify_unique_usertype()

template<typename F >
void sol::stack::modify_unique_usertype ( const stack_reference obj,
F &&  f 
)
inline
8140  {
8141  typedef meta::bind_traits<meta::unqualified_t<F>> bt;
8142  typedef typename bt::template arg_at<0> T;
8143  modify_unique_usertype_as<meta::unqualified_t<T>>(obj, std::forward<F>(f));
8144  }

§ modify_unique_usertype_as()

template<typename T , typename F >
void sol::stack::modify_unique_usertype_as ( const stack_reference obj,
F &&  f 
)
inline
8129  {
8130  typedef unique_usertype_traits<T> u_traits;
8131  void* raw = lua_touserdata(obj.lua_state(), obj.stack_index());
8132  void* ptr_memory = detail::align_usertype_pointer(raw);
8133  void* uu_memory = detail::align_usertype_unique<T>(raw);
8134  T& uu = *static_cast<T*>(uu_memory);
8135  f(uu);
8136  *static_cast<void**>(ptr_memory) = static_cast<void*>(u_traits::get(uu));
8137  }
void * align_usertype_pointer(void *ptr)
Definition: sol.hpp:7200
stack_proxy get(types< Args... > t, const protected_function_result &fr)
Definition: sol.hpp:12588

§ multi_check() [1/6]

template<bool b, typename... Args, typename Handler >
bool sol::stack::multi_check ( lua_State *  L,
int  index,
Handler &&  handler,
record tracking 
)
7995  {
7996  return stack_detail::check_types<b>{}.check(types<meta::unqualified_t<Args>...>(), L, index, std::forward<Handler>(handler), tracking);
7997  }

§ multi_check() [2/6]

template<bool b, typename... Args, typename Handler >
bool sol::stack::multi_check ( lua_State *  L,
int  index,
Handler &&  handler 
)
8000  {
8001  record tracking{};
8002  return multi_check<b, Args...>(L, index, std::forward<Handler>(handler), tracking);
8003  }
bool multi_check(lua_State *L, int index)
Definition: sol.hpp:8022

§ multi_check() [3/6]

template<bool b, typename... Args>
bool sol::stack::multi_check ( lua_State *  L,
int  index 
)
8006  {
8007  auto handler = no_panic;
8008  return multi_check<b, Args...>(L, index, handler);
8009  }
bool multi_check(lua_State *L, int index)
Definition: sol.hpp:8022
int no_panic(lua_State *, int, type, type, const char *=nullptr) noexcept
Definition: sol.hpp:6402

§ multi_check() [4/6]

template<typename... Args, typename Handler >
bool sol::stack::multi_check ( lua_State *  L,
int  index,
Handler &&  handler,
record tracking 
)
8012  {
8013  return multi_check<true, Args...>(L, index, std::forward<Handler>(handler), tracking);
8014  }
bool multi_check(lua_State *L, int index)
Definition: sol.hpp:8022

§ multi_check() [5/6]

template<typename... Args, typename Handler >
bool sol::stack::multi_check ( lua_State *  L,
int  index,
Handler &&  handler 
)
8017  {
8018  return multi_check<true, Args...>(L, index, std::forward<Handler>(handler));
8019  }
bool multi_check(lua_State *L, int index)
Definition: sol.hpp:8022

§ multi_check() [6/6]

template<typename... Args>
bool sol::stack::multi_check ( lua_State *  L,
int  index 
)
8022  {
8023  return multi_check<true, Args...>(L, index);
8024  }
bool multi_check(lua_State *L, int index)
Definition: sol.hpp:8022

§ multi_push() [1/2]

int sol::stack::multi_push ( lua_State *  )
inline
7790  {
7791  // do nothing
7792  return 0;
7793  }

§ multi_push() [2/2]

template<typename T , typename... Args>
int sol::stack::multi_push ( lua_State *  L,
T &&  t,
Args &&...  args 
)
inline
7796  {
7797  int pushcount = push(L, std::forward<T>(t));
7798  void(detail::swallow{ (pushcount += stack::push(L, std::forward<Args>(args)), 0)... });
7799  return pushcount;
7800  }
std::initializer_list< int > swallow
Definition: sol.hpp:462
int push(lua_State *L, Arg &&arg, Args &&... args)
Definition: sol.hpp:7776

§ multi_push_reference() [1/2]

int sol::stack::multi_push_reference ( lua_State *  )
inline
7802  {
7803  // do nothing
7804  return 0;
7805  }

§ multi_push_reference() [2/2]

template<typename T , typename... Args>
int sol::stack::multi_push_reference ( lua_State *  L,
T &&  t,
Args &&...  args 
)
inline
7808  {
7809  int pushcount = push_reference(L, std::forward<T>(t));
7810  void(detail::swallow{ (pushcount += stack::push_reference(L, std::forward<Args>(args)), 0)... });
7811  return pushcount;
7812  }
std::initializer_list< int > swallow
Definition: sol.hpp:462
int push_reference(lua_State *L, Arg &&arg, Args &&... args)
Definition: sol.hpp:7786

§ pop()

template<typename T >
decltype(auto) sol::stack::pop ( lua_State *  L)
inline
8064  {
8065  return popper<meta::unqualified_t<T>>{}.pop(L);
8066  }

§ pop_n()

template<bool top_level = false>
push_popper_n<top_level> sol::stack::pop_n ( lua_State *  L,
int  x 
)
6671  {
6672  return push_popper_n<top_level>(L, x);
6673  }

§ probe_get_field() [1/2]

template<bool global = false, bool raw = false, typename C = detail::non_lua_nil_t, typename Key >
probe sol::stack::probe_get_field ( lua_State *  L,
Key &&  key 
)
8089  {
8090  return probe_field_getter<meta::unqualified_t<Key>, C, global, raw>{}.get(L, std::forward<Key>(key));
8091  }

§ probe_get_field() [2/2]

template<bool global = false, bool raw = false, typename C = detail::non_lua_nil_t, typename Key >
probe sol::stack::probe_get_field ( lua_State *  L,
Key &&  key,
int  tableindex 
)
8094  {
8095  return probe_field_getter<meta::unqualified_t<Key>, C, global, raw>{}.get(L, std::forward<Key>(key), tableindex);
8096  }

§ probe_raw_get_field() [1/2]

template<bool global = false, typename C = detail::non_lua_nil_t, typename Key >
probe sol::stack::probe_raw_get_field ( lua_State *  L,
Key &&  key 
)
8099  {
8100  return probe_get_field<global, true, C>(L, std::forward<Key>(key));
8101  }

§ probe_raw_get_field() [2/2]

template<bool global = false, typename C = detail::non_lua_nil_t, typename Key >
probe sol::stack::probe_raw_get_field ( lua_State *  L,
Key &&  key,
int  tableindex 
)
8104  {
8105  return probe_get_field<global, true, C>(L, std::forward<Key>(key), tableindex);
8106  }

§ push() [1/2]

template<typename T , typename... Args>
int sol::stack::push ( lua_State *  L,
T &&  t,
Args &&...  args 
)
inline
7770  {
7771  return pusher<meta::unqualified_t<T>>{}.push(L, std::forward<T>(t), std::forward<Args>(args)...);
7772  }

§ push() [2/2]

template<typename T , typename Arg , typename... Args, typename = std::enable_if_t<!std::is_same<T, Arg>::value>>
int sol::stack::push ( lua_State *  L,
Arg &&  arg,
Args &&...  args 
)
inline
7776  {
7777  return pusher<meta::unqualified_t<T>>{}.push(L, std::forward<Arg>(arg), std::forward<Args>(args)...);
7778  }

§ push_environment_of() [1/2]

int sol::stack::push_environment_of ( lua_State *  L,
int  index = -1 
)
inline
10337  {
10338 #if SOL_LUA_VERSION < 502
10339  // Use lua_getfenv
10340  lua_getfenv(L, index);
10341  return 1;
10342 #else
10343  // Use upvalues as explained in Lua 5.2 and beyond's manual
10344  if (lua_getupvalue(L, index, 1) == nullptr) {
10345  push(L, lua_nil);
10346  return 1;
10347  }
10348 #endif
10349  return 1;
10350  }
const lua_nil_t lua_nil
Definition: sol.hpp:4683
int push(lua_State *L, Arg &&arg, Args &&... args)
Definition: sol.hpp:7776

§ push_environment_of() [2/2]

template<typename T >
int sol::stack::push_environment_of ( const T target)
10353  {
10354  target.push();
10355  return push_environment_of(target.lua_state(), -1) + 1;
10356  }
int push_environment_of(const T &target)
Definition: sol.hpp:10353

§ push_pop()

template<bool top_level = false, typename T >
push_popper<top_level, T> sol::stack::push_pop ( T &&  x)
6661  {
6662  return push_popper<top_level, T>(std::forward<T>(x));
6663  }

§ push_pop_at()

template<typename T >
push_popper_at sol::stack::push_pop_at ( T &&  x)
6665  {
6666  int c = x.push();
6667  lua_State* L = x.lua_state();
6668  return push_popper_at(L, lua_absindex(L, -c), c);
6669  }

§ push_reference() [1/2]

template<typename T , typename... Args>
int sol::stack::push_reference ( lua_State *  L,
T &&  t,
Args &&...  args 
)
inline
7781  {
7782  return stack_detail::push_reference<T>(L, std::forward<T>(t), std::forward<Args>(args)...);
7783  }

§ push_reference() [2/2]

template<typename T , typename Arg , typename... Args>
int sol::stack::push_reference ( lua_State *  L,
Arg &&  arg,
Args &&...  args 
)
inline
7786  {
7787  return stack_detail::push_reference<T>(L, std::forward<Arg>(arg), std::forward<Args>(args)...);
7788  }

§ raw_get_field() [1/2]

template<bool global = false, typename Key >
void sol::stack::raw_get_field ( lua_State *  L,
Key &&  key 
)
8079  {
8080  get_field<global, true>(L, std::forward<Key>(key));
8081  }

§ raw_get_field() [2/2]

template<bool global = false, typename Key >
void sol::stack::raw_get_field ( lua_State *  L,
Key &&  key,
int  tableindex 
)
8084  {
8085  get_field<global, true>(L, std::forward<Key>(key), tableindex);
8086  }

§ raw_set_field() [1/2]

template<bool global = false, typename Key , typename Value >
void sol::stack::raw_set_field ( lua_State *  L,
Key &&  key,
Value &&  value 
)
8119  {
8120  set_field<global, true>(L, std::forward<Key>(key), std::forward<Value>(value));
8121  }

§ raw_set_field() [2/2]

template<bool global = false, typename Key , typename Value >
void sol::stack::raw_set_field ( lua_State *  L,
Key &&  key,
Value &&  value,
int  tableindex 
)
8124  {
8125  set_field<global, true>(L, std::forward<Key>(key), std::forward<Value>(value), tableindex);
8126  }

§ remove()

void sol::stack::remove ( lua_State *  L,
int  rawindex,
int  count 
)
inline
6576  {
6577  if (count < 1)
6578  return;
6579  int top = lua_gettop(L);
6580  if (top < 1) {
6581  return;
6582  }
6583  if (rawindex == -count || top == rawindex) {
6584  // Slice them right off the top
6585  lua_pop(L, static_cast<int>(count));
6586  return;
6587  }
6588 
6589  // Remove each item one at a time using stack operations
6590  // Probably slower, maybe, haven't benchmarked,
6591  // but necessary
6592  int index = lua_absindex(L, rawindex);
6593  if (index < 0) {
6594  index = lua_gettop(L) + (index + 1);
6595  }
6596  int last = index + count;
6597  for (int i = index; i < last; ++i) {
6598  lua_remove(L, index);
6599  }
6600  }
int top(lua_State *L)
Definition: sol.hpp:7743

§ script()

void sol::stack::script ( lua_State *  L,
const string_view code,
const std::string chunkname = detail::default_chunk_name(),
load_mode  mode = load_mode::any 
)
inline
11889  {
11890  detail::typical_chunk_name_t basechunkname = {};
11891  const char* chunknametarget = detail::make_chunk_name(code, chunkname, basechunkname);
11892  if (luaL_loadbufferx(L, code.data(), code.size(), chunknametarget, to_string(mode).c_str()) || lua_pcall(L, 0, LUA_MULTRET, 0)) {
11893  lua_error(L);
11894  }
11895  }
char[32] typical_chunk_name_t
Definition: sol.hpp:11708
const string_view & to_string(error_code ec)
Definition: sol.hpp:8913
const char * make_chunk_name(const string_view &code, const std::string &chunkname, char(&basechunkname)[N])
Definition: sol.hpp:11716

§ script_file()

void sol::stack::script_file ( lua_State *  L,
const std::string filename,
load_mode  mode = load_mode::any 
)
inline
11897  {
11898  if (luaL_loadfilex(L, filename.c_str(), to_string(mode).c_str()) || lua_pcall(L, 0, LUA_MULTRET, 0)) {
11899  lua_error(L);
11900  }
11901  }
const string_view & to_string(error_code ec)
Definition: sol.hpp:8913

§ set_field() [1/2]

template<bool global = false, bool raw = false, typename Key , typename Value >
void sol::stack::set_field ( lua_State *  L,
Key &&  key,
Value &&  value 
)
8109  {
8110  field_setter<meta::unqualified_t<Key>, global, raw>{}.set(L, std::forward<Key>(key), std::forward<Value>(value));
8111  }

§ set_field() [2/2]

template<bool global = false, bool raw = false, typename Key , typename Value >
void sol::stack::set_field ( lua_State *  L,
Key &&  key,
Value &&  value,
int  tableindex 
)
8114  {
8115  field_setter<meta::unqualified_t<Key>, global, raw>{}.set(L, std::forward<Key>(key), std::forward<Value>(value), tableindex);
8116  }

§ set_ref()

template<typename T >
int sol::stack::set_ref ( lua_State *  L,
T &&  arg,
int  tableindex = -2 
)
11806  {
11807  push(L, std::forward<T>(arg));
11808  return luaL_ref(L, tableindex);
11809  }
int push(lua_State *L, Arg &&arg, Args &&... args)
Definition: sol.hpp:7776

§ top()

int sol::stack::top ( lua_State *  L)
inline
7743  {
7744  return lua_gettop(L);
7745  }

§ unqualified_check() [1/3]

template<typename T , typename Handler >
bool sol::stack::unqualified_check ( lua_State *  L,
int  index,
Handler &&  handler,
record tracking 
)
7835  {
7836  typedef meta::unqualified_t<T> Tu;
7837  checker<Tu> c;
7838  // VC++ has a bad warning here: shut it up
7839  (void)c;
7840  return c.check(L, index, std::forward<Handler>(handler), tracking);
7841  }

§ unqualified_check() [2/3]

template<typename T , typename Handler >
bool sol::stack::unqualified_check ( lua_State *  L,
int  index,
Handler &&  handler 
)
7844  {
7845  record tracking{};
7846  return unqualified_check<T>(L, index, std::forward<Handler>(handler), tracking);
7847  }

§ unqualified_check() [3/3]

template<typename T >
bool sol::stack::unqualified_check ( lua_State *  L,
int  index = -lua_size<meta::unqualified_t<T>>::value 
)
7850  {
7851  auto handler = no_panic;
7852  return unqualified_check<T>(L, index, handler);
7853  }
int no_panic(lua_State *, int, type, type, const char *=nullptr) noexcept
Definition: sol.hpp:6402

§ unqualified_check_get() [1/3]

template<typename T , typename Handler >
decltype(auto) sol::stack::unqualified_check_get ( lua_State *  L,
int  index,
Handler &&  handler,
record tracking 
)
inline
7874  {
7875  typedef meta::unqualified_t<T> Tu;
7876  check_getter<Tu> cg{};
7877  (void)cg;
7878  return cg.get(L, index, std::forward<Handler>(handler), tracking);
7879  }

§ unqualified_check_get() [2/3]

template<typename T , typename Handler >
decltype(auto) sol::stack::unqualified_check_get ( lua_State *  L,
int  index,
Handler &&  handler 
)
inline
7882  {
7883  record tracking{};
7884  return unqualified_check_get<T>(L, index, handler, tracking);
7885  }

§ unqualified_check_get() [3/3]

template<typename T >
decltype(auto) sol::stack::unqualified_check_get ( lua_State *  L,
int  index = -lua_size<meta::unqualified_t<T>>::value 
)
inline
7888  {
7889  auto handler = no_panic;
7890  return unqualified_check_get<T>(L, index, handler);
7891  }
int no_panic(lua_State *, int, type, type, const char *=nullptr) noexcept
Definition: sol.hpp:6402

§ unqualified_get() [1/2]

template<typename T >
decltype(auto) sol::stack::unqualified_get ( lua_State *  L,
int  index,
record tracking 
)
inline
8042  {
8043  return stack_detail::tagged_unqualified_get(types<T>(), L, index, tracking);
8044  }
decltype(auto) tagged_unqualified_get(types< T >, lua_State *L, int index, record &tracking)
Definition: sol.hpp:7959

§ unqualified_get() [2/2]

template<typename T >
decltype(auto) sol::stack::unqualified_get ( lua_State *  L,
int  index = -lua_size<meta::unqualified_t<T>>::value 
)
inline
8047  {
8048  record tracking{};
8049  return unqualified_get<T>(L, index, tracking);
8050  }