Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / AMI_Timeouts / timeout_client.h
blobeea4333abc1d6192471bf6d48e4b3c262c87de6f
1 //=============================================================================
2 /**
3 * @file timeout_client.h
5 * Tests timeouts with AMI.
7 * @author Michael Kircher <Michael.Kircher@mchp.siemens.de>
8 */
9 //=============================================================================
11 #include "ace/Task.h"
12 #include "timeout_i.h"
14 class TimeoutClient : public ACE_Task_Base
16 public:
17 TimeoutClient (CORBA::ORB_ptr orb,
18 TimeoutObj_ptr timeoutObject,
19 AMI_TimeoutObjHandler_ptr replyHandlerObject,
20 TimeoutHandler_i *timeoutHandler_i,
21 unsigned long timeToWait);
23 ~TimeoutClient ();
25 private:
26 // Initialize the context of this class.
27 int initialize ();
29 // Run in a separate thread.
30 virtual int svc ();
32 // Wrapps complex invocations logic.
33 void send (CORBA::Boolean async,
34 unsigned long local_timeout,
35 unsigned long remote_sleep);
37 // Test if the synchronous timeouts still work.
38 int synch_test ();
40 // Test the accuracy of the timeouts.
41 int accuracy_test ();
43 // Test if the timeout functionality disturbs non-timeout invocations
44 int none_test ();
46 private:
47 CORBA::ORB_var orb_;
49 // A CORBA object reference to the target object.
50 TimeoutObj_var timeoutObject_;
52 // A CORBA object reference to the reply handler
53 AMI_TimeoutObjHandler_var replyHandlerObject_;
55 // A pointer to the actual C++ reply handler implementation
56 TimeoutHandler_i *timeoutHandler_i_;
58 // Remember the policy manager.
59 CORBA::PolicyManager_var policy_manager_;
61 // Count test local exceptions
62 unsigned short local_reply_excep_counter_;
64 const CORBA::Boolean INVOKE_SYNCH;
66 const CORBA::Boolean INVOKE_ASYNCH;
68 unsigned long timeToWait_;