Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Xt_Stopwatch / timer.h
bloba9fd30dc470a46c6d2d218b7a2e9a55838ebb54d
2 //=============================================================================
3 /**
4 * @file timer.h
6 * @author Bala <bala@cs.wustl.edu>
7 */
8 //=============================================================================
11 #ifndef TIMER_H
12 #define TIMER_H
14 #include "Stopwatch_display.h"
17 #include <Xm/Xm.h>
20 class Timer_imp
22 public:
23 /// Constructor
24 Timer_imp (XtAppContext &,
25 CORBA::Long,
26 Stopwatch_display *);
28 /// Destructor
29 virtual ~Timer_imp ();
31 /// Resets, and starts the clock ticking
32 void start ();
34 /// Stops the clock
35 void stop ();
37 /// Returns time since timer started
38 CORBA::Float elapsed_time ();
40 private:
41 /// Static member function used for TimeOut callback.
42 static void tick_callback (XtPointer,
43 XtIntervalId *);
45 /// Called every interval_ milliseconds
46 void tick ();
48 /// Called at each clock tick...
49 virtual void report_time (CORBA::Float);
51 /// A copy of the stopwatch object
52 Stopwatch_display *stopwatch_;
54 /// Current number of ticks
55 CORBA::Long counter_;
57 /// Time in milliseconds between updates
58 CORBA::Long interval_;
60 /// Identifier of current TimeOut
61 XtIntervalId id_;
63 /// Required by Xt functions
64 XtAppContext app_;
68 #endif /* TIMER_H */