summaryrefslogtreecommitdiff
path: root/ACE/ace/Reactor.h
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2015-06-30 09:21:29 +0200
committerJohnny Willemsen <jwillemsen@remedy.nl>2015-06-30 09:21:29 +0200
commitea28a545402c6766a376b81ebe0922d0a0ab1d19 (patch)
tree0768941c3f7f1b46c84afd2ad77a75958db2d540 /ACE/ace/Reactor.h
parent59885c8648ae1015fc95091a7acea4f7f0b4008b (diff)
downloadATCD-ea28a545402c6766a376b81ebe0922d0a0ab1d19.tar.gz
Added support to schedule and reset timers using std::chrono::duration at the moment C++11 support is available
* ACE/ace/Reactor.h: * ACE/ace/Reactor_Timer_Interface.h: * ACE/tests/Reactor_Timer_Test.cpp:
Diffstat (limited to 'ACE/ace/Reactor.h')
-rw-r--r--ACE/ace/Reactor.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/ACE/ace/Reactor.h b/ACE/ace/Reactor.h
index fa2759f2abd..b7b8eb005e1 100644
--- a/ACE/ace/Reactor.h
+++ b/ACE/ace/Reactor.h
@@ -578,7 +578,19 @@ public:
const ACE_Time_Value &delay,
const ACE_Time_Value &interval =
ACE_Time_Value::zero);
-
+#if defined (ACE_HAS_CPP11)
+ template<class Rep1, class Period1, class Rep2 = int, class Period2 = std::ratio<1>>
+ long schedule_timer (ACE_Event_Handler *event_handler,
+ const void *arg,
+ const std::chrono::duration<Rep1, Period1>& delay,
+ const std::chrono::duration<Rep2, Period2>& interval =
+ std::chrono::duration<Rep2, Period2>::zero ())
+ {
+ ACE_Time_Value const tv_delay (delay);
+ ACE_Time_Value const tv_interval (interval);
+ return this->schedule_timer (event_handler, arg, tv_delay, tv_interval);
+ }
+#endif
/**
* Reset recurring timer interval.
*
@@ -592,6 +604,15 @@ public:
*/
virtual int reset_timer_interval (long timer_id,
const ACE_Time_Value &interval);
+#if defined (ACE_HAS_CPP11)
+ template<class Rep, class Period>
+ int reset_timer_interval (long timer_id,
+ const std::chrono::duration<Rep, Period>& interval)
+ {
+ ACE_Time_Value const tv_interval (interval);
+ return this->reset_timer_interval (timer_id, tv_interval);
+ }
+#endif
/**
* Cancel timer.