Ardour  9.0-pre0-582-g084a23a80d
Namespace Class Reference

#include <Namespace.h>

Classes

class  Array
 
class  Class
 
class  ClassBase
 
class  WSPtrClass
 

Public Member Functions

 Namespace (Namespace const &other)
 
 ~Namespace ()
 
Namespace beginNamespace (char const *name)
 
Namespace endNamespace ()
 
template<class T >
NamespaceaddVariable (char const *name, T *pt, bool isWritable=true)
 
template<typename U >
NamespaceaddConst (char const *name, const U val)
 
template<class FP >
NamespaceaddFunction (char const *name, FP const fp)
 
template<class FP >
NamespaceaddRefFunction (char const *name, FP const fp)
 
template<typename T >
Namespace registerArray (char const *name)
 
NamespaceaddCFunction (char const *name, int(*const fp)(lua_State *))
 
template<class T >
Class< T > beginClass (char const *name)
 
template<class T >
WSPtrClass< T > beginWSPtrClass (char const *name)
 
template<class K , class V >
Class< std::map< K, V > > beginStdMap (char const *name)
 
template<class T >
Class< std::set< T > > beginStdSet (char const *name)
 
template<unsigned int T>
Class< std::bitset< T > > beginStdBitSet (char const *name)
 
template<class T >
Class< std::list< T > > beginConstStdList (char const *name)
 
template<class T >
Class< std::list< T > > beginStdList (char const *name)
 
template<class T >
Class< std::list< T * > > beginConstStdCPtrList (char const *name)
 
template<class T >
Class< std::list< T * > > beginStdCPtrList (char const *name)
 
template<class T >
Class< std::vector< T > > beginConstStdVector (char const *name)
 
template<class T >
Class< std::vector< T > > beginStdVector (char const *name)
 
template<class T >
Class< std::shared_ptr< const std::list< T > > > beginPtrConstStdList (char const *name)
 
template<class T >
Class< std::shared_ptr< std::list< T > > > beginPtrStdList (char const *name)
 
template<class T >
Class< std::shared_ptr< const std::vector< T > > > beginPtrConstStdVector (char const *name)
 
template<class T >
Class< std::shared_ptr< std::vector< T > > > beginPtrStdVector (char const *name)
 
template<class T , class U >
Class< T > deriveClass (char const *name)
 
template<class T , class U >
WSPtrClass< T > deriveWSPtrClass (char const *name)
 

Static Public Member Functions

static Namespace getGlobalNamespace (lua_State *L)
 

Private Member Functions

Namespaceoperator= (Namespace const &other)
 
void pop (int n) const
 
 Namespace (lua_State *L_)
 
 Namespace (char const *name, Namespace const *parent)
 
 Namespace (Namespace const *child)
 
 Namespace (ClassBase const *child)
 

Private Attributes

lua_State *const L
 
int m_stackSize
 

Detailed Description

Provides C++ to Lua registration capabilities.

This class is not instantiated directly, call getGlobalNamespace to start the registration process.

Definition at line 119 of file Namespace.h.

Constructor & Destructor Documentation

◆ Namespace() [1/5]

Namespace::Namespace ( lua_State L_)
inlineexplicitprivate

Open the global namespace for registrations.

Definition at line 1616 of file Namespace.h.

◆ Namespace() [2/5]

Namespace::Namespace ( char const *  name,
Namespace const *  parent 
)
inlineprivate

Open a namespace for registrations.

The namespace is created if it doesn't already exist. The parent namespace is at the top of the Lua stack.

Definition at line 1640 of file Namespace.h.

◆ Namespace() [3/5]

Namespace::Namespace ( Namespace const *  child)
inlineexplicitprivate

Creates a continued registration from a child namespace.

Definition at line 1687 of file Namespace.h.

◆ Namespace() [4/5]

Namespace::Namespace ( ClassBase const *  child)
inlineexplicitprivate

Creates a continued registration from a child class.

Definition at line 1709 of file Namespace.h.

◆ Namespace() [5/5]

Namespace::Namespace ( Namespace const &  other)
inline

Copy Constructor.

Ownership of the stack is transferred to the new object. This happens when the compiler emits temporaries to hold these objects while chaining registrations across namespaces.

Definition at line 1731 of file Namespace.h.

◆ ~Namespace()

Namespace::~Namespace ( )
inline

Closes this namespace registration.

Definition at line 1745 of file Namespace.h.

Member Function Documentation

◆ addCFunction()

Namespace& Namespace::addCFunction ( char const *  name,
int(*)(lua_State *)  fp 
)
inline

Add or replace a lua_CFunction.

Definition at line 1919 of file Namespace.h.

◆ addConst()

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

Definition at line 1814 of file Namespace.h.

◆ addFunction()

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

Add or replace a property.

If the set function is omitted or null, the property is read-only. Add or replace a free function.

Definition at line 1878 of file Namespace.h.

◆ addRefFunction()

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

Definition at line 1891 of file Namespace.h.

◆ addVariable()

template<class T >
Namespace& Namespace::addVariable ( char const *  name,
T *  pt,
bool  isWritable = true 
)
inline

Add or replace a variable.

Definition at line 1784 of file Namespace.h.

◆ beginClass()

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

Open a new or existing class for registrations.

Definition at line 1933 of file Namespace.h.

◆ beginConstStdCPtrList()

template<class T >
Class<std::list<T*> > Namespace::beginConstStdCPtrList ( char const *  name)
inline

Definition at line 2039 of file Namespace.h.

◆ beginConstStdList()

template<class T >
Class<std::list<T> > Namespace::beginConstStdList ( char const *  name)
inline

Definition at line 2004 of file Namespace.h.

◆ beginConstStdVector()

template<class T >
Class<std::vector<T> > Namespace::beginConstStdVector ( char const *  name)
inline

Definition at line 2076 of file Namespace.h.

◆ beginNamespace()

Namespace Namespace::beginNamespace ( char const *  name)
inline

Open a new or existing namespace for registrations.

Definition at line 1763 of file Namespace.h.

◆ beginPtrConstStdList()

template<class T >
Class<std::shared_ptr<const std::list<T> > > Namespace::beginPtrConstStdList ( char const *  name)
inline

Definition at line 2108 of file Namespace.h.

◆ beginPtrConstStdVector()

template<class T >
Class<std::shared_ptr<const std::vector<T> > > Namespace::beginPtrConstStdVector ( char const *  name)
inline

Definition at line 2146 of file Namespace.h.

◆ beginPtrStdList()

template<class T >
Class<std::shared_ptr<std::list<T> > > Namespace::beginPtrStdList ( char const *  name)
inline

Definition at line 2121 of file Namespace.h.

◆ beginPtrStdVector()

template<class T >
Class<std::shared_ptr<std::vector<T> > > Namespace::beginPtrStdVector ( char const *  name)
inline

Definition at line 2161 of file Namespace.h.

◆ beginStdBitSet()

template<unsigned int T>
Class<std::bitset<T> > Namespace::beginStdBitSet ( char const *  name)
inline

Definition at line 1987 of file Namespace.h.

◆ beginStdCPtrList()

template<class T >
Class<std::list<T*> > Namespace::beginStdCPtrList ( char const *  name)
inline

Definition at line 2056 of file Namespace.h.

◆ beginStdList()

template<class T >
Class<std::list<T> > Namespace::beginStdList ( char const *  name)
inline

Definition at line 2020 of file Namespace.h.

◆ beginStdMap()

template<class K , class V >
Class<std::map<K, V> > Namespace::beginStdMap ( char const *  name)
inline

Definition at line 1950 of file Namespace.h.

◆ beginStdSet()

template<class T >
Class<std::set<T> > Namespace::beginStdSet ( char const *  name)
inline

Definition at line 1970 of file Namespace.h.

◆ beginStdVector()

template<class T >
Class<std::vector<T> > Namespace::beginStdVector ( char const *  name)
inline

Definition at line 2092 of file Namespace.h.

◆ beginWSPtrClass()

template<class T >
WSPtrClass<T> Namespace::beginWSPtrClass ( char const *  name)
inline

weak & shared pointer class

Definition at line 1940 of file Namespace.h.

◆ deriveClass()

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

Derive a new class for registrations.

To continue registrations for the class later, use beginClass(). Do not call deriveClass() again.

Definition at line 2187 of file Namespace.h.

◆ deriveWSPtrClass()

template<class T , class U >
WSPtrClass<T> Namespace::deriveWSPtrClass ( char const *  name)
inline

Definition at line 2194 of file Namespace.h.

◆ endNamespace()

Namespace Namespace::endNamespace ( )
inline

Continue namespace registration in the parent.

Do not use this on the global namespace.

Definition at line 1774 of file Namespace.h.

◆ getGlobalNamespace()

static Namespace Namespace::getGlobalNamespace ( lua_State L)
inlinestatic

Open the global namespace.

Definition at line 1754 of file Namespace.h.

◆ operator=()

Namespace& Namespace::operator= ( Namespace const &  other)
private

◆ pop()

void Namespace::pop ( int  n) const
inlineprivate

Error reporting.

VF: This function looks handy, why aren't we using it? Pop the Lua stack.

Definition at line 167 of file Namespace.h.

◆ registerArray()

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

Add or replace a array type

Definition at line 1909 of file Namespace.h.

Member Data Documentation

◆ L

lua_State* const Namespace::L
private

Definition at line 124 of file Namespace.h.

◆ m_stackSize

int Namespace::m_stackSize
mutableprivate

Definition at line 125 of file Namespace.h.


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