summaryrefslogtreecommitdiff
path: root/TAO/examples/Callback_Quoter/Supplier_Timer_Handler.h
blob: 51385d299294392ad86b6be4a86ce35a44ee10da (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* -*- C++ -*- */
// $Id$

// ===========================================================
//
//
// = LIBRARY
//    TAO/examples/Callback_Quoter
//
// = FILENAME
//    Consumer_Input_Handler.h
//
// = DESCRIPTION
//    Definition of the Supplier_Timer_Handler class.
//
// = AUTHOR
//    Kirthika Parameswaran <kirthika@cs.wustl.edu>
//
// ===========================================================

#ifndef SUPPLIER_TIMER_HANDLER_H
#define SUPPLIER_TIMER_HANDLER_H
#include "ace/Reactor.h"
#include "ace/Timer_Queue.h"
#include "ace/Event_Handler.h"
#include "Supplier_i.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

// Creating a class to handle timer  events.
// Since only timer events need to be handled, only the handle_timeout
// method is overlaoded.

class Supplier;
class Supplier_Timer_Handler : public ACE_Event_Handler
{
  // = TITLE
  //    Callback Quoter Supplier Timer Handler  class.
  //
  // = Description
  //    Feeds stock information to the Callback Quoter notifier
  //    periodically.

public:

  Supplier_Timer_Handler (Supplier *supplier,ACE_Reactor *reactor);
  // initilization.

  ~Supplier_Timer_Handler (void);
  // destructor
 
  virtual int handle_timeout (const ACE_Time_Value &tv,
                              const void *arg = 0);
  // Method which will be called by the Reactor when timeout
  // occurs.

private:

  Supplier *supplier_obj_;
  // the supplier instance.

  ACE_Reactor *reactor_;
  // reactor used by the supplier.
};

#endif /* SUPPLIER_TIMER_HANDLER_H */