![]() |
Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
\inheaderfile solutions/tasking/tasktree.h \inmodule TaskingSolution More...
#include <tasktree.h>
Classes | |
struct | GroupData |
struct | GroupHandler |
struct | TaskHandler |
Public Types | |
using | GroupSetupHandler = std::function<SetupResult()> |
using | GroupDoneHandler = std::function<DoneResult(DoneWith)> |
Public Member Functions | |
template<typename StorageStruct > | |
GroupItem (const Storage< StorageStruct > &storage) | |
Constructs a GroupItem element holding the storage object. | |
GroupItem (const Loop &loop) | |
GroupItem (const QList< GroupItem > &children) | |
Constructs a GroupItem element with a given list of items. | |
GroupItem (std::initializer_list< GroupItem > children) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Protected Types | |
enum class | Type { List , Group , GroupData , Storage , TaskHandler } |
using | InterfaceCreateHandler = std::function<TaskInterface *(void)> |
using | InterfaceSetupHandler = std::function<SetupResult(TaskInterface &)> |
using | InterfaceDoneHandler = std::function<DoneResult(const TaskInterface &, DoneWith)> |
Protected Member Functions | |
GroupItem ()=default | |
GroupItem (Type type) | |
GroupItem (const GroupData &data) | |
GroupItem (const TaskHandler &handler) | |
void | addChildren (const QList< GroupItem > &children) |
Static Protected Member Functions | |
static GroupItem | groupHandler (const GroupHandler &handler) |
static GroupItem | parallelLimit (int limit) |
static GroupItem | workflowPolicy (WorkflowPolicy policy) |
template<typename Result , typename Function , typename ... Args, typename DecayedFunction = std::decay_t<Function>> | |
static constexpr bool | isInvocable () |
Friends | |
class | ContainerNode |
class | TaskNode |
class | TaskTreePrivate |
\inheaderfile solutions/tasking/tasktree.h \inmodule TaskingSolution
GroupItem represents the basic element that may be a part of any Group. \reentrant
GroupItem is a basic element that may be a part of any \l {Tasking::Group} {Group}. It encapsulates the functionality provided by any GroupItem's subclass. It is a value type and it is safe to copy the GroupItem instance, even when it is originally created via the subclass' constructor.
There are four main kinds of GroupItem: \table \header
ConcurrentCallTask<ResultType>
or NetworkQueryTask
. Asynchronous tasks are the main reason for using a task tree. \row Definition at line 208 of file tasktree.h.
using Tasking::GroupItem::GroupDoneHandler = std::function<DoneResult(DoneWith)> |
Definition at line 214 of file tasktree.h.
using Tasking::GroupItem::GroupSetupHandler = std::function<SetupResult()> |
Definition at line 212 of file tasktree.h.
|
protected |
Definition at line 229 of file tasktree.h.
|
protected |
Definition at line 233 of file tasktree.h.
|
protected |
Definition at line 231 of file tasktree.h.
|
strongprotected |
Enumerator | |
---|---|
List | |
Group | |
GroupData | |
Storage | |
TaskHandler |
Definition at line 255 of file tasktree.h.
|
inline |
Constructs a GroupItem
element holding the storage object.
When the \l {Tasking::Group} {Group} element containing this GroupItem is entered by the running task tree, an instance of the StorageStruct
is created dynamically.
When that group is about to be left after its execution, the previously instantiated StorageStruct
is deleted.
The dynamically created instance of StorageStruct
is accessible from inside any handler body of the parent \l {Tasking::Group} {Group} element, including nested groups and its tasks, via the \l {Tasking::Storage::operator->()} {Storage::operator->()}, \l {Tasking::Storage::operator*()} {Storage::operator*()}, or Storage::activeStorage() method.
Definition at line 217 of file tasktree.h.
|
inline |
Definition at line 221 of file tasktree.h.
Constructs a GroupItem
element with a given list of items.
When this GroupItem
element is parsed by the TaskTree, it is simply replaced with its items.
This constructor is useful when constructing a \l {Tasking::Group} {Group} element with lists of GroupItem
elements:
If you want to create a subtree, use \l {Tasking::Group} {Group} instead.
GroupItem
with the \l {Tasking::Group} {Group} element, as \l {Tasking::Group} {Group} keeps its children nested after being parsed by the task tree, while this GroupItem
does not.Definition at line 224 of file tasktree.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 225 of file tasktree.h.
|
protecteddefault |
|
inlineprotected |
Definition at line 264 of file tasktree.h.
|
inlineprotected |
Definition at line 265 of file tasktree.h.
|
inlineprotected |
Definition at line 268 of file tasktree.h.
Definition at line 1355 of file tasktree.cpp.
References addChildren(), child, Tasking::GroupItem::GroupHandler::m_callDoneIf, Tasking::GroupItem::GroupHandler::m_doneHandler, Tasking::GroupItem::GroupData::m_groupHandler, Tasking::GroupItem::GroupData::m_loop, Tasking::GroupItem::GroupData::m_parallelLimit, Tasking::GroupItem::GroupHandler::m_setupHandler, Tasking::GroupItem::GroupData::m_workflowPolicy, QT_ASSERT, qWarning, and storage.
Referenced by addChildren().
|
inlinestaticprotected |
Definition at line 273 of file tasktree.h.
|
inlinestaticconstexprprotected |
Definition at line 280 of file tasktree.h.
|
inlinestaticprotected |
Definition at line 274 of file tasktree.h.
|
inlinestaticprotected |
Definition at line 275 of file tasktree.h.
References policy.
|
friend |
Definition at line 289 of file tasktree.h.
|
friend |
Definition at line 290 of file tasktree.h.
|
friend |
Definition at line 291 of file tasktree.h.