Luna< T > Class Template Reference

Helper class to create lua C++ class bindings. More...

#include <Luna.hh>

List of all members.

Classes

struct  RegType
struct  userdataType

Public Types

typedef int(T::* mfp )(lua_State *L)

Static Public Member Functions

static void registerMethods (lua_State *l)
 Register methods in lua namespace.
static T * check (lua_State *l, int narg)
 Get userdata from Lua stack and return pointer to T object.
static T * create (lua_State *l)
 Create a new object from C++ (like new).
static int getMethod (lua_State *l, const std::string &funcname)
 Fetch a lua method from this class Use it when you want to call some method of this class from C++.

Detailed Description

template<typename T>
class Luna< T >

Helper class to create lua C++ class bindings.

Adapted from http://lua-users.org/wiki/SimplerCppBinding Some things are added, like basic inheritance, __newindex, and the possibility to call lua code from C++


Member Function Documentation

template<typename T >
int Luna< T >::getMethod ( lua_State *  l,
const std::string &  funcname 
) [inline, static]

Fetch a lua method from this class Use it when you want to call some method of this class from C++.

Returns:
1 if successful (method pushed on the stack), or 0

The documentation for this class was generated from the following file:
Generated on Mon Apr 5 21:17:34 2010 for Stechec/TBT by  doxygen 1.6.3