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
9
namespace
libscratchcpp
10
{
11
12
class
ExecutionContext
;
13
class
Thread
;
14
struct
ValueData
;
15
17
class
LIBSCRATCHCPP_EXPORT
ExecutableCode
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
libscratchcpp::ExecutableCode
The ExecutableCode class represents the code of a compiled Scratch script.
Definition
executablecode.h:18
libscratchcpp::ExecutableCode::createExecutionContext
virtual std::shared_ptr< ExecutionContext > createExecutionContext(Thread *thread) const =0
libscratchcpp::ExecutableCode::reset
virtual void reset(ExecutionContext *context)=0
libscratchcpp::ExecutableCode::~ExecutableCode
virtual ~ExecutableCode()
Definition
executablecode.h:20
libscratchcpp::ExecutableCode::run
virtual void run(ExecutionContext *context)=0
libscratchcpp::ExecutableCode::isFinished
virtual bool isFinished(ExecutionContext *context) const =0
libscratchcpp::ExecutableCode::runReporter
virtual ValueData runReporter(ExecutionContext *context)=0
libscratchcpp::ExecutableCode::runPredicate
virtual bool runPredicate(ExecutionContext *context)=0
libscratchcpp::ExecutableCode::kill
virtual void kill(ExecutionContext *context)=0
libscratchcpp::ExecutionContext
The ExecutionContext represents the execution context of a target (can be a clone) with variables,...
Definition
executioncontext.h:20
libscratchcpp::Thread
The Thread class represents a running Scratch script.
Definition
thread.h:19
global.h
LIBSCRATCHCPP_EXPORT
#define LIBSCRATCHCPP_EXPORT
Definition
global.h:17
libscratchcpp
The main namespace of the library.
Definition
asset.h:10
libscratchcpp::ValueData
The ValueData struct holds the data of Value. It's used in compiled Scratch code for better performan...
Definition
valuedata.h:26
include
scratchcpp
executablecode.h
Generated by
1.13.2