Go to the documentation of this file. 1 #ifndef __BITTYBUZZCLOSUREREGISTER_H_
2 #define __BITTYBUZZCLOSUREREGISTER_H_
5 #include "bittybuzz/BittyBuzzSettings.h"
7 #include <cpp-common/HashMapStack.h>
10 #include <string_view>
18 bbzheap_idx_t closureHeapIdx,
19 bbzheap_idx_t selfHeapIdx,
25 const char* functionName)
const override;
28 uint16_t idx)
const override;
39 #endif // __BITTYBUZZCLOSUREREGISTER_H_
HashMapStack< std::string_view, BittyBuzzRegisteredClosure, m_maxSize > m_closureRegisterMap
Definition: BittyBuzzClosureRegister.h:36
Definition: BittyBuzzClosureRegister.h:13
A class to register buzz function/closures id and associate them with a string.
Definition: IBittyBuzzClosureRegister.h:24
std::optional< std::reference_wrapper< const BittyBuzzRegisteredClosure > > getRegisteredClosure(const char *functionName) const override
get the id of a stored function by it's associated name
Definition: BittyBuzzClosureRegister.cpp:55
void clearClosures() override
Clears all the registered closures.
Definition: BittyBuzzClosureRegister.cpp:49
HashMapStack< uint16_t, const char *, m_maxSize > m_closureNameRegisters
Definition: BittyBuzzClosureRegister.h:35
bool registerClosure(const char *functionName, bbzheap_idx_t closureHeapIdx, bbzheap_idx_t selfHeapIdx, const BittyBuzzFunctionDescription &description) override
register a closure to the list
Definition: BittyBuzzClosureRegister.cpp:16
uint16_t getRegisteredClosureLength() const override
get the length/number of the registered closures
Definition: BittyBuzzClosureRegister.cpp:68
Description for a function, used for the FunctionDescriptionRequest/Response.
Definition: BittyBuzzFunctionDescription.h:11
constexpr static uint16_t m_maxSize
Definition: BittyBuzzClosureRegister.h:32
#define BBZ_CLOSURE_REGISTER_LENGTH
Template file used by CMake to provide default or user-provided values for the settings of the BittyB...
Definition: BittyBuzzSettings.in.h:10
~BittyBuzzClosureRegister()=default