Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / tests / AMI_Timeouts / timeout_i.h
blobe15ae5330233f3e0c8cf2b0be9f4a6bc2f22d1a0
1 //=============================================================================
2 /**
3 * @file timeout_i.h
5 * Implements the CORBA object.
7 * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
8 */
9 //=============================================================================
11 #ifndef TIMEOUT_I_H
12 #define TIMEOUT_I_H
14 #include "ace/High_Res_Timer.h"
15 #include "timeoutS.h"
17 class Timeout_i
18 : public POA_TimeoutObj
20 public:
21 Timeout_i (CORBA::ORB_ptr orb);
23 ~Timeout_i () = default;
25 virtual void sendTimeToWait (CORBA::Long msec);
27 virtual void shutdown ();
29 private:
30 CORBA::ORB_var orb_;
33 class TimeoutHandler_i
34 : public POA_AMI_TimeoutObjHandler
36 public:
37 TimeoutHandler_i ();
39 ~TimeoutHandler_i () = default;
41 virtual void sendTimeToWait ();
43 virtual void sendTimeToWait_excep (
44 ::Messaging::ExceptionHolder * excep_holder);
46 void reset_reply_counter ();
48 void reset_reply_excep_counter ();
50 unsigned short reply_counter ();
52 unsigned short reply_excep_counter ();
54 /// Start the time measurement
55 void start ();
57 /// Return the elapsed time
58 ACE_Time_Value &elapsed_time ();
60 private:
61 unsigned short reply_counter_;
63 unsigned short reply_excep_counter_;
65 ACE_High_Res_Timer timer_;
67 ACE_Time_Value elapsed_time_;
70 #endif /* TIMEOUT_I_H */