Defines a native function that the program can call. More...
#include <juce_LittleFootRunner.h>
Public Types | |
using | ImplementationFunction = int32(*)(void *, const int32 *) |
Public Member Functions | |
NativeFunction (const char *nameAndArgumentTypes, ImplementationFunction fn) | |
Creates a NativeFunction from its signature and an implementation function. More... | |
Static Public Member Functions | |
static FunctionID | createID (const char *nameAndArgTypes) |
Converts a function signature to its hashed ID. More... | |
Public Attributes | |
ImplementationFunction | function |
A static function that will be called. More... | |
FunctionID | functionID |
The ID is a hash of the name + arguments, but not the return type. More... | |
const char * | nameAndArguments |
This signature must have the form "name/[return type][arg1][arg2..]". More... | |
uint8 | numArgs |
The number of arguments that the function takes. More... | |
Type | returnType |
The function's return type. More... | |
Static Private Member Functions | |
static int | indexOfSlash (const char *nameAndArgs) noexcept |
Defines a native function that the program can call.
{Blocks}
using littlefoot::NativeFunction::ImplementationFunction = int32 (*) (void*, const int32*) |
|
inline |
Creates a NativeFunction from its signature and an implementation function.
The format of nameAndArgumentTypes is "name/[return type][arg1][arg2..]" So for example "int foobar (float, bool)" would be "foobar/ifb"
|
inlinestatic |
Converts a function signature to its hashed ID.
References jassert.
|
inlinestaticprivatenoexcept |
References jassert.
ImplementationFunction littlefoot::NativeFunction::function |
A static function that will be called.
Referenced by littlefoot::Runner< programAndHeapSpace, stackAndGlobalsSpace >::FunctionExecutionContext::callNative().
FunctionID littlefoot::NativeFunction::functionID |
The ID is a hash of the name + arguments, but not the return type.
const char* littlefoot::NativeFunction::nameAndArguments |
This signature must have the form "name/[return type][arg1][arg2..]".
uint8 littlefoot::NativeFunction::numArgs |
The number of arguments that the function takes.
Type littlefoot::NativeFunction::returnType |
The function's return type.