littlefoot::LittleFootRemoteHeap< ImplementationClass > Struct Template Reference
juce_blocks_basics » littlefoot

This class manages the synchronisation of a remote block of heap memory used by a littlefoot program running on a block. More...

## Public Member Functions

| LittleFootRemoteHeap (uint32 blockSizeToUse) noexcept
void | reset ()
void | clearTargetData () noexcept
void | resetDeviceStateToUnknown ()
void | resetDataRangeToUnknown (size_t offset, size_t size) noexcept
void | setByte (size_t offset, uint8 value) noexcept
void | setBytes (size_t offset, const uint8 *data, size_t num) noexcept
void | setBits (uint32 startBit, uint32 numBits, uint32 value) noexcept
uint8 | getByte (size_t offset) noexcept
bool | isFullySynced () const noexcept
void | sendChanges (ImplementationClass &bi, bool forceSend)
void | handleACKFromDevice (ImplementationClass &bi, uint32 packetIndex) noexcept
bool | isProgramLoaded () noexcept

## Static Public Member Functions

static bool | isAllZero (const uint8 *data, size_t size) noexcept

## Public Attributes

const size_t | blockSize

## Static Public Attributes

static constexpr uint16 | unknownByte = 0x100

## Detailed Description

### template<typename ImplementationClass>
struct littlefoot::LittleFootRemoteHeap< ImplementationClass >

This class manages the synchronisation of a remote block of heap memory used by a littlefoot program running on a block.

Data in the block can be changed by calling setByte, setBytes, setBits etc, and these changes will be flushed to the device when sendChanges is called.

## Constructor & Destructor Documentation

## LittleFootRemoteHeap()

template<typename ImplementationClass >

littlefoot::LittleFootRemoteHeap< ImplementationClass >::LittleFootRemoteHeap | ( | uint32 | blockSizeToUse | ) |

noexcept

References littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDeviceStateToUnknown().

## Member Function Documentation

## reset()

template<typename ImplementationClass >

void littlefoot::LittleFootRemoteHeap< ImplementationClass >::reset | ( |  | ) |

References littlefoot::LittleFootRemoteHeap< ImplementationClass >::clearTargetData(), JUCE_LOG_LITTLEFOOT_HEAP, and littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDeviceStateToUnknown().

## clearTargetData()

template<typename ImplementationClass >

void littlefoot::LittleFootRemoteHeap< ImplementationClass >::clearTargetData | ( |  | ) |

noexcept

References JUCE_LOG_LITTLEFOOT_HEAP, and zeromem().

Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::reset().

## resetDeviceStateToUnknown()

template<typename ImplementationClass >

void littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDeviceStateToUnknown | ( |  | ) |

References OwnedArray< ObjectClass, TypeOfCriticalSectionToUse >::clear(), JUCE_LOG_LITTLEFOOT_HEAP, and littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDataRangeToUnknown().

Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::handleACKFromDevice(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::LittleFootRemoteHeap(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::reset().

## resetDataRangeToUnknown()

template<typename ImplementationClass >

void littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDataRangeToUnknown | ( | size_t | offset,
|  | size_t | size
| ) |  |

noexcept

References littlefoot::LittleFootRemoteHeap< ImplementationClass >::unknownByte.

Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDeviceStateToUnknown().

## setByte()

template<typename ImplementationClass >

void littlefoot::LittleFootRemoteHeap< ImplementationClass >::setByte | ( | size_t | offset,
|  | uint8 | value
| ) |  |

noexcept

References littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize, and jassertfalse.

Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::setBytes().

## setBytes()

template<typename ImplementationClass >

void littlefoot::LittleFootRemoteHeap< ImplementationClass >::setBytes | ( | size_t | offset,
|  | const uint8 * | data,
|  | size_t | num
| ) |  |

noexcept

References littlefoot::LittleFootRemoteHeap< ImplementationClass >::setByte().

## setBits()

template<typename ImplementationClass >

void littlefoot::LittleFootRemoteHeap< ImplementationClass >::setBits | ( | uint32 | startBit,
|  | uint32 | numBits,
|  | uint32 | value
| ) |  |

noexcept

References littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize, jassertfalse, JUCE_LOG_LITTLEFOOT_HEAP, readLittleEndianBitsInBuffer(), and writeLittleEndianBitsInBuffer().

## getByte()

template<typename ImplementationClass >

uint8 littlefoot::LittleFootRemoteHeap< ImplementationClass >::getByte | ( | size_t | offset | ) |

noexcept

References littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize, and jassertfalse.

## isFullySynced()

template<typename ImplementationClass >

bool littlefoot::LittleFootRemoteHeap< ImplementationClass >::isFullySynced | ( |  | ) | const

noexcept

## isAllZero()

template<typename ImplementationClass >

static bool littlefoot::LittleFootRemoteHeap< ImplementationClass >::isAllZero | ( | const uint8 * | data,
|  | size_t | size
| ) |  |

static noexcept

Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::sendChanges().

## sendChanges()

template<typename ImplementationClass >

void littlefoot::LittleFootRemoteHeap< ImplementationClass >::sendChanges | ( | ImplementationClass & | bi,
|  | bool | forceSend
| ) |  |

References littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize, Time::getCurrentTime(), OwnedArray< ObjectClass, TypeOfCriticalSectionToUse >::getLast(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::isAllZero(), OwnedArray< ObjectClass, TypeOfCriticalSectionToUse >::isEmpty(), JUCE_LOG_LITTLEFOOT_HEAP, and RelativeTime::milliseconds().

Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::handleACKFromDevice().

## handleACKFromDevice()

template<typename ImplementationClass >

void littlefoot::LittleFootRemoteHeap< ImplementationClass >::handleACKFromDevice | ( | ImplementationClass & | bi,
|  | uint32 | packetIndex
| ) |  |

noexcept

References littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize, OwnedArray< ObjectClass, TypeOfCriticalSectionToUse >::getUnchecked(), OwnedArray< ObjectClass, TypeOfCriticalSectionToUse >::isEmpty(), JUCE_LOG_LITTLEFOOT_HEAP, OwnedArray< ObjectClass, TypeOfCriticalSectionToUse >::removeRange(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDeviceStateToUnknown(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::sendChanges(), and OwnedArray< ObjectClass, TypeOfCriticalSectionToUse >::size().

## isProgramLoaded()

template<typename ImplementationClass >

bool littlefoot::LittleFootRemoteHeap< ImplementationClass >::isProgramLoaded | ( |  | ) |

noexcept

References littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize, littlefoot::Program::checksumMatches(), and littlefoot::Program::getProgramSize().

## Member Data Documentation

## blockSize

template<typename ImplementationClass >

const size_t littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize

Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::getByte(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::handleACKFromDevice(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::isProgramLoaded(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::sendChanges(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::setBits(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::setByte().

## unknownByte

template<typename ImplementationClass >

constexpr uint16 littlefoot::LittleFootRemoteHeap< ImplementationClass >::unknownByte = 0x100

static constexpr

Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDataRangeToUnknown().

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

- juce_LittleFootRemoteHeap.h