STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types
stapl::skeletons::memento Class Reference

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...

Public Member Functions

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...
 

Public Types

using element_type = skeletons_impl::memento_element_base
 

Detailed Description

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

Member Function Documentation

◆ 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
spawnerthe spawner used for spawning the enclosed skeleton before pausing
skeletonthe skeleton for which the state should be recorded
lid_offsetthe id offset of the skeleton after pausing
skeleton_sizethe size of the enclosed skeleton
coordthe coordinate of the enclosed skeleton
inthe input flow that should be passed to the enclosed skeleton upon continuation
outthe output flow that should be passed to the enclosed skeleton upon continuation
cur_stagecurrent stage of the paused skeleton. It is needed to determine the state upon resuming
is_lazyif this skeleton can stay untouched in the memento
frontif 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_lazynessif 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: