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

A reference to a block of memory which contains a complete program. More...

#include <juce_blocks_basics.h>

Collaboration diagram for juce::littlefoot::Program:

Public Member Functions

 Program (const void *data, uint32 totalMemorySize) noexcept
 
uint16 calculateChecksum () const noexcept
 
bool checksumMatches () const noexcept
 
void dumpAllFunctions (juce::OutputStream &out) const
 Calls dumpFunctionDisassembly() for all functions. More...
 
void dumpFunctionDisassembly (juce::OutputStream &out, uint32 functionIndex) const
 Prints the assembly code for a given function. More...
 
const uint8getFunctionEndAddress (uint32 functionIndex) const noexcept
 
FunctionID getFunctionID (uint32 functionIndex) const noexcept
 
const uint8getFunctionStartAddress (uint32 functionIndex) const noexcept
 
uint16 getHeapSizeBytes () const noexcept
 Returns the number of bytes of heap space the program needs. More...
 
uint32 getNumFunctions () const noexcept
 
uint16 getNumGlobals () const noexcept
 Returns the number of global variables the program uses. More...
 
juce::String getOpDisassembly (const uint8 *&prog) const
 
uint32 getProgramSize () const noexcept
 
uint16 getStoredChecksum () const noexcept
 
uint32 getTotalSpaceNeeded () const noexcept
 

Static Public Member Functions

static int32 floatToInt (float value) noexcept
 
static uint8 getNumExtraBytesForOpcode (OpCode op) noexcept
 For a given op code, this returns the number of program bytes that follow it. More...
 
static float intToFloat (int32 value) noexcept
 
static int16 readInt16 (const uint8 *d) noexcept
 
static int32 readInt32 (const uint8 *d) noexcept
 
static void writeInt16 (uint8 *d, int16 v) noexcept
 
static void writeInt32 (uint8 *d, int32 v) noexcept
 

Public Attributes

const uint32 maxProgramSize
 
const uint8programStart = 0
 

Static Public Attributes

static constexpr uint32 programHeaderSize = 10
 

Private Member Functions

const uint8getFunctionEntry (uint32 index) const noexcept
 

Static Private Member Functions

static void copyFloatMem (void *dest, const void *src) noexcept
 

Detailed Description

A reference to a block of memory which contains a complete program.

Data format: 2 bytes - program checksum 2 bytes - program size 2 bytes - num functions 2 bytes - num globals 2 bytes - amount of heap space needed (bytes) 2 bytes - ID of function 1 2 bytes - byte offset of function 1 code 2 bytes - ID of function 2 2 bytes - byte offset of function 2 code etc.. ...function code...

Constructor & Destructor Documentation

◆ Program()

juce::littlefoot::Program::Program ( const void *  data,
uint32  totalMemorySize 
)
inlinenoexcept

Member Function Documentation

◆ calculateChecksum()

uint16 juce::littlefoot::Program::calculateChecksum ( ) const
inlinenoexcept

◆ checksumMatches()

bool juce::littlefoot::Program::checksumMatches ( ) const
inlinenoexcept

◆ copyFloatMem()

static void juce::littlefoot::Program::copyFloatMem ( void *  dest,
const void *  src 
)
inlinestaticprivatenoexcept

◆ dumpAllFunctions()

void juce::littlefoot::Program::dumpAllFunctions ( juce::OutputStream out) const
inline

Calls dumpFunctionDisassembly() for all functions.

◆ dumpFunctionDisassembly()

void juce::littlefoot::Program::dumpFunctionDisassembly ( juce::OutputStream out,
uint32  functionIndex 
) const
inline

Prints the assembly code for a given function.

◆ floatToInt()

static int32 juce::littlefoot::Program::floatToInt ( float  value)
inlinestaticnoexcept

◆ getFunctionEndAddress()

const uint8* juce::littlefoot::Program::getFunctionEndAddress ( uint32  functionIndex) const
inlinenoexcept

◆ getFunctionEntry()

const uint8* juce::littlefoot::Program::getFunctionEntry ( uint32  index) const
inlineprivatenoexcept

◆ getFunctionID()

FunctionID juce::littlefoot::Program::getFunctionID ( uint32  functionIndex) const
inlinenoexcept

◆ getFunctionStartAddress()

const uint8* juce::littlefoot::Program::getFunctionStartAddress ( uint32  functionIndex) const
inlinenoexcept

◆ getHeapSizeBytes()

uint16 juce::littlefoot::Program::getHeapSizeBytes ( ) const
inlinenoexcept

Returns the number of bytes of heap space the program needs.

◆ getNumExtraBytesForOpcode()

static uint8 juce::littlefoot::Program::getNumExtraBytesForOpcode ( OpCode  op)
inlinestaticnoexcept

For a given op code, this returns the number of program bytes that follow it.

◆ getNumFunctions()

uint32 juce::littlefoot::Program::getNumFunctions ( ) const
inlinenoexcept

◆ getNumGlobals()

uint16 juce::littlefoot::Program::getNumGlobals ( ) const
inlinenoexcept

Returns the number of global variables the program uses.

◆ getOpDisassembly()

juce::String juce::littlefoot::Program::getOpDisassembly ( const uint8 *&  prog) const
inline

◆ getProgramSize()

uint32 juce::littlefoot::Program::getProgramSize ( ) const
inlinenoexcept

◆ getStoredChecksum()

uint16 juce::littlefoot::Program::getStoredChecksum ( ) const
inlinenoexcept

◆ getTotalSpaceNeeded()

uint32 juce::littlefoot::Program::getTotalSpaceNeeded ( ) const
inlinenoexcept

◆ intToFloat()

static float juce::littlefoot::Program::intToFloat ( int32  value)
inlinestaticnoexcept

◆ readInt16()

static int16 juce::littlefoot::Program::readInt16 ( const uint8 d)
inlinestaticnoexcept

◆ readInt32()

static int32 juce::littlefoot::Program::readInt32 ( const uint8 d)
inlinestaticnoexcept

◆ writeInt16()

static void juce::littlefoot::Program::writeInt16 ( uint8 d,
int16  v 
)
inlinestaticnoexcept

◆ writeInt32()

static void juce::littlefoot::Program::writeInt32 ( uint8 d,
int32  v 
)
inlinestaticnoexcept

Member Data Documentation

◆ maxProgramSize

const uint32 juce::littlefoot::Program::maxProgramSize

◆ programHeaderSize

constexpr uint32 juce::littlefoot::Program::programHeaderSize = 10
static

◆ programStart

const uint8* juce::littlefoot::Program::programStart = 0

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