2 //=============================================================================
4 * @file ConnectDisconnect.h
6 * Test connect-disconnect methods of Notify.
8 * @author Pradeep Gore <pradeep@cs.wustl.edu>
10 //=============================================================================
13 #ifndef NOTIFY_CONNECT_DISCONNECT_H
14 #define NOTIFY_CONNECT_DISCONNECT_H
16 #include "Notify_Test_Client.h"
17 #include "Notify_StructuredPushConsumer.h"
18 #include "Notify_StructuredPushSupplier.h"
19 #include "Notify_PushConsumer.h"
20 #include "Notify_PushSupplier.h"
21 #include "Notify_SequencePushConsumer.h"
22 #include "Notify_SequencePushSupplier.h"
26 #pragma warning(disable:4250)
29 class ConnectDisconnect
;
33 The entity that connects/disconnects.
38 CD_Entity (ConnectDisconnect
* cd
, int id
);
42 ConnectDisconnect
* cd_
;
45 #define CD_DECLARE_ENTITY(X) \
46 class CD_##X : public TAO_Notify_##X, public CD_Entity \
49 CD_##X (ConnectDisconnect* cd, int id); \
52 CD_DECLARE_ENTITY(PushConsumer
)
53 CD_DECLARE_ENTITY(StructuredPushConsumer
)
54 CD_DECLARE_ENTITY(SequencePushConsumer
)
56 CD_DECLARE_ENTITY(PushSupplier
)
57 CD_DECLARE_ENTITY(StructuredPushSupplier
)
58 CD_DECLARE_ENTITY(SequencePushSupplier
)
60 /***************************************************************************/
62 class ConnectDisconnect
: public Notify_Test_Client
65 // Initialization and termination code.
66 ConnectDisconnect (void);
67 virtual ~ConnectDisconnect ();
69 /// Keeps track of how many objects were destroyed.
70 void on_entity_destroyed (void);
72 int parse_args (int argc
,
85 /// Check if we got the expected results.
86 int check_results (void);
90 void create_EC (void);
92 /// The one channel that we create using the factory.
93 CosNotifyChannelAdmin::EventChannel_var ec_
;
95 /// The consumer admin used by consumers.
96 CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_
;
98 /// The supplier admin used by suppliers.
99 CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_
;
101 /// Arrays of Consumers.
102 TAO_Notify_Tests_PushConsumer
** any_consumer_
;
103 TAO_Notify_Tests_StructuredPushConsumer
** structured_consumer_
;
104 TAO_Notify_Tests_SequencePushConsumer
** sequence_consumer_
;
106 /// arrays of Suppliers
107 TAO_Notify_Tests_PushSupplier
** any_supplier_
;
108 TAO_Notify_Tests_StructuredPushSupplier
** structured_supplier_
;
109 TAO_Notify_Tests_SequencePushSupplier
** sequence_supplier_
;
111 /// Count of clients destroyed. for c consumers, s suppliers and for t times.
112 /// this should be (s+c)*t.
113 ACE_Atomic_Op
<TAO_SYNCH_MUTEX
, int> result_count_
;
115 int expected_count_
; // (s+c)*t
117 // = command line params
119 /// The number of iterations to connect disconnect.
122 /// The number of counsumers to create.
125 /// The number of suppliers to create.
129 /***************************************************************************/
131 #if defined(_MSC_VER)
133 #endif /* _MSC_VER */
135 #endif /* NOTIFY_TESTS_UPDATES_H */