summaryrefslogtreecommitdiff
path: root/TAO/examples/AMH/Sink_Server/Timer_Handler.h
blob: 191c52e20740111d07b222b2787da93e9a7e9ef8 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// -*- C++ -*-

// =========================================================================
/**
 *  @file  Timer_Handler.h
 *
 *  $Id$
 *
 *  @desc  Fires servant upcall after a specified period of delay
 *
 *  @author Mayur Deshpande <mayur@ics.uci.edu>
 *
 */
// =========================================================================

#ifndef TIMER_HANDLER_H
#define TIMER_HANDLER_H

#include "ace/Timer_Queue.h"
#include "TestS.h"

// @@ Mayur, please do not program like a Java programmer.  Please
//    move the class declaration to a separate header file, and keep
//    the implementation code in this file.
//
// Mayur: Okie.  I thought it would be easier if everything was
// present in a single file because this class is small.  Of course,
// if this class grows big (which shouldn't happen), that might be a
// problem.

class Timer_Handler : public ACE_Event_Handler
{
public:

  Timer_Handler (Test::AMH_RoundtripResponseHandler_ptr rh, 
                 Test::Timestamp send_time);

  virtual int handle_timeout (const ACE_Time_Value &,
                              const void *);

  virtual int handle_close (ACE_HANDLE handle,
                            ACE_Reactor_Mask mask);

private:
  // Store the RH and the parameter that we send back to the client.
  // We create one Timer_Handler instance for each RH.
  Test::AMH_RoundtripResponseHandler_ptr rh_;
  Test::Timestamp send_time_;
};

#endif /* TIMER_HANDLER_H */