API Documentation
Static Public Member Functions | List of all members
nkAstraeus::nkMemoryWrap::BufferWrapper Class Referencefinal

Wraps a nkMemory::Buffer and offers functions for use in scripting. More...

Static Public Member Functions

static void updateEnvironment (nkScripts::Environment *env)
 
static nkScripts::OutputValue constructor (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue constructorFromString (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)
 

Detailed Description

Wraps a nkMemory::Buffer and offers functions for use in scripting.

Member Function Documentation

◆ updateEnvironment()

static void nkAstraeus::nkMemoryWrap::BufferWrapper::updateEnvironment ( nkScripts::Environment env)
static

Updates a given environment and set it up to use all functions wrapped by this wrapper.

Parameters
envThe environment to set up.

◆ constructor()

static nkScripts::OutputValue nkAstraeus::nkMemoryWrap::BufferWrapper::constructor ( const nkScripts::DataStack stack)
static

Wrapper static function for the empty size constructor of nkMemory::Buffer.

local t = nkMemory.Buffer.new(byteSize) ;
Parameters
stackThe parameter stack.
Returns
An output value with the user type and data allocated.

◆ constructorFromString()

static nkScripts::OutputValue nkAstraeus::nkMemoryWrap::BufferWrapper::constructorFromString ( const nkScripts::DataStack stack)
static

Wrapper static function for a string copy constructor.

local t = nkMemory.Buffer.fromString('aString') ;
Parameters
stackThe parameter stack.
Returns
An output value with the user type and data allocated.

◆ destructor()

static void nkAstraeus::nkMemoryWrap::BufferWrapper::destructor ( void *  toDestroy)
static

Wrapper function for the destructor of the user type.

Parameters
toDestroyThe data that has to be freed.

◆ getData()

static nkScripts::OutputValue nkAstraeus::nkMemoryWrap::BufferWrapper::getData ( const nkScripts::DataStack stack)
static

Wrapper function for the nkMemory::Buffer::getData() function.

local d = t:getData() ;
Parameters
stackThe parameter stack.
Returns
The getter value, as a unsigned char* (converted to a string in Lua).

◆ getSize()

static nkScripts::OutputValue nkAstraeus::nkMemoryWrap::BufferWrapper::getSize ( const nkScripts::DataStack stack)
static

Wrapper function for the nkMemory::Buffer::getSize() function.

local s = t:getSize() ;
Parameters
stackThe parameter stack.
Returns
The getter value, as an int.

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