Ardour  9.0-rc2-184-gc50547f0a6
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 1920 of file Namespace.h.

◆ addConst()

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

Definition at line 1815 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 1879 of file Namespace.h.

◆ addRefFunction()

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

Definition at line 1892 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 1934 of file Namespace.h.

◆ beginConstStdCPtrList()

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

Definition at line 2040 of file Namespace.h.

◆ beginConstStdList()

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

Definition at line 2005 of file Namespace.h.

◆ beginConstStdVector()

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

Definition at line 2077 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 2109 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 2147 of file Namespace.h.

◆ beginPtrStdList()

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

Definition at line 2122 of file Namespace.h.

◆ beginPtrStdVector()

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

Definition at line 2162 of file Namespace.h.

◆ beginStdBitSet()

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

Definition at line 1988 of file Namespace.h.

◆ beginStdCPtrList()

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

Definition at line 2057 of file Namespace.h.

◆ beginStdList()

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

Definition at line 2021 of file Namespace.h.

◆ beginStdMap()

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

Definition at line 1951 of file Namespace.h.

◆ beginStdSet()

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

Definition at line 1971 of file Namespace.h.

◆ beginStdVector()

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

Definition at line 2093 of file Namespace.h.

◆ beginWSPtrClass()

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

weak & shared pointer class

Definition at line 1941 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 2188 of file Namespace.h.

◆ deriveWSPtrClass()

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

Definition at line 2195 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 1910 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: