nsbaci 1.0
Loading...
Searching...
No Matches
nsbaci::services::runtime::Interpreter Class Referenceabstract

Executes instructions for threads within a program context. More...

#include <interpreter.h>

Inheritance diagram for nsbaci::services::runtime::Interpreter:

Public Member Functions

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

Detailed Description

Executes instructions for threads within a program context.

The Interpreter is responsible for fetching and executing instructions based on the current thread's program counter.

Member Function Documentation

◆ executeInstruction()

virtual InterpreterResult nsbaci::services::runtime::Interpreter::executeInstruction ( Thread & t,
Program & program )
pure virtual

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

Implemented in nsbaci::services::runtime::NsbaciInterpreter.

◆ isWaitingForInput()

virtual bool nsbaci::services::runtime::Interpreter::isWaitingForInput ( ) const
pure virtual

Check if interpreter is waiting for input.

Returns
True if waiting for input.

Implemented in nsbaci::services::runtime::NsbaciInterpreter.

◆ provideInput()

virtual void nsbaci::services::runtime::Interpreter::provideInput ( const std::string & input)
pure virtual

Provide input to a thread waiting for input.

Parameters
inputThe input string.

Implemented in nsbaci::services::runtime::NsbaciInterpreter.

◆ reset()

virtual void nsbaci::services::runtime::Interpreter::reset ( )
pure virtual

Reset interpreter state for a new run.

Clears any pending input and waiting state.

Implemented in nsbaci::services::runtime::NsbaciInterpreter.

◆ setDrawingCallback()

virtual void nsbaci::services::runtime::Interpreter::setDrawingCallback ( DrawingCallback callback)
pure virtual

Set the drawing callback for drawing operations.

Parameters
callbackFunction to call when drawing is requested.

Implemented in nsbaci::services::runtime::NsbaciInterpreter.

◆ setOutputCallback()

virtual void nsbaci::services::runtime::Interpreter::setOutputCallback ( OutputCallback callback)
pure virtual

Set the output callback for print operations.

Parameters
callbackFunction to call when output is produced.

Implemented in nsbaci::services::runtime::NsbaciInterpreter.


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