nsbaci 1.0
Loading...
Searching...
No Matches
nsbaci::services::runtime::NsbaciInterpreter Class Referencefinal

BACI-specific implementation of the Interpreter. More...

#include <nsbaciInterpreter.h>

Inheritance diagram for nsbaci::services::runtime::NsbaciInterpreter:
Collaboration diagram for nsbaci::services::runtime::NsbaciInterpreter:

Public Member Functions

InterpreterResult executeInstruction (Thread &t, Program &program) override
 Executes the current instruction for the given thread with the program context.
void provideInput (const std::string &input) override
 Provide input to a thread waiting for input.
bool isWaitingForInput () const override
 Check if interpreter is waiting for input.
void setOutputCallback (OutputCallback callback) override
 Set the output callback for print operations.
void setDrawingCallback (DrawingCallback callback) override
 Set the drawing callback for drawing operations.
void reset () override
 Reset interpreter state for a new run.

Detailed Description

BACI-specific implementation of the Interpreter.

NsbaciInterpreter executes BACI p-code instructions, managing the execution state and interaction with the program context.

Member Function Documentation

◆ executeInstruction()

InterpreterResult nsbaci::services::runtime::NsbaciInterpreter::executeInstruction ( Thread & t,
Program & program )
overridevirtual

Executes the current instruction for the given thread with the program context.

Parameters
tThe thread whose instruction should be executed.
programThe program context in which to execute the instruction.
Returns
InterpreterResult indicating success or any errors encountered.

Implements nsbaci::services::runtime::Interpreter.

Here is the call graph for this function:

◆ isWaitingForInput()

bool nsbaci::services::runtime::NsbaciInterpreter::isWaitingForInput ( ) const
overridevirtual

Check if interpreter is waiting for input.

Returns
True if waiting for input.

Implements nsbaci::services::runtime::Interpreter.

◆ provideInput()

void nsbaci::services::runtime::NsbaciInterpreter::provideInput ( const std::string & input)
overridevirtual

Provide input to a thread waiting for input.

Parameters
inputThe input string.

Implements nsbaci::services::runtime::Interpreter.

◆ reset()

void nsbaci::services::runtime::NsbaciInterpreter::reset ( )
overridevirtual

Reset interpreter state for a new run.

Clears any pending input and waiting state.

Implements nsbaci::services::runtime::Interpreter.

◆ setDrawingCallback()

void nsbaci::services::runtime::NsbaciInterpreter::setDrawingCallback ( DrawingCallback callback)
overridevirtual

Set the drawing callback for drawing operations.

Parameters
callbackFunction to call when drawing is requested.

Implements nsbaci::services::runtime::Interpreter.

◆ setOutputCallback()

void nsbaci::services::runtime::NsbaciInterpreter::setOutputCallback ( OutputCallback callback)
overridevirtual

Set the output callback for print operations.

Parameters
callbackFunction to call when output is produced.

Implements nsbaci::services::runtime::Interpreter.


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