OpenMiner  0.0.1a
Voxel game engine
Public Member Functions | Static Public Member Functions | List of all members
sol::basic_thread< base_t > Class Template Reference

#include <sol.hpp>

Inheritance diagram for sol::basic_thread< base_t >:
base_t

Public Member Functions

 basic_thread () noexcept=default
 
 basic_thread (const basic_thread &)=default
 
 basic_thread (basic_thread &&)=default
 
template<typename T , meta::enable< meta::neg< std::is_same< meta::unqualified_t< T >, basic_thread >>, is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
 basic_thread (T &&r)
 
 basic_thread (const stack_reference &r)
 
 basic_thread (stack_reference &&r)
 
basic_threadoperator= (const basic_thread &)=default
 
basic_threadoperator= (basic_thread &&)=default
 
template<typename T , meta::enable< is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
 basic_thread (lua_State *L, T &&r)
 
 basic_thread (lua_State *L, int index=-1)
 
 basic_thread (lua_State *L, ref_index index)
 
 basic_thread (lua_State *L, lua_State *actualthread)
 
 basic_thread (lua_State *L, this_state actualthread)
 
 basic_thread (lua_State *L, lua_thread_state actualthread)
 
state_view state () const
 
bool is_main_thread () const
 
lua_State * thread_state () const
 
thread_status status () const
 
basic_thread create ()
 

Static Public Member Functions

static basic_thread create (lua_State *L)
 

Constructor & Destructor Documentation

§ basic_thread() [1/12]

template<typename base_t >
sol::basic_thread< base_t >::basic_thread ( )
defaultnoexcept

§ basic_thread() [2/12]

template<typename base_t >
sol::basic_thread< base_t >::basic_thread ( const basic_thread< base_t > &  )
default

§ basic_thread() [3/12]

template<typename base_t >
sol::basic_thread< base_t >::basic_thread ( basic_thread< base_t > &&  )
default

§ basic_thread() [4/12]

template<typename base_t >
template<typename T , meta::enable< meta::neg< std::is_same< meta::unqualified_t< T >, basic_thread >>, is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
sol::basic_thread< base_t >::basic_thread ( T &&  r)
inline
21753  : base_t(std::forward<T>(r)) {
21754 #if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
21755  auto pp = stack::push_pop(*this);
21756  constructor_handler handler{};
21757  stack::check<basic_thread>(lua_state(), -1, handler);
21758 #endif // Safety
21759  }
push_popper< top_level, T > push_pop(T &&x)
Definition: sol.hpp:6661

§ basic_thread() [5/12]

template<typename base_t >
sol::basic_thread< base_t >::basic_thread ( const stack_reference r)
inline
21761  : basic_thread(r.lua_state(), r.stack_index()){};
basic_thread() noexcept=default

§ basic_thread() [6/12]

template<typename base_t >
sol::basic_thread< base_t >::basic_thread ( stack_reference &&  r)
inline
21763  : basic_thread(r.lua_state(), r.stack_index()){};
basic_thread() noexcept=default

§ basic_thread() [7/12]

template<typename base_t >
template<typename T , meta::enable< is_lua_reference< meta::unqualified_t< T >>> = meta::enabler>
sol::basic_thread< base_t >::basic_thread ( lua_State *  L,
T &&  r 
)
inline
21768  : base_t(L, std::forward<T>(r)) {
21769 #if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
21770  auto pp = stack::push_pop(*this);
21771  constructor_handler handler{};
21772  stack::check<basic_thread>(lua_state(), -1, handler);
21773 #endif // Safety
21774  }
push_popper< top_level, T > push_pop(T &&x)
Definition: sol.hpp:6661

§ basic_thread() [8/12]

template<typename base_t >
sol::basic_thread< base_t >::basic_thread ( lua_State *  L,
int  index = -1 
)
inline
21776  : base_t(L, index) {
21777 #if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
21778  constructor_handler handler{};
21779  stack::check<basic_thread>(L, index, handler);
21780 #endif // Safety
21781  }

§ basic_thread() [9/12]

template<typename base_t >
sol::basic_thread< base_t >::basic_thread ( lua_State *  L,
ref_index  index 
)
inline
21783  : base_t(L, index) {
21784 #if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
21785  auto pp = stack::push_pop(*this);
21786  constructor_handler handler{};
21787  stack::check<basic_thread>(lua_state(), -1, handler);
21788 #endif // Safety
21789  }
push_popper< top_level, T > push_pop(T &&x)
Definition: sol.hpp:6661

§ basic_thread() [10/12]

template<typename base_t >
sol::basic_thread< base_t >::basic_thread ( lua_State *  L,
lua_State *  actualthread 
)
inline
21791  : basic_thread(L, lua_thread_state{ actualthread }) {
21792  }
basic_thread() noexcept=default

§ basic_thread() [11/12]

template<typename base_t >
sol::basic_thread< base_t >::basic_thread ( lua_State *  L,
this_state  actualthread 
)
inline
21794  : basic_thread(L, lua_thread_state{ actualthread.L }) {
21795  }
basic_thread() noexcept=default

§ basic_thread() [12/12]

template<typename base_t >
sol::basic_thread< base_t >::basic_thread ( lua_State *  L,
lua_thread_state  actualthread 
)
inline
21797  : base_t(L, -stack::push(L, actualthread)) {
21798 #if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
21799  constructor_handler handler{};
21800  stack::check<basic_thread>(lua_state(), -1, handler);
21801 #endif // Safety
21802  if (!is_stack_based<base_t>::value) {
21803  lua_pop(lua_state(), 1);
21804  }
21805  }
int push(lua_State *L, T &&t, Args &&... args)
Definition: sol.hpp:7770

Member Function Documentation

§ create() [1/2]

template<typename base_t >
basic_thread sol::basic_thread< base_t >::create ( )
inline
21836  {
21837  return create(lua_state());
21838  }
basic_thread create()
Definition: sol.hpp:21836

§ create() [2/2]

template<typename base_t >
static basic_thread sol::basic_thread< base_t >::create ( lua_State *  L)
inlinestatic
21840  {
21841  lua_newthread(L);
21842  basic_thread result(L);
21843  if (!is_stack_based<base_t>::value) {
21844  lua_pop(L, 1);
21845  }
21846  return result;
21847  }
basic_thread() noexcept=default

§ is_main_thread()

template<typename base_t >
bool sol::basic_thread< base_t >::is_main_thread ( ) const
inline
21811  {
21812  return stack::is_main_thread(this->thread_state());
21813  }
lua_State * thread_state() const
Definition: sol.hpp:21815
bool is_main_thread(lua_State *L)
Definition: sol.hpp:7747

§ operator=() [1/2]

template<typename base_t >
basic_thread& sol::basic_thread< base_t >::operator= ( const basic_thread< base_t > &  )
default

§ operator=() [2/2]

template<typename base_t >
basic_thread& sol::basic_thread< base_t >::operator= ( basic_thread< base_t > &&  )
default

§ state()

template<typename base_t >
state_view sol::basic_thread< base_t >::state ( ) const
inline
21807  {
21808  return state_view(this->thread_state());
21809  }
lua_State * thread_state() const
Definition: sol.hpp:21815

§ status()

template<typename base_t >
thread_status sol::basic_thread< base_t >::status ( ) const
inline
21821  {
21822  lua_State* lthread = thread_state();
21823  auto lstat = static_cast<thread_status>(lua_status(lthread));
21824  if (lstat == thread_status::ok) {
21825  lua_Debug ar;
21826  if (lua_getstack(lthread, 0, &ar) > 0)
21827  return thread_status::ok;
21828  else if (lua_gettop(lthread) == 0)
21829  return thread_status::dead;
21830  else
21831  return thread_status::yielded;
21832  }
21833  return lstat;
21834  }
lua_State * thread_state() const
Definition: sol.hpp:21815
thread_status
Definition: sol.hpp:5155

§ thread_state()

template<typename base_t >
lua_State* sol::basic_thread< base_t >::thread_state ( ) const
inline
21815  {
21816  auto pp = stack::push_pop(*this);
21817  lua_State* lthread = lua_tothread(lua_state(), -1);
21818  return lthread;
21819  }
push_popper< top_level, T > push_pop(T &&x)
Definition: sol.hpp:6661

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