libscratchcpp
A library for C++ based Scratch project players
Toggle main menu visibility
Loading...
Searching...
No Matches
thread.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
3
#pragma once
4
5
#include "
valuedata.h
"
6
#include "spimpl.h"
7
8
namespace
libscratchcpp
9
{
10
11
class
Target
;
12
class
Promise
;
13
class
IEngine
;
14
class
Script
;
15
class
ThreadPrivate;
16
18
class
LIBSCRATCHCPP_EXPORT
Thread
19
{
20
public
:
21
Thread
(
Target
*
target
,
IEngine
*
engine
,
Script
*
script
);
22
Thread
(
const
Thread
&) =
delete
;
23
24
Target
*
target
()
const
;
25
IEngine
*
engine
()
const
;
26
Script
*
script
()
const
;
27
28
void
run
();
29
ValueData
runReporter
();
30
bool
runPredicate
();
31
void
kill
();
32
void
reset
();
33
34
bool
isFinished
()
const
;
35
36
std::shared_ptr<Promise>
promise
()
const
;
37
void
setPromise
(std::shared_ptr<Promise>
promise
);
38
39
private
:
40
spimpl::unique_impl_ptr<ThreadPrivate> impl;
41
};
42
43
}
// namespace libscratchcpp
libscratchcpp::IEngine
The IEngine interface provides an API for running Scratch projects.
Definition
iengine.h:41
libscratchcpp::Promise
The Promise class represents the eventual completion of an asynchronous operation.
Definition
promise.h:15
libscratchcpp::Script
The Script class represents a compiled Scratch script.
Definition
script.h:23
libscratchcpp::Target
The Target class is the Stage or a Sprite.
Definition
target.h:28
libscratchcpp::Thread::engine
IEngine * engine() const
Definition
thread.cpp:35
libscratchcpp::Thread::reset
void reset()
Definition
thread.cpp:76
libscratchcpp::Thread::script
Script * script() const
Definition
thread.cpp:41
libscratchcpp::Thread::Thread
Thread(const Thread &)=delete
libscratchcpp::Thread::isFinished
bool isFinished() const
Definition
thread.cpp:82
libscratchcpp::Thread::Thread
Thread(Target *target, IEngine *engine, Script *script)
Definition
thread.cpp:13
libscratchcpp::Thread::runPredicate
bool runPredicate()
Definition
thread.cpp:60
libscratchcpp::Thread::promise
std::shared_ptr< Promise > promise() const
Definition
thread.cpp:88
libscratchcpp::Thread::runReporter
ValueData runReporter()
Definition
thread.cpp:53
libscratchcpp::Thread::kill
void kill()
Definition
thread.cpp:70
libscratchcpp::Thread::run
void run()
Definition
thread.cpp:47
libscratchcpp::Thread::target
Target * target() const
Definition
thread.cpp:29
libscratchcpp::Thread::setPromise
void setPromise(std::shared_ptr< Promise > promise)
Definition
thread.cpp:94
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
valuedata.h
include
scratchcpp
thread.h
Generated by
1.17.0