Lua_icxx  1.02 (Aug 2011)
LuaTempResult::Item Class Reference

Represent one of the items of a LuaTempResult. More...

#include <LuaTempResult.h>

List of all members.

Public Member Functions

 Item (lua_State *lua, int stackPos, LuaErrCode errCode)
 Construct an getItem to refer to the Lua object at given stack pos of given Lua state.
int getTypeID () const
 Get the type of Lua object referenced by this Item (returns one of the LUA_T enum)
bool isNil () const
 Test if Lua nil.
void push () const
 Push the Item onto the Lua stack.
bool isError () const
 Test if Lua error.
template<typename TT >
 operator TT () const
 Convert Item to a value such as int, float, etc.
template<typename TT >
TT getAs () const
 Convert Item to a value such as int, float, etc.
template<typename TT >
bool operator== (TT val) const
 Compare a result Item to another value such as int, float etc.
template<typename TT >
bool operator!= (TT val) const
 Compare a result Item to another value such as int, float etc.
template<typename TT >
bool operator>= (TT val) const
 Compare a result Item to another value such as int, float etc.
template<typename TT >
bool operator<= (TT val) const
 Compare a result Item to another value such as int, float etc.
template<typename TT >
bool operator> (TT val) const
 Compare a result Item to another value such as int, float etc.
template<typename TT >
bool operator< (TT val) const
 Compare a result Item to another value such as int, float etc.

Public Attributes

lua_State *const mLua
 Lua state in which this getItem resides.
int const mStackPos
 position of this getItem on stack for Lua state
LuaErrCode const mErrCode
 err code for this item

Detailed Description

Represent one of the items of a LuaTempResult.

This getItem is still on the Lua stack. Items are created by LuaTempResult.

Definition at line 148 of file LuaTempResult.h.


Constructor & Destructor Documentation

LuaTempResult::Item::Item ( lua_State *  lua,
int  stackPos,
LuaErrCode  errCode 
) [inline]

Construct an getItem to refer to the Lua object at given stack pos of given Lua state.

This is typically called by LuaTempResult (though it is ok to call directly if working directly with a Lua state). Note that stackPos can be LUA_UNACCEPTABLE_STACK_POS, in which case this Item is equiv to nil.

Definition at line 157 of file LuaTempResult.h.