00001 // -*- C++ -*- 00002 00003 /** 00004 * @file Timer_Reactor.h 00005 * 00006 * $Id: Timer_Reactor.h 81422 2008-04-24 12:33:29Z johnnyw $ 00007 * 00008 * @author Pradeep Gore <pradeep@oomworks.com> 00009 */ 00010 00011 #ifndef TAO_Notify_TIMER_REACTOR_H 00012 #define TAO_Notify_TIMER_REACTOR_H 00013 #include /**/ "ace/pre.h" 00014 00015 #include "orbsvcs/Notify/notify_serv_export.h" 00016 #include "orbsvcs/Notify/Timer.h" 00017 00018 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00019 # pragma once 00020 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00021 00022 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00023 class ACE_Reactor; 00024 ACE_END_VERSIONED_NAMESPACE_DECL 00025 00026 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00027 00028 /** 00029 * @class TAO_Notify_Timer_Reactor 00030 * 00031 * @brief Reactor::instance based timer. The timers are dispatched by 00032 * the main thread. 00033 */ 00034 class TAO_Notify_Serv_Export TAO_Notify_Timer_Reactor : public TAO_Notify_Timer 00035 { 00036 public: 00037 typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_Timer_Reactor > Ptr; 00038 00039 /// Constructor 00040 TAO_Notify_Timer_Reactor (void); 00041 00042 /// Destructor 00043 virtual ~TAO_Notify_Timer_Reactor (); 00044 00045 /// Schedule a timer 00046 virtual long schedule_timer (ACE_Event_Handler *handler, 00047 const ACE_Time_Value &delay_time, 00048 const ACE_Time_Value &interval); 00049 00050 /// Cancel Timer 00051 virtual int cancel_timer (long timer_id); 00052 00053 protected: 00054 /// The instance reactor that we use. 00055 ACE_Reactor* reactor_; 00056 00057 private: 00058 /// Release 00059 virtual void release (void); 00060 }; 00061 00062 TAO_END_VERSIONED_NAMESPACE_DECL 00063 00064 #include /**/ "ace/post.h" 00065 #endif /* TAO_Notify_TIMER_REACTOR_H */