cocos2d-x  3.0-alpha0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LuaStack Class Reference

#include <CCLuaStack.h>

Inheritance diagram for LuaStack:
Object

Public Member Functions

lua_StategetLuaState (void)
 Method used to get a pointer to the lua_State that the script module is attached to. More...
 
local getLuaState ()
 Method used to get a pointer to the lua_State that the script module is attached to. More...
 
virtual void addSearchPath (const char *path)
 Add a path to find lua files in. More...
 
virtual void addLuaLoader (lua_CFunction func)
 Add lua loader, now it is used on android. More...
 
virtual void removeScriptObjectByObject (Object *object)
 Remove Object from lua state. More...
 
virtual void removeScriptHandler (int nHandler)
 Remove Lua function reference. More...
 
virtual int reallocateScriptHandler (int nHandler)
 Remove Lua function reference. More...
 
virtual int executeString (const char *codes)
 Execute script code contained in the given string. More...
 
virtual int executeScriptFile (const char *filename)
 Execute a script file. More...
 
local executeScriptFile ( local filename)
 Execute a script file. More...
 
virtual int executeGlobalFunction (const char *functionName)
 Execute a scripted global function. More...
 
virtual void clean (void)
virtual void pushInt (int intValue)
local pushInt ( local intValue)
virtual void pushFloat (float floatValue)
local pushFloat ( local floatValue)
virtual void pushBoolean (bool boolValue)
local pushBoolean ( local boolValue)
virtual void pushString (const char *stringValue)
local pushString ( local stringValue)
virtual void pushString (const char *stringValue, int length)
var pushString ( var stringValue, var length)
local pushString ( local stringValue, local length)
virtual void pushNil (void)
virtual void pushObject (Object *objectValue, const char *typeName)
local pushObject ( local objectValue, local typeName)
virtual void pushLuaValue (const LuaValue &value)
local pushLuaValue ( local value)
virtual void pushLuaValueDict (const LuaValueDict &dict)
local pushLuaValueDict ( local dict)
virtual void pushLuaValueArray (const LuaValueArray &array)
virtual bool pushFunctionByHandler (int nHandler)
virtual int executeFunction (int numArgs)
virtual int executeFunctionByHandler (int nHandler, int numArgs)
local executeFunctionByHandler ( local nHandler, local numArgs)
virtual int executeFunctionReturnArray (int handler, int numArgs, int numResults, Array &resultArray)
local executeFunctionReturnArray ( local handler, local numArgs, local numResults, local resultArray)
virtual bool handleAssert (const char *msg)
- Public Member Functions inherited from Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
void release ()
 Release the ownership immediately. More...
 
void retain ()
 Retains the ownership. More...
 
Objectautorelease ()
 Release the ownership sometime soon automatically. More...
 
bool isSingleReference () const
 Returns a boolean value that indicates whether there is only one reference to the object. More...
 
unsigned int retainCount () const
 Returns the object's current reference count. More...
 
virtual bool isEqual (const Object *object)
 Returns a boolean value that indicates whether this object and a given object are equal. More...
 
virtual void acceptVisitor (DataVisitor &visitor)
virtual void update (float dt)

Static Public Member Functions

static LuaStackcreate (void)
var create ()
static LuaStackattach (lua_State *L)
var attach ( var L)

Protected Member Functions

 LuaStack (void)
bool init (void)
bool initWithLuaState (lua_State *L)

Protected Attributes

lua_State_state
int _callFromLua
var _callFromLua
local _callFromLua
- Protected Attributes inherited from Object
unsigned int _reference
 count of references More...
 
var _reference
 count of references More...
 
local _reference
 count of references More...
 
unsigned int _autoReleaseCount
 count of autorelease More...
 
var _autoReleaseCount
 count of autorelease More...
 
local _autoReleaseCount
 count of autorelease More...
 

Additional Inherited Members

- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID More...
 
int _luaID
 Lua reference id. More...
 

Constructor & Destructor Documentation

LuaStack ( void  )
inlineprotected
var LuaStack (   )
inlineprotected
local LuaStack (   )
inlineprotected

Member Function Documentation

virtual void addLuaLoader ( lua_CFunction  func)
virtual

Add lua loader, now it is used on android.

var addLuaLoader ( var  func)
virtual

Add lua loader, now it is used on android.

local addLuaLoader ( local  func)
virtual

Add lua loader, now it is used on android.

virtual void addSearchPath ( const char *  path)
virtual

Add a path to find lua files in.

Parameters
pathto be added to the Lua path
var addSearchPath ( var  path)
virtual

Add a path to find lua files in.

Parameters
pathto be added to the Lua path
local addSearchPath ( local  path)
virtual

Add a path to find lua files in.

Parameters
pathto be added to the Lua path
static LuaStack* attach ( lua_State L)
static
var attach ( var  L)
static
local attach ( local  L)
static
virtual void clean ( void  )
virtual
var clean (   )
virtual
local clean (   )
virtual
static LuaStack* create ( void  )
static
var create (   )
static
local create (   )
static
virtual int executeFunction ( int  numArgs)
virtual
var executeFunction ( var  numArgs)
virtual
local executeFunction ( local  numArgs)
virtual
virtual int
executeFunctionByHandler
( int  nHandler,
int  numArgs 
)
virtual
var executeFunctionByHandler ( var  nHandler,
var  numArgs 
)
virtual
local executeFunctionByHandler ( local  nHandler,
local  numArgs 
)
virtual
virtual int
executeFunctionReturnArray
( int  handler,
int  numArgs,
int  numResults,
Array resultArray 
)
virtual
var executeFunctionReturnArray ( var  handler,
var  numArgs,
var  numResults,
var  resultArray 
)
virtual
local executeFunctionReturnArray ( local  handler,
local  numArgs,
local  numResults,
local  resultArray 
)
virtual
virtual int executeGlobalFunction ( const char *  functionName)
virtual

Execute a scripted global function.

The function should not take any parameters and should return an integer.

Parameters
functionNameString object holding the name of the function, in the global script environment, that is to be executed.
Returns
The integer value returned from the script function.
var executeGlobalFunction ( var  functionName)
virtual

Execute a scripted global function.

The function should not take any parameters and should return an integer.

Parameters
functionNameString object holding the name of the function, in the global script environment, that is to be executed.
Returns
The integer value returned from the script function.
local executeGlobalFunction ( local  functionName)
virtual

Execute a scripted global function.

The function should not take any parameters and should return an integer.

Parameters
functionNameString object holding the name of the function, in the global script environment, that is to be executed.
Returns
The integer value returned from the script function.
virtual int executeScriptFile ( const char *  filename)
virtual

Execute a script file.

Parameters
filenameString object holding the filename of the script file that is to be executed
var executeScriptFile ( var  filename)
virtual

Execute a script file.

Parameters
filenameString object holding the filename of the script file that is to be executed
local executeScriptFile ( local  filename)
virtual

Execute a script file.

Parameters
filenameString object holding the filename of the script file that is to be executed
virtual int executeString ( const char *  codes)
virtual

Execute script code contained in the given string.

Parameters
codesholding the valid script code that should be executed.
Returns
0 if the string is excuted correctly.
other if the string is excuted wrongly.
var executeString ( var  codes)
virtual

Execute script code contained in the given string.

Parameters
codesholding the valid script code that should be executed.
Returns
0 if the string is excuted correctly.
other if the string is excuted wrongly.
local executeString ( local  codes)
virtual

Execute script code contained in the given string.

Parameters
codesholding the valid script code that should be executed.
Returns
0 if the string is excuted correctly.
other if the string is excuted wrongly.
lua_State* getLuaState ( void  )
inline

Method used to get a pointer to the lua_State that the script module is attached to.

Returns
A pointer to the lua_State that the script module is attached to.
var getLuaState (   )
inline

Method used to get a pointer to the lua_State that the script module is attached to.

Returns
A pointer to the lua_State that the script module is attached to.
local getLuaState (   )
inline

Method used to get a pointer to the lua_State that the script module is attached to.

Returns
A pointer to the lua_State that the script module is attached to.
virtual bool handleAssert ( const char *  msg)
virtual
var handleAssert ( var  msg)
virtual
local handleAssert ( local  msg)
virtual
bool init ( void  )
protected
var init (   )
protected
local init (   )
protected
bool initWithLuaState ( lua_State L)
protected
var initWithLuaState ( var  L)
protected
local initWithLuaState ( local  L)
protected
virtual void pushBoolean ( bool  boolValue)
virtual
var pushBoolean ( var  boolValue)
virtual
local pushBoolean ( local  boolValue)
virtual
virtual void pushFloat ( float  floatValue)
virtual
var pushFloat ( var  floatValue)
virtual
local pushFloat ( local  floatValue)
virtual
virtual bool pushFunctionByHandler ( int  nHandler)
virtual
var pushFunctionByHandler ( var  nHandler)
virtual
local pushFunctionByHandler ( local  nHandler)
virtual
virtual void pushInt ( int  intValue)
virtual
var pushInt ( var  intValue)
virtual
local pushInt ( local  intValue)
virtual
virtual void pushLuaValue ( const LuaValue value)
virtual
var pushLuaValue ( var  value)
virtual
local pushLuaValue ( local  value)
virtual
virtual void pushLuaValueArray ( const LuaValueArray array)
virtual
var pushLuaValueArray ( var  array)
virtual
local pushLuaValueArray ( local  array)
virtual
virtual void pushLuaValueDict ( const LuaValueDict dict)
virtual
var pushLuaValueDict ( var  dict)
virtual
local pushLuaValueDict ( local  dict)
virtual
virtual void pushNil ( void  )
virtual
var pushNil (   )
virtual
local pushNil (   )
virtual
virtual void pushObject ( Object objectValue,
const char *  typeName 
)
virtual
var pushObject ( var  objectValue,
var  typeName 
)
virtual
local pushObject ( local  objectValue,
local  typeName 
)
virtual
virtual void pushString ( const char *  stringValue)
virtual
var pushString ( var  stringValue)
virtual
local pushString ( local  stringValue)
virtual
virtual void pushString ( const char *  stringValue,
int  length 
)
virtual
var pushString ( var  stringValue,
var  length 
)
virtual
local pushString ( local  stringValue,
local  length 
)
virtual
virtual int reallocateScriptHandler ( int  nHandler)
virtual

Remove Lua function reference.

var reallocateScriptHandler ( var  nHandler)
virtual

Remove Lua function reference.

local reallocateScriptHandler ( local  nHandler)
virtual

Remove Lua function reference.

virtual void removeScriptHandler ( int  nHandler)
virtual

Remove Lua function reference.

var removeScriptHandler ( var  nHandler)
virtual

Remove Lua function reference.

local removeScriptHandler ( local  nHandler)
virtual

Remove Lua function reference.

virtual void
removeScriptObjectByObject
( Object object)
virtual

Remove Object from lua state.

Parameters
objectThe object to be removed.
var removeScriptObjectByObject ( var  object)
virtual

Remove Object from lua state.

Parameters
objectThe object to be removed.
local removeScriptObjectByObject ( local  object)
virtual

Remove Object from lua state.

Parameters
objectThe object to be removed.

Member Data Documentation

int _callFromLua
protected
var _callFromLua
protected
local _callFromLua
protected
lua_State* _state
protected
var _state
protected
local _state
protected

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