Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / lib / Notify_Test_Client.h
blob5a8e6b551e12f8cb8478430be99b58d2700e23eb
1 /* -*- C++ -*- */
2 //=============================================================================
3 /**
4 * @file Notify_Test_Client.h
6 * Prototype Test Driver for all the Notify tests.
8 * @author Pradeep Gore <pradeep@cs.wustl.edu>
9 */
10 //=============================================================================
13 #ifndef NOTIFY_TEST_CLIENT_H
14 #define NOTIFY_TEST_CLIENT_H
16 #include "ace/Atomic_Op_T.h"
17 #include "ace/Thread_Mutex.h"
18 #include "orbsvcs/CosNotifyChannelAdminS.h"
19 #include "orbsvcs/CosNotifyCommC.h"
20 #include "orbsvcs/CosNamingC.h"
21 #include "notify_test_export.h"
23 class TAO_Notify_Tests_Peer;
25 /**
26 * @class Notify_Test_Client
28 * @brief Notify_Test_Client
30 * Shows how consumers Notify_Test_Client for events.
32 class TAO_NOTIFY_TEST_Export Notify_Test_Client
34 public:
35 Notify_Test_Client ();
36 virtual ~Notify_Test_Client ();
38 /// starts the orb and resolves the notify factory via a naming service.
39 virtual int init (int argc, ACE_TCHAR *argv []);
41 /// Allow the user to override this empty method
42 virtual int parse_args (int argc, ACE_TCHAR* argv[]);
44 /// Call ORB::run to accept requests.
45 int ORB_run ();
46 int ORB_run (ACE_Time_Value& tv);
48 /// How many clients will call consumer_done.
49 void consumer_start (TAO_Notify_Tests_Peer*);
51 /// Callback for clients to unregister themselves.
52 void consumer_done (TAO_Notify_Tests_Peer*);
54 /// Access the done boolean.
55 bool is_done () const;
57 /// Access the ORB. This class retains ownership.
58 CORBA::ORB_ptr orb ();
60 /// Access the Root POA. This class retains ownership.
61 PortableServer::POA_ptr root_poa ();
63 /// Access the Naming Context. This class retains ownership.
64 CosNaming::NamingContext_ptr naming_context ();
66 /// Access the Notify Factory. This class retains ownership.
67 CosNotifyChannelAdmin::EventChannelFactory_ptr notify_factory ();
69 /// Create an Event Channel. Ownership is passed to the caller.
70 CosNotifyChannelAdmin::EventChannel_ptr create_event_channel (
71 const char* name,
72 bool resolve);
74 protected:
75 /// Initializes the ORB.
76 int init_ORB (int argc,
77 ACE_TCHAR *argv []);
79 /// Try to get hold of a running naming service.
80 void resolve_naming_service ();
82 /// Try to resolve the Notify factory from the Naming service.
83 void resolve_Notify_factory ();
85 // = Data Members
86 /// Reference to the root poa.
87 PortableServer::POA_var root_poa_;
89 /// The ORB that we use.
90 CORBA::ORB_var orb_;
92 /// Handle to the name service.
93 CosNaming::NamingContext_var naming_context_;
95 /// Channel factory.
96 CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_;
98 /// The group operator between admin-proxy's.
99 CosNotifyChannelAdmin::InterFilterGroupOperator ifgop_;
101 /// Initial qos specified to the factory when creating the EC.
102 CosNotification::QoSProperties initial_qos_;
104 /// Initial admin props specified to the factory when creating the EC.
105 CosNotification::AdminProperties initial_admin_;
107 private:
108 ACE_Atomic_Op< TAO_SYNCH_MUTEX, int > num_clients_;
109 bool done_;
112 #endif /* NOTIFY_TEST_CLIENT_H */