OpenMiner  0.0.1a
Voxel game engine
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
sol Namespace Reference

Namespaces

 adl_barrier_detail
 
 call_detail
 
 container_detail
 
 detail
 
 detail_
 
 filter_detail
 
 function_detail
 
 meta
 
 property_detail
 
 stack
 
 unicode
 
 usertype_detail
 

Classes

struct  absolute_index
 
struct  argument_handler
 
struct  argument_handler< types< R, Args... > >
 
struct  as_args_t
 
struct  as_container_t
 
struct  as_container_t< T & >
 
struct  as_returns_t
 
struct  as_table_t
 
class  bad_optional_access
 
struct  base_list
 
class  basic_coroutine
 
struct  basic_environment
 
class  basic_function
 
class  basic_lightuserdata
 
class  basic_object
 
class  basic_object_base
 
class  basic_protected_function
 
class  basic_reference
 
struct  basic_string_view
 
struct  basic_string_view_hash
 
class  basic_table_core
 
class  basic_table_iterator
 
class  basic_thread
 
class  basic_userdata
 
struct  call_construction
 
struct  clean_type
 
struct  closure
 
struct  closure<>
 
struct  constexpr_optional_base
 
struct  constructor_handler
 
struct  constructor_list
 
struct  constructor_wrapper
 
struct  container_traits
 
struct  container_usertype_metatable
 
struct  destructor_wrapper
 
struct  destructor_wrapper< void >
 
struct  env_t
 
class  error
 
struct  factory_wrapper
 
struct  filter_wrapper
 
struct  function_arguments
 
struct  function_sig
 
struct  in_place_tag
 
struct  is_assignable
 
struct  is_automagical
 
struct  is_container
 
struct  is_environment
 
struct  is_function
 
struct  is_function< basic_function< T, aligned > >
 
struct  is_function< basic_protected_function< T, aligned, Handler > >
 
struct  is_function_binding
 
struct  is_lightuserdata
 
struct  is_lightuserdata< basic_lightuserdata< T > >
 
struct  is_lua_index
 
struct  is_lua_index< absolute_index >
 
struct  is_lua_index< raw_index >
 
struct  is_lua_index< ref_index >
 
struct  is_lua_index< upvalue_index >
 
struct  is_lua_primitive
 
struct  is_lua_primitive< as_table_t< T > >
 
struct  is_lua_primitive< light< T > >
 
struct  is_lua_primitive< lightuserdata_value >
 
struct  is_lua_primitive< nested< T > >
 
struct  is_lua_primitive< non_null< T > >
 
struct  is_lua_primitive< optional< T > >
 
struct  is_lua_primitive< protected_function_result >
 
struct  is_lua_primitive< std::reference_wrapper< T > >
 
struct  is_lua_primitive< T * >
 
struct  is_lua_primitive< unsafe_function_result >
 
struct  is_lua_primitive< user< T > >
 
struct  is_lua_primitive< userdata_value >
 
struct  is_lua_reference
 
struct  is_lua_reference_or_proxy
 
struct  is_main_threaded
 
struct  is_nothrow_move_assignable
 
struct  is_nothrow_move_constructible
 
struct  is_proxy_primitive
 
struct  is_stack_based
 
struct  is_stack_based< protected_function_result >
 
struct  is_stack_based< stack_proxy >
 
struct  is_stack_based< stack_proxy_base >
 
struct  is_stack_based< unsafe_function_result >
 
struct  is_stack_based< variadic_args >
 
struct  is_table
 
struct  is_table< basic_table_core< x, T > >
 
struct  is_tieable
 
struct  is_to_stringable
 
struct  is_transparent_argument
 
struct  is_transparent_argument< this_environment >
 
struct  is_transparent_argument< this_main_state >
 
struct  is_transparent_argument< this_state >
 
struct  is_transparent_argument< variadic_args >
 
struct  is_unique_usertype
 
struct  is_userdata
 
struct  is_userdata< basic_userdata< T > >
 
struct  is_variable_binding
 
struct  is_variadic_arguments
 
struct  light
 
struct  lightuserdata_value
 
struct  load_result
 
struct  lua_bind_traits
 
struct  lua_nil_t
 
struct  lua_size
 
struct  lua_size< std::pair< A, B > >
 
struct  lua_size< std::tuple< Args... > >
 
struct  lua_thread_state
 
struct  lua_type_of
 
struct  member_function_wrapper
 
struct  metatable_registry_key
 
struct  metatable_t
 
struct  nested
 
struct  new_table
 
struct  no_construction
 
struct  no_metatable_t
 
struct  no_prop
 
struct  non_null
 
struct  nullopt_t
 
class  optional
 
class  optional< T & >
 
class  optional< T && >
 
struct  optional_base
 
struct  overload_set
 
struct  property_wrapper
 
struct  protect_t
 
struct  protected_function_result
 
struct  proxy
 
struct  proxy_base
 
struct  proxy_base_tag
 
struct  raw_index
 
struct  readonly_wrapper
 
struct  ref_index
 
struct  returns_self_with
 
struct  simple_tag
 
class  simple_usertype
 
struct  simple_usertype_metatable
 
struct  stack_count
 
struct  stack_dependencies
 
struct  stack_guard
 
struct  stack_iterator
 
struct  stack_proxy
 
struct  stack_proxy_base
 
class  stack_reference
 
class  state
 
class  state_view
 
struct  static_stack_dependencies
 
struct  this_environment
 
struct  this_main_state
 
struct  this_state
 
struct  tie_size
 
struct  tie_size< protected_function_result >
 
struct  tie_size< tie_t< Tn... > >
 
struct  tie_size< unsafe_function_result >
 
struct  tie_t
 
struct  trivial_init_t
 
struct  type_panic_t
 
struct  types
 
struct  unique_usertype_traits
 
struct  unique_usertype_traits< std::shared_ptr< T > >
 
struct  unique_usertype_traits< std::unique_ptr< T, D > >
 
struct  unsafe_function_result
 
struct  upvalue_index
 
struct  user
 
struct  userdata_value
 
class  usertype
 
struct  usertype_metatable
 
struct  usertype_metatable< T, std::index_sequence< I... >, Tn... >
 
struct  usertype_metatable_core
 
struct  usertype_traits
 
struct  var_wrapper
 
struct  variadic_args
 
struct  variadic_results
 
struct  wrap
 
struct  wrapper
 
struct  wrapper< F, std::enable_if_t< std::is_function< std::remove_pointer_t< meta::unqualified_t< F > > >::value > >
 
struct  wrapper< F, std::enable_if_t< std::is_member_object_pointer< meta::unqualified_t< F > >::value > >
 
struct  wrapper< R(O::*)(Args...) && >
 
struct  wrapper< R(O::*)(Args...) const & >
 
struct  wrapper< R(O::*)(Args...) const && >
 
struct  wrapper< R(O::*)(Args...) const >
 
struct  wrapper< R(O::*)(Args...) const volatile & >
 
struct  wrapper< R(O::*)(Args...) const volatile && >
 
struct  wrapper< R(O::*)(Args...) const volatile >
 
struct  wrapper< R(O::*)(Args...)& >
 
struct  wrapper< R(O::*)(Args...)>
 
struct  wrapper< R(O::*)(Args...,...) && >
 
struct  wrapper< R(O::*)(Args...,...) const & >
 
struct  wrapper< R(O::*)(Args...,...) const && >
 
struct  wrapper< R(O::*)(Args...,...) const volatile & >
 
struct  wrapper< R(O::*)(Args...,...) const volatile && >
 
struct  wrapper< R(O::*)(Args...,...)& >
 
struct  yielding_t
 

Typedefs

using reference = basic_reference< false >
 
using main_reference = basic_reference< true >
 
template<bool b>
using table_core = basic_table_core< b, reference >
 
template<bool b>
using main_table_core = basic_table_core< b, main_reference >
 
template<bool b>
using stack_table_core = basic_table_core< b, stack_reference >
 
template<typename T >
using basic_table = basic_table_core< false, T >
 
typedef table_core< false > table
 
typedef table_core< true > global_table
 
typedef main_table_core< false > main_table
 
typedef main_table_core< true > main_global_table
 
typedef stack_table_core< false > stack_table
 
typedef stack_table_core< true > stack_global_table
 
using environment = basic_environment< reference >
 
using main_environment = basic_environment< main_reference >
 
using stack_environment = basic_environment< stack_reference >
 
using unsafe_function = basic_function< reference, false >
 
using safe_function = basic_protected_function< reference, false, reference >
 
using main_unsafe_function = basic_function< main_reference, false >
 
using main_safe_function = basic_protected_function< main_reference, false, reference >
 
using stack_unsafe_function = basic_function< stack_reference, false >
 
using stack_safe_function = basic_protected_function< stack_reference, false, reference >
 
using stack_aligned_unsafe_function = basic_function< stack_reference, true >
 
using stack_aligned_safe_function = basic_protected_function< stack_reference, true, reference >
 
using protected_function = safe_function
 
using main_protected_function = main_safe_function
 
using stack_protected_function = stack_safe_function
 
using stack_aligned_protected_function = stack_aligned_safe_function
 
using function = unsafe_function
 
using main_function = main_unsafe_function
 
using stack_function = stack_unsafe_function
 
using stack_aligned_function = stack_aligned_unsafe_function
 
using stack_aligned_stack_handler_function = basic_protected_function< stack_reference, true, stack_reference >
 
using safe_function_result = protected_function_result
 
using function_result = unsafe_function_result
 
using object = basic_object< reference >
 
using userdata = basic_userdata< reference >
 
using lightuserdata = basic_lightuserdata< reference >
 
using thread = basic_thread< reference >
 
using coroutine = basic_coroutine< reference >
 
using main_object = basic_object< main_reference >
 
using main_userdata = basic_userdata< main_reference >
 
using main_lightuserdata = basic_lightuserdata< main_reference >
 
using main_coroutine = basic_coroutine< main_reference >
 
using stack_object = basic_object< stack_reference >
 
using stack_userdata = basic_userdata< stack_reference >
 
using stack_lightuserdata = basic_lightuserdata< stack_reference >
 
using stack_thread = basic_thread< stack_reference >
 
using stack_coroutine = basic_coroutine< stack_reference >
 
using string_view = basic_string_view< char >
 
using wstring_view = basic_string_view< wchar_t >
 
using u16string_view = basic_string_view< char16_t >
 
using u32string_view = basic_string_view< char32_t >
 
using string_view_hash = std::hash< string_view >
 
template<std::size_t I>
using index_value = std::integral_constant< std::size_t, I >
 
using in_place_t = in_place_tag(&)(detail::in_place_of_tag)
 
template<typename T >
using in_place_type_t = in_place_tag(&)(detail::in_place_of_t< T >)
 
template<std::size_t I>
using in_place_index_t = in_place_tag(&)(detail::in_place_of_i< I >)
 
template<typename T >
using is_trivially_destructible = ::std::has_trivial_destructor< T >
 
template<class T >
using OptionalBase = typename ::std::conditional< ::std::is_trivially_destructible< T >::value, constexpr_optional_base< typename ::std::remove_const< T >::type >, optional_base< typename ::std::remove_const< T >::type >>::type
 
template<typename... Args>
using constructors = constructor_list< Args... >
 
typedef static_stack_dependencies<-1, 1 > self_dependency
 
typedef returns_self_with returns_self
 
typedef lua_nil_t nil_t
 
typedef std::remove_pointer_t< lua_CFunction > lua_CFunction_ref
 
typedef closure c_closure
 
typedef meta_function meta_method
 
using exception_handler_function = int(*)(lua_State *, optional< const std::exception & >, string_view)
 
template<typename... Args>
using bases = base_list< Args... >
 
typedef bases base_classes_tag
 
template<typename T >
using clean_type_t = typename clean_type< T >::type
 

Enumerations

enum  lib : char {
  lib::base, lib::package, lib::coroutine, lib::string,
  lib::os, lib::math, lib::table, lib::debug,
  lib::bit32, lib::io, lib::ffi, lib::jit,
  lib::utf8, lib::count
}
 
enum  call_syntax { call_syntax::dot = 0, call_syntax::colon = 1 }
 
enum  load_mode { load_mode::any = 0, load_mode::text = 1, load_mode::binary = 2 }
 
enum  call_status : int {
  call_status::ok = LUA_OK, call_status::yielded = LUA_YIELD, call_status::runtime = LUA_ERRRUN, call_status::memory = LUA_ERRMEM,
  call_status::handler = LUA_ERRERR, call_status::gc = LUA_ERRGCMM, call_status::syntax = LUA_ERRSYNTAX, call_status::file = LUA_ERRFILE
}
 
enum  thread_status : int {
  thread_status::ok = LUA_OK, thread_status::yielded = LUA_YIELD, thread_status::runtime = LUA_ERRRUN, thread_status::memory = LUA_ERRMEM,
  thread_status::gc = LUA_ERRGCMM, thread_status::handler = LUA_ERRERR, thread_status::dead = -1
}
 
enum  load_status : int {
  load_status::ok = LUA_OK, load_status::syntax = LUA_ERRSYNTAX, load_status::memory = LUA_ERRMEM, load_status::gc = LUA_ERRGCMM,
  load_status::file = LUA_ERRFILE
}
 
enum  type : int {
  type::none = LUA_TNONE, type::lua_nil = LUA_TNIL, type::nil = lua_nil, type::string = LUA_TSTRING,
  type::number = LUA_TNUMBER, type::thread = LUA_TTHREAD, type::boolean = LUA_TBOOLEAN, type::function = LUA_TFUNCTION,
  type::userdata = LUA_TUSERDATA, type::lightuserdata = LUA_TLIGHTUSERDATA, type::table = LUA_TTABLE, type::poly = -0xFFFF
}
 
enum  meta_function {
  meta_function::construct, meta_function::index, meta_function::new_index, meta_function::mode,
  meta_function::call, meta_function::call_function = call, meta_function::metatable, meta_function::to_string,
  meta_function::length, meta_function::unary_minus, meta_function::addition, meta_function::subtraction,
  meta_function::multiplication, meta_function::division, meta_function::modulus, meta_function::power_of,
  meta_function::involution = power_of, meta_function::concatenation, meta_function::equal_to, meta_function::less_than,
  meta_function::less_than_or_equal_to, meta_function::garbage_collect, meta_function::floor_division, meta_function::bitwise_left_shift,
  meta_function::bitwise_right_shift, meta_function::bitwise_not, meta_function::bitwise_and, meta_function::bitwise_or,
  meta_function::bitwise_xor, meta_function::pairs, meta_function::ipairs, meta_function::next,
  meta_function::type, meta_function::type_info
}
 

Functions

constexpr in_place_tag in_place (detail::in_place_of_tag)
 
template<typename T >
constexpr in_place_tag in_place (detail::in_place_of_t< T >)
 
template<std::size_t I>
constexpr in_place_tag in_place (detail::in_place_of_i< I >)
 
constexpr in_place_tag in_place_of (detail::in_place_of_tag)
 
template<typename T >
constexpr in_place_tag in_place_type (detail::in_place_of_t< T >)
 
template<std::size_t I>
constexpr in_place_tag in_place_index (detail::in_place_of_i< I >)
 
template<class T >
constexpr T && constexpr_forward (typename ::std::remove_reference< T >::type &t) noexcept
 
template<class T >
constexpr T && constexpr_forward (typename ::std::remove_reference< T >::type &&t) noexcept
 
template<class T >
constexpr ::std::remove_reference< T >::type && constexpr_move (T &&t) noexcept
 
template<class T >
constexpr bool operator== (const optional< T > &x, const optional< T > &y)
 
template<class T >
constexpr bool operator!= (const optional< T > &x, const optional< T > &y)
 
template<class T >
constexpr bool operator< (const optional< T > &x, const optional< T > &y)
 
template<class T >
constexpr bool operator> (const optional< T > &x, const optional< T > &y)
 
template<class T >
constexpr bool operator<= (const optional< T > &x, const optional< T > &y)
 
template<class T >
constexpr bool operator>= (const optional< T > &x, const optional< T > &y)
 
template<class T >
constexpr bool operator== (const optional< T > &x, nullopt_t) noexcept
 
template<class T >
constexpr bool operator== (nullopt_t, const optional< T > &x) noexcept
 
template<class T >
constexpr bool operator!= (const optional< T > &x, nullopt_t) noexcept
 
template<class T >
constexpr bool operator!= (nullopt_t, const optional< T > &x) noexcept
 
template<class T >
constexpr bool operator< (const optional< T > &, nullopt_t) noexcept
 
template<class T >
constexpr bool operator< (nullopt_t, const optional< T > &x) noexcept
 
template<class T >
constexpr bool operator<= (const optional< T > &x, nullopt_t) noexcept
 
template<class T >
constexpr bool operator<= (nullopt_t, const optional< T > &) noexcept
 
template<class T >
constexpr bool operator> (const optional< T > &x, nullopt_t) noexcept
 
template<class T >
constexpr bool operator> (nullopt_t, const optional< T > &) noexcept
 
template<class T >
constexpr bool operator>= (const optional< T > &, nullopt_t) noexcept
 
template<class T >
constexpr bool operator>= (nullopt_t, const optional< T > &x) noexcept
 
template<class T >
constexpr bool operator== (const optional< T > &x, const T &v)
 
template<class T >
constexpr bool operator== (const T &v, const optional< T > &x)
 
template<class T >
constexpr bool operator!= (const optional< T > &x, const T &v)
 
template<class T >
constexpr bool operator!= (const T &v, const optional< T > &x)
 
template<class T >
constexpr bool operator< (const optional< T > &x, const T &v)
 
template<class T >
constexpr bool operator> (const T &v, const optional< T > &x)
 
template<class T >
constexpr bool operator> (const optional< T > &x, const T &v)
 
template<class T >
constexpr bool operator< (const T &v, const optional< T > &x)
 
template<class T >
constexpr bool operator>= (const optional< T > &x, const T &v)
 
template<class T >
constexpr bool operator<= (const T &v, const optional< T > &x)
 
template<class T >
constexpr bool operator<= (const optional< T > &x, const T &v)
 
template<class T >
constexpr bool operator>= (const T &v, const optional< T > &x)
 
template<class T >
constexpr bool operator== (const optional< T &> &x, const T &v)
 
template<class T >
constexpr bool operator== (const T &v, const optional< T &> &x)
 
template<class T >
constexpr bool operator!= (const optional< T &> &x, const T &v)
 
template<class T >
constexpr bool operator!= (const T &v, const optional< T &> &x)
 
template<class T >
constexpr bool operator< (const optional< T &> &x, const T &v)
 
template<class T >
constexpr bool operator> (const T &v, const optional< T &> &x)
 
template<class T >
constexpr bool operator> (const optional< T &> &x, const T &v)
 
template<class T >
constexpr bool operator< (const T &v, const optional< T &> &x)
 
template<class T >
constexpr bool operator>= (const optional< T &> &x, const T &v)
 
template<class T >
constexpr bool operator<= (const T &v, const optional< T &> &x)
 
template<class T >
constexpr bool operator<= (const optional< T &> &x, const T &v)
 
template<class T >
constexpr bool operator>= (const T &v, const optional< T &> &x)
 
template<class T >
constexpr bool operator== (const optional< const T &> &x, const T &v)
 
template<class T >
constexpr bool operator== (const T &v, const optional< const T &> &x)
 
template<class T >
constexpr bool operator!= (const optional< const T &> &x, const T &v)
 
template<class T >
constexpr bool operator!= (const T &v, const optional< const T &> &x)
 
template<class T >
constexpr bool operator< (const optional< const T &> &x, const T &v)
 
template<class T >
constexpr bool operator> (const T &v, const optional< const T &> &x)
 
template<class T >
constexpr bool operator> (const optional< const T &> &x, const T &v)
 
template<class T >
constexpr bool operator< (const T &v, const optional< const T &> &x)
 
template<class T >
constexpr bool operator>= (const optional< const T &> &x, const T &v)
 
template<class T >
constexpr bool operator<= (const T &v, const optional< const T &> &x)
 
template<class T >
constexpr bool operator<= (const optional< const T &> &x, const T &v)
 
template<class T >
constexpr bool operator>= (const T &v, const optional< const T &> &x)
 
template<class T >
void swap (optional< T > &x, optional< T > &y) noexcept(noexcept(x.swap(y)))
 
template<class T >
constexpr optional< typename ::std::decay< T >::typemake_optional (T &&v)
 
template<class X >
constexpr optional< X & > make_optional (::std::reference_wrapper< X > v)
 
template<typename... Functions>
auto initializers (Functions &&... functions)
 
template<typename... Functions>
auto factories (Functions &&... functions)
 
template<typename Fx >
auto destructor (Fx &&fx)
 
template<typename F , typename... Args>
auto filters (F &&f, Args &&... args)
 
bool operator== (lua_nil_t, lua_nil_t)
 
bool operator!= (lua_nil_t, lua_nil_t)
 
template<typename F >
yielding_t< std::decay_t< F > > yielding (F &&f)
 
template<typename T >
auto make_light (T &l)
 
template<typename T >
auto make_user (T &&u)
 
template<typename T >
auto meta_registry_key (T &&key)
 
template<typename... Args>
closure< Args... > make_closure (lua_CFunction f, Args &&... args)
 
template<typename Sig = function_sig<>, typename... Args>
auto as_function (Args &&... args)
 
template<typename Sig = function_sig<>, typename... Args>
auto as_function_reference (Args &&... args)
 
template<typename T >
as_table_t< Tas_table_ref (T &&container)
 
template<typename T >
as_table_t< meta::unqualified_t< T > > as_table (T &&container)
 
template<typename T >
nested< Tas_nested_ref (T &&container)
 
template<typename T >
nested< meta::unqualified_t< T > > as_nested (T &&container)
 
const std::stringto_string (call_status c)
 
bool is_indeterminate_call_failure (call_status c)
 
const std::stringto_string (load_status c)
 
const std::stringto_string (load_mode c)
 
const std::array< std::string, 32 > & meta_function_names ()
 
const std::stringto_string (meta_function mf)
 
type type_of (lua_State *L, int index)
 
std::string type_name (lua_State *L, type t)
 
template<typename T >
type type_of ()
 
void set_default_exception_handler (lua_State *L, exception_handler_function exf=&detail::default_exception_handler)
 
std::string associated_type_name (lua_State *L, int index, type t)
 
int type_panic_string (lua_State *L, int index, type expected, type actual, const std::string &message="") noexcept(false)
 
int type_panic_c_str (lua_State *L, int index, type expected, type actual, const char *message=nullptr) noexcept(false)
 
int no_panic (lua_State *, int, type, type, const char *=nullptr) noexcept
 
void type_error (lua_State *L, int expected, int actual) noexcept(false)
 
void type_error (lua_State *L, type expected, type actual) noexcept(false)
 
void type_assert (lua_State *L, int index, type expected, type actual) noexcept(false)
 
void type_assert (lua_State *L, int index, type expected)
 
bool operator== (const stack_reference &l, const stack_reference &r)
 
bool operator!= (const stack_reference &l, const stack_reference &r)
 
bool operator== (const stack_reference &lhs, const lua_nil_t &)
 
bool operator== (const lua_nil_t &, const stack_reference &rhs)
 
bool operator!= (const stack_reference &lhs, const lua_nil_t &)
 
bool operator!= (const lua_nil_t &, const stack_reference &rhs)
 
lua_State * main_thread (lua_State *L, lua_State *backup_if_unsupported=nullptr)
 
template<bool lb, bool rb>
bool operator== (const basic_reference< lb > &l, const basic_reference< rb > &r)
 
template<bool lb, bool rb>
bool operator!= (const basic_reference< lb > &l, const basic_reference< rb > &r)
 
template<bool lb>
bool operator== (const basic_reference< lb > &lhs, const lua_nil_t &)
 
template<bool rb>
bool operator== (const lua_nil_t &, const basic_reference< rb > &rhs)
 
template<bool lb>
bool operator!= (const basic_reference< lb > &lhs, const lua_nil_t &)
 
template<bool rb>
bool operator!= (const lua_nil_t &, const basic_reference< rb > &rhs)
 
template<typename... Args>
decltype(auto) overload (Args &&... args)
 
template<typename proxy_t , bool is_const>
stack_iterator< proxy_t, is_const > operator+ (typename stack_iterator< proxy_t, is_const >::difference_type n, const stack_iterator< proxy_t, is_const > &r)
 
template<std::size_t I>
stack_proxy get (const unsafe_function_result &fr)
 
template<std::size_t I, typename... Args>
stack_proxy get (types< Args... > t, const unsafe_function_result &fr)
 
template<std::size_t I>
stack_proxy get (const protected_function_result &fr)
 
template<std::size_t I, typename... Args>
stack_proxy get (types< Args... > t, const protected_function_result &fr)
 
template<typename T >
auto protect (T &&value)
 
template<typename F , typename G >
decltype(auto) property (F &&f, G &&g)
 
template<typename F >
decltype(auto) property (F &&f)
 
template<typename F >
decltype(auto) readonly_property (F &&f)
 
template<typename F >
decltype(auto) writeonly_property (F &&f)
 
template<typename R , typename T >
auto readonly (R T::*v)
 
template<typename V >
auto var (V &&v)
 
template<typename F , F fx>
int c_call (lua_State *L)
 
template<typename... Fxs>
int c_call (lua_State *L)
 
template<typename... Args, typename R >
constexpr auto resolve (R fun_ptr(Args...)) -> R(*)(Args...)
 
template<typename Sig >
constexpr Sig * resolve (Sig *fun_ptr)
 
template<typename... Args, typename R , typename C >
constexpr auto resolve (R(C::*mem_ptr)(Args...)) -> R(C::*)(Args...)
 
template<typename Sig , typename C >
constexpr Sig C::* resolve (Sig C::*mem_ptr)
 
template<typename... Sig, typename F , meta::disable< std::is_function< meta::unqualified_t< F >>> = meta::enabler>
constexpr auto resolve (F &&f) -> decltype(detail::resolve_i(types< Sig... >(), std::forward< F >(f)))
 
template<typename Table , typename Key , typename T >
bool operator== (T &&left, const proxy< Table, Key > &right)
 
template<typename Table , typename Key , typename T >
bool operator== (const proxy< Table, Key > &right, T &&left)
 
template<typename Table , typename Key , typename T >
bool operator!= (T &&left, const proxy< Table, Key > &right)
 
template<typename Table , typename Key , typename T >
bool operator!= (const proxy< Table, Key > &right, T &&left)
 
template<typename Table , typename Key >
bool operator== (lua_nil_t, const proxy< Table, Key > &right)
 
template<typename Table , typename Key >
bool operator== (const proxy< Table, Key > &right, lua_nil_t)
 
template<typename Table , typename Key >
bool operator!= (lua_nil_t, const proxy< Table, Key > &right)
 
template<typename Table , typename Key >
bool operator!= (const proxy< Table, Key > &right, lua_nil_t)
 
template<typename Source >
auto as_args (Source &&source)
 
template<typename R = reference, bool should_pop = !is_stack_based<R>::value, typename T >
make_reference (lua_State *L, T &&value)
 
template<typename T , typename R = reference, bool should_pop = !is_stack_based<R>::value, typename... Args>
make_reference (lua_State *L, Args &&... args)
 
template<typename T >
object make_object (lua_State *L, T &&value)
 
template<typename T , typename... Args>
object make_object (lua_State *L, Args &&... args)
 
template<typename T >
auto as_container (T &&value)
 
template<typename T , typename E >
void set_environment (const basic_environment< E > &env, const T &target)
 
template<typename E = reference, typename T >
basic_environment< E > get_environment (const T &target)
 
void register_main_thread (lua_State *L)
 
int default_at_panic (lua_State *L)
 
int default_traceback_error_handler (lua_State *L)
 
void set_default_state (lua_State *L, lua_CFunction panic_function=&default_at_panic, lua_CFunction traceback_function=c_call< decltype(&default_traceback_error_handler), &default_traceback_error_handler >, exception_handler_function exf=detail::default_exception_handler)
 
std::size_t total_memory_used (lua_State *L)
 
protected_function_result script_pass_on_error (lua_State *, protected_function_result result)
 
protected_function_result script_throw_on_error (lua_State *L, protected_function_result result)
 
protected_function_result script_default_on_error (lua_State *L, protected_function_result pfr)
 
template<typename Source >
auto as_returns (Source &&source)
 

Variables

constexpr struct sol::trivial_init_t trivial_init
 
constexpr nullopt_t nullopt {nullopt_t::init()}
 
const auto default_constructor = constructors<types<>>{}
 
const auto no_constructor = no_construction{}
 
const auto call_constructor = call_construction{}
 
const destructor_wrapper< void > default_destructor {}
 
const lua_nil_t lua_nil {}
 
const nil_t nil {}
 
const metatable_t metatable_key = {}
 
const env_t env_key = {}
 
const no_metatable_t no_metatable = {}
 
const auto base_classes = base_classes_tag()
 
const type_panic_t type_panic = {}
 
struct sol::simple_tag simple
 
const new_table create = new_table{}
 

Typedef Documentation

§ base_classes_tag

§ bases

template<typename... Args>
using sol::bases = typedef base_list<Args...>

§ basic_table

template<typename T >
using sol::basic_table = typedef basic_table_core<false, T>

§ c_closure

§ clean_type_t

template<typename T >
using sol::clean_type_t = typedef typename clean_type<T>::type

§ constructors

template<typename... Args>
using sol::constructors = typedef constructor_list<Args...>

§ coroutine

§ environment

§ exception_handler_function

using sol::exception_handler_function = typedef int(*)(lua_State*, optional<const std::exception&>, string_view)

§ function

using sol::function = typedef unsafe_function

§ function_result

§ global_table

§ in_place_index_t

template<std::size_t I>
using sol::in_place_index_t = typedef in_place_tag (&)(detail::in_place_of_i<I>)

§ in_place_t

§ in_place_type_t

template<typename T >
using sol::in_place_type_t = typedef in_place_tag (&)(detail::in_place_of_t<T>)

§ index_value

template<std::size_t I>
using sol::index_value = typedef std::integral_constant<std::size_t, I>

§ is_trivially_destructible

template<typename T >
using sol::is_trivially_destructible = typedef ::std::has_trivial_destructor<T>

§ lightuserdata

§ lua_CFunction_ref

typedef std::remove_pointer_t<lua_CFunction> sol::lua_CFunction_ref

§ main_coroutine

§ main_environment

§ main_function

§ main_global_table

§ main_lightuserdata

§ main_object

§ main_protected_function

§ main_reference

using sol::main_reference = typedef basic_reference<true>

§ main_safe_function

§ main_table

§ main_table_core

template<bool b>
using sol::main_table_core = typedef basic_table_core<b, main_reference>

§ main_unsafe_function

§ main_userdata

§ meta_method

§ nil_t

§ object

§ OptionalBase

template<class T >
using sol::OptionalBase = typedef typename ::std::conditional< ::std::is_trivially_destructible<T>::value, constexpr_optional_base<typename ::std::remove_const<T>::type>, optional_base<typename ::std::remove_const<T>::type>>::type

§ protected_function

§ reference

using sol::reference = typedef basic_reference<false>

§ returns_self

§ safe_function

§ safe_function_result

§ self_dependency

§ stack_aligned_function

§ stack_aligned_protected_function

§ stack_aligned_safe_function

§ stack_aligned_stack_handler_function

§ stack_aligned_unsafe_function

§ stack_coroutine

§ stack_environment

§ stack_function

§ stack_global_table

§ stack_lightuserdata

§ stack_object

§ stack_protected_function

§ stack_safe_function

§ stack_table

§ stack_table_core

template<bool b>
using sol::stack_table_core = typedef basic_table_core<b, stack_reference>

§ stack_thread

§ stack_unsafe_function

§ stack_userdata

§ string_view

using sol::string_view = typedef basic_string_view<char>

§ string_view_hash

using sol::string_view_hash = typedef std::hash<string_view>

§ table

typedef table_core< false > sol::table

§ table_core

template<bool b>
using sol::table_core = typedef basic_table_core<b, reference>

§ thread

§ u16string_view

using sol::u16string_view = typedef basic_string_view<char16_t>

§ u32string_view

using sol::u32string_view = typedef basic_string_view<char32_t>

§ unsafe_function

§ userdata

§ wstring_view

using sol::wstring_view = typedef basic_string_view<wchar_t>

Enumeration Type Documentation

§ call_status

enum sol::call_status : int
strong
Enumerator
ok 
yielded 
runtime 
memory 
handler 
gc 
syntax 
file 
5144  : int {
5145  ok = LUA_OK,
5146  yielded = LUA_YIELD,
5147  runtime = LUA_ERRRUN,
5148  memory = LUA_ERRMEM,
5149  handler = LUA_ERRERR,
5150  gc = LUA_ERRGCMM,
5151  syntax = LUA_ERRSYNTAX,
5152  file = LUA_ERRFILE,
5153  };

§ call_syntax

enum sol::call_syntax
strong
Enumerator
dot 
colon 
5133  {
5134  dot = 0,
5135  colon = 1
5136  };

§ lib

enum sol::lib : char
strong
Enumerator
base 
package 
coroutine 
string 
os 
math 
table 
debug 
bit32 
io 
ffi 
jit 
utf8 
count 
5102  : char {
5103  // print, assert, and other base functions
5104  base,
5105  // require and other package functions
5106  package,
5107  // coroutine functions and utilities
5108  coroutine,
5109  // string library
5110  string,
5111  // functionality from the OS
5112  os,
5113  // all things math
5114  math,
5115  // the table manipulator and observer functions
5116  table,
5117  // the debug library
5118  debug,
5119  // the bit library: different based on which you're using
5120  bit32,
5121  // input/output library
5122  io,
5123  // LuaJIT only
5124  ffi,
5125  // LuaJIT only
5126  jit,
5127  // library for handling utf8: new to Lua
5128  utf8,
5129  // do not use
5130  count
5131  };
table_core< false > table
Definition: sol.hpp:291
basic_coroutine< reference > coroutine
Definition: sol.hpp:354

§ load_mode

enum sol::load_mode
strong
Enumerator
any 
text 
binary 
5138  {
5139  any = 0,
5140  text = 1,
5141  binary = 2,
5142  };

§ load_status

enum sol::load_status : int
strong
Enumerator
ok 
syntax 
memory 
gc 
file 
5165  : int {
5166  ok = LUA_OK,
5167  syntax = LUA_ERRSYNTAX,
5168  memory = LUA_ERRMEM,
5169  gc = LUA_ERRGCMM,
5170  file = LUA_ERRFILE,
5171  };

§ meta_function

enum sol::meta_function
strong
Enumerator
construct 
index 
new_index 
mode 
call 
call_function 
metatable 
to_string 
length 
unary_minus 
addition 
subtraction 
multiplication 
division 
modulus 
power_of 
involution 
concatenation 
equal_to 
less_than 
less_than_or_equal_to 
garbage_collect 
floor_division 
bitwise_left_shift 
bitwise_right_shift 
bitwise_not 
bitwise_and 
bitwise_or 
bitwise_xor 
pairs 
ipairs 
next 
type 
type_info 
5277  {
5278  construct,
5279  index,
5280  new_index,
5281  mode,
5282  call,
5283  call_function = call,
5284  metatable,
5285  to_string,
5286  length,
5287  unary_minus,
5288  addition,
5289  subtraction,
5291  division,
5292  modulus,
5293  power_of,
5294  involution = power_of,
5295  concatenation,
5296  equal_to,
5297  less_than,
5303  bitwise_not,
5304  bitwise_and,
5305  bitwise_or,
5306  bitwise_xor,
5307  pairs,
5308  ipairs,
5309  next,
5310  type,
5311  type_info,
5312  };
int call(lua_State *L)
Definition: sol.hpp:12872
type
Definition: sol.hpp:5173
const string_view & to_string(error_code ec)
Definition: sol.hpp:8913
int construct(lua_State *L)
Definition: sol.hpp:13232

§ thread_status

enum sol::thread_status : int
strong
Enumerator
ok 
yielded 
runtime 
memory 
gc 
handler 
dead 
5155  : int {
5156  ok = LUA_OK,
5157  yielded = LUA_YIELD,
5158  runtime = LUA_ERRRUN,
5159  memory = LUA_ERRMEM,
5160  gc = LUA_ERRGCMM,
5161  handler = LUA_ERRERR,
5162  dead = -1,
5163  };

§ type

enum sol::type : int
strong
Enumerator
none 
lua_nil 
nil 
string 
number 
thread 
boolean 
function 
userdata 
lightuserdata 
table 
poly 
5173  : int {
5174  none = LUA_TNONE,
5175  lua_nil = LUA_TNIL,
5176 #if !defined(SOL_NO_NIL)
5177  nil = lua_nil,
5178 #endif // Objective C/C++ Keyword that's found in OSX SDK and OBJC -- check for all forms to protect
5179  string = LUA_TSTRING,
5180  number = LUA_TNUMBER,
5181  thread = LUA_TTHREAD,
5182  boolean = LUA_TBOOLEAN,
5183  function = LUA_TFUNCTION,
5184  userdata = LUA_TUSERDATA,
5185  lightuserdata = LUA_TLIGHTUSERDATA,
5186  table = LUA_TTABLE,
5187  poly = -0xFFFF
5188  };
const lua_nil_t lua_nil
Definition: sol.hpp:4683
basic_userdata< reference > userdata
Definition: sol.hpp:351
basic_thread< reference > thread
Definition: sol.hpp:353
const nil_t nil
Definition: sol.hpp:4692
table_core< false > table
Definition: sol.hpp:291
basic_lightuserdata< reference > lightuserdata
Definition: sol.hpp:352

Function Documentation

§ as_args()

template<typename Source >
auto sol::as_args ( Source &&  source)
15945  {
15946  return as_args_t<Source>{ std::forward<Source>(source) };
15947  }

§ as_container()

template<typename T >
auto sol::as_container ( T &&  value)
16282  {
16283  return as_container_t<T>(std::forward<T>(value));
16284  }

§ as_function()

template<typename Sig = function_sig<>, typename... Args>
auto sol::as_function ( Args &&...  args)
4972  {
4973  return function_arguments<Sig, std::decay_t<Args>...>(std::forward<Args>(args)...);
4974  }

§ as_function_reference()

template<typename Sig = function_sig<>, typename... Args>
auto sol::as_function_reference ( Args &&...  args)
4977  {
4978  return function_arguments<Sig, Args...>(std::forward<Args>(args)...);
4979  }

§ as_nested()

template<typename T >
nested<meta::unqualified_t<T> > sol::as_nested ( T &&  container)
5043  {
5044  return nested<meta::unqualified_t<T>>(std::forward<T>(container));
5045  }

§ as_nested_ref()

template<typename T >
nested<T> sol::as_nested_ref ( T &&  container)
5038  {
5039  return nested<T>(std::forward<T>(container));
5040  }

§ as_returns()

template<typename Source >
auto sol::as_returns ( Source &&  source)
22117  {
22118  return as_returns_t<std::decay_t<Source>>{ std::forward<Source>(source) };
22119  }

§ as_table()

template<typename T >
as_table_t<meta::unqualified_t<T> > sol::as_table ( T &&  container)
5033  {
5034  return as_table_t<meta::unqualified_t<T>>(std::forward<T>(container));
5035  }

§ as_table_ref()

template<typename T >
as_table_t<T> sol::as_table_ref ( T &&  container)
5028  {
5029  return as_table_t<T>(std::forward<T>(container));
5030  }

§ associated_type_name()

std::string sol::associated_type_name ( lua_State *  L,
int  index,
type  t 
)
inline
6311  {
6312  switch (t) {
6313  case type::poly:
6314  return "anything";
6315  case type::userdata:
6316  {
6317  if (lua_getmetatable(L, index) == 0) {
6318  break;
6319  }
6320  lua_pushlstring(L, "__name", 6);
6321  lua_rawget(L, -2);
6322  size_t sz;
6323  const char* name = lua_tolstring(L, -1, &sz);
6324  std::string tn(name, static_cast<std::string::size_type>(sz));
6325  lua_pop(L, 2);
6326  return name;
6327  }
6328  default:
6329  break;
6330  }
6331  return lua_typename(L, static_cast<int>(t));
6332  }
basic_userdata< reference > userdata
Definition: sol.hpp:351

§ c_call() [1/2]

template<typename F , F fx>
int sol::c_call ( lua_State *  L)
inline
13862  {
13863  typedef meta::unqualified_t<F> Fu;
13864  typedef std::integral_constant<bool, std::is_same<Fu, lua_CFunction>::value
13865 #if defined(SOL_NOEXCEPT_FUNCTION_TYPE) && SOL_NOEXCEPT_FUNCTION_TYPE
13866  || std::is_same<Fu, detail::lua_CFunction_noexcept>::value
13867 #endif
13868  > is_raw;
13869  return function_detail::c_call_raw<F, fx>(is_raw(), L);
13870  }

§ c_call() [2/2]

template<typename... Fxs>
int sol::c_call ( lua_State *  L)
inline
13882  {
13883  if (sizeof...(Fxs) < 2) {
13885  }
13886  else {
13887  return call_detail::overload_match_arity<typename Fxs::type...>(function_detail::c_call_matcher<Fxs...>(), L, lua_gettop(L), 1);
13888  }
13889  }
int call(lua_State *L)
Definition: sol.hpp:12872
type
Definition: sol.hpp:5173
int overload_match_arity(Match &&matchfx, lua_State *L, int fxarity, int start, Args &&... args)
Definition: sol.hpp:13195

§ constexpr_forward() [1/2]

template<class T >
constexpr T&& sol::constexpr_forward ( typename ::std::remove_reference< T >::type t)
inlinenoexcept
3432  {
3433  return static_cast<T&&>(t);
3434  }

§ constexpr_forward() [2/2]

template<class T >
constexpr T&& sol::constexpr_forward ( typename ::std::remove_reference< T >::type &&  t)
inlinenoexcept
3437  {
3438  static_assert(!::std::is_lvalue_reference<T>::value, "!!");
3439  return static_cast<T&&>(t);
3440  }

§ constexpr_move()

template<class T >
constexpr ::std::remove_reference<T>::type&& sol::constexpr_move ( T &&  t)
inlinenoexcept
3443  {
3444  return static_cast<typename ::std::remove_reference<T>::type&&>(t);
3445  }
type
Definition: sol.hpp:5173

§ default_at_panic()

int sol::default_at_panic ( lua_State *  L)
inline
20922  {
20923 #if defined(SOL_NO_EXCEPTIONS) && SOL_NO_EXCEPTIONS
20924  (void)L;
20925  return -1;
20926 #else
20927  size_t messagesize;
20928  const char* message = lua_tolstring(L, -1, &messagesize);
20929  if (message) {
20930  std::string err(message, messagesize);
20931  lua_settop(L, 0);
20932 #if defined(SOL_PRINT_ERRORS) && SOL_PRINT_ERRORS
20933  std::cerr << "[sol2] An error occurred and panic has been invoked: ";
20934  std::cerr << err;
20935  std::cerr << std::endl;
20936 #endif
20937  throw error(err);
20938  }
20939  lua_settop(L, 0);
20940  throw error(std::string("An unexpected error occurred and panic has been invoked"));
20941 #endif // Printing Errors
20942  }

§ default_traceback_error_handler()

int sol::default_traceback_error_handler ( lua_State *  L)
inline
20944  {
20945  std::string msg = "An unknown error has triggered the default error handler";
20946  optional<string_view> maybetopmsg = stack::check_get<string_view>(L, 1);
20947  if (maybetopmsg) {
20948  const string_view& topmsg = maybetopmsg.value();
20949  msg.assign(topmsg.data(), topmsg.size());
20950  }
20951  luaL_traceback(L, L, msg.c_str(), 1);
20952  optional<string_view> maybetraceback = stack::check_get<string_view>(L, -1);
20953  if (maybetraceback) {
20954  const string_view& traceback = maybetraceback.value();
20955  msg.assign(traceback.data(), traceback.size());
20956  }
20957 #if defined(SOL_PRINT_ERRORS) && SOL_PRINT_ERRORS
20958  //std::cerr << "[sol2] An error occurred and was caught in traceback: ";
20959  //std::cerr << msg;
20960  //std::cerr << std::endl;
20961 #endif // Printing
20962  return stack::push(L, msg);
20963  }
int push(lua_State *L, Arg &&arg, Args &&... args)
Definition: sol.hpp:7776
basic_string_view< char > string_view
Definition: sol.hpp:1186

§ destructor()

template<typename Fx >
auto sol::destructor ( Fx &&  fx)
inline
4547  {
4548  return destructor_wrapper<std::decay_t<Fx>>(std::forward<Fx>(fx));
4549  }

§ factories()

template<typename... Functions>
auto sol::factories ( Functions &&...  functions)
inline
4529  {
4530  return factory_wrapper<std::decay_t<Functions>...>(std::forward<Functions>(functions)...);
4531  }

§ filters()

template<typename F , typename... Args>
auto sol::filters ( F &&  f,
Args &&...  args 
)
4613  {
4614  return filter_wrapper<std::decay_t<F>, std::decay_t<Args>...>(std::forward<F>(f), std::forward<Args>(args)...);
4615  }

§ get() [1/4]

template<std::size_t I>
stack_proxy sol::get ( const unsafe_function_result fr)
12573  {
12574  return stack_proxy(fr.lua_state(), static_cast<int>(fr.stack_index() + I));
12575  }

§ get() [2/4]

template<std::size_t I, typename... Args>
stack_proxy sol::get ( types< Args... >  t,
const unsafe_function_result fr 
)
12578  {
12579  return detail::get(t, index_value<I>(), index_value<0>(), fr);
12580  }
stack_proxy get(types< Args... > t, const protected_function_result &fr)
Definition: sol.hpp:12588

§ get() [3/4]

template<std::size_t I>
stack_proxy sol::get ( const protected_function_result fr)
12583  {
12584  return stack_proxy(fr.lua_state(), static_cast<int>(fr.stack_index() + I));
12585  }

§ get() [4/4]

template<std::size_t I, typename... Args>
stack_proxy sol::get ( types< Args... >  t,
const protected_function_result fr 
)
12588  {
12589  return detail::get(t, index_value<I>(), index_value<0>(), fr);
12590  }
stack_proxy get(types< Args... > t, const protected_function_result &fr)
Definition: sol.hpp:12588

§ get_environment()

template<typename E = reference, typename T >
basic_environment<E> sol::get_environment ( const T target)
20696  {
20697  lua_State* L = target.lua_state();
20698  auto pp = stack::pop_n(L, stack::push_environment_of(target));
20699  return basic_environment<E>(L, -1);
20700  }
push_popper_n< top_level > pop_n(lua_State *L, int x)
Definition: sol.hpp:6671
int push_environment_of(const T &target)
Definition: sol.hpp:10353

§ in_place() [1/3]

constexpr in_place_tag sol::in_place ( detail::in_place_of_tag  )
inline
3223  {
3224  return in_place_tag();
3225  }

§ in_place() [2/3]

template<typename T >
constexpr in_place_tag sol::in_place ( detail::in_place_of_t< T )
inline
3227  {
3228  return in_place_tag();
3229  }

§ in_place() [3/3]

template<std::size_t I>
constexpr in_place_tag sol::in_place ( detail::in_place_of_i< I >  )
inline
3231  {
3232  return in_place_tag();
3233  }

§ in_place_index()

template<std::size_t I>
constexpr in_place_tag sol::in_place_index ( detail::in_place_of_i< I >  )
inline
3243  {
3244  return in_place_tag();
3245  }

§ in_place_of()

constexpr in_place_tag sol::in_place_of ( detail::in_place_of_tag  )
inline
3235  {
3236  return in_place_tag();
3237  }

§ in_place_type()

template<typename T >
constexpr in_place_tag sol::in_place_type ( detail::in_place_of_t< T )
inline
3239  {
3240  return in_place_tag();
3241  }

§ initializers()

template<typename... Functions>
auto sol::initializers ( Functions &&...  functions)
inline
4515  {
4516  return constructor_wrapper<std::decay_t<Functions>...>(std::forward<Functions>(functions)...);
4517  }

§ is_indeterminate_call_failure()

bool sol::is_indeterminate_call_failure ( call_status  c)
inline
5226  {
5227  switch (c) {
5228  case call_status::ok:
5229  case call_status::yielded:
5230  case call_status::runtime:
5231  case call_status::memory:
5232  case call_status::handler:
5233  case call_status::gc:
5234  case call_status::syntax:
5235  case call_status::file:
5236  return false;
5237  }
5238  return true;
5239  }

§ main_thread()

lua_State* sol::main_thread ( lua_State *  L,
lua_State *  backup_if_unsupported = nullptr 
)
inline
6676  {
6677 #if SOL_LUA_VERSION < 502
6678  if (L == nullptr)
6679  return backup_if_unsupported;
6680  lua_getglobal(L, detail::default_main_thread_name());
6681  auto pp = stack::pop_n(L, 1);
6682  if (type_of(L, -1) == type::thread) {
6683  return lua_tothread(L, -1);
6684  }
6685  return backup_if_unsupported;
6686 #else
6687  if (L == nullptr)
6688  return backup_if_unsupported;
6689  lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_MAINTHREAD);
6690  lua_State* Lmain = lua_tothread(L, -1);
6691  lua_pop(L, 1);
6692  return Lmain;
6693 #endif // Lua 5.2+ has the main thread getter
6694  }
basic_thread< reference > thread
Definition: sol.hpp:353
type type_of()
Definition: sol.hpp:5770
push_popper_n< top_level > pop_n(lua_State *L, int x)
Definition: sol.hpp:6671
const char(& default_main_thread_name())[9]
Definition: sol.hpp:6569

§ make_closure()

template<typename... Args>
closure<Args...> sol::make_closure ( lua_CFunction  f,
Args &&...  args 
)
4958  {
4959  return closure<Args...>(f, std::forward<Args>(args)...);
4960  }

§ make_light()

template<typename T >
auto sol::make_light ( T l)
4893  {
4894  typedef meta::unwrapped_t<std::remove_pointer_t<std::remove_pointer_t<T>>> L;
4895  return light<L>(l);
4896  }

§ make_object() [1/2]

template<typename T >
object sol::make_object ( lua_State *  L,
T &&  value 
)
16230  {
16231  return make_reference<object, true>(L, std::forward<T>(value));
16232  }

§ make_object() [2/2]

template<typename T , typename... Args>
object sol::make_object ( lua_State *  L,
Args &&...  args 
)
16235  {
16236  return make_reference<T, object, true>(L, std::forward<Args>(args)...);
16237  }

§ make_optional() [1/2]

template<class T >
constexpr optional<typename ::std::decay<T>::type> sol::make_optional ( T &&  v)
4332  {
4333  return optional<typename ::std::decay<T>::type>(constexpr_forward<T>(v));
4334  }
type
Definition: sol.hpp:5173

§ make_optional() [2/2]

template<class X >
constexpr optional<X&> sol::make_optional ( ::std::reference_wrapper< X >  v)
4337  {
4338  return optional<X&>(v.get());
4339  }

§ make_reference() [1/2]

template<typename R = reference, bool should_pop = !is_stack_based<R>::value, typename T >
R sol::make_reference ( lua_State *  L,
T &&  value 
)
16123  {
16124  int backpedal = stack::push(L, std::forward<T>(value));
16125  R r = stack::get<R>(L, -backpedal);
16126  if (should_pop) {
16127  lua_pop(L, backpedal);
16128  }
16129  return r;
16130  }
int push(lua_State *L, Arg &&arg, Args &&... args)
Definition: sol.hpp:7776

§ make_reference() [2/2]

template<typename T , typename R = reference, bool should_pop = !is_stack_based<R>::value, typename... Args>
R sol::make_reference ( lua_State *  L,
Args &&...  args 
)
16133  {
16134  int backpedal = stack::push<T>(L, std::forward<Args>(args)...);
16135  R r = stack::get<R>(L, -backpedal);
16136  if (should_pop) {
16137  lua_pop(L, backpedal);
16138  }
16139  return r;
16140  }

§ make_user()

template<typename T >
auto sol::make_user ( T &&  u)
4917  {
4918  typedef meta::unwrapped_t<meta::unqualified_t<T>> U;
4919  return user<U>(std::forward<T>(u));
4920  }

§ meta_function_names()

const std::array<std::string, 32>& sol::meta_function_names ( )
inline
5316  {
5317  static const std::array<std::string, 32> names = { { "new",
5318  "__index",
5319  "__newindex",
5320  "__mode",
5321  "__call",
5322  "__mt",
5323  "__tostring",
5324  "__len",
5325  "__unm",
5326  "__add",
5327  "__sub",
5328  "__mul",
5329  "__div",
5330  "__mod",
5331  "__pow",
5332  "__concat",
5333  "__eq",
5334  "__lt",
5335  "__le",
5336  "__gc",
5337 
5338  "__idiv",
5339  "__shl",
5340  "__shr",
5341  "__bnot",
5342  "__band",
5343  "__bor",
5344  "__bxor",
5345 
5346  "__pairs",
5347  "__ipairs",
5348  "next",
5349  "__type",
5350  "__typeinfo" } };
5351  return names;
5352  }

§ meta_registry_key()

template<typename T >
auto sol::meta_registry_key ( T &&  key)
4932  {
4933  typedef meta::unqualified_t<T> K;
4934  return metatable_registry_key<K>(std::forward<T>(key));
4935  }

§ no_panic()

int sol::no_panic ( lua_State *  ,
int  ,
type  ,
type  ,
const char *  = nullptr 
)
inlinenoexcept
6402  {
6403  return 0;
6404  }

§ operator!=() [1/20]

template<class T >
constexpr bool sol::operator!= ( const optional< T > &  x,
const optional< T > &  y 
)
4057  {
4058  return !(x == y);
4059  }

§ operator!=() [2/20]

template<class T >
constexpr bool sol::operator!= ( const optional< T > &  x,
nullopt_t   
)
noexcept
4093  {
4094  return bool(x);
4095  }

§ operator!=() [3/20]

template<class T >
constexpr bool sol::operator!= ( nullopt_t  ,
const optional< T > &  x 
)
noexcept
4098  {
4099  return bool(x);
4100  }

§ operator!=() [4/20]

template<class T >
constexpr bool sol::operator!= ( const optional< T > &  x,
const T v 
)
4154  {
4155  return bool(x) ? *x != v : true;
4156  }

§ operator!=() [5/20]

template<class T >
constexpr bool sol::operator!= ( const T v,
const optional< T > &  x 
)
4159  {
4160  return bool(x) ? v != *x : true;
4161  }

§ operator!=() [6/20]

template<class T >
constexpr bool sol::operator!= ( const optional< T &> &  x,
const T v 
)
4215  {
4216  return bool(x) ? *x != v : true;
4217  }

§ operator!=() [7/20]

template<class T >
constexpr bool sol::operator!= ( const T v,
const optional< T &> &  x 
)
4220  {
4221  return bool(x) ? v != *x : true;
4222  }

§ operator!=() [8/20]

template<class T >
constexpr bool sol::operator!= ( const optional< const T &> &  x,
const T v 
)
4276  {
4277  return bool(x) ? *x != v : true;
4278  }

§ operator!=() [9/20]

template<class T >
constexpr bool sol::operator!= ( const T v,
const optional< const T &> &  x 
)
4281  {
4282  return bool(x) ? v != *x : true;
4283  }

§ operator!=() [10/20]

bool sol::operator!= ( lua_nil_t  ,
lua_nil_t   
)
inline
4687  {
4688  return false;
4689  }

§ operator!=() [11/20]

bool sol::operator!= ( const stack_reference l,
const stack_reference r 
)
inline
6544  {
6545  return !operator==(l, r);
6546  }
bool operator==(const proxy< Table, Key > &right, lua_nil_t)
Definition: sol.hpp:15690

§ operator!=() [12/20]

bool sol::operator!= ( const stack_reference lhs,
const lua_nil_t  
)
inline
6556  {
6557  return lhs.valid();
6558  }

§ operator!=() [13/20]

bool sol::operator!= ( const lua_nil_t ,
const stack_reference rhs 
)
inline
6560  {
6561  return rhs.valid();
6562  }

§ operator!=() [14/20]

template<bool lb, bool rb>
bool sol::operator!= ( const basic_reference< lb > &  l,
const basic_reference< rb > &  r 
)
inline
6999  {
7000  return !operator==(l, r);
7001  }
bool operator==(const proxy< Table, Key > &right, lua_nil_t)
Definition: sol.hpp:15690

§ operator!=() [15/20]

template<bool lb>
bool sol::operator!= ( const basic_reference< lb > &  lhs,
const lua_nil_t  
)
inline
7014  {
7015  return lhs.valid();
7016  }

§ operator!=() [16/20]

template<bool rb>
bool sol::operator!= ( const lua_nil_t ,
const basic_reference< rb > &  rhs 
)
inline
7019  {
7020  return rhs.valid();
7021  }

§ operator!=() [17/20]

template<typename Table , typename Key , typename T >
bool sol::operator!= ( T &&  left,
const proxy< Table, Key > &  right 
)
inline
15673  {
15674  typedef decltype(stack::get<T>(nullptr, 0)) U;
15675  return right.template get<optional<U>>() != left;
15676  }
stack_proxy get(types< Args... > t, const protected_function_result &fr)
Definition: sol.hpp:12588

§ operator!=() [18/20]

template<typename Table , typename Key , typename T >
bool sol::operator!= ( const proxy< Table, Key > &  right,
T &&  left 
)
inline
15679  {
15680  typedef decltype(stack::get<T>(nullptr, 0)) U;
15681  return right.template get<optional<U>>() != left;
15682  }
stack_proxy get(types< Args... > t, const protected_function_result &fr)
Definition: sol.hpp:12588

§ operator!=() [19/20]

template<typename Table , typename Key >
bool sol::operator!= ( lua_nil_t  ,
const proxy< Table, Key > &  right 
)
inline
15695  {
15696  return right.valid();
15697  }

§ operator!=() [20/20]

template<typename Table , typename Key >
bool sol::operator!= ( const proxy< Table, Key > &  right,
lua_nil_t   
)
inline
15700  {
15701  return right.valid();
15702  }

§ operator+()

template<typename proxy_t , bool is_const>
stack_iterator<proxy_t, is_const> sol::operator+ ( typename stack_iterator< proxy_t, is_const >::difference_type  n,
const stack_iterator< proxy_t, is_const > &  r 
)
inline
12092  {
12093  return r + n;
12094  }

§ operator<() [1/9]

template<class T >
constexpr bool sol::operator< ( const optional< T > &  x,
const optional< T > &  y 
)
4062  {
4063  return (!y) ? false : (!x) ? true : *x < *y;
4064  }

§ operator<() [2/9]

template<class T >
constexpr bool sol::operator< ( const optional< T > &  ,
nullopt_t   
)
noexcept
4103  {
4104  return false;
4105  }

§ operator<() [3/9]

template<class T >
constexpr bool sol::operator< ( nullopt_t  ,
const optional< T > &  x 
)
noexcept
4108  {
4109  return bool(x);
4110  }

§ operator<() [4/9]

template<class T >
constexpr bool sol::operator< ( const optional< T > &  x,
const T v 
)
4164  {
4165  return bool(x) ? *x < v : true;
4166  }

§ operator<() [5/9]

template<class T >
constexpr bool sol::operator< ( const T v,
const optional< T > &  x 
)
4179  {
4180  return bool(x) ? v < *x : false;
4181  }

§ operator<() [6/9]

template<class T >
constexpr bool sol::operator< ( const optional< T &> &  x,
const T v 
)
4225  {
4226  return bool(x) ? *x < v : true;
4227  }

§ operator<() [7/9]

template<class T >
constexpr bool sol::operator< ( const T v,
const optional< T &> &  x 
)
4240  {
4241  return bool(x) ? v < *x : false;
4242  }

§ operator<() [8/9]

template<class T >
constexpr bool sol::operator< ( const optional< const T &> &  x,
const T v 
)
4286  {
4287  return bool(x) ? *x < v : true;
4288  }

§ operator<() [9/9]

template<class T >
constexpr bool sol::operator< ( const T v,
const optional< const T &> &  x 
)
4301  {
4302  return bool(x) ? v < *x : false;
4303  }

§ operator<=() [1/9]

template<class T >
constexpr bool sol::operator<= ( const optional< T > &  x,
const optional< T > &  y 
)
4072  {
4073  return !(y < x);
4074  }

§ operator<=() [2/9]

template<class T >
constexpr bool sol::operator<= ( const optional< T > &  x,
nullopt_t   
)
noexcept
4113  {
4114  return (!x);
4115  }

§ operator<=() [3/9]

template<class T >
constexpr bool sol::operator<= ( nullopt_t  ,
const optional< T > &   
)
noexcept
4118  {
4119  return true;
4120  }

§ operator<=() [4/9]

template<class T >
constexpr bool sol::operator<= ( const T v,
const optional< T > &  x 
)
4189  {
4190  return bool(x) ? v <= *x : false;
4191  }

§ operator<=() [5/9]

template<class T >
constexpr bool sol::operator<= ( const optional< T > &  x,
const T v 
)
4194  {
4195  return bool(x) ? *x <= v : true;
4196  }

§ operator<=() [6/9]

template<class T >
constexpr bool sol::operator<= ( const T v,
const optional< T &> &  x 
)
4250  {
4251  return bool(x) ? v <= *x : false;
4252  }

§ operator<=() [7/9]

template<class T >
constexpr bool sol::operator<= ( const optional< T &> &  x,
const T v 
)
4255  {
4256  return bool(x) ? *x <= v : true;
4257  }

§ operator<=() [8/9]

template<class T >
constexpr bool sol::operator<= ( const T v,
const optional< const T &> &  x 
)
4311  {
4312  return bool(x) ? v <= *x : false;
4313  }

§ operator<=() [9/9]

template<class T >
constexpr bool sol::operator<= ( const optional< const T &> &  x,
const T v 
)
4316  {
4317  return bool(x) ? *x <= v : true;
4318  }

§ operator==() [1/20]

template<class T >
constexpr bool sol::operator== ( const optional< T > &  x,
const optional< T > &  y 
)
4052  {
4053  return bool(x) != bool(y) ? false : bool(x) == false ? true : *x == *y;
4054  }

§ operator==() [2/20]

template<class T >
constexpr bool sol::operator== ( const optional< T > &  x,
nullopt_t   
)
noexcept
4083  {
4084  return (!x);
4085  }

§ operator==() [3/20]

template<class T >
constexpr bool sol::operator== ( nullopt_t  ,
const optional< T > &  x 
)
noexcept
4088  {
4089  return (!x);
4090  }

§ operator==() [4/20]

template<class T >
constexpr bool sol::operator== ( const optional< T > &  x,
const T v 
)
4144  {
4145  return bool(x) ? *x == v : false;
4146  }

§ operator==() [5/20]

template<class T >
constexpr bool sol::operator== ( const T v,
const optional< T > &  x 
)
4149  {
4150  return bool(x) ? v == *x : false;
4151  }

§ operator==() [6/20]

template<class T >
constexpr bool sol::operator== ( const optional< T &> &  x,
const T v 
)
4205  {
4206  return bool(x) ? *x == v : false;
4207  }

§ operator==() [7/20]

template<class T >
constexpr bool sol::operator== ( const T v,
const optional< T &> &  x 
)
4210  {
4211  return bool(x) ? v == *x : false;
4212  }

§ operator==() [8/20]

template<class T >
constexpr bool sol::operator== ( const optional< const T &> &  x,
const T v 
)
4266  {
4267  return bool(x) ? *x == v : false;
4268  }

§ operator==() [9/20]

template<class T >
constexpr bool sol::operator== ( const T v,
const optional< const T &> &  x 
)
4271  {
4272  return bool(x) ? v == *x : false;
4273  }

§ operator==() [10/20]

bool sol::operator== ( lua_nil_t  ,
lua_nil_t   
)
inline
4684  {
4685  return true;
4686  }

§ operator==() [11/20]

bool sol::operator== ( const stack_reference l,
const stack_reference r 
)
inline
6540  {
6541  return lua_compare(l.lua_state(), l.stack_index(), r.stack_index(), LUA_OPEQ) == 0;
6542  }

§ operator==() [12/20]

bool sol::operator== ( const stack_reference lhs,
const lua_nil_t  
)
inline
6548  {
6549  return !lhs.valid();
6550  }

§ operator==() [13/20]

bool sol::operator== ( const lua_nil_t ,
const stack_reference rhs 
)
inline
6552  {
6553  return !rhs.valid();
6554  }

§ operator==() [14/20]

template<bool lb, bool rb>
bool sol::operator== ( const basic_reference< lb > &  l,
const basic_reference< rb > &  r 
)
inline
6992  {
6993  auto ppl = stack::push_pop(l);
6994  auto ppr = stack::push_pop(r);
6995  return lua_compare(l.lua_state(), -1, -2, LUA_OPEQ) == 1;
6996  }
push_popper< top_level, T > push_pop(T &&x)
Definition: sol.hpp:6661

§ operator==() [15/20]

template<bool lb>
bool sol::operator== ( const basic_reference< lb > &  lhs,
const lua_nil_t  
)
inline
7004  {
7005  return !lhs.valid();
7006  }

§ operator==() [16/20]

template<bool rb>
bool sol::operator== ( const lua_nil_t ,
const basic_reference< rb > &  rhs 
)
inline
7009  {
7010  return !rhs.valid();
7011  }

§ operator==() [17/20]

template<typename Table , typename Key , typename T >
bool sol::operator== ( T &&  left,
const proxy< Table, Key > &  right 
)
inline
15661  {
15662  typedef decltype(stack::get<T>(nullptr, 0)) U;
15663  return right.template get<optional<U>>() == left;
15664  }
stack_proxy get(types< Args... > t, const protected_function_result &fr)
Definition: sol.hpp:12588

§ operator==() [18/20]

template<typename Table , typename Key , typename T >
bool sol::operator== ( const proxy< Table, Key > &  right,
T &&  left 
)
inline
15667  {
15668  typedef decltype(stack::get<T>(nullptr, 0)) U;
15669  return right.template get<optional<U>>() == left;
15670  }
stack_proxy get(types< Args... > t, const protected_function_result &fr)
Definition: sol.hpp:12588

§ operator==() [19/20]

template<typename Table , typename Key >
bool sol::operator== ( lua_nil_t  ,
const proxy< Table, Key > &  right 
)
inline
15685  {
15686  return !right.valid();
15687  }

§ operator==() [20/20]

template<typename Table , typename Key >
bool sol::operator== ( const proxy< Table, Key > &  right,
lua_nil_t   
)
inline
15690  {
15691  return !right.valid();
15692  }

§ operator>() [1/9]

template<class T >
constexpr bool sol::operator> ( const optional< T > &  x,
const optional< T > &  y 
)
4067  {
4068  return (y < x);
4069  }

§ operator>() [2/9]

template<class T >
constexpr bool sol::operator> ( const optional< T > &  x,
nullopt_t   
)
noexcept
4123  {
4124  return bool(x);
4125  }

§ operator>() [3/9]

template<class T >
constexpr bool sol::operator> ( nullopt_t  ,
const optional< T > &   
)
noexcept
4128  {
4129  return false;
4130  }

§ operator>() [4/9]

template<class T >
constexpr bool sol::operator> ( const T v,
const optional< T > &  x 
)
4169  {
4170  return bool(x) ? v > *x : true;
4171  }

§ operator>() [5/9]

template<class T >
constexpr bool sol::operator> ( const optional< T > &  x,
const T v 
)
4174  {
4175  return bool(x) ? *x > v : false;
4176  }

§ operator>() [6/9]

template<class T >
constexpr bool sol::operator> ( const T v,
const optional< T &> &  x 
)
4230  {
4231  return bool(x) ? v > *x : true;
4232  }

§ operator>() [7/9]

template<class T >
constexpr bool sol::operator> ( const optional< T &> &  x,
const T v 
)
4235  {
4236  return bool(x) ? *x > v : false;
4237  }

§ operator>() [8/9]

template<class T >
constexpr bool sol::operator> ( const T v,
const optional< const T &> &  x 
)
4291  {
4292  return bool(x) ? v > *x : true;
4293  }

§ operator>() [9/9]

template<class T >
constexpr bool sol::operator> ( const optional< const T &> &  x,
const T v 
)
4296  {
4297  return bool(x) ? *x > v : false;
4298  }

§ operator>=() [1/9]

template<class T >
constexpr bool sol::operator>= ( const optional< T > &  x,
const optional< T > &  y 
)
4077  {
4078  return !(x < y);
4079  }

§ operator>=() [2/9]

template<class T >
constexpr bool sol::operator>= ( const optional< T > &  ,
nullopt_t   
)
noexcept
4133  {
4134  return true;
4135  }

§ operator>=() [3/9]

template<class T >
constexpr bool sol::operator>= ( nullopt_t  ,
const optional< T > &  x 
)
noexcept
4138  {
4139  return (!x);
4140  }

§ operator>=() [4/9]

template<class T >
constexpr bool sol::operator>= ( const optional< T > &  x,
const T v 
)
4184  {
4185  return bool(x) ? *x >= v : false;
4186  }

§ operator>=() [5/9]

template<class T >
constexpr bool sol::operator>= ( const T v,
const optional< T > &  x 
)
4199  {
4200  return bool(x) ? v >= *x : true;
4201  }

§ operator>=() [6/9]

template<class T >
constexpr bool sol::operator>= ( const optional< T &> &  x,
const T v 
)
4245  {
4246  return bool(x) ? *x >= v : false;
4247  }

§ operator>=() [7/9]

template<class T >
constexpr bool sol::operator>= ( const T v,
const optional< T &> &  x 
)
4260  {
4261  return bool(x) ? v >= *x : true;
4262  }

§ operator>=() [8/9]

template<class T >
constexpr bool sol::operator>= ( const optional< const T &> &  x,
const T v 
)
4306  {
4307  return bool(x) ? *x >= v : false;
4308  }

§ operator>=() [9/9]

template<class T >
constexpr bool sol::operator>= ( const T v,
const optional< const T &> &  x 
)
4321  {
4322  return bool(x) ? v >= *x : true;
4323  }

§ overload()

template<typename... Args>
decltype(auto) sol::overload ( Args &&...  args)
8890  {
8891  return overload_set<std::decay_t<Args>...>(std::forward<Args>(args)...);
8892  }

§ property() [1/2]

template<typename F , typename G >
decltype(auto) sol::property ( F &&  f,
G &&  g 
)
inline
12960  {
12961  typedef lua_bind_traits<meta::unqualified_t<F>> left_traits;
12962  typedef lua_bind_traits<meta::unqualified_t<G>> right_traits;
12963  return property_detail::property(meta::boolean<(left_traits::free_arity < right_traits::free_arity)>(), std::forward<F>(f), std::forward<G>(g));
12964  }
std::integral_constant< bool, B > boolean
Definition: sol.hpp:1284
decltype(auto) property(F &&f)
Definition: sol.hpp:12967

§ property() [2/2]

template<typename F >
decltype(auto) sol::property ( F &&  f)
inline
12967  {
12968  typedef lua_bind_traits<meta::unqualified_t<F>> left_traits;
12969  return property_detail::property(meta::boolean<(left_traits::free_arity < 2)>(), std::forward<F>(f));
12970  }
std::integral_constant< bool, B > boolean
Definition: sol.hpp:1284
decltype(auto) property(F &&f)
Definition: sol.hpp:12967

§ protect()

template<typename T >
auto sol::protect ( T &&  value)
12911  {
12912  return protect_t<std::decay_t<T>>(std::forward<T>(value));
12913  }

§ readonly()

template<typename R , typename T >
auto sol::readonly ( R T::*  v)
inline
13000  {
13001  return readonly_wrapper<meta::unqualified_t<decltype(v)>>(v);
13002  }

§ readonly_property()

template<typename F >
decltype(auto) sol::readonly_property ( F &&  f)
inline
12973  {
12974  return property_detail::property(std::true_type(), std::forward<F>(f));
12975  }
decltype(auto) property(F &&f)
Definition: sol.hpp:12967

§ register_main_thread()

void sol::register_main_thread ( lua_State *  L)
inline
20908  {
20909 #if SOL_LUA_VERSION < 502
20910  if (L == nullptr) {
20911  lua_pushnil(L);
20912  lua_setglobal(L, detail::default_main_thread_name());
20913  return;
20914  }
20915  lua_pushthread(L);
20916  lua_setglobal(L, detail::default_main_thread_name());
20917 #else
20918  (void)L;
20919 #endif
20920  }
const char(& default_main_thread_name())[9]
Definition: sol.hpp:6569

§ resolve() [1/5]

template<typename... Args, typename R >
constexpr auto sol::resolve ( R   fun_ptrArgs...) -> R (*)(Args...)
inline
14330  {
14331  return fun_ptr;
14332  }

§ resolve() [2/5]

template<typename Sig >
constexpr Sig* sol::resolve ( Sig *  fun_ptr)
inline
14335  {
14336  return fun_ptr;
14337  }

§ resolve() [3/5]

template<typename... Args, typename R , typename C >
constexpr auto sol::resolve ( R(C::*)(Args...)  mem_ptr) -> R (C::*)(Args...)
inline
14340  {
14341  return mem_ptr;
14342  }

§ resolve() [4/5]

template<typename Sig , typename C >
constexpr Sig C::* sol::resolve ( Sig C::*  mem_ptr)
inline
14345  {
14346  return detail::resolve_v(std::is_member_object_pointer<Sig C::*>(), mem_ptr);
14347  }
constexpr Sig C::* resolve_v(std::true_type, Sig C::*mem_variable_ptr)
Definition: sol.hpp:14324

§ resolve() [5/5]

template<typename... Sig, typename F , meta::disable< std::is_function< meta::unqualified_t< F >>> = meta::enabler>
constexpr auto sol::resolve ( F &&  f) -> decltype(detail::resolve_i(types<Sig...>(), std::forward<F>(f)))
inline
14350  {
14351  return detail::resolve_i(types<Sig...>(), std::forward<F>(f));
14352  }
constexpr auto resolve_i(types< Args... >, F &&f) -> decltype(resolve_i(types< R(Args...)>(), std::forward< F >(f)))
Definition: sol.hpp:14314

§ script_default_on_error()

protected_function_result sol::script_default_on_error ( lua_State *  L,
protected_function_result  pfr 
)
inline
21042  {
21043 #if defined(SOL_DEFAULT_PASS_ON_ERROR) && SOL_DEFAULT_PASS_ON_ERROR
21044  return script_pass_on_error(L, std::move(pfr));
21045 #else
21046  return script_throw_on_error(L, std::move(pfr));
21047 #endif
21048  }
protected_function_result script_throw_on_error(lua_State *L, protected_function_result result)
Definition: sol.hpp:20984
protected_function_result script_pass_on_error(lua_State *, protected_function_result result)
Definition: sol.hpp:20980

§ script_pass_on_error()

protected_function_result sol::script_pass_on_error ( lua_State *  ,
protected_function_result  result 
)
inline
20980  {
20981  return result;
20982  }

§ script_throw_on_error()

protected_function_result sol::script_throw_on_error ( lua_State *  L,
protected_function_result  result 
)
inline
20984  {
20985  type t = type_of(L, result.stack_index());
20986  std::string err = "sol: ";
20987  err += to_string(result.status());
20988  err += " error";
20989 #if !(defined(SOL_NO_EXCEPTIONS) && SOL_NO_EXCEPTIONS)
20990  std::exception_ptr eptr = std::current_exception();
20991  if (eptr) {
20992  err += " with a ";
20993  try {
20994  std::rethrow_exception(eptr);
20995  }
20996  catch (const std::exception& ex) {
20997  err += "std::exception -- ";
20998  err.append(ex.what());
20999  }
21000  catch (const std::string& message) {
21001  err += "thrown message -- ";
21002  err.append(message);
21003  }
21004  catch (const char* message) {
21005  err += "thrown message -- ";
21006  err.append(message);
21007  }
21008  catch (...) {
21009  err.append("thrown but unknown type, cannot serialize into error message");
21010  }
21011  }
21012 #endif // serialize exception information if possible
21013  if (t == type::string) {
21014  err += ": ";
21015  string_view serr = stack::get<string_view>(L, result.stack_index());
21016  err.append(serr.data(), serr.size());
21017  }
21018 #if defined(SOL_PRINT_ERRORS) && SOL_PRINT_ERRORS
21019  std::cerr << "[sol2] An error occurred and has been passed to an error handler: ";
21020  std::cerr << err;
21021  std::cerr << std::endl;
21022 #endif
21023  // replacing information of stack error into pfr
21024  int target = result.stack_index();
21025  if (result.pop_count() > 0) {
21026  stack::remove(L, target, result.pop_count());
21027  }
21028  stack::push(L, err);
21029  int top = lua_gettop(L);
21030  int towards = top - target;
21031  if (towards != 0) {
21032  lua_rotate(L, top, towards);
21033  }
21034 #if defined(SOL_NO_EXCEPTIONS) && SOL_NO_EXCEPTIONS
21035  return result;
21036 #else
21037  // just throw our error
21038  throw error(detail::direct_error, err);
21039 #endif // If exceptions are allowed
21040  }
const auto direct_error
Definition: sol.hpp:411
type
Definition: sol.hpp:5173
type type_of()
Definition: sol.hpp:5770
int top(lua_State *L)
Definition: sol.hpp:7743
const string_view & to_string(error_code ec)
Definition: sol.hpp:8913
int push(lua_State *L, Arg &&arg, Args &&... args)
Definition: sol.hpp:7776
basic_string_view< char > string_view
Definition: sol.hpp:1186
void remove(lua_State *L, int rawindex, int count)
Definition: sol.hpp:6576

§ set_default_exception_handler()

void sol::set_default_exception_handler ( lua_State *  L,
exception_handler_function  exf = &detail::default_exception_handler 
)
inline
5998  {
5999  static_assert(sizeof(void*) >= sizeof(exception_handler_function), "void* storage is too small to transport the exception handler: please file a bug on the issue tracker");
6000  void* storage;
6001  std::memcpy(&storage, &exf, sizeof(exception_handler_function));
6002  lua_pushlightuserdata(L, storage);
6003  lua_setglobal(L, detail::default_exception_handler_name());
6004  }
int(*)(lua_State *, optional< const std::exception & >, string_view) exception_handler_function
Definition: sol.hpp:5831
const char(& default_exception_handler_name())[11]
Definition: sol.hpp:5834

§ set_default_state()

void sol::set_default_state ( lua_State *  L,
lua_CFunction  panic_function = &default_at_panic,
lua_CFunction  traceback_function = c_call<decltype(&default_traceback_error_handler), &default_traceback_error_handler>,
exception_handler_function  exf = detail::default_exception_handler 
)
inline
20965  {
20966  lua_atpanic(L, panic_function);
20967  protected_function::set_default_handler(object(L, in_place, traceback_function));
20971  }
void set_default_exception_handler(lua_State *L, exception_handler_function exf=&detail::default_exception_handler)
Definition: sol.hpp:5998
constexpr in_place_tag in_place(detail::in_place_of_i< I >)
Definition: sol.hpp:3231
void register_main_thread(lua_State *L)
Definition: sol.hpp:20908
static void set_default_handler(lua_State *L, const T &ref)
Definition: sol.hpp:15111
void luajit_exception_handler(lua_State *L, int(*handler)(lua_State *, lua_CFunction)=detail::c_trampoline)
Definition: sol.hpp:11903

§ set_environment()

template<typename T , typename E >
void sol::set_environment ( const basic_environment< E > &  env,
const T target 
)
20691  {
20692  env.set_on(target);
20693  }

§ swap()

template<class T >
void sol::swap ( optional< T > &  x,
optional< T > &  y 
)
noexcept
4327  {
4328  x.swap(y);
4329  }

§ to_string() [1/4]

const std::string& sol::to_string ( call_status  c)
inline
5190  {
5191  static const std::array<std::string, 10> names{ { "ok",
5192  "yielded",
5193  "runtime",
5194  "memory",
5195  "handler",
5196  "gc",
5197  "syntax",
5198  "file",
5199  "CRITICAL_EXCEPTION_FAILURE",
5200  "CRITICAL_INDETERMINATE_STATE_FAILURE" } };
5201  switch (c) {
5202  case call_status::ok:
5203  return names[0];
5204  case call_status::yielded:
5205  return names[1];
5206  case call_status::runtime:
5207  return names[2];
5208  case call_status::memory:
5209  return names[3];
5210  case call_status::handler:
5211  return names[4];
5212  case call_status::gc:
5213  return names[5];
5214  case call_status::syntax:
5215  return names[6];
5216  case call_status::file:
5217  return names[7];
5218  }
5219  if (static_cast<std::ptrdiff_t>(c) == -1) {
5220  // One of the many cases where a critical exception error has occurred
5221  return names[8];
5222  }
5223  return names[9];
5224  }

§ to_string() [2/4]

const std::string& sol::to_string ( load_status  c)
inline
5241  {
5242  static const std::array<std::string, 7> names{ { "ok",
5243  "memory",
5244  "gc",
5245  "syntax",
5246  "file",
5247  "CRITICAL_EXCEPTION_FAILURE",
5248  "CRITICAL_INDETERMINATE_STATE_FAILURE" } };
5249  switch (c) {
5250  case load_status::ok:
5251  return names[0];
5252  case load_status::memory:
5253  return names[1];
5254  case load_status::gc:
5255  return names[2];
5256  case load_status::syntax:
5257  return names[3];
5258  case load_status::file:
5259  return names[4];
5260  }
5261  if (static_cast<int>(c) == -1) {
5262  // One of the many cases where a critical exception error has occurred
5263  return names[5];
5264  }
5265  return names[6];
5266  }

§ to_string() [3/4]

const std::string& sol::to_string ( load_mode  c)
inline
5268  {
5269  static const std::array<std::string, 3> names{ {
5270  "bt",
5271  "t",
5272  "b",
5273  } };
5274  return names[static_cast<std::size_t>(c)];
5275  }

§ to_string() [4/4]

const std::string& sol::to_string ( meta_function  mf)
inline
5354  {
5355  return meta_function_names()[static_cast<int>(mf)];
5356  }
const std::array< std::string, 32 > & meta_function_names()
Definition: sol.hpp:5316

§ total_memory_used()

std::size_t sol::total_memory_used ( lua_State *  L)
inline
20973  {
20974  std::size_t kb = lua_gc(L, LUA_GCCOUNT, 0);
20975  kb *= 1024;
20976  kb += lua_gc(L, LUA_GCCOUNTB, 0);
20977  return kb;
20978  }

§ type_assert() [1/2]

void sol::type_assert ( lua_State *  L,
int  index,
type  expected,
type  actual 
)
inlinenoexcept
6414  {
6415  if (expected != type::poly && expected != actual) {
6416  type_panic_c_str(L, index, expected, actual, nullptr);
6417  }
6418  }
int type_panic_c_str(lua_State *L, int index, type expected, type actual, const char *message=nullptr) noexcept(false)
Definition: sol.hpp:6343

§ type_assert() [2/2]

void sol::type_assert ( lua_State *  L,
int  index,
type  expected 
)
inline
6420  {
6421  type actual = type_of(L, index);
6422  type_assert(L, index, expected, actual);
6423  }
type
Definition: sol.hpp:5173
void type_assert(lua_State *L, int index, type expected)
Definition: sol.hpp:6420
type type_of()
Definition: sol.hpp:5770

§ type_error() [1/2]

void sol::type_error ( lua_State *  L,
int  expected,
int  actual 
)
inlinenoexcept
6406  {
6407  luaL_error(L, "expected %s, received %s", lua_typename(L, expected), lua_typename(L, actual));
6408  }

§ type_error() [2/2]

void sol::type_error ( lua_State *  L,
type  expected,
type  actual 
)
inlinenoexcept
6410  {
6411  type_error(L, static_cast<int>(expected), static_cast<int>(actual));
6412  }
void type_error(lua_State *L, type expected, type actual) noexcept(false)
Definition: sol.hpp:6410

§ type_name()

std::string sol::type_name ( lua_State *  L,
type  t 
)
inline
5362  {
5363  return lua_typename(L, static_cast<int>(t));
5364  }

§ type_of() [1/2]

type sol::type_of ( lua_State *  L,
int  index 
)
inline
5358  {
5359  return static_cast<type>(lua_type(L, index));
5360  }
type
Definition: sol.hpp:5173

§ type_of() [2/2]

template<typename T >
type sol::type_of ( )
inline
5770  {
5771  return lua_type_of<meta::unqualified_t<T>>::value;
5772  }

§ type_panic_c_str()

int sol::type_panic_c_str ( lua_State *  L,
int  index,
type  expected,
type  actual,
const char *  message = nullptr 
)
inlinenoexcept
6343  {
6344  const char* err = message == nullptr || (std::char_traits<char>::length(message) == 0) ? "stack index %d, expected %s, received %s" : "stack index %d, expected %s, received %s: %s";
6345  std::string actualname = associated_type_name(L, index, actual);
6346  return luaL_error(L, err, index,
6347  expected == type::poly ? "anything" : lua_typename(L, static_cast<int>(expected)),
6348  actualname.c_str(),
6349  message);
6350  }
std::string associated_type_name(lua_State *L, int index, type t)
Definition: sol.hpp:6311

§ type_panic_string()

int sol::type_panic_string ( lua_State *  L,
int  index,
type  expected,
type  actual,
const std::string message = "" 
)
inlinenoexcept
6334  {
6335  const char* err = message.empty() ? "stack index %d, expected %s, received %s" : "stack index %d, expected %s, received %s: %s";
6336  std::string actualname = associated_type_name(L, index, actual);
6337  return luaL_error(L, err, index,
6338  expected == type::poly ? "anything" : lua_typename(L, static_cast<int>(expected)),
6339  actualname.c_str(),
6340  message.c_str());
6341  }
std::string associated_type_name(lua_State *L, int index, type t)
Definition: sol.hpp:6311

§ var()

template<typename V >
auto sol::var ( V &&  v)
inline
13018  {
13019  typedef meta::unqualified_t<V> T;
13020  return var_wrapper<T>(std::forward<V>(v));
13021  }

§ writeonly_property()

template<typename F >
decltype(auto) sol::writeonly_property ( F &&  f)
inline
12978  {
12979  return property_detail::property(std::false_type(), std::forward<F>(f));
12980  }
decltype(auto) property(F &&f)
Definition: sol.hpp:12967

§ yielding()

template<typename F >
yielding_t<std::decay_t<F> > sol::yielding ( F &&  f)
inline
4728  {
4729  return yielding_t<std::decay_t<F>>(std::forward<F>(f));
4730  }

Variable Documentation

§ base_classes

const auto sol::base_classes = base_classes_tag()

§ call_constructor

const auto sol::call_constructor = call_construction{}

§ create

const new_table sol::create = new_table{}

§ default_constructor

const auto sol::default_constructor = constructors<types<>>{}

§ default_destructor

const destructor_wrapper<void> sol::default_destructor {}

§ env_key

const env_t sol::env_key = {}

§ lua_nil

const lua_nil_t sol::lua_nil {}

§ metatable_key

const metatable_t sol::metatable_key = {}

§ nil

const nil_t sol::nil {}

§ no_constructor

const auto sol::no_constructor = no_construction{}

§ no_metatable

const no_metatable_t sol::no_metatable = {}

§ nullopt

constexpr nullopt_t sol::nullopt {nullopt_t::init()}

§ simple

struct sol::simple_tag sol::simple

§ trivial_init

constexpr struct sol::trivial_init_t sol::trivial_init

§ type_panic

const type_panic_t sol::type_panic = {}