rt_instance Lua Interface¶
clearLog¶
Clears log list. Useful when reseting the instance.
- Arguments:
- any ptr Pointer to instance object
Example
rt_instance:.clearLog(ptr)
loadConfig¶
Load a JSON configuration file and overwrite the current state dictionary.
- Arguments:
- rt_instance rt instance object
- string configPath Location of JSON config file
Example
rt_instance:.loadConfig(rt,configPath)
getName¶
Returns the name of the instance
- Arguments:
- rt_instance rt instance object
- Returns:
- string name Name of the instance
Example
name = rt_instance:.getName(rt)
getName¶
Returns the name of the instance
- Arguments:
- rt_instance rt instance object
- Returns:
- string name Name of the instance
Example
name = rt_instance:.getName(rt)
getSolution¶
Returns the solution this instance is part of
Arguments:
- Returns:
- Solution object Solution object this instance is part of
Example
object = rt_instance:.getSolution()
getGlobalConfig¶
[DEPRECATED] Use instead getConfigValue.
- Arguments:
- rt_instance rt instance object
- Returns:
- table config Global configuration table
Example
config = rt_instance:.getGlobalConfig(rt)
getBaseConfigPath¶
Returns the base configuration path of a given instance.
- Arguments:
- rt_instance rt instance object
- Returns:
- string path Path to current base configuration file
Example
path = rt_instance:.getBaseConfigPath(rt)
getStateDict¶
[DEPRECATED] Use getConfigValue instead.
Arguments:
Example
rt_instance:.getStateDict()
setStateDict¶
[DEPRECATED] Use setConfigValue instead
Arguments:
Example
rt_instance:.setStateDict()
getConfigValue¶
Returns a value from the configuration of the running instance
- Arguments:
- rt_instance rt instance object
- string path Path in json config file to select
- Returns:
- any obj value
Example
obj = rt_instance:.getConfigValue(rt,path)
getConfigValueOr¶
Returns a value from the configuration of the running instance if it exists, otherwise returns the alternative value
- Arguments:
- rt_instance rt instance object
- string path Path in json config file to select
- any alt Value to be returned if path does not exists
- Returns:
- any obj value
Example
obj = rt_instance:.getConfigValueOr(rt,path,alt)
getConfigValueOrCreate¶
Returns a value from the configuration of the running instance if it exists, otherwise it places the alternative value at the path in the configuration and returns it
- Arguments:
- rt_instance rt instance object
- string path Path in json config file to select
- any alt Value to be placed in config and returned if path does not exists
- Returns:
- any obj value
Example
obj = rt_instance:.getConfigValueOrCreate(rt,path,alt)
setConfigValue¶
Set a value on the in-memory configuration of a running instance.
- Arguments:
- rt_instance rt instance object
- string path Configuration path of the value to set
- any data Value to save
Example
rt_instance:.setConfigValue(rt,path,data)
setConfigValue¶
Set a value on the in-memory configuration of a running instance.
- Arguments:
- rt_instance rt instance object
- string path Configuration path of the value to set
- any data Value to save
Example
rt_instance:.setConfigValue(rt,path,data)
getStateValueAndDelete¶
Returns a value from the state dictionary and deletes it
- Arguments:
- rt_instance rt instance object
- string path Path in json config file to select
- Returns:
- any obj value
Example
obj = rt_instance:.getStateValueAndDelete(rt,path)
stop¶
Stop the instance
- Arguments:
- any ptr Pointer to instance object
Example
rt_instance:.stop(ptr)
start¶
Start the instance
- Arguments:
- rt_instance rt instance object
- string script Optional Lua script to run
Example
rt_instance:.start(rt,script)
reset¶
Reset the instance state
- Arguments:
- rt_instance rt instance object
Example
rt_instance:.reset(rt)
runStep¶
Order the instance to run a single step
- Arguments:
- rt_instance rt instance object
Example
rt_instance:.runStep(rt)
getInputShapes¶
[DEPRECATED] Use getConfigValue instead
- Arguments:
- any rt instance object
- string keyName Key name to get data from
- Returns:
- table data metadata
Example
data = rt_instance:.getInputShapes(rt,keyName)
readInputSink¶
Gets data from the input sink
- Arguments:
- any rt instance object
- Returns:
- table data metadata
Example
data = rt_instance:.readInputSink(rt)
readOutputSink¶
Gets data from the output sink
- Arguments:
- any rt instance object
- Returns:
- table data metadata
Example
data = rt_instance:.readOutputSink(rt)
flushOutputSink¶
Flushes output sink and fires event
- Arguments:
- any rt instance object
- Returns:
- table data metadata
Example
data = rt_instance:.flushOutputSink(rt)
writeOutputSink¶
Writes data to a sink
- Arguments:
- rt_instance rt instance object
- string key Key name to write data to
- OutputType type Type of data to write
- table data metadata to write
- string displayName Display name of the data for the output panel
Example
rt_instance:.writeOutputSink(rt,key,type,data,displayName)
createWorker¶
Create a worker thread
- Arguments:
- rt_instance rt instance object
- string onInit Name of the function to call on init
- string onRun Name of the function to call when the instance is in play mode
- Returns:
- int result Error code on creation
Example
result = rt_instance:.createWorker(rt,onInit,onRun)
setPause¶
Set pause state for the instance
- Arguments:
- rt_instance rt instance object
- boolean Pause state to set
- Returns:
- boolean paused Return true if the instance was paused (false if instance is stopped or already paused)
Example
paused = rt_instance:.setPause(rt,Pause)
sleep¶
Stop the instance thread for sleepMs miliseconds
- Arguments:
- rt_instance rt instance object
- number sleepMs Ms to suspend thread
Example
rt_instance:.sleep(rt,sleepMs)
setDeltaTime¶
Set the timestep for instance processing
- Arguments:
- rt_instance rt instance object
- number step Desired timestep for instance
Example
rt_instance:.setDeltaTime(rt,step)
getDeltaTime¶
Returns the instance delta time
- Arguments:
- rt_instance rt instance object
- Returns:
- number step Timestep
Example
step = rt_instance:.getDeltaTime(rt)
getFPS¶
Returns the current instance FPS counter
- Arguments:
- rt_instance rt instance object
- Returns:
- number fps instance FPS
Example
fps = rt_instance:.getFPS(rt)
getStatus¶
Get instance thread handler status
- Arguments:
- any ptr Pointer to instance object
- Returns:
- number alive Thread handler status (1-Alive, 0-Dead)
Example
alive = rt_instance:.getStatus(ptr)
isRunning¶
Check if instance is running
- Arguments:
- any ptr Pointer to instance object
Example
rt_instance:.isRunning(ptr)
isPaused¶
Check if instance is paused
- Arguments:
- rt_instance rt instance object
- Returns:
- boolean paused instance is paused
Example
paused = rt_instance:.isPaused(rt)
getThreadId¶
Returns ID of the current thread
- Arguments:
- rt_instance rt instance object
- Returns:
- number id Thread id
Example
id = rt_instance:.getThreadId(rt)
getPluginByName¶
Retrieve a plugin from its name.
- Arguments:
- rt_instance rt instance object
- string instanceName Plugin name
- Returns:
- any ptr Pointer to Module object of the pointer
Example
ptr = rt_instance:.getPluginByName(rt,instanceName)
getPluginNames¶
Get a list of the names of all the Plugins in the instance
- Arguments:
- rt_instance rt instance object
- Returns:
- string[] list Plugin names list
Example
list = rt_instance:.getPluginNames(rt)
getHeadVersion¶
Returns the version of the versioning head
- Arguments:
- rt_instance rt instance object
- Returns:
- number version Version of the head
Example
version = rt_instance:.getHeadVersion(rt)
getThreadVersion¶
Returns the current location in the versioning system for this thread
- Arguments:
- rt_instance rt instance object
- Returns:
- number version Location of the thread
Example
version = rt_instance:.getThreadVersion(rt)
getVersionCount¶
Returns the numbers of versions being controlled
- Arguments:
- rt_instance rt instance object
- Returns:
- number count Number of versions being managed
Example
count = rt_instance:.getVersionCount(rt)
stepThread¶
Increases thread location and commits new version if > head
- Arguments:
- any rt instance object
Example
rt_instance:.stepThread(rt)
waitForEpoch¶
Return when epoch becomes available
- Arguments:
- any rt instance object
- int Epoch to wait for
Example
rt_instance:.waitForEpoch(rt,Epoch)
setPerformanceCounterState¶
Enable/Disable instance PerformanceCounters
- Arguments:
- rt_instance rt instance object
- boolean state Enable/Disable PerformanceCounters
Example
rt_instance:.setPerformanceCounterState(rt,state)
writePerformanceCounter¶
Write a value to a PerformanceCounter
- Arguments:
- rt_instance rt instance object
- string name Performance Counter name
- number value Performance Counter value
Example
rt_instance:.writePerformanceCounter(rt,name,value)
getAllPerformanceCounters¶
getAllPerformanceCounters
- Arguments:
- rt_instance rt instance object/*
Example
rt_instance:.getAllPerformanceCounters(rt)
getInstancePerformanceCounters¶
getInstancePerformanceCounters
- Arguments:
- rt_instance rt instance object/*
Example
rt_instance:.getInstancePerformanceCounters(rt)
loadProfilerPreset¶
Load a profiler preset historic values from a file
- Arguments:
- rt_instance rt instance object
- string file_name File path to load values from
Example
rt_instance:.loadProfilerPreset(rt,file_name)
saveProfilerPreset¶
Save a profiler preset historic values (200ms average) to a file
- Arguments:
- rt_instance rt instance object
- string file_name File path to save values to
Example
rt_instance:.saveProfilerPreset(rt,file_name)
setProfilerSimulationEnabled¶
Set a profiler simulation state, this simulates timing values according to loaded preset file
- Arguments:
- rt_instance rt instance object
- boolean is_enabled Is simulation enabled
Example
rt_instance:.setProfilerSimulationEnabled(rt,is_enabled)
postEvent¶
Broadcast a local event message that will be run on all bound functions
- Arguments:
- rt_instance rt instance object
- string domain Domain in which this eventType lives
- string eventType Event type to post
- table data Data to broacast to functions
Example
rt_instance:.postEvent(rt,domain,eventType,data)
bindEvent¶
Bind a function to a local event name, this function will be called when the corresponding event is posted.
- Arguments:
- rt_instance rt instance object
- string name Event name to bound with function
- fn lua_fn Lua function to call when event is broadcast
Example
rt_instance:.bindEvent(rt,name,lua_fn)
processEvents¶
Process the current event pool
- Arguments:
- rt_instance rt instance object
Example
rt_instance:.processEvents(rt)
createBuffer¶
Creates buffer of specified size and type
- Arguments:
- rt_instance rt instance object
- integer height **
- integer width **
- BufferDataType type (enum)
- string name Buffer name (Optional, default will be used when not present)
- Returns:
- buffer buffer Buffer object
Example
buffer = rt_instance:.createBuffer(rt,height,width,type,name)