-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue genodelabs/genode#5402
- Loading branch information
Showing
5,095 changed files
with
824,571 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef QT_QTCONCURRENT_MODULE_H | ||
#define QT_QTCONCURRENT_MODULE_H | ||
#include <QtConcurrent/QtConcurrentDepends> | ||
#include "qtaskbuilder.h" | ||
#include "qtconcurrentcompilertest.h" | ||
#include "qtconcurrentfilter.h" | ||
#include "qtconcurrentfilterkernel.h" | ||
#include "qtconcurrentfunctionwrappers.h" | ||
#include "qtconcurrentiteratekernel.h" | ||
#include "qtconcurrentmap.h" | ||
#include "qtconcurrentmapkernel.h" | ||
#include "qtconcurrentmedian.h" | ||
#include "qtconcurrentreducekernel.h" | ||
#include "qtconcurrentrun.h" | ||
#include "qtconcurrentrunbase.h" | ||
#include "qtconcurrentstoredfunctioncall.h" | ||
#include "qtconcurrenttask.h" | ||
#include "qtconcurrentthreadengine.h" | ||
#include "qtconcurrentversion.h" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* This file was generated by cmake with the info from Concurrent target. */ | ||
#ifdef __cplusplus /* create empty PCH in C mode */ | ||
# include <QtCore/QtCore> | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "qtconcurrentfilter.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "qtconcurrentmap.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "qtconcurrentrun.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "qtconcurrentversion.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
// Copyright (C) 2020 The Qt Company Ltd. | ||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | ||
|
||
#ifndef QTBASE_QTTASKBUILDER_H | ||
#define QTBASE_QTTASKBUILDER_H | ||
|
||
#if !defined(QT_NO_CONCURRENT) || defined(Q_QDOC) | ||
|
||
#include <QtConcurrent/qtconcurrentstoredfunctioncall.h> | ||
|
||
QT_BEGIN_NAMESPACE | ||
|
||
#ifdef Q_QDOC | ||
|
||
namespace QtConcurrent { | ||
|
||
enum class FutureResult { Ignore }; | ||
|
||
using InvokeResultType = int; | ||
|
||
template <class Task, class ...Args> | ||
class QTaskBuilder | ||
{ | ||
public: | ||
[[nodiscard]] | ||
QFuture<InvokeResultType> spawn(); | ||
|
||
void spawn(FutureResult); | ||
|
||
template <class ...ExtraArgs> | ||
[[nodiscard]] | ||
QTaskBuilder<Task, ExtraArgs...> withArguments(ExtraArgs &&...args); | ||
|
||
[[nodiscard]] | ||
QTaskBuilder<Task, Args...> &onThreadPool(QThreadPool &newThreadPool); | ||
|
||
[[nodiscard]] | ||
QTaskBuilder<Task, Args...> &withPriority(int newPriority); | ||
}; | ||
|
||
} // namespace QtConcurrent | ||
|
||
#else | ||
|
||
namespace QtConcurrent { | ||
|
||
enum class FutureResult { Ignore }; | ||
|
||
template <class Task, class ...Args> | ||
class QTaskBuilder | ||
{ | ||
public: | ||
[[nodiscard]] | ||
auto spawn() | ||
{ | ||
return TaskResolver<std::decay_t<Task>, std::decay_t<Args>...>::run( | ||
std::move(taskWithArgs), startParameters); | ||
} | ||
|
||
// We don't want to run with promise when we don't return a QFuture | ||
void spawn(FutureResult) | ||
{ | ||
(new StoredFunctionCall<Task, Args...>(std::move(taskWithArgs))) | ||
->start(startParameters); | ||
} | ||
|
||
template <class ...ExtraArgs> | ||
[[nodiscard]] | ||
constexpr auto withArguments(ExtraArgs &&...args) | ||
{ | ||
static_assert(std::tuple_size_v<TaskWithArgs> == 1, | ||
"This function cannot be invoked if " | ||
"arguments have already been passed."); | ||
|
||
static_assert(sizeof...(ExtraArgs) >= 1, | ||
"One or more arguments must be passed."); | ||
|
||
// We have to re-create a builder, because the type has changed | ||
return QTaskBuilder<Task, ExtraArgs...>( | ||
startParameters, | ||
std::get<0>(std::move(taskWithArgs)), | ||
std::forward<ExtraArgs>(args)... | ||
); | ||
} | ||
|
||
[[nodiscard]] | ||
constexpr auto &onThreadPool(QThreadPool &newThreadPool) | ||
{ | ||
startParameters.threadPool = &newThreadPool; | ||
return *this; | ||
} | ||
|
||
[[nodiscard]] | ||
constexpr auto &withPriority(int newPriority) | ||
{ | ||
startParameters.priority = newPriority; | ||
return *this; | ||
} | ||
|
||
protected: // Methods | ||
constexpr explicit QTaskBuilder(Task &&task, Args &&...arguments) | ||
: taskWithArgs{std::forward<Task>(task), std::forward<Args>(arguments)...} | ||
{} | ||
|
||
constexpr QTaskBuilder( | ||
const TaskStartParameters ¶meters, Task &&task, Args &&...arguments) | ||
: taskWithArgs{std::forward<Task>(task), std::forward<Args>(arguments)...} | ||
, startParameters{parameters} | ||
{} | ||
|
||
private: // Methods | ||
// Required for creating a builder from "task" function | ||
template <class T> | ||
friend constexpr auto task(T &&t); | ||
|
||
// Required for creating a new builder from "withArguments" function | ||
template <class T, class ...A> | ||
friend class QTaskBuilder; | ||
|
||
private: // Data | ||
using TaskWithArgs = DecayedTuple<Task, Args...>; | ||
|
||
TaskWithArgs taskWithArgs; | ||
TaskStartParameters startParameters; | ||
}; | ||
|
||
} // namespace QtConcurrent | ||
|
||
#endif // Q_QDOC | ||
|
||
QT_END_NAMESPACE | ||
|
||
#endif // !defined(QT_NO_CONCURRENT) | ||
|
||
#endif //QTBASE_QTTASKBUILDER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (C) 2016 The Qt Company Ltd. | ||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | ||
|
||
#ifndef QTCONCURRENT_GLOBAL_H | ||
#define QTCONCURRENT_GLOBAL_H | ||
|
||
#include <QtCore/qglobal.h> | ||
#include <QtConcurrent/qtconcurrentexports.h> | ||
|
||
#endif // include guard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (C) 2016 The Qt Company Ltd. | ||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | ||
|
||
#ifndef QTCONCURRENT_COMPILERTEST_H | ||
#define QTCONCURRENT_COMPILERTEST_H | ||
|
||
#include <QtConcurrent/qtconcurrent_global.h> | ||
|
||
#ifndef QT_NO_CONCURRENT | ||
|
||
QT_BEGIN_NAMESPACE | ||
|
||
namespace QtPrivate { | ||
|
||
template <class T, typename = void> | ||
struct IsIterable : std::false_type {}; | ||
template <class T> | ||
struct IsIterable<T, std::void_t<decltype(std::declval<T>().begin()), | ||
decltype(std::declval<T>().end())>> | ||
: std::true_type | ||
{ }; | ||
|
||
template <class T> | ||
inline constexpr bool IsIterableValue = IsIterable<T>::value; | ||
|
||
template <class T, typename = void> | ||
struct IsDereferenceable : std::false_type {}; | ||
template <class T> | ||
struct IsDereferenceable<T, std::void_t<decltype(*std::declval<T>())>> | ||
: std::true_type | ||
{ }; | ||
|
||
template <class T> | ||
inline constexpr bool IsDereferenceableValue = IsDereferenceable<T>::value; | ||
} | ||
|
||
QT_END_NAMESPACE | ||
|
||
#endif // QT_NO_CONCURRENT | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (C) 2022 The Qt Company Ltd. | ||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | ||
|
||
#ifndef QTCONCURRENTEXPORTS_H | ||
#define QTCONCURRENTEXPORTS_H | ||
|
||
#include <QtCore/qcompilerdetection.h> | ||
#include <QtCore/qtconfigmacros.h> // Q_CONCURRENT_EXPORT | ||
#include <QtCore/qtdeprecationmarkers.h> // QT_IF_DEPRECATED_SINCE | ||
|
||
#if defined(QT_SHARED) || !defined(QT_STATIC) | ||
# if defined(QT_BUILD_CONCURRENT_LIB) | ||
# define Q_CONCURRENT_EXPORT Q_DECL_EXPORT | ||
# else | ||
# define Q_CONCURRENT_EXPORT Q_DECL_IMPORT | ||
# endif | ||
#else | ||
# define Q_CONCURRENT_EXPORT | ||
#endif | ||
|
||
#if !defined(QT_BUILD_CONCURRENT_LIB) && !defined(QT_STATIC) | ||
/* outside library -> inline decl + defi */ | ||
/* static builds treat everything as part of the library, so they never inline */ | ||
# define QT_CONCURRENT_INLINE_SINCE(major, minor) inline | ||
# define QT_CONCURRENT_INLINE_IMPL_SINCE(major, minor) 1 | ||
#elif defined(QT_CONCURRENT_BUILD_REMOVED_API) | ||
/* inside library, inside removed_api.cpp: | ||
* keep deprecated API -> non-inline decl; | ||
* remove deprecated API -> inline decl; | ||
* definition is always available */ | ||
# define QT_CONCURRENT_INLINE_SINCE(major, minor) \ | ||
QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */) | ||
# define QT_CONCURRENT_INLINE_IMPL_SINCE(major, minor) 1 | ||
#else | ||
/* inside library, outside removed_api.cpp: | ||
* keep deprecated API -> non-inline decl, no defi; | ||
* remove deprecated API -> inline decl, defi */ | ||
# define QT_CONCURRENT_INLINE_SINCE(major, minor) \ | ||
QT_IF_DEPRECATED_SINCE(major, minor, inline, /* not inline */) | ||
# define QT_CONCURRENT_INLINE_IMPL_SINCE(major, minor) \ | ||
QT_IF_DEPRECATED_SINCE(major, minor, 1, 0) | ||
#endif | ||
|
||
#ifdef QT_CONCURRENT_BUILD_REMOVED_API | ||
# define QT_CONCURRENT_REMOVED_SINCE(major, minor) QT_DEPRECATED_SINCE(major, minor) | ||
#else | ||
# define QT_CONCURRENT_REMOVED_SINCE(major, minor) 0 | ||
#endif | ||
|
||
#endif // QTCONCURRENTEXPORTS_H |
Oops, something went wrong.