Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / APG / Timers / CB.h
blobd05154a876fb32c4c4131ed03377e491b5c93a22
1 /* -*- C++ -*- */
2 #if !defined(CB_H)
3 #define CB_H
5 #include "ace/Event_Handler.h"
7 #include "TimerDispatcher.h"
9 // Listing 1 code/ch20
10 class CB : public ACE_Event_Handler
12 public:
13 CB ();
15 // Set the timer id that is being handled by this instance.
16 void setID (long timerID);
18 // Get the timer id.
19 long getID ();
21 // Handle the timeout.
22 virtual int handle_timeout(const ACE_Time_Value &tv,
23 const void *arg = 0);
25 virtual int handle_close (ACE_HANDLE handle,
26 ACE_Reactor_Mask close_mask);
28 private:
29 long timerID_;
30 int count_;
32 // Listing 1
34 #endif /*CB_H*/