OpenMiner  0.0.1a
Voxel game engine
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
sol::protected_function_result Struct Reference

#include <sol.hpp>

Inheritance diagram for sol::protected_function_result:
sol::proxy_base< protected_function_result > sol::proxy_base_tag

Public Types

typedef stack_proxy reference_type
 
typedef stack_proxy value_type
 
typedef stack_proxypointer
 
typedef std::ptrdiff_t difference_type
 
typedef std::size_t size_type
 
typedef stack_iterator< stack_proxy, false > iterator
 
typedef stack_iterator< stack_proxy, true > const_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

 protected_function_result ()=default
 
 protected_function_result (lua_State *Ls, int idx=-1, int retnum=0, int popped=0, call_status pferr=call_status::ok) noexcept
 
 protected_function_result (const protected_function_result &)=default
 
protected_function_resultoperator= (const protected_function_result &)=default
 
 protected_function_result (protected_function_result &&o) noexcept
 
protected_function_resultoperator= (protected_function_result &&o) noexcept
 
 protected_function_result (const unsafe_function_result &o)=delete
 
protected_function_resultoperator= (const unsafe_function_result &o)=delete
 
 protected_function_result (unsafe_function_result &&o) noexcept
 
protected_function_resultoperator= (unsafe_function_result &&o) noexcept
 
call_status status () const noexcept
 
bool valid () const noexcept
 
template<typename T >
decltype(auto) get (int index_offset=0) const
 
type get_type (difference_type index_offset=0) const noexcept
 
stack_proxy operator[] (difference_type index_offset) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
lua_State * lua_state () const noexcept
 
int stack_index () const noexcept
 
int return_count () const noexcept
 
int pop_count () const noexcept
 
void abandon () noexcept
 
 ~protected_function_result ()
 
- Public Member Functions inherited from sol::proxy_base< protected_function_result >
 operator std::string () const
 
 operator T () const
 
 operator T& () const
 
lua_State * lua_state () const
 

Private Member Functions

template<typename T >
decltype(auto) tagged_get (types< optional< T >>, int index_offset) const
 
template<typename T >
decltype(auto) tagged_get (types< T >, int index_offset) const
 
optional< errortagged_get (types< optional< error >>, int index_offset) const
 
error tagged_get (types< error >, int index_offset) const
 

Private Attributes

lua_State * L
 
int index
 
int returncount
 
int popcount
 
call_status err
 

Member Typedef Documentation

§ const_iterator

§ const_reverse_iterator

§ difference_type

§ iterator

§ pointer

§ reference_type

§ reverse_iterator

§ size_type

§ value_type

Constructor & Destructor Documentation

§ protected_function_result() [1/6]

sol::protected_function_result::protected_function_result ( )
default

§ protected_function_result() [2/6]

sol::protected_function_result::protected_function_result ( lua_State *  Ls,
int  idx = -1,
int  retnum = 0,
int  popped = 0,
call_status  pferr = call_status::ok 
)
inlinenoexcept
12274  : L(Ls), index(idx), returncount(retnum), popcount(popped), err(pferr) {
12275  }
int popcount
Definition: sol.hpp:12217
int returncount
Definition: sol.hpp:12216
int index
Definition: sol.hpp:12215
call_status err
Definition: sol.hpp:12218
lua_State * L
Definition: sol.hpp:12214

§ protected_function_result() [3/6]

sol::protected_function_result::protected_function_result ( const protected_function_result )
default

§ protected_function_result() [4/6]

sol::protected_function_result::protected_function_result ( protected_function_result &&  o)
inlinenoexcept
12279  : L(o.L), index(o.index), returncount(o.returncount), popcount(o.popcount), err(o.err) {
12280  // Must be manual, otherwise destructor will screw us
12281  // return count being 0 is enough to keep things clean
12282  // but we will be thorough
12283  o.abandon();
12284  }
int popcount
Definition: sol.hpp:12217
int returncount
Definition: sol.hpp:12216
int index
Definition: sol.hpp:12215
call_status err
Definition: sol.hpp:12218
lua_State * L
Definition: sol.hpp:12214

§ protected_function_result() [5/6]

sol::protected_function_result::protected_function_result ( const unsafe_function_result o)
delete

§ protected_function_result() [6/6]

sol::protected_function_result::protected_function_result ( unsafe_function_result &&  o)
inlinenoexcept
15415  : L(o.lua_state()), index(o.stack_index()), returncount(o.return_count()), popcount(o.return_count()), err(o.status()) {
15416  // Must be manual, otherwise destructor will screw us
15417  // return count being 0 is enough to keep things clean
15418  // but we will be thorough
15419  o.abandon();
15420  }
int popcount
Definition: sol.hpp:12217
int returncount
Definition: sol.hpp:12216
int index
Definition: sol.hpp:12215
call_status err
Definition: sol.hpp:12218
lua_State * L
Definition: sol.hpp:12214

§ ~protected_function_result()

sol::protected_function_result::~protected_function_result ( )
inline
12381  {
12383  }
int popcount
Definition: sol.hpp:12217
int index
Definition: sol.hpp:12215
lua_State * L
Definition: sol.hpp:12214
void remove(lua_State *L, int rawindex, int count)
Definition: sol.hpp:6576

Member Function Documentation

§ abandon()

void sol::protected_function_result::abandon ( )
inlinenoexcept
12374  {
12375  //L = nullptr;
12376  index = 0;
12377  returncount = 0;
12378  popcount = 0;
12380  }
int popcount
Definition: sol.hpp:12217
int returncount
Definition: sol.hpp:12216
int index
Definition: sol.hpp:12215
call_status err
Definition: sol.hpp:12218

§ begin() [1/2]

iterator sol::protected_function_result::begin ( )
inline
12324  {
12325  return iterator(L, index, stack_index() + return_count());
12326  }
stack_iterator< stack_proxy, false > iterator
Definition: sol.hpp:12267
int return_count() const noexcept
Definition: sol.hpp:12368
int index
Definition: sol.hpp:12215
lua_State * L
Definition: sol.hpp:12214
int stack_index() const noexcept
Definition: sol.hpp:12365

§ begin() [2/2]

const_iterator sol::protected_function_result::begin ( ) const
inline
12330  {
12331  return const_iterator(L, index, stack_index() + return_count());
12332  }
int return_count() const noexcept
Definition: sol.hpp:12368
stack_iterator< stack_proxy, true > const_iterator
Definition: sol.hpp:12268
int index
Definition: sol.hpp:12215
lua_State * L
Definition: sol.hpp:12214
int stack_index() const noexcept
Definition: sol.hpp:12365

§ cbegin()

const_iterator sol::protected_function_result::cbegin ( ) const
inline
12336  {
12337  return begin();
12338  }
iterator begin()
Definition: sol.hpp:12324

§ cend()

const_iterator sol::protected_function_result::cend ( ) const
inline
12339  {
12340  return end();
12341  }
iterator end()
Definition: sol.hpp:12327

§ crbegin()

const_reverse_iterator sol::protected_function_result::crbegin ( ) const
inline
12355  {
12356  return std::reverse_iterator<const_iterator>(cbegin());
12357  }
const_iterator cbegin() const
Definition: sol.hpp:12336

§ crend()

const_reverse_iterator sol::protected_function_result::crend ( ) const
inline
12358  {
12359  return std::reverse_iterator<const_iterator>(cend());
12360  }
const_iterator cend() const
Definition: sol.hpp:12339

§ end() [1/2]

iterator sol::protected_function_result::end ( )
inline
12327  {
12329  }
stack_iterator< stack_proxy, false > iterator
Definition: sol.hpp:12267
int return_count() const noexcept
Definition: sol.hpp:12368
lua_State * L
Definition: sol.hpp:12214
int stack_index() const noexcept
Definition: sol.hpp:12365

§ end() [2/2]

const_iterator sol::protected_function_result::end ( ) const
inline
12333  {
12335  }
int return_count() const noexcept
Definition: sol.hpp:12368
stack_iterator< stack_proxy, true > const_iterator
Definition: sol.hpp:12268
lua_State * L
Definition: sol.hpp:12214
int stack_index() const noexcept
Definition: sol.hpp:12365

§ get()

template<typename T >
decltype(auto) sol::protected_function_result::get ( int  index_offset = 0) const
inline
12312  {
12313  return tagged_get(types<meta::unqualified_t<T>>(), index_offset);
12314  }
decltype(auto) tagged_get(types< optional< T >>, int index_offset) const
Definition: sol.hpp:12221

§ get_type()

type sol::protected_function_result::get_type ( difference_type  index_offset = 0) const
inlinenoexcept
12316  {
12317  return type_of(L, index + static_cast<int>(index_offset));
12318  }
int index
Definition: sol.hpp:12215
lua_State * L
Definition: sol.hpp:12214
type type_of(lua_State *L, int index)
Definition: sol.hpp:5358

§ lua_state()

lua_State* sol::protected_function_result::lua_state ( ) const
inlinenoexcept
12362  {
12363  return L;
12364  };
lua_State * L
Definition: sol.hpp:12214

§ operator=() [1/4]

protected_function_result& sol::protected_function_result::operator= ( const protected_function_result )
default

§ operator=() [2/4]

protected_function_result& sol::protected_function_result::operator= ( protected_function_result &&  o)
inlinenoexcept
12285  {
12286  L = o.L;
12287  index = o.index;
12288  returncount = o.returncount;
12289  popcount = o.popcount;
12290  err = o.err;
12291  // Must be manual, otherwise destructor will screw us
12292  // return count being 0 is enough to keep things clean
12293  // but we will be thorough
12294  o.abandon();
12295  return *this;
12296  }
int popcount
Definition: sol.hpp:12217
int returncount
Definition: sol.hpp:12216
int index
Definition: sol.hpp:12215
call_status err
Definition: sol.hpp:12218
lua_State * L
Definition: sol.hpp:12214

§ operator=() [3/4]

protected_function_result& sol::protected_function_result::operator= ( const unsafe_function_result o)
delete

§ operator=() [4/4]

protected_function_result & sol::protected_function_result::operator= ( unsafe_function_result &&  o)
inlinenoexcept
15422  {
15423  L = o.lua_state();
15424  index = o.stack_index();
15425  returncount = o.return_count();
15426  popcount = o.return_count();
15427  err = o.status();
15428  // Must be manual, otherwise destructor will screw us
15429  // return count being 0 is enough to keep things clean
15430  // but we will be thorough
15431  o.abandon();
15432  return *this;
15433  }
int popcount
Definition: sol.hpp:12217
int returncount
Definition: sol.hpp:12216
int index
Definition: sol.hpp:12215
call_status err
Definition: sol.hpp:12218
lua_State * L
Definition: sol.hpp:12214

§ operator[]()

stack_proxy sol::protected_function_result::operator[] ( difference_type  index_offset) const
inline
12320  {
12321  return stack_proxy(L, index + static_cast<int>(index_offset));
12322  }
int index
Definition: sol.hpp:12215
lua_State * L
Definition: sol.hpp:12214

§ pop_count()

int sol::protected_function_result::pop_count ( ) const
inlinenoexcept
12371  {
12372  return popcount;
12373  };
int popcount
Definition: sol.hpp:12217

§ rbegin() [1/2]

reverse_iterator sol::protected_function_result::rbegin ( )
inline
12343  {
12344  return std::reverse_iterator<iterator>(begin());
12345  }
iterator begin()
Definition: sol.hpp:12324

§ rbegin() [2/2]

const_reverse_iterator sol::protected_function_result::rbegin ( ) const
inline
12349  {
12350  return std::reverse_iterator<const_iterator>(begin());
12351  }
iterator begin()
Definition: sol.hpp:12324

§ rend() [1/2]

reverse_iterator sol::protected_function_result::rend ( )
inline
12346  {
12347  return std::reverse_iterator<iterator>(end());
12348  }
iterator end()
Definition: sol.hpp:12327

§ rend() [2/2]

const_reverse_iterator sol::protected_function_result::rend ( ) const
inline
12352  {
12353  return std::reverse_iterator<const_iterator>(end());
12354  }
iterator end()
Definition: sol.hpp:12327

§ return_count()

int sol::protected_function_result::return_count ( ) const
inlinenoexcept
12368  {
12369  return returncount;
12370  };
int returncount
Definition: sol.hpp:12216

§ stack_index()

int sol::protected_function_result::stack_index ( ) const
inlinenoexcept
12365  {
12366  return index;
12367  };
int index
Definition: sol.hpp:12215

§ status()

call_status sol::protected_function_result::status ( ) const
inlinenoexcept
12303  {
12304  return err;
12305  }
call_status err
Definition: sol.hpp:12218

§ tagged_get() [1/4]

template<typename T >
decltype(auto) sol::protected_function_result::tagged_get ( types< optional< T >>  ,
int  index_offset 
) const
inlineprivate
12221  {
12222  typedef decltype(stack::get<optional<T>>(L, index)) ret_t;
12223  int target = index + index_offset;
12224  if (!valid()) {
12225  return ret_t(nullopt);
12226  }
12227  return stack::get<optional<T>>(L, target);
12228  }
bool valid() const noexcept
Definition: sol.hpp:12307
int index
Definition: sol.hpp:12215
decltype(auto) get(lua_State *L, int index, record &tracking)
Definition: sol.hpp:8053
lua_State * L
Definition: sol.hpp:12214
constexpr nullopt_t nullopt
Definition: sol.hpp:3498

§ tagged_get() [2/4]

template<typename T >
decltype(auto) sol::protected_function_result::tagged_get ( types< T ,
int  index_offset 
) const
inlineprivate
12231  {
12232  int target = index + index_offset;
12233 #if defined(SOL_SAFE_PROXIES) && SOL_SAFE_PROXIES
12234  if (!valid()) {
12235  type t = type_of(L, target);
12236  type_panic_c_str(L, target, t, type::none, "bad get from protected_function_result (is not an error)");
12237  }
12238 #endif // Check Argument Safety
12239  return stack::get<T>(L, target);
12240  }
bool valid() const noexcept
Definition: sol.hpp:12307
int type_panic_c_str(lua_State *L, int index, type expected, type actual, const char *message=nullptr) noexcept(false)
Definition: sol.hpp:6343
int index
Definition: sol.hpp:12215
lua_State * L
Definition: sol.hpp:12214
type type_of(lua_State *L, int index)
Definition: sol.hpp:5358

§ tagged_get() [3/4]

optional<error> sol::protected_function_result::tagged_get ( types< optional< error >>  ,
int  index_offset 
) const
inlineprivate
12242  {
12243  int target = index + index_offset;
12244  if (valid()) {
12245  return nullopt;
12246  }
12247  return error(detail::direct_error, stack::get<std::string>(L, target));
12248  }
const auto direct_error
Definition: sol.hpp:411
bool valid() const noexcept
Definition: sol.hpp:12307
int index
Definition: sol.hpp:12215
lua_State * L
Definition: sol.hpp:12214
constexpr nullopt_t nullopt
Definition: sol.hpp:3498

§ tagged_get() [4/4]

error sol::protected_function_result::tagged_get ( types< error ,
int  index_offset 
) const
inlineprivate
12250  {
12251  int target = index + index_offset;
12252 #if defined(SOL_SAFE_PROXIES) && SOL_SAFE_PROXIES
12253  if (valid()) {
12254  type t = type_of(L, target);
12255  type_panic_c_str(L, target, t, type::none, "bad get from protected_function_result (is an error)");
12256  }
12257 #endif // Check Argument Safety
12258  return error(detail::direct_error, stack::get<std::string>(L, target));
12259  }
const auto direct_error
Definition: sol.hpp:411
bool valid() const noexcept
Definition: sol.hpp:12307
int type_panic_c_str(lua_State *L, int index, type expected, type actual, const char *message=nullptr) noexcept(false)
Definition: sol.hpp:6343
int index
Definition: sol.hpp:12215
lua_State * L
Definition: sol.hpp:12214
type type_of(lua_State *L, int index)
Definition: sol.hpp:5358

§ valid()

bool sol::protected_function_result::valid ( ) const
inlinenoexcept
12307  {
12308  return status() == call_status::ok || status() == call_status::yielded;
12309  }
call_status status() const noexcept
Definition: sol.hpp:12303

Member Data Documentation

§ err

call_status sol::protected_function_result::err
private

§ index

int sol::protected_function_result::index
private

§ L

lua_State* sol::protected_function_result::L
private

§ popcount

int sol::protected_function_result::popcount
private

§ returncount

int sol::protected_function_result::returncount
private

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