Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
Tasking::GroupItem Class Reference

\typealias Tasking::GroupItems More...

#include <tasktree.h>

Inheritance diagram for Tasking::GroupItem:
Collaboration diagram for Tasking::GroupItem:

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 GroupItems &children)
 Constructs a GroupItem element with a given list of items.
 GroupItem (std::initializer_list< GroupItem > children)

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 (const Loop &loop)
 GroupItem ()=default
 GroupItem (Type type)
 GroupItem (const GroupData &data)
 GroupItem (const TaskHandler &handler)
void addChildren (const GroupItems &children)

Static Protected Member Functions

static GroupItem groupHandler (const GroupHandler &handler)
template<typename Result, typename Function, typename ... Args, typename DecayedFunction = std::decay_t<Function>>
static constexpr bool isInvocable ()

Friends

class ContainerNode
class TaskNode
class TaskTreePrivate
class ParallelLimitFunctor
class WorkflowPolicyFunctor
TASKING_EXPORT friend Group operator>> (const For &forItem, const Do &doItem)

Detailed Description

\typealias Tasking::GroupItems

Type alias for QList<GroupItem>.

\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

Definition at line 225 of file tasktree.h.

Member Typedef Documentation

◆ GroupDoneHandler

Definition at line 231 of file tasktree.h.

◆ GroupSetupHandler

Definition at line 229 of file tasktree.h.

◆ InterfaceCreateHandler

using Tasking::GroupItem::InterfaceCreateHandler = std::function<TaskInterface *(void)>
protected

Definition at line 245 of file tasktree.h.

◆ InterfaceDoneHandler

using Tasking::GroupItem::InterfaceDoneHandler = std::function<DoneResult(const TaskInterface &, DoneWith)>
protected

Definition at line 249 of file tasktree.h.

◆ InterfaceSetupHandler

Definition at line 247 of file tasktree.h.

Member Enumeration Documentation

◆ Type

enum class Tasking::GroupItem::Type
strongprotected
Enumerator
List 
Group 
GroupData 
Storage 
TaskHandler 

Definition at line 271 of file tasktree.h.

Constructor & Destructor Documentation

◆ GroupItem() [1/8]

template<typename StorageStruct>
Tasking::GroupItem::GroupItem ( const Storage< StorageStruct > & storage)
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.

See also
{Tasking::Storage} {Storage}

Definition at line 234 of file tasktree.h.

References GroupItem(), and Storage.

Referenced by GroupItem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GroupItem() [2/8]

Tasking::GroupItem::GroupItem ( const GroupItems & items)
inline

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:

static QList<GroupItems> getItems();
...
const Group root {
getItems(), // OK, getItems() list is wrapped into a single GroupItem element
};
Definition qlist.h:80
const GroupItem finishAllAndSuccess
const GroupItem parallel
static GroupItem onGroupSetup(Handler &&handler)
\typealias Tasking::GroupItem::GroupSetupHandler
Definition tasktree.h:441
static GroupItem onGroupDone(Handler &&handler, CallDoneIf callDoneIf=CallDoneIf::SuccessOrError)
Constructs a group's element holding the group done handler.
Definition tasktree.h:447

If you want to create a subtree, use \l {Tasking::Group} {Group} instead.

Note
Don't confuse this 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.
See also
{Tasking::Group} {Group}

Definition at line 239 of file tasktree.h.

References List.

◆ GroupItem() [3/8]

Tasking::GroupItem::GroupItem ( std::initializer_list< GroupItem > children)
inline

Definition at line 240 of file tasktree.h.

References List.

◆ GroupItem() [4/8]

Tasking::GroupItem::GroupItem ( const Loop & loop)
inlineprotected

Definition at line 243 of file tasktree.h.

References GroupItem().

Here is the call graph for this function:

◆ GroupItem() [5/8]

Tasking::GroupItem::GroupItem ( )
protecteddefault

◆ GroupItem() [6/8]

Tasking::GroupItem::GroupItem ( Type type)
inlineprotected

Definition at line 280 of file tasktree.h.

◆ GroupItem() [7/8]

Tasking::GroupItem::GroupItem ( const GroupData & data)
inlineprotected

Definition at line 281 of file tasktree.h.

References GroupItem(), and GroupData.

Referenced by GroupItem(), and GroupItem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GroupItem() [8/8]

Tasking::GroupItem::GroupItem ( const TaskHandler & handler)
inlineprotected

Definition at line 284 of file tasktree.h.

References GroupItem(), and TaskHandler.

Referenced by Tasking::ExecutableItem::ExecutableItem(), and GroupItem().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ addChildren()

void GroupItem::addChildren ( const GroupItems & children)
protected

Definition at line 1475 of file tasktree.cpp.

References Group, and List.

◆ groupHandler()

GroupItem Tasking::GroupItem::groupHandler ( const GroupHandler & handler)
inlinestaticprotected

Definition at line 289 of file tasktree.h.

Referenced by Tasking::Group::onGroupDone(), and Tasking::Group::onGroupSetup().

Here is the caller graph for this function:

◆ isInvocable()

template<typename Result, typename Function, typename ... Args, typename DecayedFunction = std::decay_t<Function>>
constexpr bool Tasking::GroupItem::isInvocable ( )
inlinestaticconstexprprotected

Definition at line 294 of file tasktree.h.

◆ ContainerNode

friend class ContainerNode
friend

Definition at line 304 of file tasktree.h.

◆ operator>>

TASKING_EXPORT friend Group operator>> ( const For & forItem,
const Do & doItem )
friend

Definition at line 1294 of file tasktree.cpp.

◆ ParallelLimitFunctor

friend class ParallelLimitFunctor
friend

Definition at line 307 of file tasktree.h.

◆ TaskNode

friend class TaskNode
friend

Definition at line 305 of file tasktree.h.

◆ TaskTreePrivate

friend class TaskTreePrivate
friend

Definition at line 306 of file tasktree.h.

◆ WorkflowPolicyFunctor

friend class WorkflowPolicyFunctor
friend

Definition at line 308 of file tasktree.h.


The documentation for this class was generated from the following files: