3 //=============================================================================
5 * @file Supplier_Timer_Handler.h
7 * Definition of the Supplier_Timer_Handler class.
9 * @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
11 //=============================================================================
14 #ifndef SUPPLIER_TIMER_HANDLER_H
15 #define SUPPLIER_TIMER_HANDLER_H
16 #include "ace/Reactor.h"
17 #include "ace/Timer_Queue.h"
18 #include "ace/Event_Handler.h"
19 #include "Supplier_i.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
28 * @class Supplier_Timer_Handler
30 * @brief Feeds stock information to the Callback Quoter notifier
33 * Create a class to handle timer events. Since only timer events
34 * need to be handled, only the handle_timeout method is overlaoded.
36 class Supplier_Timer_Handler
: public ACE_Event_Handler
40 Supplier_Timer_Handler (Supplier
*supplier
,
45 ~Supplier_Timer_Handler (void);
47 /// Method which will be called by the Reactor when timeout occurs.
48 virtual int handle_timeout (const ACE_Time_Value
&tv
,
53 /// The values of the stock and its rate are got from the file.
54 int get_stock_information (void);
56 /// The supplier instance.
57 Supplier
*supplier_obj_
;
59 /// Reactor used by the supplier.
60 ACE_Reactor
*reactor_
;
62 /// The file handle of the file from where the stock input is obtained.
65 /// The name of the stock.
66 char stockname_
[BUFSIZ
];
68 /// The market value of the stock.It will be typecasted to long later.
72 #endif /* SUPPLIER_TIMER_HANDLER_H */