24 #ifndef PPL_Pending_List_templates_hh
25 #define PPL_Pending_List_templates_hh 1
31 namespace Implementation {
35 template <
typename Traits>
36 typename Pending_List<Traits>::iterator
40 iterator position = active_list.begin();
41 for (
iterator active_list_end = active_list.end();
42 position != active_list_end
43 && Traits::less_than(position->deadline(), deadline);
48 if (free_list.empty()) {
55 pending_element_p = free_list.begin();
56 free_list.erase(pending_element_p);
57 pending_element_p->assign(deadline, handler, expired_flag);
59 iterator r = active_list.insert(position, *pending_element_p);
64 template <
typename Traits>
67 if (!active_list.OK()) {
70 if (!free_list.OK()) {
74 const typename Traits::Threshold* old;
78 for (
const_iterator active_list_end = active_list.end(); i != active_list_end; ++i) {
79 const typename Traits::Threshold& t = i->deadline();
80 if (Traits::less_than(t, *old)) {
82 std::cerr <<
"The active list is not sorted!"
98 #endif // !defined(PPL_Pending_List_templates_hh)
A class for pending watchdog events with embedded links.
Abstract base class for handlers of the watchdog events.
A class providing iterators for embedded lists.
bool OK() const
Checks if all the invariants are satisfied.
The entire library is confined to this namespace.
iterator insert(const typename Traits::Threshold &deadline, const Handler &handler, bool &expired_flag)
Inserts a new Pending_Element object with the given attributes.