LPCGame
A Simple 2d Game Engine
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
LuaC::LuaUdataParam< T > Class Template Reference

#include <luacudataparam.h>

Inherits LuaC::LuaParam.

Public Member Functions

 LuaUdataParam (T *obj)
 
void Push (lua_State *l) override
 
void Push (lua_State *l, std::string name) override
 

Static Public Member Functions

static T * Retrieve (lua_State *l)
 

Detailed Description

template<class T>
class LuaC::LuaUdataParam< T >

A class for packing together one of our classes and its Lua lib Push function so that we can easily push it onto a Lua state and use it as a parameter

Constructor & Destructor Documentation

template<class T >
LuaC::LuaUdataParam< T >::LuaUdataParam ( T *  obj)
inline

Construct the parameter, giving it a pointer to the object it's pushing

Parameters
objThe object to be pushed into the state

Member Function Documentation

template<class T >
void LuaC::LuaUdataParam< T >::Push ( lua_State *  l)
inlineoverridevirtual

Push the parameter value on to a Lua state using the pusher function

Parameters
lThe Lua state to push the object onto

Implements LuaC::LuaParam.

template<class T >
void LuaC::LuaUdataParam< T >::Push ( lua_State *  l,
std::string  name 
)
inlineoverridevirtual

Push the parameter onto a Lua state as a global variable with some name

Parameters
lLua state to push onto
nameGlobal name to be given to the object

Implements LuaC::LuaParam.

template<class T >
static T* LuaC::LuaUdataParam< T >::Retrieve ( lua_State *  l)
inlinestatic

Get the Lua Param from the top of the Lua Stack Used for retrieving the return value of a Lua function call

Parameters
lLua state to get result from

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