Go to the documentation of this file. 1 #ifndef __BITTYBUZZVM_H_
2 #define __BITTYBUZZVM_H_
44 bool init(
const std::reference_wrapper<IBittyBuzzLib>* bbzLibs,
45 uint32_t bbzLibsLength)
override;
47 bool start()
override;
57 bbzvm_state
getState()
const override;
59 bbzvm_error
getError()
const override;
76 #endif // __BITTYBUZZVM_H_
const IBSP & m_bsp
Definition: BittyBuzzVm.h:65
BBVMRet
Definition: IBittyBuzzVm.h:10
A class to register buzz function/closures id and associate them with a string.
Definition: IBittyBuzzClosureRegister.h:24
bool start() override
Starts the vm.
Definition: BittyBuzzVm.cpp:64
void terminate() override
Terminate the virtual machine and removes all messages that were supposed to be processed.
Definition: BittyBuzzVm.cpp:80
bbzvm_t m_bbzVm
Definition: BittyBuzzVm.h:73
Definition: BittyBuzzVm.h:17
LogLevel
The log level used for the logger.
Definition: ILogger.h:9
bool init(const std::reference_wrapper< IBittyBuzzLib > *bbzLibs, uint32_t bbzLibsLength) override
Init the virtual machine.
Definition: BittyBuzzVm.cpp:38
Manages the UI available to the user.
Definition: IUserUI.h:7
Definition: IBittyBuzzNeighborsManager.h:4
IUserInterface & m_ui
Definition: BittyBuzzVm.h:71
Manages BittyBuzz virtual machine.
Definition: IBittyBuzzVm.h:14
IBittyBuzzClosureRegister & m_closureRegister
Definition: BittyBuzzVm.h:69
Class that resolves a string from the bittybuzz virtual machine.
Definition: IBittyBuzzStringResolver.h:10
~BittyBuzzVm() override=default
IBittyBuzzMessageService & m_messageService
Definition: BittyBuzzVm.h:67
bbzvm_instr getInstruction() const override
Get the current instruction of the VM.
Definition: BittyBuzzVm.cpp:126
ILogger & m_logger
Definition: BittyBuzzVm.h:70
bbzvm_state getState() const override
Get the state of the vm.
Definition: BittyBuzzVm.cpp:122
A logger class with basic logging capabilities.
Definition: ILogger.h:35
BBVMRet step() override
Does one execution step in the virtual machine. Thus execute the buzz code in the step function.
Definition: BittyBuzzVm.cpp:90
void stop() override
Stops the vm, can be called in another thread or in an interrupt.
Definition: BittyBuzzVm.cpp:73
IBittyBuzzMessageHandler & m_messageHandler
Definition: BittyBuzzVm.h:66
message service use by the BBVM. Constructs the messages and dispatches it at the appropriate place (...
Definition: IBittyBuzzMessageService.h:9
void logDump(LogLevel logLevel) override
Logs the virtual machine state, stack, heap and table segments.
Definition: BittyBuzzVm.cpp:78
const IBittyBuzzBytecode & m_bytecode
Definition: BittyBuzzVm.h:64
Manages the user interface The user interface can consist of buttons, LED, serial print ports,...
Definition: IUserInterface.h:36
IBittyBuzzNeighborsManager & m_neighborsManager
Definition: BittyBuzzVm.h:68
Manages the BittyBuzz byte code.
Definition: IBittyBuzzBytecode.h:9
Handles messages destined to the bbvm.
Definition: IBittyBuzzMessageHandler.h:8
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.
Definition: BittyBuzzVm.cpp:9
bbzvm_error getError() const override
Get the error state of the VM.
Definition: BittyBuzzVm.cpp:124