Public Member Functions | Private Types | List of all members
sol::state Class Reference

#include <sol.hpp>

Inheritance diagram for sol::state:
Inheritance graph
[legend]

Public Member Functions

template<typename... Args, typename... Keys>
decltype(auto) get (Keys &&... keys) const
 
stateoperator= (const state &)=delete
 
stateoperator= (state &&that)
 
 state (const state &)=delete
 
 state (lua_CFunction panic, lua_Alloc alfunc, void *alpointer=nullptr)
 
 state (lua_CFunction panic=default_at_panic)
 
 state (state &&)=default
 
 ~state ()
 
- Public Member Functions inherited from sol::state_view
template<typename Fx >
void add_package_loader (Fx &&fx, bool clear_all_package_loaders=false)
 
iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
gc_mode change_gc_mode_generational (int minor_multiplier, int major_multiplier)
 
gc_mode change_gc_mode_incremental (int pause, int step_multiplier, int step_byte_size)
 
void clear_package_loaders ()
 
void collect_garbage ()
 
void collect_gc ()
 
template<typename Name , typename... Args>
table create_named_table (Name &&name, Args &&... args)
 
template<typename Key , typename Value , typename... Args>
table create_table (int narr, int nrec, Key &&key, Value &&value, Args &&... args)
 
table create_table (int narr=0, int nrec=0)
 
template<typename Name , typename Key , typename Value , typename... Args>
table create_table (Name &&name, int narr, int nrec, Key &&key, Value &&value, Args &&... args)
 
template<typename Name >
table create_table (Name &&name, int narr=0, int nrec=0)
 
template<typename... Args>
table create_table_with (Args &&... args)
 
template<typename E >
protected_function_result do_file (const std::string &filename, const basic_environment< E > &env, load_mode mode=load_mode::any)
 
protected_function_result do_file (const std::string &filename, load_mode mode=load_mode::any)
 
template<typename E >
protected_function_result do_reader (lua_Reader reader, void *data, const basic_environment< E > &env, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
protected_function_result do_reader (lua_Reader reader, void *data, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
template<typename E >
protected_function_result do_string (const string_view &code, const basic_environment< E > &env, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
protected_function_result do_string (const string_view &code, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
iterator end () const
 
template<typename Fx >
void for_each (Fx &&fx)
 
template<typename... Args, typename... Keys>
decltype(auto) get (Keys &&... keys) const
 
template<typename T , typename Key , typename D >
decltype(auto) get_or (Key &&key, D &&otherwise) const
 
template<typename T , typename Key >
decltype(auto) get_or (Key &&key, T &&otherwise) const
 
global_tableglobals ()
 
global_table globals () const
 
bool is_gc_on () const
 
load_result load (const string_view &code, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
load_result load (lua_Reader reader, void *data, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
load_result load_buffer (const char *buff, size_t size, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
load_result load_buffer (const std::byte *buff, size_t size, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
load_result load_file (const std::string &filename, load_mode mode=load_mode::any)
 
lua_Statelua_state () const
 
std::size_t memory_used () const
 
template<bool read_only = true, typename... Args>
state_viewnew_enum (const string_view &name, Args &&... args)
 
template<typename T , bool read_only = true>
state_viewnew_enum (const string_view &name, std::initializer_list< std::pair< string_view, T >> items)
 
template<typename Class , typename... Args>
usertype< Class > new_usertype (Args &&... args)
 
template<typename... Args>
void open_libraries (Args &&... args)
 
 operator lua_State * () const
 
template<typename T >
table_proxy< global_table &, detail::proxy_key_t< T > > operator[] (T &&key)
 
template<typename T >
table_proxy< const global_table &, detail::proxy_key_t< T > > operator[] (T &&key) const
 
table registry () const
 
object require (const std::string &key, lua_CFunction open_function, bool create_global=true)
 
object require_file (const std::string &key, const std::string &filename, bool create_global=true, load_mode mode=load_mode::any)
 
object require_script (const std::string &key, const string_view &code, bool create_global=true, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
void restart_gc ()
 
template<typename E >
protected_function_result safe_script (const string_view &code, const basic_environment< E > &env, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
template<typename Fx , typename E >
protected_function_result safe_script (const string_view &code, const basic_environment< E > &env, Fx &&on_error, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
protected_function_result safe_script (const string_view &code, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
template<typename Fx , meta::disable_any< meta::is_string_constructible< meta::unqualified_t< Fx >>, meta::is_specialization_of< meta::unqualified_t< Fx >, basic_environment >> = meta::enabler>
protected_function_result safe_script (const string_view &code, Fx &&on_error, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
protected_function_result safe_script (lua_Reader reader, void *data, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
template<typename Fx , meta::disable_any< meta::is_string_constructible< meta::unqualified_t< Fx >>, meta::is_specialization_of< meta::unqualified_t< Fx >, basic_environment >> = meta::enabler>
protected_function_result safe_script (lua_Reader reader, void *data, Fx &&on_error, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
template<typename Fx , typename E >
protected_function_result safe_script_file (const std::string &filename, const basic_environment< E > &env, Fx &&on_error, load_mode mode=load_mode::any)
 
template<typename E >
protected_function_result safe_script_file (const std::string &filename, const basic_environment< E > &env, load_mode mode=load_mode::any)
 
template<typename Fx , meta::disable_any< meta::is_string_constructible< meta::unqualified_t< Fx >>, meta::is_specialization_of< meta::unqualified_t< Fx >, basic_environment >> = meta::enabler>
protected_function_result safe_script_file (const std::string &filename, Fx &&on_error, load_mode mode=load_mode::any)
 
protected_function_result safe_script_file (const std::string &filename, load_mode mode=load_mode::any)
 
template<typename Fx , typename E >
protected_function_result script (const string_view &code, const basic_environment< E > &env, Fx &&on_error, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
protected_function_result script (const string_view &code, const environment &env, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
unsafe_function_result script (const string_view &code, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
template<typename Fx , meta::disable_any< meta::is_string_constructible< meta::unqualified_t< Fx >>, meta::is_specialization_of< meta::unqualified_t< Fx >, basic_environment >> = meta::enabler>
protected_function_result script (const string_view &code, Fx &&on_error, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
template<typename Fx , typename E >
protected_function_result script_file (const std::string &filename, const basic_environment< E > &env, Fx &&on_error, load_mode mode=load_mode::any)
 
protected_function_result script_file (const std::string &filename, const environment &env, load_mode mode=load_mode::any)
 
template<typename Fx , meta::disable_any< meta::is_string_constructible< meta::unqualified_t< Fx >>, meta::is_specialization_of< meta::unqualified_t< Fx >, basic_environment >> = meta::enabler>
protected_function_result script_file (const std::string &filename, Fx &&on_error, load_mode mode=load_mode::any)
 
unsafe_function_result script_file (const std::string &filename, load_mode mode=load_mode::any)
 
template<typename... Args>
state_viewset (Args &&... args)
 
void set_exception_handler (exception_handler_function handler)
 
template<typename Sig , typename... Args, typename Key >
state_viewset_function (Key &&key, Args &&... args)
 
template<typename... Args, typename Key >
state_viewset_function (Key &&key, Args &&... args)
 
void set_panic (lua_CFunction panic)
 
int stack_clear ()
 
int stack_top () const
 
 state_view (lua_State *Ls)
 
 state_view (this_state Ls)
 
bool step_gc (int step_size_kilobytes)
 
void stop_gc ()
 
bool supports_gc_mode (gc_mode mode) const noexcept
 
template<typename T , typename... Keys>
decltype(auto) traverse_get (Keys &&... keys) const
 
template<typename... Args>
state_viewtraverse_set (Args &&... args)
 
template<typename E >
unsafe_function_result unsafe_script (const string_view &code, const basic_environment< E > &env, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
unsafe_function_result unsafe_script (const string_view &code, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
template<typename E >
unsafe_function_result unsafe_script (lua_Reader reader, void *data, const basic_environment< E > &env, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
unsafe_function_result unsafe_script (lua_Reader reader, void *data, const std::string &chunkname=detail::default_chunk_name(), load_mode mode=load_mode::any)
 
template<typename E >
unsafe_function_result unsafe_script_file (const std::string &filename, const basic_environment< E > &env, load_mode mode=load_mode::any)
 
unsafe_function_result unsafe_script_file (const std::string &filename, load_mode mode=load_mode::any)
 

Private Types

typedef std::unique_ptr< lua_State, detail::state_deleterunique_base
 

Additional Inherited Members

- Public Types inherited from sol::state_view
using const_iterator = typename global_table::const_iterator
 
using iterator = typename global_table::iterator
 
- Static Public Member Functions inherited from sol::state_view
template<typename Key , typename Value , typename... Args>
static table create_table (lua_State *L, int narr, int nrec, Key &&key, Value &&value, Args &&... args)
 
static table create_table (lua_State *L, int narr=0, int nrec=0)
 
template<typename... Args>
static table create_table_with (lua_State *L, Args &&... args)
 

Detailed Description

Definition at line 28238 of file sol.hpp.

Member Typedef Documentation

◆ unique_base

typedef std::unique_ptr<lua_State, detail::state_deleter> sol::state::unique_base
private

Definition at line 28240 of file sol.hpp.

Constructor & Destructor Documentation

◆ state() [1/4]

sol::state::state ( lua_CFunction  panic = default_at_panic)
inline

Definition at line 28243 of file sol.hpp.

◆ state() [2/4]

sol::state::state ( lua_CFunction  panic,
lua_Alloc  alfunc,
void *  alpointer = nullptr 
)
inline

Definition at line 28247 of file sol.hpp.

◆ state() [3/4]

sol::state::state ( const state )
delete

◆ state() [4/4]

sol::state::state ( state &&  )
default

◆ ~state()

sol::state::~state ( )
inline

Definition at line 28263 of file sol.hpp.

Member Function Documentation

◆ get()

template<typename... Args, typename... Keys>
decltype(auto) sol::state_view::get ( typename...  Args,
typename...  Keys 
)
inline

Definition at line 27951 of file sol.hpp.

◆ operator=() [1/2]

state& sol::state::operator= ( const state )
delete

◆ operator=() [2/2]

state& sol::state::operator= ( state &&  that)
inline

Definition at line 28255 of file sol.hpp.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:53