memento
is following Memento design skeleton and is responsible for keeping track of not-yet-spawned skeletons. Skeletons can ask a spawner
to store their current state. The spawner
in turn asks its skeleton_manager
to store the state.
More...
|
bool | front_is_lazy () |
| the front element of the memento stack at times needs to stays untouched until some criteria is met. The entities that can remain untouched are called lazy. This method checks if the element is lazy. More...
|
|
std::size_t | size () const |
|
bool | is_empty () |
|
void | pop () |
|
template<typename Spawner , typename S , typename Coord , typename In , typename Out > |
void | record_state (Spawner spawner, S &skeleton, std::size_t lid_offset, Coord &skeleton_size, Coord &coord, In const &in, Out const &out, std::size_t cur_stage, bool is_lazy=false, bool front=false) |
| This method records the current state of a partially spawned skeleton in the memento double-ended queue of the skeleton_manager . More...
|
|
void | resume (bool ignore_lazyness=false) |
| This method resumes the spawning process of the front element of the memento dequeue as long as there is nothing else to do and the front element is not lazy. If all the elements of the memento double-ended queue are already resumed and there is nothing else left to do nothing will be done. More...
|
|
|
using | element_type = skeletons_impl::memento_element_base |
|
memento
is following Memento design skeleton and is responsible for keeping track of not-yet-spawned skeletons. Skeletons can ask a spawner
to store their current state. The spawner
in turn asks its skeleton_manager
to store the state.
- See also
- skeleton_manager::record_state
-
skeleton_manager::resume
◆ front_is_lazy()
bool stapl::skeletons::memento::front_is_lazy |
( |
| ) |
|
the front element of the memento stack at times needs to stays untouched until some criteria is met. The entities that can remain untouched are called lazy. This method checks if the element is lazy.
- Returns
- true only if the element on top of the memento stack is lazy
◆ record_state()
template<typename Spawner , typename S , typename Coord , typename In , typename Out >
void stapl::skeletons::memento::record_state |
( |
Spawner |
spawner, |
|
|
S & |
skeleton, |
|
|
std::size_t |
lid_offset, |
|
|
Coord & |
skeleton_size, |
|
|
Coord & |
coord, |
|
|
In const & |
in, |
|
|
Out const & |
out, |
|
|
std::size_t |
cur_stage, |
|
|
bool |
is_lazy = false , |
|
|
bool |
front = false |
|
) |
| |
This method records the current state of a partially spawned skeleton in the memento double-ended queue of the skeleton_manager
.
- Parameters
-
spawner | the spawner used for spawning the enclosed skeleton before pausing |
skeleton | the skeleton for which the state should be recorded |
lid_offset | the id offset of the skeleton after pausing |
skeleton_size | the size of the enclosed skeleton |
coord | the coordinate of the enclosed skeleton |
in | the input flow that should be passed to the enclosed skeleton upon continuation |
out | the output flow that should be passed to the enclosed skeleton upon continuation |
cur_stage | current stage of the paused skeleton. It is needed to determine the state upon resuming |
is_lazy | if this skeleton can stay untouched in the memento |
front | if this state should be inserted in the front of the memento double-ended queue |
◆ resume()
void stapl::skeletons::memento::resume |
( |
bool |
ignore_lazyness = false | ) |
|
This method resumes the spawning process of the front element of the memento dequeue as long as there is nothing else to do and the front element is not lazy. If all the elements of the memento double-ended queue are already resumed and there is nothing else left to do nothing will be done.
The skeleton manager which holds this memento stack will finish the spawning process if there is nothing left to spawn in this memento stack.
- Parameters
-
ignore_lazyness | if true, continue the spawning process even if the front element of the memento is lazy |
The documentation for this class was generated from the following files: