xentara-plugin v2.0.3
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::model::ForEachTaskFunction Class Reference

A function object used to iterate over all the tasks of an element. More...

#include <xentara/model/ForEachTaskFunction.hpp>

Public Types

using result_type = bool
 The result type.
 

Public Member Functions

template<std::invocable< const utils::core::Uuid &, std::string_view, const std::shared_ptr< process::Task > & > Callable>
 ForEachTaskFunction (Callable &&callable)
 Constructor that sets the callable to be called.
 
auto operator() (const utils::core::Uuid &uuid, std::string_view name, const std::shared_ptr< process::Task > &task) const -> bool
 Function call operator.
 
auto operator() (const process::Task::Role &role, const std::shared_ptr< process::Task > &task) const -> bool
 Function call operator that takes a task role instead of an explicit UUID and name.
 

Detailed Description

A function object used to iterate over all the tasks of an element.

See also
skill::Element::forEachTask()

Member Typedef Documentation

◆ result_type

The result type.

Constructor & Destructor Documentation

◆ ForEachTaskFunction()

template<std::invocable< const utils::core::Uuid &, std::string_view, const std::shared_ptr< process::Task > & > Callable>
xentara::model::ForEachTaskFunction::ForEachTaskFunction ( Callable &&  callable)

Constructor that sets the callable to be called.

Parameters
callableThe callable to be called for each task. The return type must be bool, and must evaluate to true to stop iterating over the tasks, or to false to continue iterating.

Member Function Documentation

◆ operator()() [1/2]

auto xentara::model::ForEachTaskFunction::operator() ( const process::Task::Role role,
const std::shared_ptr< process::Task > &  task 
) const -> bool

Function call operator that takes a task role instead of an explicit UUID and name.

Parameters
roleThe role of the task.
taskThe task itself.
Returns
Returns true to stop iterating over the tasks.

◆ operator()() [2/2]

auto xentara::model::ForEachTaskFunction::operator() ( const utils::core::Uuid uuid,
std::string_view  name,
const std::shared_ptr< process::Task > &  task 
) const -> bool

Function call operator.

Parameters
uuidThe UUID of the task.
nameThe name of the task.
taskThe task itself.
Returns
Returns true to stop iterating over the tasks.