Handle for a reference.
More...
#include <reference.hpp>
|
template<typename Type > |
| operator Type () const |
|
template<typename Type > |
Type | read () const |
| Read the value that is being referenced.
|
|
| Reference (State *state) |
| Create a reference using the value on top of the stack. Consumes the value.
|
|
| Reference (State *state, int index) |
| Create a reference to a value on the stack. Does not consume the value.
|
|
|
std::shared_ptr< const RefLifecycle > | life |
| Smart pointer to the reference's lifecycle manager.
|
|
◆ Reference() [1/2]
luwra::Reference::Reference |
( |
State * |
state | ) |
|
|
inline |
Create a reference using the value on top of the stack. Consumes the value.
◆ Reference() [2/2]
luwra::Reference::Reference |
( |
State * |
state, |
|
|
int |
index |
|
) |
| |
|
inline |
Create a reference to a value on the stack. Does not consume the value.
◆ operator Type()
template<typename Type >
luwra::Reference::operator Type |
( |
| ) |
const |
|
inline |
◆ read()
template<typename Type >
Type luwra::Reference::read |
( |
| ) |
const |
|
inline |
Read the value that is being referenced.
◆ life
Smart pointer to the reference's lifecycle manager.
Why a smart pointer? Copying RefLifecycle creates new Lua references, which we want to avoid. Therefore we use shared_ptr which gives us cheap reference counting.