24 #ifndef PPL_Threshold_Watcher_inlines_hh
25 #define PPL_Threshold_Watcher_inlines_hh 1
32 template <
typename Traits>
33 template <
typename Flag_Base,
typename Flag>
36 const Flag_Base*
volatile& holder,
40 Implementation::
Watchdog::Handler_Flag<Flag_Base, Flag>(holder,
42 typename Traits::Threshold threshold;
43 Traits::from_delta(threshold, delta);
44 if (!Traits::less_than(Traits::get(), threshold)) {
45 throw std::invalid_argument(
"Threshold_Watcher constructor called with a"
46 " threshold already reached");
48 pending_position = add_threshold(threshold, handler, expired);
51 template <
typename Traits>
56 handler(*new Implementation::
Watchdog::Handler_Function(function)) {
57 typename Traits::Threshold threshold;
58 Traits::from_delta(threshold, delta);
59 if (!Traits::less_than(Traits::get(), threshold)) {
60 throw std::invalid_argument(
"Threshold_Watcher constructor called with a"
61 " threshold already reached");
63 pending_position = add_threshold(threshold, handler, expired);
68 #endif // !defined(PPL_Threshold_Watcher_inlines_hh)
Threshold_Watcher(const typename Traits::Delta &delta, const Flag_Base *volatile &holder, Flag &flag)
The entire library is confined to this namespace.