Pioneer
Public Member Functions | List of all members
LuaMetaType< T > Class Template Reference

#include <LuaMetaType.h>

Inheritance diagram for LuaMetaType< T >:
Inheritance graph
[legend]
Collaboration diagram for LuaMetaType< T >:
Collaboration graph
[legend]

Public Member Functions

 LuaMetaType (const char *name)
 
LuaMetaTypeStartRecording ()
 
LuaMetaTypeStopRecording ()
 
void SetProtected (bool enabled)
 
template<typename Dt >
LuaMetaTypeAddMember (const char *name, member_pointer< T, Dt > t)
 
LuaMetaTypeAddMember (const char *name, free_function< T > getter, free_function< T > setter=nullptr)
 
template<typename Dt , typename Dt2 = Dt>
LuaMetaTypeAddMember (const char *name, const_member_function< T, Dt > getter, member_function< T, void, Dt2 > setter=nullptr)
 
template<typename Dt , typename Dt2 = Dt>
LuaMetaTypeAddMember (const char *name, member_function< T, Dt > getter, member_function< T, void, Dt2 > setter=nullptr)
 
template<typename Rt , typename... Args>
LuaMetaTypeAddFunction (const char *name, const_member_function< T, Rt, Args... > fn)
 
template<typename Rt , typename... Args>
LuaMetaTypeAddFunction (const char *name, member_function< T, Rt, Args... > fn)
 
LuaMetaTypeAddFunction (const char *name, free_function< T > fn)
 
LuaMetaTypeRegisterFuncs (const luaL_Reg *functions)
 
- Public Member Functions inherited from LuaMetaTypeBase
 LuaMetaTypeBase (const char *name)
 
void CreateMetaType (lua_State *l)
 
const char * GetTypeName () const
 
const char * GetParent () const
 
void SetParent (const char *parent)
 
void GetMetatable () const
 
bool IsValid () const
 
void StartRecording ()
 
void StopRecording ()
 

Additional Inherited Members

- Static Public Member Functions inherited from LuaMetaTypeBase
static void GetNames (std::vector< std::string > &names, const std::string &prefix="", bool methodsOnly=false)
 
static bool GetMetatableFromName (lua_State *l, const char *name)
 
- Protected Types inherited from LuaMetaTypeBase
template<typename T , typename Dt >
using member_pointer = Dt T::*
 
template<typename T >
using free_function = int(*)(lua_State *, T *)
 
template<typename T , typename Rt , typename... Args>
using member_function = Rt(T::*)(Args...)
 
template<typename T , typename Rt , typename... Args>
using const_member_function = Rt(T::*)(Args...) const
 
- Protected Member Functions inherited from LuaMetaTypeBase
void GetAttrTable (lua_State *L, int index)
 
void GetMethodTable (lua_State *L, int index)
 
- Static Protected Member Functions inherited from LuaMetaTypeBase
template<typename T , typename Dt >
static int member_wrapper_ (lua_State *L)
 
template<typename T >
static int getter_member_wrapper_ (lua_State *L)
 
template<typename T , typename Dt , typename Dt2 >
static int getter_member_fn_wrapper_ (lua_State *L)
 
template<typename T >
static int fn_wrapper_ (lua_State *L)
 
template<typename T , typename Rt , typename... Args>
static std::enable_if<!std::is_same< Rt, void >::value, int >::type member_fn_wrapper_ (lua_State *L)
 
template<typename T , typename Rt , typename... Args>
static std::enable_if< std::is_same< Rt, void >::value, int >::type member_fn_wrapper_ (lua_State *L)
 
template<typename MemT >
static void PushPointerToMember (lua_State *L, MemT obj)
 
template<typename MemT >
static MemT & PullPointerToMember (lua_State *L, int idx)
 
template<typename T >
static void PushFreeFunction (lua_State *L, free_function< T > obj)
 
template<typename T >
static free_function< T > PullFreeFunction (lua_State *L, int index)
 
- Protected Attributes inherited from LuaMetaTypeBase
std::string m_typeName
 
std::string m_parent
 
lua_State * m_lua
 
int m_ref = LUA_NOREF
 
int m_index = 0
 

Constructor & Destructor Documentation

◆ LuaMetaType()

template<typename T >
LuaMetaType< T >::LuaMetaType ( const char *  name)
inline

Member Function Documentation

◆ AddFunction() [1/3]

template<typename T >
template<typename Rt , typename... Args>
LuaMetaType& LuaMetaType< T >::AddFunction ( const char *  name,
const_member_function< T, Rt, Args... >  fn 
)
inline

◆ AddFunction() [2/3]

template<typename T >
LuaMetaType& LuaMetaType< T >::AddFunction ( const char *  name,
free_function< T >  fn 
)
inline
Here is the call graph for this function:

◆ AddFunction() [3/3]

template<typename T >
template<typename Rt , typename... Args>
LuaMetaType& LuaMetaType< T >::AddFunction ( const char *  name,
member_function< T, Rt, Args... >  fn 
)
inline
Here is the call graph for this function:

◆ AddMember() [1/4]

template<typename T >
template<typename Dt , typename Dt2 = Dt>
LuaMetaType& LuaMetaType< T >::AddMember ( const char *  name,
const_member_function< T, Dt >  getter,
member_function< T, void, Dt2 >  setter = nullptr 
)
inline
Here is the call graph for this function:

◆ AddMember() [2/4]

template<typename T >
LuaMetaType& LuaMetaType< T >::AddMember ( const char *  name,
free_function< T >  getter,
free_function< T >  setter = nullptr 
)
inline
Here is the call graph for this function:

◆ AddMember() [3/4]

template<typename T >
template<typename Dt , typename Dt2 = Dt>
LuaMetaType& LuaMetaType< T >::AddMember ( const char *  name,
member_function< T, Dt >  getter,
member_function< T, void, Dt2 >  setter = nullptr 
)
inline
Here is the call graph for this function:

◆ AddMember() [4/4]

template<typename T >
template<typename Dt >
LuaMetaType& LuaMetaType< T >::AddMember ( const char *  name,
member_pointer< T, Dt >  t 
)
inline
Here is the call graph for this function:

◆ RegisterFuncs()

template<typename T >
LuaMetaType& LuaMetaType< T >::RegisterFuncs ( const luaL_Reg *  functions)
inline
Here is the call graph for this function:

◆ SetProtected()

template<typename T >
void LuaMetaType< T >::SetProtected ( bool  enabled)
inline

◆ StartRecording()

template<typename T >
LuaMetaType& LuaMetaType< T >::StartRecording ( )
inline
Here is the call graph for this function:

◆ StopRecording()

template<typename T >
LuaMetaType& LuaMetaType< T >::StopRecording ( )
inline
Here is the call graph for this function:

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