2
// ConnectDisconnect.h,v 1.10 2003/07/06 21:41:57 pradeep Exp
3
// ==========================================================================
9
// Test connect-disconnect methods of Notify.
12
// Pradeep Gore <pradeep@cs.wustl.edu>
14
// ==========================================================================
16
#ifndef NOTIFY_CONNECT_DISCONNECT_H
17
#define NOTIFY_CONNECT_DISCONNECT_H
19
#include "Notify_Test_Client.h"
20
#include "Notify_StructuredPushConsumer.h"
21
#include "Notify_StructuredPushSupplier.h"
22
#include "Notify_PushConsumer.h"
23
#include "Notify_PushSupplier.h"
24
#include "Notify_SequencePushConsumer.h"
25
#include "Notify_SequencePushSupplier.h"
28
#if (_MSC_VER >= 1200)
30
#endif /* _MSC_VER >= 1200 */
31
#pragma warning(disable:4250)
34
class ConnectDisconnect;
38
// The entity that connects/disconnects.
40
CD_Entity (ConnectDisconnect* cd, int id);
44
ConnectDisconnect* cd_;
47
#define CD_DECLARE_ENTITY(X) \
48
class CD_##X : public TAO_Notify_##X, public CD_Entity \
51
CD_##X (ConnectDisconnect* cd, int id); \
54
CD_DECLARE_ENTITY(PushConsumer)
55
CD_DECLARE_ENTITY(StructuredPushConsumer)
56
CD_DECLARE_ENTITY(SequencePushConsumer)
58
CD_DECLARE_ENTITY(PushSupplier)
59
CD_DECLARE_ENTITY(StructuredPushSupplier)
60
CD_DECLARE_ENTITY(SequencePushSupplier)
62
/***************************************************************************/
64
class ConnectDisconnect : public Notify_Test_Client
67
// Initialization and termination code.
68
ConnectDisconnect (void);
69
virtual ~ConnectDisconnect ();
71
void on_entity_destroyed (void);
72
// Keeps track of how many objects were destroyed.
74
int parse_args (int argc,
82
void run_test (ACE_ENV_SINGLE_ARG_DECL);
85
void end_test (ACE_ENV_SINGLE_ARG_DECL);
88
int check_results (void);
89
// Check if we got the expected results.
92
void create_EC (ACE_ENV_SINGLE_ARG_DECL);
95
CosNotifyChannelAdmin::EventChannel_var ec_;
96
// The one channel that we create using the factory.
98
CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
99
// The consumer admin used by consumers.
101
CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
102
// The supplier admin used by suppliers.
104
TAO_Notify_Tests_PushConsumer** any_consumer_;
105
TAO_Notify_Tests_StructuredPushConsumer** structured_consumer_;
106
TAO_Notify_Tests_SequencePushConsumer** sequence_consumer_;
107
// Arrays of Consumers.
109
TAO_Notify_Tests_PushSupplier** any_supplier_;
110
TAO_Notify_Tests_StructuredPushSupplier** structured_supplier_;
111
TAO_Notify_Tests_SequencePushSupplier** sequence_supplier_;
112
// arrays of Suppliers
114
ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> result_count_;
115
// Count of clients destroyed. for c consumers, s suppliers and for t times.
116
// this should be (s+c)*t.
118
int expected_count_; // (s+c)*t
120
// = command line params
123
// The number of iterations to connect disconnect.
126
// The number of counsumers to create.
129
// The number of suppliers to create.
132
/***************************************************************************/
134
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
136
#endif /* _MSC_VER */
138
#endif /* NOTIFY_TESTS_UPDATES_H */