Wraps a nkMemory::BufferCast<T> and offers functions for use in scripting. More...
Static Public Member Functions | |
static void | updateEnvironment (nkScripts::Environment *env, nkMemory::StringView typeName, nkMemory::StringView typeNameUserObject="") |
static nkScripts::OutputValue | constructor (const nkScripts::DataStack &stack) |
static void | destructor (void *toDestroy) |
static nkScripts::OutputValue | getData (const nkScripts::DataStack &stack) |
static nkScripts::OutputValue | getSize (const nkScripts::DataStack &stack) |
Wraps a nkMemory::BufferCast<T> and offers functions for use in scripting.
This wrapper is a template like the class it wraps. In Lua, the class needs to be instanciated. As such, this wrapper template will register a type of BufferCast within the environment, given the names provided.
|
static |
Updates a given environment and set it up to use all functions wrapped by this wrapper.
env | The environment to set up. |
typeName | The name to give to the type in the scripting environment. |
typeNameUserObject | The name of the contained object type, if any. |
|
static |
Wrapper static function for the empty size constructor of nkMemory::BufferCast.
stack | The parameter stack. |
|
static |
Wrapper function for the destructor of the user type.
toDestroy | The data that has to be freed. |
|
static |
Wrapper function for the nkMemory::BufferCast::getData() function.
stack | The parameter stack. |
|
static |
Wrapper function for the nkMemory::BufferCast::getSize() function.
stack | The parameter stack. |