Ardour  8.7-15-gadf511264b
UserdataValue< T > Class Template Reference

#include <Userdata.h>

Inheritance diagram for UserdataValue< T >:
[legend]

Static Public Member Functions

static void * place (lua_State *const L)
 
template<class U >
static void push (lua_State *const L, U const &u)
 
- Static Public Member Functions inherited from Userdata
static void * get_ptr (lua_State *L, int index)
 
template<class T >
static UserdatagetExact (lua_State *L, int index)
 
template<class T >
static T * get (lua_State *L, int index, bool canBeConst)
 
template<class T >
static T * try_get (lua_State *L, int index, bool canBeConst)
 

Private Member Functions

 UserdataValue (UserdataValue< T > const &)
 
UserdataValue< T > operator= (UserdataValue< T > const &)
 
T * getObject ()
 
 UserdataValue ()
 
 ~UserdataValue ()
 

Private Attributes

char m_storage [sizeof(T)]
 

Additional Inherited Members

- Public Member Functions inherited from Userdata
virtual ~Userdata ()
 
- Protected Member Functions inherited from Userdata
void * getPointer () const
 
- Protected Attributes inherited from Userdata
void * m_p
 

Detailed Description

template<class T>
class UserdataValue< T >

Wraps a class object stored in a Lua userdata.

The lifetime of the object is managed by Lua. The object is constructed inside the userdata using placement new.

Definition at line 361 of file Userdata.h.

Constructor & Destructor Documentation

◆ UserdataValue() [1/2]

template<class T >
UserdataValue< T >::UserdataValue ( UserdataValue< T > const &  )
private

◆ UserdataValue() [2/2]

template<class T >
UserdataValue< T >::UserdataValue ( )
inlineprivate

Used for placement construction.

Definition at line 381 of file Userdata.h.

◆ ~UserdataValue()

template<class T >
UserdataValue< T >::~UserdataValue ( )
inlineprivate

Definition at line 386 of file Userdata.h.

Member Function Documentation

◆ getObject()

template<class T >
T* UserdataValue< T >::getObject ( )
inlineprivate

Definition at line 369 of file Userdata.h.

◆ operator=()

template<class T >
UserdataValue<T> UserdataValue< T >::operator= ( UserdataValue< T > const &  )
private

◆ place()

template<class T >
static void* UserdataValue< T >::place ( lua_State *const  L)
inlinestatic

Push a T via placement new.

The caller is responsible for calling placement new using the returned uninitialized storage.

Definition at line 398 of file Userdata.h.

◆ push()

template<class T >
template<class U >
static void UserdataValue< T >::push ( lua_State *const  L,
U const &  u 
)
inlinestatic

Push T via copy construction from U.

Definition at line 413 of file Userdata.h.

Member Data Documentation

◆ m_storage

template<class T >
char UserdataValue< T >::m_storage[sizeof(T)]
private

Definition at line 367 of file Userdata.h.


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