|
template<typename Graph , typename Iter , typename Rule > |
void | apply_async (Iter it_begin, Iter it_end, Graph &&g, Rule &&rule) |
| Apply a rule asynchronously. More...
|
|
template<typename Iter , typename Graph , typename Rule > |
void | apply_sync (Iter it_begin, Iter it_end, Graph &&g, Rule &&rule) |
| Apply a rule synchronously. More...
|
|
template<IterateOver iterate_over, typename Graph > |
decltype(auto) | iterator_pair (const Graph &g) |
| Get an iterator pair over selected graph entities. More...
|
|
template<IterateOver iterate_over, typename Graph , typename EntityDesc > |
decltype(auto) | iterator_pair (EntityDesc e, const Graph &g) |
| Get an iterator pair over selected graph entities. More...
|
|
template<typename Iter , typename Graph , typename Rule >
void Utopia::GraphUtils::apply_sync |
( |
Iter |
it_begin, |
|
|
Iter |
it_end, |
|
|
Graph && |
g, |
|
|
Rule && |
rule |
|
) |
| |
Apply a rule synchronously.
This helper function applies a rule to a range of entities that is given through an iterator pair. A state cache is created that stores the returned states of the rule function. After the rule was applied to each graph entity within the iterator range the cached states are moved to the actual states of the graph entities, thus, updating their states synchronously.
- Template Parameters
-
Iter | The iterator type |
Graph | The graph type |
Rule | The rule type |
- Parameters
-
it_begin | The begin of the graph entity iterator range. |
it_end | The end of the graph entity iterator range. |
g | The graph |
rule | The rule function to be applied to each element within the iterator range. |
- Warning
- Be careful to not operate directly on the state of a graph entity within the rule function. Rather, first create a copy of the state and return the copied and changed state at the end of the function.