JUCE
|
Loads a program, and lets the user execute its functions. More...
#include <juce_LittleFootRunner.h>
Classes | |
struct | FunctionExecutionContext |
Public Types | |
enum class | ErrorCode : uint8 { ok = 0 , executionTimedOut , unknownInstruction , stackOverflow , stackUnderflow , illegalAddress , divisionByZero , unknownFunction } |
Return codes from a function call. More... | |
Static Public Member Functions | |
static const char * | getErrorDescription (ErrorCode e) noexcept |
Returns a text description for an error code. | |
static uint32 | getMaximumProgramSize () noexcept |
Public Attributes | |
uint8 | allMemory [(size_t)(((programAndHeapSpace+stackAndGlobalsSpace)+3) &~3)] |
Program | program |
Static Public Attributes | |
static constexpr uint32 | totalProgramAndHeapSpace = programAndHeapSpace |
static constexpr uint32 | totalStackAndGlobalsSpace = stackAndGlobalsSpace |
Loads a program, and lets the user execute its functions.
The programAndHeapSpace is the number of bytes allocated for program + heap. stackAndGlobalsSpace is the size of the globals + stack area.
Memory layout:
Program code goes at address 0, followed by any shared data the program needs globals are at the top end of the buffer stack space stretches downwards from the start of the globals
|
strong |
|
noexcept |
|
noexcept |
Installs an array of native functions that the code can use.
Note that this doesn't take ownership of any memory involved, so the caller mustn't pass any dangling pointers
|
noexcept |
Returns the number of native functions available.
|
noexcept |
Returns one of the native functions available.
The index must not be out of range.
References jassert.
|
noexcept |
Clears the memory state.
References littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::allMemory.
Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::Runner().
|
noexcept |
Clears all the non-program data.
References littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::allMemory, end(), littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::getProgramAndDataStart(), littlefoot::Program::getProgramSize(), and littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::program.
|
staticnoexcept |
Returns a text description for an error code.
References littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::divisionByZero, littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::executionTimedOut, littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::illegalAddress, littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::ok, littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::stackOverflow, littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::stackUnderflow, littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::unknownFunction, and littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::unknownInstruction.
|
noexcept |
Calls one of the functions in the program, by its textual signature.
References littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().
|
noexcept |
Calls one of the functions in the program, by its function ID.
References littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::run().
|
staticnoexcept |
|
noexcept |
References littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::allMemory.
Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::clearHeapAndGlobals(), littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::getProgramAndDataSize(), and littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::setDataByte().
|
noexcept |
|
noexcept |
|
noexcept |
Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::getHeapBits(), littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::getHeapByte(), littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::getHeapInt(), littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::setHeapByte(), and littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::setHeapInt().
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
staticconstexpr |
|
staticconstexpr |
uint8 littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::allMemory[(size_t)(((programAndHeapSpace+stackAndGlobalsSpace)+3) &~3)] |
Program littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::program |