A class to register buzz function/closures id and associate them with a string.
More...
#include <IBittyBuzzClosureRegister.h>
A class to register buzz function/closures id and associate them with a string.
◆ ~IBittyBuzzClosureRegister()
virtual IBittyBuzzClosureRegister::~IBittyBuzzClosureRegister |
( |
| ) |
|
|
virtualdefault |
◆ clearClosures()
virtual void IBittyBuzzClosureRegister::clearClosures |
( |
| ) |
|
|
pure virtual |
◆ getRegisteredClosure() [1/2]
virtual std::optional<std::reference_wrapper<const BittyBuzzRegisteredClosure> > IBittyBuzzClosureRegister::getRegisteredClosure |
( |
const char * |
functionName | ) |
const |
|
pure virtual |
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
Implemented in BittyBuzzClosureRegister.
◆ getRegisteredClosure() [2/2]
virtual std::optional<std::reference_wrapper<const BittyBuzzRegisteredClosure> > IBittyBuzzClosureRegister::getRegisteredClosure |
( |
uint16_t |
idx | ) |
const |
|
pure virtual |
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
Implemented in BittyBuzzClosureRegister.
◆ getRegisteredClosureLength()
virtual uint16_t IBittyBuzzClosureRegister::getRegisteredClosureLength |
( |
| ) |
const |
|
pure virtual |
get the length/number of the registered closures
- Returns
- the number of registered closures
Implemented in BittyBuzzClosureRegister.
◆ registerClosure()
virtual bool IBittyBuzzClosureRegister::registerClosure |
( |
const char * |
functionName, |
|
|
bbzheap_idx_t |
closureHeapIdx, |
|
|
bbzheap_idx_t |
selfHeapIdx, |
|
|
const BittyBuzzFunctionDescription & |
description |
|
) |
| |
|
pure virtual |
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)
Implemented in BittyBuzzClosureRegister.
The documentation for this class was generated from the following file: