#include <BittyBuzzClosureRegister.h>
◆ ~BittyBuzzClosureRegister()
BittyBuzzClosureRegister::~BittyBuzzClosureRegister |
( |
| ) |
|
|
default |
◆ clearClosures()
void BittyBuzzClosureRegister::clearClosures |
( |
| ) |
|
|
overridevirtual |
◆ getRegisteredClosure() [1/2]
std::optional< std::reference_wrapper< const BittyBuzzRegisteredClosure > > BittyBuzzClosureRegister::getRegisteredClosure |
( |
const char * |
functionName | ) |
const |
|
overridevirtual |
get the id of a stored function by it's associated name
- Parameters
-
functionName | the name of the function to fetch |
- Returns
- an optional that has a reference to the info of the registered closure
Implements IBittyBuzzClosureRegister.
◆ getRegisteredClosure() [2/2]
std::optional< std::reference_wrapper< const BittyBuzzRegisteredClosure > > BittyBuzzClosureRegister::getRegisteredClosure |
( |
uint16_t |
idx | ) |
const |
|
overridevirtual |
get the id of a stored function by it's associated name
- Parameters
-
idx | the index of the function to fetch |
- Returns
- an optional that has a reference to the info of the registered closure
Implements IBittyBuzzClosureRegister.
◆ getRegisteredClosureLength()
uint16_t BittyBuzzClosureRegister::getRegisteredClosureLength |
( |
| ) |
const |
|
overridevirtual |
get the length/number of the registered closures
- Returns
- the number of registered closures
Implements IBittyBuzzClosureRegister.
◆ registerClosure()
bool BittyBuzzClosureRegister::registerClosure |
( |
const char * |
functionName, |
|
|
bbzheap_idx_t |
closureHeapIdx, |
|
|
bbzheap_idx_t |
selfHeapIdx, |
|
|
const BittyBuzzFunctionDescription & |
description |
|
) |
| |
|
overridevirtual |
register a closure to the list
- Parameters
-
functionName | the name of the function, Warning, the register just keeps a pointer to the name, so make sure the data it's points to is valid during usage |
closureHeapIdx | a pointer to the heap to the closure. When registering, the function will be made permanent. |
selfHeapIdx | a pointer to the heap to the self variable, can be nil. When registering, the function will be made permanent. |
description | the description of the function, it's argument names and types |
- Returns
- true on success, false if not (i.e. no more space in the list, or the heapidx is not a closure)
Implements IBittyBuzzClosureRegister.
◆ m_closureNameRegisters
HashMapStack<uint16_t, const char*, m_maxSize> BittyBuzzClosureRegister::m_closureNameRegisters |
|
private |
◆ m_closureRegisterMap
◆ m_maxSize
The documentation for this class was generated from the following files: