Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

LuaObject Class Reference

#include <LuaState.h>

List of all members.

Public Methods

 LuaObject (lua_State *state, int stackIndex)
 LuaObject (LuaState *state, int stackIndex)
 LuaObject (LuaState &state, int stackIndex)
 LuaObject (const LuaObject &src)
const LuaObject & operator= (const LuaObject &src)
LuaState GetLuaState () const
lua_StateGetState () const
 operator lua_State * () const
 operator int () const
const char * GetTypeStr () const
int GetType () const
bool IsNil () const
bool IsTable () const
bool IsUserData () const
bool IsCFunction () const
bool IsNumber () const
bool IsString () const
bool IsUString () const
bool IsFunction () const
bool IsNull () const
bool IsPointer () const
int GetInteger () const
float GetNumber () const
const char * GetString () const
const wchar_t * GetUString () const
int StrLen () const
LuaCFunction GetCFunction () const
void * GetUserData () const
const void * GetLuaPointer () const
const void * GetPointer () const
void Push ()
void Pop ()
LuaObject GetMethods ()
void SetMethods ()
void SetTable ()
int Tag ()
int GetCount ()
LuaObject CreateTable (const char *name, int size=0)
LuaObject CreateTable (int index, int size=0)
void SetNil (const char *name)
void SetNil (int index)
void SetNumber (const char *name, double value)
void SetNumber (int index, double value)
void SetString (const char *name, const char *value)
void SetString (int index, const char *value)
void SetString (const char *name, const wchar_t *value)
void SetString (int index, const wchar_t *value)
void SetUserData (const char *name, void *value)
void SetUserData (int index, void *value)
void SetPointer (const char *name, const void *value)
void SetPointer (int index, const void *value)
void SetObject (const char *name, LuaObject value)
void SetObject (int index, LuaObject value)
LuaObject GetByName (const char *name)
LuaObject GetByIndex (int index)
void Register (const char *funcName, lua_CFunction function)
void Register (const char *funcName, LuaStateCFunction function)
void Register (const LuaFunctionList *functionList)
void Unregister (const char *funcName)
void Unregister (const LuaFunctionList *functionList)

Protected Attributes

lua_Statem_state
 The parent state of this object. More...

int m_stackIndex
 The stack index representing this object. More...


Friends

class LuaState


Detailed Description

Representation of a Lua object residing on the Lua stack.

Definition at line 623 of file LuaState.h.


Constructor & Destructor Documentation

LuaObject::LuaObject lua_State   state,
int    stackIndex
[inline]
 

Various constructors accepting different parameters.

Definition at line 629 of file LuaState.h.

00631         {
00632             if (!functionList[i].name)
00633                 break;

LuaObject::LuaObject LuaState   state,
int    stackIndex
[inline]
 

Various constructors accepting different parameters.

Definition at line 1355 of file LuaState.h.

LuaObject::LuaObject LuaState   state,
int    stackIndex
[inline]
 

Various constructors accepting different parameters.

Definition at line 1365 of file LuaState.h.

LuaObject::LuaObject const LuaObject &    src [inline]
 

Copy constructor.

Definition at line 648 of file LuaState.h.

00652                                                 {  lua_pushcclosure(m_state, f, 0);  }


Member Function Documentation

LuaObject LuaObject::CreateTable int    index,
int    size = 0
[inline]
 

Creates a table called [key] within the current LuaObject.

Parameters:
index  The index of the table to create.
size  The size of the table.
Returns:
Returns the object representing the newly created table.

Definition at line 741 of file LuaState.h.

00743                                     :
00744         m_state(object)
00745     {
00746         m_stackTop = lua_gettop(m_state);
00747     }
00748 
00749     ~LuaAutoBlock()

LuaObject LuaObject::CreateTable const char *    name,
int    size = 0
[inline]
 

Creates a table called [name] within the current LuaObject.

Parameters:
name  The name of the table to create.
size  The size of the table.
Returns:
Returns the object representing the newly created table.

Definition at line 724 of file LuaState.h.

00724       :
00725     LuaAutoBlock(lua_State* state) :
00726         m_state(state)
00727     {
00728         m_stackTop = lua_gettop(m_state);
00729     }
00730 
00731     LuaAutoBlock(LuaState* state) :
00732         m_state(*state)

LuaObject LuaObject::GetByIndex int    index [inline]
 

Assuming the current object is a table, retrieves the table entry at [index].

Parameters:
index  The numeric name of a table entry.
Returns:
Returns an LuaObject representing the retrieved entry.

Definition at line 952 of file LuaState.h.

LuaObject LuaObject::GetByName const char *    name [inline]
 

Assuming the current object is a table, retrieves the table entry called [name].

Parameters:
name  The name of the entry from the current table to retrieve.
Returns:
Returns an LuaObject representing the retrieved entry.

Definition at line 938 of file LuaState.h.

LuaCFunction LuaObject::GetCFunction   const [inline]
 

Definition at line 701 of file LuaState.h.

00703 : public LuaState

int LuaObject::GetCount   [inline]
 

Definition at line 714 of file LuaState.h.

00723 {

int LuaObject::GetInteger   const [inline]
 

Definition at line 686 of file LuaState.h.

Referenced by LS_WriteLuaFile(), and LUA_ALERT().

00688 {  return m_state;  }

const void* LuaObject::GetLuaPointer   const [inline]
 

Definition at line 703 of file LuaState.h.

00703 : public LuaState

LuaState LuaObject::GetLuaState   const [inline]
 

Retrieves the LuaState object associated with this LuaObject.

Definition at line 1374 of file LuaState.h.

LuaObject LuaObject::GetMethods   [inline]
 

Definition at line 709 of file LuaState.h.

00710 :

float LuaObject::GetNumber   const [inline]
 

Definition at line 687 of file LuaState.h.

00688 {  return m_state;  }

const void* LuaObject::GetPointer   const [inline]
 

Definition at line 704 of file LuaState.h.

00704 {

lua_State* LuaObject::GetState   const [inline]
 

Definition at line 668 of file LuaState.h.

00688 {  return m_state;  }

const char* LuaObject::GetString   const [inline]
 

Definition at line 688 of file LuaState.h.

00688                                                 {  return m_state;  }
00689 
00690 public:
00691     lua_State* m_state;
00692 
00693 protected:

int LuaObject::GetType   const [inline]
 

Definition at line 673 of file LuaState.h.

00688 {  return m_state;  }

const char* LuaObject::GetTypeStr   const [inline]
 

Definition at line 672 of file LuaState.h.

00688 {  return m_state;  }

const wchar_t* LuaObject::GetUString   const [inline]
 

Definition at line 694 of file LuaState.h.

00694                {}
00695 };
00696 
00697 

void* LuaObject::GetUserData   const [inline]
 

Definition at line 702 of file LuaState.h.

00703 : public LuaState

bool LuaObject::IsCFunction   const [inline]
 

Definition at line 678 of file LuaState.h.

00688 {  return m_state;  }

bool LuaObject::IsFunction   const [inline]
 

Definition at line 682 of file LuaState.h.

00688 {  return m_state;  }

bool LuaObject::IsNil   const [inline]
 

Definition at line 675 of file LuaState.h.

Referenced by LS_WriteLuaFile(), and LUA_ALERT().

00688 {  return m_state;  }

bool LuaObject::IsNull   const [inline]
 

Definition at line 683 of file LuaState.h.

00688 {  return m_state;  }

bool LuaObject::IsNumber   const [inline]
 

Definition at line 679 of file LuaState.h.

Referenced by LS_WriteLuaFile(), and LUA_ALERT().

00688 {  return m_state;  }

bool LuaObject::IsPointer   const [inline]
 

Definition at line 684 of file LuaState.h.

00688 {  return m_state;  }

bool LuaObject::IsString   const [inline]
 

Definition at line 680 of file LuaState.h.

00688 {  return m_state;  }

bool LuaObject::IsTable   const [inline]
 

Definition at line 676 of file LuaState.h.

00688 {  return m_state;  }

bool LuaObject::IsUString   const [inline]
 

Definition at line 681 of file LuaState.h.

00688 {  return m_state;  }

bool LuaObject::IsUserData   const [inline]
 

Definition at line 677 of file LuaState.h.

00688 {  return m_state;  }

void LuaObject::Pop   [inline]
 

Definition at line 707 of file LuaState.h.

00710 :

void LuaObject::Push   [inline]
 

Definition at line 706 of file LuaState.h.

00710 :

void LuaObject::Register const LuaFunctionList   functionList [inline]
 

Assuming the current object is a table, registers all of the functions in [functionList] with the table.

Parameters:
functionList  A NULL terminated list of functions to register in the current table object.

Definition at line 993 of file LuaState.h.

void LuaObject::Register const char *    funcName,
LuaStateCFunction    function
[inline]
 

Assuming the current object is a table, registers a C function called [funcName] within the table.

Parameters:
funcName  The name of the function to register.
function  A pointer to the C function to register.

Definition at line 979 of file LuaState.h.

void LuaObject::Register const char *    funcName,
lua_CFunction    function
[inline]
 

Assuming the current object is a table, registers a C function called [funcName] within the table.

Parameters:
funcName  The name of the function to register.
function  A pointer to the C function to register.

Definition at line 965 of file LuaState.h.

void LuaObject::SetMethods   [inline]
 

Definition at line 710 of file LuaState.h.

00710 :

void LuaObject::SetNil int    index [inline]
 

Assigns the table key [index] to nil.

Parameters:
key  The index of the object to make nil.

Definition at line 768 of file LuaState.h.

void LuaObject::SetNil const char *    name [inline]
 

Assigns the table key [name] to nil.

Parameters:
name  The name of the object to make nil.

Definition at line 756 of file LuaState.h.

void LuaObject::SetNumber int    index,
double    value
[inline]
 

Creates (or reassigns) the object called [index] to [value].

Parameters:
index  The index of the object to assign the value to.
value  The value to assign to [index].

Definition at line 794 of file LuaState.h.

00795                                                            :
00796     m_state(state),
00797     m_stackIndex(stackIndex)
00798 {
00799 }

void LuaObject::SetNumber const char *    name,
double    value
[inline]
 

Creates (or reassigns) the object called [name] to [value].

Parameters:
name  The name of the object to assign the value to.
value  The value to assign to [name].

Definition at line 781 of file LuaState.h.

00785                                                            :
00786     m_state(*state),

void LuaObject::SetObject int    index,
LuaObject    value
[inline]
 

Creates (or reassigns) the object called [index] to [value].

Parameters:
index  The index of the object to assign the value to.
value  The value to assign to [index].

Definition at line 924 of file LuaState.h.

void LuaObject::SetObject const char *    name,
LuaObject    value
[inline]
 

Creates (or reassigns) the object called [name] to [value].

Parameters:
name  The name of the object to assign the value to.
value  The value to assign to [name].

Definition at line 911 of file LuaState.h.

void LuaObject::SetPointer int    index,
const void *    value
[inline]
 

Creates (or reassigns) the object called [index] to [value].

Parameters:
index  The index of the object to assign the value to.
value  The value to assign to [index].

Definition at line 898 of file LuaState.h.

void LuaObject::SetPointer const char *    name,
const void *    value
[inline]
 

Creates (or reassigns) the object called [name] to [value].

Parameters:
name  The name of the object to assign the value to.
value  The value to assign to [name].

Definition at line 885 of file LuaState.h.

void LuaObject::SetString int    index,
const wchar_t *    value
[inline]
 

Creates (or reassigns) the object called [index] to [value].

Parameters:
index  The index of the object to assign the value to.
value  The value to assign to [index].

Definition at line 846 of file LuaState.h.

00847     {
00848         char message[800];
00849         va_list arglist;
00850 
00851         va_start(arglist, str);

void LuaObject::SetString const char *    name,
const wchar_t *    value
[inline]
 

Creates (or reassigns) the object called [name] to [value].

Parameters:
name  The name of the object to assign the value to.
value  The value to assign to [name].

Definition at line 833 of file LuaState.h.

00841     {

void LuaObject::SetString int    index,
const char *    value
[inline]
 

Creates (or reassigns) the object called [index] to [value].

Parameters:
index  The index of the object to assign the value to.
value  The value to assign to [index].

Definition at line 820 of file LuaState.h.

00821 {
00822 public:
00823     LuaStateOutFile() : m_file(NULL), m_fileOwner(false) {}
00824     virtual ~LuaStateOutFile()
00825     {

void LuaObject::SetString const char *    name,
const char *    value
[inline]
 

Creates (or reassigns) the object called [name] to [value].

Parameters:
name  The name of the object to assign the value to.
value  The value to assign to [name].

Definition at line 807 of file LuaState.h.

00821 {

void LuaObject::SetTable   [inline]
 

Definition at line 712 of file LuaState.h.

00723 {

void LuaObject::SetUserData int    index,
void *    value
[inline]
 

Creates (or reassigns) the object called [index] to [value].

Parameters:
index  The index of the object to assign the value to.
value  The value to assign to [index].

Definition at line 872 of file LuaState.h.

void LuaObject::SetUserData const char *    name,
void *    value
[inline]
 

Creates (or reassigns) the object called [name] to [value].

Parameters:
name  The name of the object to assign the value to.
value  The value to assign to [name].

Definition at line 859 of file LuaState.h.

00859     {
00860         m_file = file;
00861         m_fileOwner = false;
00862 
00863         return true;
00864     }

int LuaObject::StrLen   const [inline]
 

Definition at line 700 of file LuaState.h.

00703 : public LuaState

int LuaObject::Tag   [inline]
 

Definition at line 713 of file LuaState.h.

00723 {

void LuaObject::Unregister const LuaFunctionList   functionList [inline]
 

Assuming the current object is a table, unregisters the list of functions described in [functionList].

Parameters:
functionList  The list of functions to unregister.

Definition at line 1024 of file LuaState.h.

void LuaObject::Unregister const char *    funcName [inline]
 

Assuming the current object is a table, unregisters the function called [funcName].

Parameters:
funcName  The name of the function to unregister.

Definition at line 1011 of file LuaState.h.

LuaObject::operator int   const [inline]
 

Definition at line 670 of file LuaState.h.

00688 {  return m_state;  }

LuaObject::operator lua_State *   const [inline]
 

Definition at line 669 of file LuaState.h.

00688 {  return m_state;  }

const LuaObject& LuaObject::operator= const LuaObject &    src [inline]
 

Assignment operator.

Definition at line 657 of file LuaState.h.

00659     {  
00660         PushNil();
00661         PushCFunction(f);
00662         SetTagMethod(Tag(-2), "gc");


Friends And Related Function Documentation

friend class LuaState [friend]
 

Definition at line 1037 of file LuaState.h.


Member Data Documentation

int LuaObject::m_stackIndex [protected]
 

The stack index representing this object.

Definition at line 1040 of file LuaState.h.

lua_State* LuaObject::m_state [protected]
 

The parent state of this object.

Definition at line 1039 of file LuaState.h.


The documentation for this class was generated from the following file:
Generated on Wed Nov 7 21:15:17 2001 for LuaState(LuaWrapper) by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001