24 #ifndef PPL_Threshold_Watcher_templates_hh
25 #define PPL_Threshold_Watcher_templates_hh 1
29 template <
typename Traits>
35 return init.pending.insert(threshold, handler, expired_flag);
38 template <
typename Traits>
43 if (init.pending.empty()) {
44 Traits::check_function = 0;
49 template <
typename Traits>
52 remove_threshold(pending_position);
57 template <
typename Traits>
61 assert(i != init.pending.end());
62 const typename Traits::Threshold& current = Traits::get();
63 while (!Traits::less_than(current, i->deadline())) {
65 i->expired_flag() =
true;
66 i = remove_threshold(i);
67 if (i == init.pending.end()) {
75 #endif // !defined(PPL_Threshold_Watcher_templates_hh)
Abstract base class for handlers of the watchdog events.
static TW_Pending_List::iterator add_threshold(typename Traits::Threshold threshold, const TW_Handler &handler, bool &expired_flag)
static void check()
Check threshold reaching.
A class providing iterators for embedded lists.
The entire library is confined to this namespace.
static TW_Pending_List::iterator remove_threshold(typename TW_Pending_List::iterator position)
EList< Pending_Element< typename Traits::Threshold > >::iterator iterator
A non-const iterator to traverse the list.