libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
executablecode.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
3#pragma once
4
5#include <memory>
6
7#include "global.h"
8
9namespace libscratchcpp
10{
11
13class Thread;
14struct ValueData;
15
18{
19 public:
20 virtual ~ExecutableCode() { }
21
23 virtual void run(ExecutionContext *context) = 0;
24
29 virtual ValueData runReporter(ExecutionContext *context) = 0;
30
32 virtual bool runPredicate(ExecutionContext *context) = 0;
33
35 virtual void kill(ExecutionContext *context) = 0;
36
38 virtual void reset(ExecutionContext *context) = 0;
39
41 virtual bool isFinished(ExecutionContext *context) const = 0;
42
44 virtual std::shared_ptr<ExecutionContext> createExecutionContext(Thread *thread) const = 0;
45};
46
47} // namespace libscratchcpp
The ExecutableCode class represents the code of a compiled Scratch script.
Definition executablecode.h:18
virtual std::shared_ptr< ExecutionContext > createExecutionContext(Thread *thread) const =0
virtual void reset(ExecutionContext *context)=0
virtual ~ExecutableCode()
Definition executablecode.h:20
virtual void run(ExecutionContext *context)=0
virtual bool isFinished(ExecutionContext *context) const =0
virtual ValueData runReporter(ExecutionContext *context)=0
virtual bool runPredicate(ExecutionContext *context)=0
virtual void kill(ExecutionContext *context)=0
The ExecutionContext represents the execution context of a target (can be a clone) with variables,...
Definition executioncontext.h:20
The Thread class represents a running Scratch script.
Definition thread.h:19
#define LIBSCRATCHCPP_EXPORT
Definition global.h:17
The main namespace of the library.
Definition asset.h:10
The ValueData struct holds the data of Value. It's used in compiled Scratch code for better performan...
Definition valuedata.h:26