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

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

#include <xentara/model/ForEachEventFunction.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::Event > & > Callable>
 ForEachEventFunction (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::Event > &event) const -> bool
 Function call operator.
 
auto operator() (const process::Event::Role &role, const std::shared_ptr< process::Event > &event) const -> bool
 Function call operator that takes an event role instead of an explicit UUID and name.
 
auto operator() (const model::Attribute &attribute, const std::shared_ptr< process::Event > &event) const -> bool
 Function call operator for an attribute change event.
 
auto operator() (const model::Attribute::Role &attributeRole, const std::shared_ptr< process::Event > &event) const -> bool
 Function call operator for an attribute change event using an attribute role.
 

Detailed Description

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

See also
skill::Element::forEachEvent()

Member Typedef Documentation

◆ result_type

Constructor & Destructor Documentation

◆ ForEachEventFunction()

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

Constructor that sets the callable to be called.

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

Member Function Documentation

◆ operator()() [1/4]

auto xentara::model::ForEachEventFunction::operator() ( const model::Attribute attribute,
const std::shared_ptr< process::Event > &  event 
) const -> bool

Function call operator for an attribute change event.

Parameters
attributeThe attribute whose change the event signals.
eventThe event itself.

◆ operator()() [2/4]

auto xentara::model::ForEachEventFunction::operator() ( const model::Attribute::Role attributeRole,
const std::shared_ptr< process::Event > &  event 
) const -> bool

Function call operator for an attribute change event using an attribute role.

Parameters
attributeRoleThe role of the attribute whose change the event signals.
eventThe event itself.

◆ operator()() [3/4]

auto xentara::model::ForEachEventFunction::operator() ( const process::Event::Role role,
const std::shared_ptr< process::Event > &  event 
) const -> bool

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

Parameters
roleThe role of the event.
eventThe event itself.
Returns
Returns true to stop iterating over the events.

◆ operator()() [4/4]

auto xentara::model::ForEachEventFunction::operator() ( const utils::core::Uuid uuid,
std::string_view  name,
const std::shared_ptr< process::Event > &  event 
) const -> bool

Function call operator.

Parameters
uuidThe UUID of the event.
nameThe name of the event.
eventThe event itself.
Returns
Returns true to stop iterating over the events.