Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Mixed_Sync_ASync_Events / test_i.h
blobef04a58383f08ad74f04181cec69b4a93db51987
2 //=============================================================================
3 /**
4 * @file test_i.h
5 */
6 //=============================================================================
8 #ifndef TAO_MSAE_TEST_I_H
9 #define TAO_MSAE_TEST_I_H
11 #include "testS.h"
13 /**
14 * @class Test_i
16 * @brief Test implementation
18 * Implements the Test interface in test.idl
20 class Test_i : public POA_A::Test
22 public:
23 /// ctor
24 Test_i (CORBA::ORB_ptr orb,
25 A::AMI_TestHandler_ptr rh,
26 A::RunMode mode = A::RM_SLAVE);
28 void set_opponent (A::Test_ptr opp);
30 virtual void request (
31 ::A::RequestMode mode,
32 ::CORBA::ULong & counter,
33 ::A::FollowUp_out follow_up);
35 virtual void report (
36 const char * msg);
38 void shutdown ();
40 private:
41 CORBA::ORB_var orb_;
43 A::AMI_TestHandler_var rh_;
45 A::Test_var opponent_;
47 A::RunMode mode_;
49 unsigned int seed_;
52 class TestHandler
53 : public ACE_Event_Handler
55 public:
56 TestHandler (CORBA::ORB_ptr orb,
57 CORBA::ULong max_count,
58 A::RunMode mode);
60 void set_counter (CORBA::ULong counter);
62 void set_opponent (A::Test_ptr opp);
64 void set_reply_handler (A::AMI_TestHandler_ptr rh);
66 virtual int handle_timeout (const ACE_Time_Value &tv,
67 const void *arg);
69 virtual int handle_exception (ACE_HANDLE fc = ACE_INVALID_HANDLE);
71 void handle_followup (A::FollowUp fup, CORBA::ULong counter);
73 void start ();
75 CORBA::ORB_ptr orb () { return this->orb_.in (); }
76 A::Test_ptr opponent () { return this->opponent_.in (); }
77 CORBA::ULong max_count () { return this->max_count_; }
78 A::RunMode mode () { return this->mode_; }
80 private:
81 CORBA::ORB_var orb_;
82 A::Test_var opponent_;
83 A::AMI_TestHandler_var rh_;
84 CORBA::ULong max_count_;
85 A::RunMode mode_;
86 CORBA::ULong counter_;
87 unsigned int seed_;
90 class Test_Reply_i : public POA_A::AMI_TestHandler
92 public:
93 Test_Reply_i (CORBA::ORB_ptr orb,
94 CORBA::ULong max_count,
95 A::RunMode mode);
97 virtual void request (
98 ::CORBA::ULong counter,
99 ::A::FollowUp follow_up);
101 virtual void request_excep (
102 ::Messaging::ExceptionHolder * excep_holder);
104 virtual void report (
105 void);
107 virtual void report_excep (
108 ::Messaging::ExceptionHolder * excep_holder);
110 TestHandler& test_handler () { return this->evh_; }
112 private:
113 TestHandler evh_;
117 #endif /* TAO_MSAE_TEST_I_H */