Also use Objects as part of an operation but as a result don't generate Any operation...
[ACE_TAO.git] / ACE / ace / Reactor_Timer_Interface.h
blob3000d93b1d0d915317617e5dc09eddebe2737633
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Reactor_Timer_Interface.h
7 * @author Irfan Pyarali <irfan@oomworks.com>
8 */
9 //=============================================================================
11 #ifndef ACE_REACTOR_TIMER_INTERFACE_H
12 #define ACE_REACTOR_TIMER_INTERFACE_H
14 #include /**/ "ace/pre.h"
16 #include "ace/Time_Value.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 class ACE_Event_Handler;
26 /**
27 * @class ACE_Reactor_Timer_Interface
29 * @brief Interface for timer related methods on the Reactor.
31 class ACE_Export ACE_Reactor_Timer_Interface
33 public:
34 virtual ~ACE_Reactor_Timer_Interface (void);
36 virtual long schedule_timer (ACE_Event_Handler *event_handler,
37 const void *arg,
38 const ACE_Time_Value &delay,
39 const ACE_Time_Value &interval = ACE_Time_Value::zero) = 0;
41 #if defined (ACE_HAS_CPP11)
42 template<class Rep1, class Period1, class Rep2 = int, class Period2 = std::ratio<1>>
43 long schedule_timer (ACE_Event_Handler *event_handler,
44 const void *arg,
45 const std::chrono::duration<Rep1, Period1>& delay,
46 const std::chrono::duration<Rep2, Period2>& interval = std::chrono::duration<Rep2, Period2>::zero ())
48 ACE_Time_Value const tv_delay (delay);
49 ACE_Time_Value const tv_interval (interval);
50 return this->schedule_timer (event_handler, arg, tv_delay, tv_interval);
52 #endif
54 virtual int reset_timer_interval (long timer_id,
55 const ACE_Time_Value &interval) = 0;
56 #if defined (ACE_HAS_CPP11)
57 template<class Rep, class Period>
58 int reset_timer_interval (long timer_id,
59 const std::chrono::duration<Rep, Period>& interval)
61 ACE_Time_Value const tv_interval (interval);
62 return this->reset_timer_interval (timer_id, tv_interval);
64 #endif
66 virtual int cancel_timer (long timer_id,
67 const void **arg = 0,
68 int dont_call_handle_close = 1) = 0;
70 virtual int cancel_timer (ACE_Event_Handler *event_handler,
71 int dont_call_handle_close = 1) = 0;
75 ACE_END_VERSIONED_NAMESPACE_DECL
77 #include /**/ "ace/post.h"
79 #endif /* ACE_REACTOR_TIMER_INTERFACE_H */