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

Custom PARAGRAPH termination detection which signals termination after a predefined number of invocations of the receive_notify method. More...

Public Member Functions

 counter_based_terminator (size_type count=2)
 
bool operator() (void)
 Starting function required by executor for terminators. Noop for this terminator. More...
 
void receive_notify (void)
 Invokes base class method terminator_base::call_notifier() after the defined number of invocations.
 
size_type iterations (void) const noexcept override
 Returns the number of times the terminator has iterated.
 
template<typename Notifier >
void set_notifier (Notifier &&notifier)
 Sets the function to be called when termination is detected.
 

Public Types

using size_type = std::size_t
 

Protected Member Functions

void call_notifier (void) const
 Calls the registered notifier when the terminator has finished.
 

Detailed Description

Custom PARAGRAPH termination detection which signals termination after a predefined number of invocations of the receive_notify method.

Used by composition::nest_map_mr_factory to tie termination to the completion of a predefined set of PARAGRAPH task completions.

Member Function Documentation

◆ operator()()

bool stapl::detail::counter_based_terminator::operator() ( void  )
virtual

Starting function required by executor for terminators. Noop for this terminator.

Returns
true if receive_notify() has been called the required number of times, otherwise false.

Implements stapl::terminator_base.


The documentation for this class was generated from the following file: