OpenMiner  0.0.1a
Voxel game engine
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
sol::stack_reference Class Reference

#include <sol.hpp>

Public Member Functions

 stack_reference () noexcept=default
 
 stack_reference (lua_nil_t) noexcept
 
 stack_reference (lua_State *L, lua_nil_t) noexcept
 
 stack_reference (lua_State *L, int i) noexcept
 
 stack_reference (lua_State *L, absolute_index i) noexcept
 
 stack_reference (lua_State *L, raw_index i) noexcept
 
 stack_reference (lua_State *L, ref_index i) noexcept=delete
 
 stack_reference (lua_State *L, const reference &r) noexcept=delete
 
 stack_reference (lua_State *L, const stack_reference &r) noexcept
 
 stack_reference (stack_reference &&o) noexcept=default
 
stack_referenceoperator= (stack_reference &&) noexcept=default
 
 stack_reference (const stack_reference &) noexcept=default
 
stack_referenceoperator= (const stack_reference &) noexcept=default
 
int push () const noexcept
 
int push (lua_State *Ls) const noexcept
 
void pop () const noexcept
 
void pop (lua_State *Ls, int n=1) const noexcept
 
int stack_index () const noexcept
 
const void * pointer () const noexcept
 
type get_type () const noexcept
 
lua_State * lua_state () const noexcept
 
bool valid () const noexcept
 

Protected Member Functions

int registry_index () const noexcept
 

Private Attributes

lua_State * luastate = nullptr
 
int index = 0
 

Constructor & Destructor Documentation

§ stack_reference() [1/11]

sol::stack_reference::stack_reference ( )
defaultnoexcept

§ stack_reference() [2/11]

sol::stack_reference::stack_reference ( lua_nil_t  )
inlinenoexcept
6458  : stack_reference(){};
stack_reference() noexcept=default

§ stack_reference() [3/11]

sol::stack_reference::stack_reference ( lua_State *  L,
lua_nil_t   
)
inlinenoexcept
6460  : luastate(L), index(0) {
6461  }
lua_State * luastate
Definition: sol.hpp:6447
int index
Definition: sol.hpp:6448

§ stack_reference() [4/11]

sol::stack_reference::stack_reference ( lua_State *  L,
int  i 
)
inlinenoexcept
6463  : stack_reference(L, absolute_index(L, i)) {
6464  }
stack_reference() noexcept=default

§ stack_reference() [5/11]

sol::stack_reference::stack_reference ( lua_State *  L,
absolute_index  i 
)
inlinenoexcept
6466  : luastate(L), index(i) {
6467  }
lua_State * luastate
Definition: sol.hpp:6447
int index
Definition: sol.hpp:6448

§ stack_reference() [6/11]

sol::stack_reference::stack_reference ( lua_State *  L,
raw_index  i 
)
inlinenoexcept
6469  : luastate(L), index(i) {
6470  }
lua_State * luastate
Definition: sol.hpp:6447
int index
Definition: sol.hpp:6448

§ stack_reference() [7/11]

sol::stack_reference::stack_reference ( lua_State *  L,
ref_index  i 
)
deletenoexcept

§ stack_reference() [8/11]

sol::stack_reference::stack_reference ( lua_State *  L,
const reference r 
)
deletenoexcept

§ stack_reference() [9/11]

sol::stack_reference::stack_reference ( lua_State *  L,
const stack_reference r 
)
inlinenoexcept
6474  : luastate(L) {
6475  if (!r.valid()) {
6476  index = 0;
6477  return;
6478  }
6479  int i = r.stack_index();
6480  if (detail::xmovable(lua_state(), r.lua_state())) {
6481  lua_pushvalue(r.lua_state(), r.index);
6482  lua_xmove(r.lua_state(), luastate, 1);
6483  i = absolute_index(luastate, -1);
6484  }
6485  index = i;
6486  }
lua_State * lua_state() const noexcept
Definition: sol.hpp:6530
bool xmovable(lua_State *leftL, lua_State *rightL)
Definition: sol.hpp:6435
lua_State * luastate
Definition: sol.hpp:6447
int index
Definition: sol.hpp:6448

§ stack_reference() [10/11]

sol::stack_reference::stack_reference ( stack_reference &&  o)
defaultnoexcept

§ stack_reference() [11/11]

sol::stack_reference::stack_reference ( const stack_reference )
defaultnoexcept

Member Function Documentation

§ get_type()

type sol::stack_reference::get_type ( ) const
inlinenoexcept
6525  {
6526  int result = lua_type(lua_state(), index);
6527  return static_cast<type>(result);
6528  }
lua_State * lua_state() const noexcept
Definition: sol.hpp:6530
int index
Definition: sol.hpp:6448

§ lua_state()

lua_State* sol::stack_reference::lua_state ( ) const
inlinenoexcept
6530  {
6531  return luastate;
6532  }
lua_State * luastate
Definition: sol.hpp:6447

§ operator=() [1/2]

stack_reference& sol::stack_reference::operator= ( stack_reference &&  )
defaultnoexcept

§ operator=() [2/2]

stack_reference& sol::stack_reference::operator= ( const stack_reference )
defaultnoexcept

§ pointer()

const void* sol::stack_reference::pointer ( ) const
inlinenoexcept
6520  {
6521  const void* vp = lua_topointer(lua_state(), stack_index());
6522  return vp;
6523  }
lua_State * lua_state() const noexcept
Definition: sol.hpp:6530
int stack_index() const noexcept
Definition: sol.hpp:6516

§ pop() [1/2]

void sol::stack_reference::pop ( ) const
inlinenoexcept
6508  {
6509  pop(lua_state());
6510  }
lua_State * lua_state() const noexcept
Definition: sol.hpp:6530
void pop() const noexcept
Definition: sol.hpp:6508

§ pop() [2/2]

void sol::stack_reference::pop ( lua_State *  Ls,
int  n = 1 
) const
inlinenoexcept
6512  {
6513  lua_pop(Ls, n);
6514  }

§ push() [1/2]

int sol::stack_reference::push ( ) const
inlinenoexcept
6492  {
6493  return push(lua_state());
6494  }
lua_State * lua_state() const noexcept
Definition: sol.hpp:6530
int push() const noexcept
Definition: sol.hpp:6492

§ push() [2/2]

int sol::stack_reference::push ( lua_State *  Ls) const
inlinenoexcept
6496  {
6497  if (lua_state() == nullptr) {
6498  lua_pushnil(Ls);
6499  return 1;
6500  }
6501  lua_pushvalue(lua_state(), index);
6502  if (Ls != lua_state()) {
6503  lua_xmove(lua_state(), Ls, 1);
6504  }
6505  return 1;
6506  }
lua_State * lua_state() const noexcept
Definition: sol.hpp:6530
int index
Definition: sol.hpp:6448

§ registry_index()

int sol::stack_reference::registry_index ( ) const
inlineprotectednoexcept
6451  {
6452  return LUA_NOREF;
6453  }

§ stack_index()

int sol::stack_reference::stack_index ( ) const
inlinenoexcept
6516  {
6517  return index;
6518  }
int index
Definition: sol.hpp:6448

§ valid()

bool sol::stack_reference::valid ( ) const
inlinenoexcept
6534  {
6535  type t = get_type();
6536  return t != type::lua_nil && t != type::none;
6537  }
type get_type() const noexcept
Definition: sol.hpp:6525

Member Data Documentation

§ index

int sol::stack_reference::index = 0
private

§ luastate

lua_State* sol::stack_reference::luastate = nullptr
private

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