HiveMind
Public Member Functions | List of all members
IBittyBuzzClosureRegister Class Referenceabstract

A class to register buzz function/closures id and associate them with a string. More...

#include <IBittyBuzzClosureRegister.h>

Inheritance diagram for IBittyBuzzClosureRegister:
Inheritance graph
Collaboration diagram for IBittyBuzzClosureRegister:
Collaboration graph

Public Member Functions

virtual ~IBittyBuzzClosureRegister ()=default
 
virtual bool registerClosure (const char *functionName, bbzheap_idx_t closureHeapIdx, bbzheap_idx_t selfHeapIdx, const BittyBuzzFunctionDescription &description)=0
 register a closure to the list More...
 
virtual void clearClosures ()=0
 Clears all the registered closures. More...
 
virtual std::optional< std::reference_wrapper< const BittyBuzzRegisteredClosure > > getRegisteredClosure (const char *functionName) const =0
 get the id of a stored function by it's associated name More...
 
virtual std::optional< std::reference_wrapper< const BittyBuzzRegisteredClosure > > getRegisteredClosure (uint16_t idx) const =0
 get the id of a stored function by it's associated name More...
 
virtual uint16_t getRegisteredClosureLength () const =0
 get the length/number of the registered closures More...
 

Detailed Description

A class to register buzz function/closures id and associate them with a string.

Constructor & Destructor Documentation

◆ ~IBittyBuzzClosureRegister()

virtual IBittyBuzzClosureRegister::~IBittyBuzzClosureRegister ( )
virtualdefault

Member Function Documentation

◆ clearClosures()

virtual void IBittyBuzzClosureRegister::clearClosures ( )
pure virtual

Clears all the registered closures.

Implemented in BittyBuzzClosureRegister.

Here is the caller graph for this function:

◆ 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
functionNamethe name of the function to fetch
Returns
an optional that has a reference to the info of the registered closure

Implemented in BittyBuzzClosureRegister.

Here is the caller graph for this function:

◆ 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
idxthe 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.

Here is the caller graph for this function:

◆ 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
functionNamethe 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
closureHeapIdxa pointer to the heap to the closure. When registering, the function will be made permanent.
selfHeapIdxa pointer to the heap to the self variable, can be nil. When registering, the function will be made permanent.
descriptionthe 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.

Here is the caller graph for this function:

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