Ardour  9.0-pre0-582-g084a23a80d
Namespace::Class< T > Class Template Reference
Inheritance diagram for Namespace::Class< T >:
[legend]

Public Member Functions

 Class (char const *name, Namespace const *parent)
 
 Class (char const *name, Namespace const *parent, void const *const staticKey)
 
Namespace endClass ()
 
template<class U >
Class< T > & addStaticData (char const *name, U *pu, bool isWritable=true)
 
Class< T > & addOperator (char const *name, int(*const fp)(lua_State *))
 
template<class FP >
Class< T > & addMetamethod (char const *name, FP const fp)
 
template<class FP >
Class< T > & addStaticFunction (char const *name, FP const fp)
 
Class< T > & addStaticCFunction (char const *name, int(*const fp)(lua_State *))
 
template<class U >
Class< T > & addData (char const *name, const U T::*mp, bool isWritable=true)
 
template<class TG , class TS >
Class< T > & addProperty (char const *name, TG(T::*get)() const, bool(T::*set)(TS))
 
template<class TG , class TS >
Class< T > & addProperty (char const *name, TG(*get)(T const *), bool(*set)(T *, TS))
 
template<class MemFn >
Class< T > & addFunction (char const *name, MemFn mf)
 
template<class MemFn >
Class< T > & addPtrFunction (char const *name, MemFn mf)
 
template<class MemFn >
Class< T > & addWPtrFunction (char const *name, MemFn mf)
 
template<class MemFn >
Class< T > & addRefFunction (char const *name, MemFn mf)
 
Class< T > & addCFunction (char const *name, int(T::*mfp)(lua_State *))
 
Class< T > & addExtCFunction (char const *name, int(*const fp)(lua_State *))
 
Class< T > & addCFunction (char const *name, int(T::*mfp)(lua_State *) const)
 
template<typename U >
Class< T > & addConst (char const *name, const U val)
 
template<class MemFn , class C >
Class< T > & addConstructor ()
 
template<class MemFn >
Class< T > & addConstructor ()
 
template<class MemFn , class PT >
Class< T > & addPtrConstructor ()
 
Class< T > & addVoidConstructor ()
 
template<class PT >
Class< T > & addVoidPtrConstructor ()
 
Class< T > & addEqualCheck ()
 
template<class U >
Class< T > & addCast (char const *name)
 
- Public Member Functions inherited from Namespace::ClassBase
 ClassBase (lua_State *L_)
 
 ClassBase (ClassBase const &other)
 
 ~ClassBase ()
 

Additional Inherited Members

- Protected Member Functions inherited from Namespace::ClassBase
void createConstTable (char const *name)
 
void createClassTable (char const *name)
 
void createStaticTable (char const *name)
 
void pop (int n) const
 
- Static Protected Member Functions inherited from Namespace::ClassBase
static int indexMetaMethod (lua_State *L)
 
static int newindexMetaMethod (lua_State *L)
 
template<class Params , class C >
static int ctorContainerProxy (lua_State *L)
 
template<class Params , class T >
static int ctorPlacementProxy (lua_State *L)
 
template<class Params , class T , class C >
static int ctorPtrPlacementProxy (lua_State *L)
 
template<class T >
static int ctorNilPtrPlacementProxy (lua_State *L)
 
- Protected Attributes inherited from Namespace::ClassBase
lua_State *const L
 
int m_stackSize
 

Detailed Description

template<class T>
class Namespace::Class< T >

Provides a class registration in a lua_State.

After contstruction the Lua stack holds these objects: -1 static table -2 class table -3 const table -4 (enclosing namespace)

Definition at line 556 of file Namespace.h.

Constructor & Destructor Documentation

◆ Class() [1/2]

template<class T >
Namespace::Class< T >::Class ( char const *  name,
Namespace const *  parent 
)
inline

Register a new class or add to an existing class registration.

Definition at line 563 of file Namespace.h.

◆ Class() [2/2]

template<class T >
Namespace::Class< T >::Class ( char const *  name,
Namespace const *  parent,
void const *const  staticKey 
)
inline

Derive a new class.

Definition at line 619 of file Namespace.h.

Member Function Documentation

◆ addCast()

template<class T >
template<class U >
Class<T>& Namespace::Class< T >::addCast ( char const *  name)
inline

Definition at line 1145 of file Namespace.h.

◆ addCFunction() [1/2]

template<class T >
Class<T>& Namespace::Class< T >::addCFunction ( char const *  name,
int(T::*)(lua_State *) const  mfp 
)
inline

Add or replace a const member lua_CFunction.

Definition at line 1044 of file Namespace.h.

◆ addCFunction() [2/2]

template<class T >
Class<T>& Namespace::Class< T >::addCFunction ( char const *  name,
int(T::*)(lua_State *)  mfp 
)
inline

Add or replace a member lua_CFunction.

Definition at line 1015 of file Namespace.h.

◆ addConst()

template<class T >
template<typename U >
Class<T>& Namespace::Class< T >::addConst ( char const *  name,
const U  val 
)
inline

Add or replace a static const data

Definition at line 1062 of file Namespace.h.

◆ addConstructor() [1/2]

template<class T >
template<class MemFn , class C >
Class<T>& Namespace::Class< T >::addConstructor ( )
inline

Add or replace a primary Constructor.

The primary Constructor is invoked when calling the class type table like a function.

The template parameter should be a function pointer type that matches the desired Constructor (since you can't take the address of a Constructor and pass it as an argument).

Definition at line 1093 of file Namespace.h.

◆ addConstructor() [2/2]

template<class T >
template<class MemFn >
Class<T>& Namespace::Class< T >::addConstructor ( )
inline

Definition at line 1104 of file Namespace.h.

◆ addData()

template<class T >
template<class U >
Class<T>& Namespace::Class< T >::addData ( char const *  name,
const U T::*  mp,
bool  isWritable = true 
)
inline

Add or replace a data member.

Definition at line 827 of file Namespace.h.

◆ addEqualCheck()

template<class T >
Class<T>& Namespace::Class< T >::addEqualCheck ( )
inline

Definition at line 1136 of file Namespace.h.

◆ addExtCFunction()

template<class T >
Class<T>& Namespace::Class< T >::addExtCFunction ( char const *  name,
int(*)(lua_State *)  fp 
)
inline

Definition at line 1029 of file Namespace.h.

◆ addFunction()

template<class T >
template<class MemFn >
Class<T>& Namespace::Class< T >::addFunction ( char const *  name,
MemFn  mf 
)
inline

Add or replace a member function.

Definition at line 979 of file Namespace.h.

◆ addMetamethod()

template<class T >
template<class FP >
Class<T>& Namespace::Class< T >::addMetamethod ( char const *  name,
FP const  fp 
)
inline

Add or replace a Metamethod Metamethod, evaluate a const class-member method

Definition at line 775 of file Namespace.h.

◆ addOperator()

template<class T >
Class<T>& Namespace::Class< T >::addOperator ( char const *  name,
int(*)(lua_State *)  fp 
)
inline

Add or replace a Metatable Metamethod calling a lua_CFunction.

Definition at line 752 of file Namespace.h.

◆ addProperty() [1/2]

template<class T >
template<class TG , class TS >
Class<T>& Namespace::Class< T >::addProperty ( char const *  name,
TG(*)(T const *)  get,
bool(*)(T *, TS)  set 
)
inline

Add or replace a property member, by proxy.

When a class is closed for modification and does not provide (or cannot provide) the function signatures necessary to implement get or set for a property, this will allow non-member functions act as proxies.

Both the get and the set functions require a T const* and T* in the first argument respectively.

Definition at line 925 of file Namespace.h.

◆ addProperty() [2/2]

template<class T >
template<class TG , class TS >
Class<T>& Namespace::Class< T >::addProperty ( char const *  name,
TG(T::*)() const  get,
bool(T::*)(TS)  set 
)
inline

Add or replace a property member.

Definition at line 863 of file Namespace.h.

◆ addPtrConstructor()

template<class T >
template<class MemFn , class PT >
Class<T>& Namespace::Class< T >::addPtrConstructor ( )
inline

Definition at line 1115 of file Namespace.h.

◆ addPtrFunction()

template<class T >
template<class MemFn >
Class<T>& Namespace::Class< T >::addPtrFunction ( char const *  name,
MemFn  mf 
)
inline

Definition at line 987 of file Namespace.h.

◆ addRefFunction()

template<class T >
template<class MemFn >
Class<T>& Namespace::Class< T >::addRefFunction ( char const *  name,
MemFn  mf 
)
inline

Definition at line 1003 of file Namespace.h.

◆ addStaticCFunction()

template<class T >
Class<T>& Namespace::Class< T >::addStaticCFunction ( char const *  name,
int(*)(lua_State *)  fp 
)
inline

Add or replace a lua_CFunction.

Definition at line 814 of file Namespace.h.

◆ addStaticData()

template<class T >
template<class U >
Class<T>& Namespace::Class< T >::addStaticData ( char const *  name,
U *  pu,
bool  isWritable = true 
)
inline

Add or replace a static data member.

Definition at line 678 of file Namespace.h.

◆ addStaticFunction()

template<class T >
template<class FP >
Class<T>& Namespace::Class< T >::addStaticFunction ( char const *  name,
FP const  fp 
)
inline

Add or replace a static member function.

Definition at line 800 of file Namespace.h.

◆ addVoidConstructor()

template<class T >
Class<T>& Namespace::Class< T >::addVoidConstructor ( )
inline

Definition at line 1125 of file Namespace.h.

◆ addVoidPtrConstructor()

template<class T >
template<class PT >
Class<T>& Namespace::Class< T >::addVoidPtrConstructor ( )
inline

Definition at line 1131 of file Namespace.h.

◆ addWPtrFunction()

template<class T >
template<class MemFn >
Class<T>& Namespace::Class< T >::addWPtrFunction ( char const *  name,
MemFn  mf 
)
inline

Definition at line 995 of file Namespace.h.

◆ endClass()

template<class T >
Namespace Namespace::Class< T >::endClass ( )
inline

Continue registration in the enclosing namespace.

Definition at line 668 of file Namespace.h.


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