JUCE  v5.2.0-514-g49784a029
JUCE API
juce::littlefoot::NativeFunction Struct Reference

Defines a native function that the program can call. More...

#include <juce_blocks_basics.h>

Collaboration diagram for juce::littlefoot::NativeFunction:

Public Types

using ImplementationFunction = int32(*)(void *, const int32 *)
 

Public Member Functions

 NativeFunction (const char *nameAndArgumentTypes, ImplementationFunction fn) noexcept
 Creates a NativeFunction from its signature and an implementation function. More...
 

Static Public Member Functions

static FunctionID createID (const char *nameAndArgTypes) noexcept
 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
 

Detailed Description

Defines a native function that the program can call.

Member Typedef Documentation

◆ ImplementationFunction

Constructor & Destructor Documentation

◆ NativeFunction()

juce::littlefoot::NativeFunction::NativeFunction ( const char *  nameAndArgumentTypes,
ImplementationFunction  fn 
)
inlinenoexcept

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"

Member Function Documentation

◆ createID()

static FunctionID juce::littlefoot::NativeFunction::createID ( const char *  nameAndArgTypes)
inlinestaticnoexcept

Converts a function signature to its hashed ID.

◆ indexOfSlash()

static int juce::littlefoot::NativeFunction::indexOfSlash ( const char *  nameAndArgs)
inlinestaticprivatenoexcept

Member Data Documentation

◆ function

ImplementationFunction juce::littlefoot::NativeFunction::function

A static function that will be called.

◆ functionID

FunctionID juce::littlefoot::NativeFunction::functionID

The ID is a hash of the name + arguments, but not the return type.

◆ nameAndArguments

const char* juce::littlefoot::NativeFunction::nameAndArguments

This signature must have the form "name/[return type][arg1][arg2..]".

◆ numArgs

uint8 juce::littlefoot::NativeFunction::numArgs

The number of arguments that the function takes.

◆ returnType

Type juce::littlefoot::NativeFunction::returnType

The function's return type.


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