summaryrefslogtreecommitdiff
path: root/examples/APG/Timers/CB.h
blob: 716ad4e4f50a1207b030a9590d106588210ecf7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* -*- C++ -*- */
// $Id$

#if !defined(CB_H)
#define CB_H

#include "ace/Event_Handler.h"

#include "TimerDispatcher.h"

// Listing 1 code/ch20
class CB : public ACE_Event_Handler
{
public:
  CB ();

  // Set the timer id that is being handled by this instance.
  void setID (long timerID);

  // Get the timer id.
  long getID (void);

  // Handle the timeout.
  virtual int handle_timeout(const ACE_Time_Value &tv, 
			     const void *arg = 0);

  virtual int handle_close (ACE_HANDLE handle,
                            ACE_Reactor_Mask close_mask);

private:
  long timerID_;
  int count_;
};
// Listing 1

#endif /*CB_H*/