Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / BiDirectional_DelayedUpcall / test_i.h
blob7d63e09030c4821599e3db8f8c3e6f90043317cf
2 //=============================================================================
3 /**
4 * @file test_i.h
6 * @author Balachandran Natarajan <bala@cs.wustl.edu>
7 */
8 //=============================================================================
11 #ifndef TAO_BIDIRECTIONAL_TEST_I_H
12 #define TAO_BIDIRECTIONAL_TEST_I_H
14 #include "testS.h"
15 #include "ace/Event_Handler.h"
17 /**
18 * @class Callback_i
20 * @brief A callback object to the "client"
22 * To test that the server can call the client on the same
23 * connection that was established by the client
25 class Callback_i : public virtual POA_Callback
27 public:
28 /// ctor
29 Callback_i (CORBA::ORB_ptr orb, Simple_Server_ptr srv);
31 /// Safe way to shutdown
32 void shutdown (void);
34 /// The callback method
35 void callback_method (void);
37 private:
38 /// The orb
39 /// The server
40 CORBA::ORB_var orb_;
41 Simple_Server_var server_;
44 /**
45 * @class Simple_Server_i
47 * @brief Simpler Server implementation
49 * Implements the Simple_Server interface in test.idl
51 class Simple_Server_i : public virtual POA_Simple_Server, public virtual ACE_Event_Handler
53 public:
54 /// ctor
55 Simple_Server_i (CORBA::ORB_ptr orb, int no_iterations);
57 // = The Simple_Server methods.
58 CORBA::Long test_method (CORBA::Boolean do_callback);
60 void callback_object (Callback_ptr callback);
62 void shutdown (void);
64 virtual int handle_timeout (const ACE_Time_Value &current_time,
65 const void *act = 0);
67 private:
68 /// The ORB
69 CORBA::ORB_var orb_;
71 /// Flag to indicate, whether we are ready for a remote call.
72 int flag_;
74 /// Callback Object
75 Callback_var callback_;
77 /// Number of times the callback needs to be called
78 int no_iterations_;
81 #if defined(__ACE_INLINE__)
82 #include "test_i.inl"
83 #endif /* __ACE_INLINE__ */
85 #endif /* TAO_BIDIRECTIONAL_TEST_I_H */