Luwra
Minimal-overhead Lua wrapper for C++
Static Public Member Functions | List of all members
luwra::Value< UserType * > Struct Template Reference

Enables reading and pushing the arbitrary type UserType. More...

Static Public Member Functions

static void push (State *state, const UserType *ptr)
 Copy a user type value onto the stack. Uses construct to invoke the copy constructor. More...
 
static UserType * read (State *state, int index)
 Get a pointer to a user type value on the stack. More...
 

Detailed Description

template<typename UserType>
struct luwra::Value< UserType * >

Enables reading and pushing the arbitrary type UserType.

Member Function Documentation

§ push()

template<typename UserType >
static void luwra::Value< UserType * >::push ( State state,
const UserType *  ptr 
)
inlinestatic

Copy a user type value onto the stack. Uses construct to invoke the copy constructor.

Parameters
stateLua state
ptrPointer to the value

§ read()

template<typename UserType >
static UserType* luwra::Value< UserType * >::read ( State state,
int  index 
)
inlinestatic

Get a pointer to a user type value on the stack.

Parameters
stateLua state
indexIndex of the value on the stack
Returns
A pointer to the user type value.