OpenMiner  0.0.1a
Voxel game engine
Public Member Functions | Private Types | List of all members
sol::basic_environment< base_type > Struct Template Reference

#include <sol.hpp>

Inheritance diagram for sol::basic_environment< base_type >:
sol::basic_table_core< top_level, base_type > sol::basic_object_base< base_type >

Public Member Functions

 basic_environment () noexcept=default
 
 basic_environment (const basic_environment &)=default
 
 basic_environment (basic_environment &&)=default
 
basic_environmentoperator= (const basic_environment &)=default
 
basic_environmentoperator= (basic_environment &&)=default
 
 basic_environment (const stack_reference &r)
 
 basic_environment (stack_reference &&r)
 
 basic_environment (lua_State *L, new_table nt)
 
template<bool b>
 basic_environment (lua_State *L, new_table t, const basic_reference< b > &fallback)
 
 basic_environment (env_t, const stack_reference &extraction_target)
 
template<bool b>
 basic_environment (env_t, const basic_reference< b > &extraction_target)
 
 basic_environment (lua_State *L, int index=-1)
 
 basic_environment (lua_State *L, ref_index index)
 
template<typename T , meta::enable< meta::neg< meta::any_same< meta::unqualified_t< T >, basic_environment >>, meta::neg< std::is_same< base_type, stack_reference >>, meta::neg< std::is_same< lua_nil_t, meta::unqualified_t< T >>>, is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
 basic_environment (T &&r) noexcept
 
 basic_environment (lua_nil_t r) noexcept
 
template<typename T , meta::enable< is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
 basic_environment (lua_State *L, T &&r) noexcept
 
template<typename T >
void set_on (const T &target) const
 
- Public Member Functions inherited from sol::basic_table_core< top_level, base_type >
 basic_table_core () noexcept=default
 
 basic_table_core (const basic_table_core &)=default
 
 basic_table_core (basic_table_core &&)=default
 
basic_table_coreoperator= (const basic_table_core &)=default
 
basic_table_coreoperator= (basic_table_core &&)=default
 
 basic_table_core (const stack_reference &r)
 
 basic_table_core (stack_reference &&r)
 
template<typename T , meta::enable_any< is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
 basic_table_core (lua_State *L, T &&r)
 
 basic_table_core (lua_State *L, const new_table &nt)
 
 basic_table_core (lua_State *L, int index=-1)
 
 basic_table_core (lua_State *L, ref_index index)
 
template<typename T , meta::enable< meta::neg< meta::any_same< meta::unqualified_t< T >, basic_table_core >>, meta::neg< std::is_same< base_type, stack_reference >>, meta::neg< std::is_same< lua_nil_t, meta::unqualified_t< T >>>, is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
 basic_table_core (T &&r) noexcept
 
 basic_table_core (lua_nil_t r) noexcept
 
iterator begin () const
 
iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
template<typename... Ret, typename... Keys>
decltype(auto) get (Keys &&... keys) const
 
template<typename T , typename Key >
decltype(auto) get_or (Key &&key, T &&otherwise) const
 
template<typename T , typename Key , typename D >
decltype(auto) get_or (Key &&key, D &&otherwise) const
 
template<typename T , typename... Keys>
decltype(auto) traverse_get (Keys &&... keys) const
 
template<typename... Keys>
basic_table_coretraverse_set (Keys &&... keys)
 
template<typename... Args>
basic_table_coreset (Args &&... args)
 
template<typename... Ret, typename... Keys>
decltype(auto) raw_get (Keys &&... keys) const
 
template<typename T , typename Key >
decltype(auto) raw_get_or (Key &&key, T &&otherwise) const
 
template<typename T , typename Key , typename D >
decltype(auto) raw_get_or (Key &&key, D &&otherwise) const
 
template<typename T , typename... Keys>
decltype(auto) traverse_raw_get (Keys &&... keys) const
 
template<typename... Keys>
basic_table_coretraverse_raw_set (Keys &&... keys)
 
template<typename... Args>
basic_table_coreraw_set (Args &&... args)
 
template<typename T >
basic_table_coreset_usertype (usertype< T > &user)
 
template<typename Key , typename T >
basic_table_coreset_usertype (Key &&key, usertype< T > &user)
 
template<typename Class , typename... Args>
basic_table_corenew_usertype (const std::string &name, Args &&... args)
 
template<typename Class , typename CTor0 , typename... CTor, typename... Args>
basic_table_corenew_usertype (const std::string &name, Args &&... args)
 
template<typename Class , typename... CArgs, typename... Args>
basic_table_corenew_usertype (const std::string &name, constructors< CArgs... > ctor, Args &&... args)
 
template<typename Class , typename... Args>
basic_table_corenew_simple_usertype (const std::string &name, Args &&... args)
 
template<typename Class , typename CTor0 , typename... CTor, typename... Args>
basic_table_corenew_simple_usertype (const std::string &name, Args &&... args)
 
template<typename Class , typename... CArgs, typename... Args>
basic_table_corenew_simple_usertype (const std::string &name, constructors< CArgs... > ctor, Args &&... args)
 
template<typename Class , typename... Args>
simple_usertype< Class > create_simple_usertype (Args &&... args)
 
template<typename Class , typename CTor0 , typename... CTor, typename... Args>
simple_usertype< Class > create_simple_usertype (Args &&... args)
 
template<typename Class , typename... CArgs, typename... Args>
simple_usertype< Class > create_simple_usertype (constructors< CArgs... > ctor, Args &&... args)
 
template<bool read_only = true, typename... Args>
table new_enum (const string_view &name, Args &&... args)
 
template<typename T , bool read_only = true>
table new_enum (const string_view &name, std::initializer_list< std::pair< string_view, T >> items)
 
template<typename Fx >
void for_each (Fx &&fx) const
 
size_t size () const
 
bool empty () const
 
template<typename T >
proxy< basic_table_core &, Toperator[] (T &&key) &
 
template<typename T >
proxy< const basic_table_core &, Toperator[] (T &&key) const &
 
template<typename T >
proxy< basic_table_core, Toperator[] (T &&key) &&
 
template<typename Sig , typename Key , typename... Args>
basic_table_coreset_function (Key &&key, Args &&... args)
 
template<typename Key , typename... Args>
basic_table_coreset_function (Key &&key, Args &&... args)
 
template<typename... Args>
basic_table_coreadd (Args &&... args)
 
table create (int narr=0, int nrec=0)
 
template<typename Key , typename Value , typename... Args>
table create (int narr, int nrec, Key &&key, Value &&value, Args &&... args)
 
template<typename Name >
table create (Name &&name, int narr=0, int nrec=0)
 
template<typename Name , typename Key , typename Value , typename... Args>
table create (Name &&name, int narr, int nrec, Key &&key, Value &&value, Args &&... args)
 
template<typename... Args>
table create_with (Args &&... args)
 
template<typename Name , typename... Args>
table create_named (Name &&name, Args &&... args)
 
- Public Member Functions inherited from sol::basic_object_base< base_type >
 basic_object_base () noexcept=default
 
 basic_object_base (const basic_object_base &)=default
 
 basic_object_base (basic_object_base &&)=default
 
 basic_object_base (T &&arg, Args &&... args)
 
basic_object_baseoperator= (const basic_object_base &)=default
 
basic_object_baseoperator= (basic_object_base &&)=default
 
decltype(auto) as () const
 
bool is () const
 

Private Types

typedef basic_table< base_type > base_t
 

Additional Inherited Members

- Public Types inherited from sol::basic_table_core< top_level, base_type >
typedef basic_table_iterator< base_type > iterator
 
typedef iterator const_iterator
 
- Static Public Member Functions inherited from sol::basic_table_core< top_level, base_type >
static table create (lua_State *L, int narr=0, int nrec=0)
 
template<typename Key , typename Value , typename... Args>
static table create (lua_State *L, int narr, int nrec, Key &&key, Value &&value, Args &&... args)
 
template<typename... Args>
static table create_with (lua_State *L, Args &&... args)
 
- Protected Member Functions inherited from sol::basic_table_core< top_level, base_type >
 basic_table_core (detail::no_safety_tag, lua_nil_t n)
 
 basic_table_core (detail::no_safety_tag, lua_State *L, int index)
 
 basic_table_core (detail::no_safety_tag, lua_State *L, ref_index index)
 
template<typename T , meta::enable< meta::neg< meta::any_same< meta::unqualified_t< T >, basic_table_core >>, meta::neg< std::is_same< base_type, stack_reference >>, meta::neg< std::is_same< lua_nil_t, meta::unqualified_t< T >>>, is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
 basic_table_core (detail::no_safety_tag, T &&r) noexcept
 
template<typename T , meta::enable< is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
 basic_table_core (detail::no_safety_tag, lua_State *L, T &&r) noexcept
 

Member Typedef Documentation

§ base_t

template<typename base_type>
typedef basic_table<base_type> sol::basic_environment< base_type >::base_t
private

Constructor & Destructor Documentation

§ basic_environment() [1/14]

template<typename base_type>
sol::basic_environment< base_type >::basic_environment ( )
defaultnoexcept

§ basic_environment() [2/14]

template<typename base_type>
sol::basic_environment< base_type >::basic_environment ( const basic_environment< base_type > &  )
default

§ basic_environment() [3/14]

template<typename base_type>
sol::basic_environment< base_type >::basic_environment ( basic_environment< base_type > &&  )
default

§ basic_environment() [4/14]

template<typename base_type>
sol::basic_environment< base_type >::basic_environment ( const stack_reference r)
inline
20594  : basic_environment(r.lua_state(), r.stack_index()) {
20595  }
basic_environment() noexcept=default

§ basic_environment() [5/14]

template<typename base_type>
sol::basic_environment< base_type >::basic_environment ( stack_reference &&  r)
inline
20597  : basic_environment(r.lua_state(), r.stack_index()) {
20598  }
basic_environment() noexcept=default

§ basic_environment() [6/14]

template<typename base_type>
sol::basic_environment< base_type >::basic_environment ( lua_State *  L,
new_table  nt 
)
inline
20601  : base_t(L, std::move(nt)) {
20602  }
basic_table< base_type > base_t
Definition: sol.hpp:20583

§ basic_environment() [7/14]

template<typename base_type>
template<bool b>
sol::basic_environment< base_type >::basic_environment ( lua_State *  L,
new_table  t,
const basic_reference< b > &  fallback 
)
inline
20605  : basic_environment(L, std::move(t)) {
20606  stack_table mt(L, new_table(0, 1));
20607  mt.set(meta_function::index, fallback);
20608  this->set(metatable_key, mt);
20609  mt.pop();
20610  }
basic_environment() noexcept=default
const metatable_t metatable_key
Definition: sol.hpp:4700
stack_table_core< false > stack_table
Definition: sol.hpp:295

§ basic_environment() [8/14]

template<typename base_type>
sol::basic_environment< base_type >::basic_environment ( env_t  ,
const stack_reference extraction_target 
)
inline
20613  : base_t(detail::no_safety, extraction_target.lua_state(), (stack::push_environment_of(extraction_target), -1)) {
20614 #if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
20615  constructor_handler handler{};
20616  stack::check<env_t>(this->lua_state(), -1, handler);
20617 #endif // Safety
20618  lua_pop(this->lua_state(), 2);
20619  }
basic_table< base_type > base_t
Definition: sol.hpp:20583
struct sol::detail::no_safety_tag no_safety
int push_environment_of(lua_State *L, int index=-1)
Definition: sol.hpp:10337

§ basic_environment() [9/14]

template<typename base_type>
template<bool b>
sol::basic_environment< base_type >::basic_environment ( env_t  ,
const basic_reference< b > &  extraction_target 
)
inline
20622  : base_t(detail::no_safety, extraction_target.lua_state(), (stack::push_environment_of(extraction_target), -1)) {
20623 #if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
20624  constructor_handler handler{};
20625  stack::check<env_t>(this->lua_state(), -1, handler);
20626 #endif // Safety
20627  lua_pop(this->lua_state(), 2);
20628  }
basic_table< base_type > base_t
Definition: sol.hpp:20583
struct sol::detail::no_safety_tag no_safety
int push_environment_of(lua_State *L, int index=-1)
Definition: sol.hpp:10337

§ basic_environment() [10/14]

template<typename base_type>
sol::basic_environment< base_type >::basic_environment ( lua_State *  L,
int  index = -1 
)
inline
20630  : base_t(detail::no_safety, L, index) {
20631 #if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
20632  constructor_handler handler{};
20633  stack::check<basic_environment>(L, index, handler);
20634 #endif // Safety
20635  }
basic_table< base_type > base_t
Definition: sol.hpp:20583
struct sol::detail::no_safety_tag no_safety

§ basic_environment() [11/14]

template<typename base_type>
sol::basic_environment< base_type >::basic_environment ( lua_State *  L,
ref_index  index 
)
inline
20637  : base_t(detail::no_safety, L, index) {
20638 #if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
20639  auto pp = stack::push_pop(*this);
20640  constructor_handler handler{};
20641  stack::check<basic_environment>(L, -1, handler);
20642 #endif // Safety
20643  }
basic_table< base_type > base_t
Definition: sol.hpp:20583
struct sol::detail::no_safety_tag no_safety
push_popper< top_level, T > push_pop(T &&x)
Definition: sol.hpp:6661

§ basic_environment() [12/14]

template<typename base_type>
template<typename T , meta::enable< meta::neg< meta::any_same< meta::unqualified_t< T >, basic_environment >>, meta::neg< std::is_same< base_type, stack_reference >>, meta::neg< std::is_same< lua_nil_t, meta::unqualified_t< T >>>, is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
sol::basic_environment< base_type >::basic_environment ( T &&  r)
inlinenoexcept
20646  : base_t(detail::no_safety, std::forward<T>(r)) {
20647 #if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
20648  if (!is_environment<meta::unqualified_t<T>>::value) {
20649  auto pp = stack::push_pop(*this);
20650  constructor_handler handler{};
20651  stack::check<basic_environment>(lua_state(), -1, handler);
20652  }
20653 #endif // Safety
20654  }
basic_table< base_type > base_t
Definition: sol.hpp:20583
struct sol::detail::no_safety_tag no_safety
push_popper< top_level, T > push_pop(T &&x)
Definition: sol.hpp:6661

§ basic_environment() [13/14]

template<typename base_type>
sol::basic_environment< base_type >::basic_environment ( lua_nil_t  r)
inlinenoexcept
20656  : base_t(detail::no_safety, r) {
20657  }
basic_table< base_type > base_t
Definition: sol.hpp:20583
struct sol::detail::no_safety_tag no_safety

§ basic_environment() [14/14]

template<typename base_type>
template<typename T , meta::enable< is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
sol::basic_environment< base_type >::basic_environment ( lua_State *  L,
T &&  r 
)
inlinenoexcept
20661  : base_t(detail::no_safety, L, std::forward<T>(r)) {
20662 #if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
20663  if (!is_environment<meta::unqualified_t<T>>::value) {
20664  auto pp = stack::push_pop(*this);
20665  constructor_handler handler{};
20666  stack::check<basic_environment>(lua_state(), -1, handler);
20667  }
20668 #endif // Safety
20669  }
basic_table< base_type > base_t
Definition: sol.hpp:20583
struct sol::detail::no_safety_tag no_safety
push_popper< top_level, T > push_pop(T &&x)
Definition: sol.hpp:6661

Member Function Documentation

§ operator=() [1/2]

template<typename base_type>
basic_environment& sol::basic_environment< base_type >::operator= ( const basic_environment< base_type > &  )
default

§ operator=() [2/2]

template<typename base_type>
basic_environment& sol::basic_environment< base_type >::operator= ( basic_environment< base_type > &&  )
default

§ set_on()

template<typename base_type>
template<typename T >
void sol::basic_environment< base_type >::set_on ( const T target) const
inline
20672  {
20673  lua_State* L = target.lua_state();
20674  auto pp = stack::push_pop(target);
20675 #if SOL_LUA_VERSION < 502
20676  // Use lua_setfenv
20677  this->push();
20678  lua_setfenv(L, -2);
20679 #else
20680  // Use upvalues as explained in Lua 5.2 and beyond's manual
20681  this->push();
20682  const char* name = lua_setupvalue(L, -2, 1);
20683  if (name == nullptr) {
20684  this->pop();
20685  }
20686 #endif
20687  }
decltype(auto) pop(lua_State *L)
Definition: sol.hpp:8064
int push(lua_State *L, Arg &&arg, Args &&... args)
Definition: sol.hpp:7776
push_popper< top_level, T > push_pop(T &&x)
Definition: sol.hpp:6661

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