libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
executioncontext.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
3
#pragma once
4
5
#include "
global.h
"
6
#include "spimpl.h"
7
8
namespace
libscratchcpp
9
{
10
11
class
Thread
;
12
class
IEngine
;
13
class
Promise
;
14
class
IStackTimer
;
15
class
IRandomGenerator
;
16
class
ExecutionContextPrivate;
17
19
class
LIBSCRATCHCPP_EXPORT
ExecutionContext
20
{
21
public
:
22
ExecutionContext
(
Thread
*
thread
);
23
ExecutionContext
(
const
ExecutionContext
&) =
delete
;
24
virtual
~ExecutionContext
() { }
25
26
Thread
*thread()
const
;
27
IEngine
*engine()
const
;
28
29
std::shared_ptr<Promise> promise()
const
;
30
void
setPromise(std::shared_ptr<Promise> promise);
31
32
IStackTimer
*stackTimer()
const
;
33
void
setStackTimer(
IStackTimer
*newStackTimer);
34
35
IRandomGenerator
*rng()
const
;
36
void
setRng(
IRandomGenerator
*newRng);
37
38
private
:
39
spimpl::unique_impl_ptr<ExecutionContextPrivate> impl;
40
};
41
42
}
// namespace libscratchcpp
libscratchcpp::ExecutionContext::thread
Thread * thread() const
Definition
executioncontext.cpp:17
libscratchcpp::ExecutionContext::ExecutionContext
ExecutionContext(Thread *thread)
Definition
executioncontext.cpp:11
libscratchcpp::ExecutionContext::ExecutionContext
ExecutionContext(const ExecutionContext &)=delete
libscratchcpp::ExecutionContext::~ExecutionContext
virtual ~ExecutionContext()
Definition
executioncontext.h:24
libscratchcpp::IEngine
The IEngine interface provides an API for running Scratch projects.
Definition
iengine.h:41
libscratchcpp::IRandomGenerator
The IRandomGenerator interface represents a random number generator that can be received e....
Definition
irandomgenerator.h:12
libscratchcpp::IStackTimer
The IStackTimer interface represents a timer that can be used by blocks.
Definition
istacktimer.h:16
libscratchcpp::Promise
The Promise class represents the eventual completion of an asynchronous operation.
Definition
promise.h:15
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
include
scratchcpp
executioncontext.h
Generated by
1.13.2