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

#include <sol.hpp>

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

Public Member Functions

 load_result ()=default
 
 load_result (lua_State *Ls, int stackindex=-1, int retnum=0, int popnum=0, load_status lerr=load_status::ok) noexcept
 
 load_result (const load_result &)=default
 
load_resultoperator= (const load_result &)=default
 
 load_result (load_result &&o) noexcept
 
load_resultoperator= (load_result &&o) noexcept
 
load_status status () const noexcept
 
bool valid () const noexcept
 
template<typename T >
T get () const
 
template<typename... Ret, typename... Args>
decltype(auto) call (Args &&... args)
 
template<typename... Args>
decltype(auto) operator() (Args &&... args)
 
lua_State * lua_state () const noexcept
 
int stack_index () const noexcept
 
 ~load_result ()
 
- Public Member Functions inherited from sol::proxy_base< load_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 >>) const
 
template<typename T >
decltype(auto) tagged_get (types< T >) const
 
optional< errortagged_get (types< optional< error >>) const
 
error tagged_get (types< error >) const
 

Private Attributes

lua_State * L
 
int index
 
int returncount
 
int popcount
 
load_status err
 

Constructor & Destructor Documentation

§ load_result() [1/4]

sol::load_result::load_result ( )
default

§ load_result() [2/4]

sol::load_result::load_result ( lua_State *  Ls,
int  stackindex = -1,
int  retnum = 0,
int  popnum = 0,
load_status  lerr = load_status::ok 
)
inlinenoexcept
20827  : L(Ls), index(stackindex), returncount(retnum), popcount(popnum), err(lerr) {
20828  }
load_status err
Definition: sol.hpp:20788
int returncount
Definition: sol.hpp:20786
lua_State * L
Definition: sol.hpp:20784
int index
Definition: sol.hpp:20785
int popcount
Definition: sol.hpp:20787

§ load_result() [3/4]

sol::load_result::load_result ( const load_result )
default

§ load_result() [4/4]

sol::load_result::load_result ( load_result &&  o)
inlinenoexcept
20832  : L(o.L), index(o.index), returncount(o.returncount), popcount(o.popcount), err(o.err) {
20833  // Must be manual, otherwise destructor will screw us
20834  // return count being 0 is enough to keep things clean
20835  // but we will be thorough
20836  o.L = nullptr;
20837  o.index = 0;
20838  o.returncount = 0;
20839  o.popcount = 0;
20840  o.err = load_status::syntax;
20841  }
load_status err
Definition: sol.hpp:20788
int returncount
Definition: sol.hpp:20786
lua_State * L
Definition: sol.hpp:20784
int index
Definition: sol.hpp:20785
int popcount
Definition: sol.hpp:20787

§ ~load_result()

sol::load_result::~load_result ( )
inline
20894  {
20896  }
lua_State * L
Definition: sol.hpp:20784
int index
Definition: sol.hpp:20785
int popcount
Definition: sol.hpp:20787
void remove(lua_State *L, int rawindex, int count)
Definition: sol.hpp:6576

Member Function Documentation

§ call()

template<typename... Ret, typename... Args>
decltype(auto) sol::load_result::call ( Args &&...  args)
inline
20873  {
20874 #if !defined(__clang__) && defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 191200000
20875  // MSVC is ass sometimes
20876  return get<protected_function>().call<Ret...>(std::forward<Args>(args)...);
20877 #else
20878  return get<protected_function>().template call<Ret...>(std::forward<Args>(args)...);
20879 #endif
20880  }

§ get()

template<typename T >
T sol::load_result::get ( ) const
inline
20868  {
20869  return tagged_get(types<meta::unqualified_t<T>>());
20870  }
decltype(auto) tagged_get(types< optional< T >>) const
Definition: sol.hpp:20791

§ lua_state()

lua_State* sol::load_result::lua_state ( ) const
inlinenoexcept
20887  {
20888  return L;
20889  };
lua_State * L
Definition: sol.hpp:20784

§ operator()()

template<typename... Args>
decltype(auto) sol::load_result::operator() ( Args &&...  args)
inline
20883  {
20884  return call<>(std::forward<Args>(args)...);
20885  }

§ operator=() [1/2]

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

§ operator=() [2/2]

load_result& sol::load_result::operator= ( load_result &&  o)
inlinenoexcept
20842  {
20843  L = o.L;
20844  index = o.index;
20845  returncount = o.returncount;
20846  popcount = o.popcount;
20847  err = o.err;
20848  // Must be manual, otherwise destructor will screw us
20849  // return count being 0 is enough to keep things clean
20850  // but we will be thorough
20851  o.L = nullptr;
20852  o.index = 0;
20853  o.returncount = 0;
20854  o.popcount = 0;
20855  o.err = load_status::syntax;
20856  return *this;
20857  }
load_status err
Definition: sol.hpp:20788
int returncount
Definition: sol.hpp:20786
lua_State * L
Definition: sol.hpp:20784
int index
Definition: sol.hpp:20785
int popcount
Definition: sol.hpp:20787

§ stack_index()

int sol::load_result::stack_index ( ) const
inlinenoexcept
20890  {
20891  return index;
20892  };
int index
Definition: sol.hpp:20785

§ status()

load_status sol::load_result::status ( ) const
inlinenoexcept
20859  {
20860  return err;
20861  }
load_status err
Definition: sol.hpp:20788

§ tagged_get() [1/4]

template<typename T >
decltype(auto) sol::load_result::tagged_get ( types< optional< T >>  ) const
inlineprivate
20791  {
20792  if (!valid()) {
20793  return optional<T>(nullopt);
20794  }
20795  return stack::get<optional<T>>(L, index);
20796  }
bool valid() const noexcept
Definition: sol.hpp:20863
lua_State * L
Definition: sol.hpp:20784
int index
Definition: sol.hpp:20785
constexpr nullopt_t nullopt
Definition: sol.hpp:3498

§ tagged_get() [2/4]

template<typename T >
decltype(auto) sol::load_result::tagged_get ( types< T ) const
inlineprivate
20799  {
20800 #if defined(SOL_SAFE_PROXIES) && SOL_SAFE_PROXIES != 0
20801  if (!valid()) {
20803  }
20804 #endif // Check Argument Safety
20805  return stack::get<T>(L, index);
20806  }
bool valid() const noexcept
Definition: sol.hpp:20863
int type_panic_c_str(lua_State *L, int index, type expected, type actual, const char *message=nullptr) noexcept(false)
Definition: sol.hpp:6343
lua_State * L
Definition: sol.hpp:20784
int index
Definition: sol.hpp:20785
type type_of(lua_State *L, int index)
Definition: sol.hpp:5358

§ tagged_get() [3/4]

optional<error> sol::load_result::tagged_get ( types< optional< error >>  ) const
inlineprivate
20808  {
20809  if (valid()) {
20810  return nullopt;
20811  }
20812  return error(detail::direct_error, stack::get<std::string>(L, index));
20813  }
const auto direct_error
Definition: sol.hpp:411
bool valid() const noexcept
Definition: sol.hpp:20863
lua_State * L
Definition: sol.hpp:20784
int index
Definition: sol.hpp:20785
constexpr nullopt_t nullopt
Definition: sol.hpp:3498

§ tagged_get() [4/4]

error sol::load_result::tagged_get ( types< error ) const
inlineprivate
20815  {
20816 #if defined(SOL_SAFE_PROXIES) && SOL_SAFE_PROXIES != 0
20817  if (valid()) {
20818  type_panic_c_str(L, index, type_of(L, index), type::none, "expecting an error type (a string, from Lua)");
20819  }
20820 #endif // Check Argument Safety
20821  return error(detail::direct_error, stack::get<std::string>(L, index));
20822  }
const auto direct_error
Definition: sol.hpp:411
bool valid() const noexcept
Definition: sol.hpp:20863
int type_panic_c_str(lua_State *L, int index, type expected, type actual, const char *message=nullptr) noexcept(false)
Definition: sol.hpp:6343
lua_State * L
Definition: sol.hpp:20784
int index
Definition: sol.hpp:20785
type type_of(lua_State *L, int index)
Definition: sol.hpp:5358

§ valid()

bool sol::load_result::valid ( ) const
inlinenoexcept
20863  {
20864  return status() == load_status::ok;
20865  }
load_status status() const noexcept
Definition: sol.hpp:20859

Member Data Documentation

§ err

load_status sol::load_result::err
private

§ index

int sol::load_result::index
private

§ L

lua_State* sol::load_result::L
private

§ popcount

int sol::load_result::popcount
private

§ returncount

int sol::load_result::returncount
private

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