-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy paththread.h
More file actions
44 lines (33 loc) · 914 Bytes
/
thread.h
File metadata and controls
44 lines (33 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "valuedata.h"
#include "spimpl.h"
namespace libscratchcpp
{
class Target;
class Promise;
class IEngine;
class Script;
class ThreadPrivate;
/*! \brief The Thread class represents a running Scratch script. */
class LIBSCRATCHCPP_EXPORT Thread
{
public:
Thread(Target *target, IEngine *engine, Script *script);
Thread(const Thread &) = delete;
~Thread();
Target *target() const;
IEngine *engine() const;
Script *script() const;
void run();
ValueData runReporter();
bool runPredicate();
void kill();
void reset();
bool isFinished() const;
std::shared_ptr<Promise> promise() const;
void setPromise(std::shared_ptr<Promise> promise);
private:
spimpl::unique_impl_ptr<ThreadPrivate> impl;
};
} // namespace libscratchcpp