#include <BittyBuzzVm.h>
|
| BittyBuzzVm (const IBittyBuzzBytecode &bytecode, const IBittyBuzzStringResolver &stringResolver, IBittyBuzzMessageHandler &messageHandler, IBittyBuzzClosureRegister &closureRegister, IBittyBuzzMessageService &messageService, IBittyBuzzNeighborsManager &neighborsManager, IUserUI &userUI, IBSP &bsp, ILogger &logger, IUserInterface &ui) |
| The constructor of the bbvm. More...
|
|
| ~BittyBuzzVm () override=default |
|
bool | init (const std::reference_wrapper< IBittyBuzzLib > *bbzLibs, uint32_t bbzLibsLength) override |
| Init the virtual machine. More...
|
|
bool | start () override |
| Starts the vm. More...
|
|
void | stop () override |
| Stops the vm, can be called in another thread or in an interrupt. More...
|
|
BBVMRet | step () override |
| Does one execution step in the virtual machine. Thus execute the buzz code in the step function. More...
|
|
void | terminate () override |
| Terminate the virtual machine and removes all messages that were supposed to be processed. More...
|
|
void | logDump (LogLevel logLevel) override |
| Logs the virtual machine state, stack, heap and table segments. More...
|
|
bbzvm_state | getState () const override |
| Get the state of the vm. More...
|
|
bbzvm_error | getError () const override |
| Get the error state of the VM. More...
|
|
bbzvm_instr | getInstruction () const override |
| Get the current instruction of the VM. More...
|
|
virtual | ~IBittyBuzzVm ()=default |
|
◆ BittyBuzzVm()
The constructor of the bbvm.
- Parameters
-
bytecode | the bytecode that the vm will run |
stringResolver | the string resolver used in the VM |
messageHandler | a reference to a buzz message handler, called on step |
closureRegister | a reference to the closure register |
messageService | a reference to the message service |
neighborsManager | a reference to a neighbors manager |
userUI | the ui accessible to the user (led, hex display, etc) |
bsp | a reference to the bsp |
logger | a reference to a logger |
ui | a reference to a user interface |
◆ ~BittyBuzzVm()
BittyBuzzVm::~BittyBuzzVm |
( |
| ) |
|
|
overridedefault |
◆ getError()
bbzvm_error BittyBuzzVm::getError |
( |
| ) |
const |
|
overridevirtual |
◆ getInstruction()
bbzvm_instr BittyBuzzVm::getInstruction |
( |
| ) |
const |
|
overridevirtual |
Get the current instruction of the VM.
Implements IBittyBuzzVm.
◆ getState()
bbzvm_state BittyBuzzVm::getState |
( |
| ) |
const |
|
overridevirtual |
◆ init()
bool BittyBuzzVm::init |
( |
const std::reference_wrapper< IBittyBuzzLib > * |
bbzLibs, |
|
|
uint32_t |
bbzLibsLength |
|
) |
| |
|
overridevirtual |
Init the virtual machine.
- Parameters
-
bbzLibs | an array of the libraries to init |
bbzLibsLength | the length of the libraries to init |
Implements IBittyBuzzVm.
◆ logDump()
void BittyBuzzVm::logDump |
( |
LogLevel |
logLevel | ) |
|
|
overridevirtual |
Logs the virtual machine state, stack, heap and table segments.
- Parameters
-
logLevel | The desired log level for the dumped information |
Implements IBittyBuzzVm.
◆ start()
bool BittyBuzzVm::start |
( |
| ) |
|
|
overridevirtual |
◆ step()
Does one execution step in the virtual machine. Thus execute the buzz code in the step function.
Implements IBittyBuzzVm.
◆ stop()
void BittyBuzzVm::stop |
( |
| ) |
|
|
overridevirtual |
Stops the vm, can be called in another thread or in an interrupt.
Implements IBittyBuzzVm.
◆ terminate()
void BittyBuzzVm::terminate |
( |
| ) |
|
|
overridevirtual |
Terminate the virtual machine and removes all messages that were supposed to be processed.
Implements IBittyBuzzVm.
◆ m_bbzVm
bbzvm_t BittyBuzzVm::m_bbzVm |
|
private |
◆ m_bsp
const IBSP& BittyBuzzVm::m_bsp |
|
private |
◆ m_bytecode
◆ m_closureRegister
◆ m_logger
◆ m_messageHandler
◆ m_messageService
◆ m_neighborsManager
◆ m_ui
The documentation for this class was generated from the following files: