~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/orbsvcs/tests/Notify/Basic/ConnectDisconnect.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- C++ -*- */
2
 
// ConnectDisconnect.h,v 1.10 2003/07/06 21:41:57 pradeep Exp
3
 
// ==========================================================================
4
 
//
5
 
// = FILENAME
6
 
//   ConnectDisconnect.h
7
 
//
8
 
// = DESCRIPTION
9
 
//   Test connect-disconnect methods of Notify.
10
 
//
11
 
// = AUTHOR
12
 
//    Pradeep Gore <pradeep@cs.wustl.edu>
13
 
//
14
 
// ==========================================================================
15
 
 
16
 
#ifndef NOTIFY_CONNECT_DISCONNECT_H
17
 
#define NOTIFY_CONNECT_DISCONNECT_H
18
 
 
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"
26
 
 
27
 
#if defined(_MSC_VER)
28
 
#if (_MSC_VER >= 1200)
29
 
#pragma warning(push)
30
 
#endif /* _MSC_VER >= 1200 */
31
 
#pragma warning(disable:4250)
32
 
#endif /* _MSC_VER */
33
 
 
34
 
class ConnectDisconnect;
35
 
 
36
 
class CD_Entity
37
 
{
38
 
  // The entity that connects/disconnects.
39
 
public:
40
 
  CD_Entity (ConnectDisconnect* cd, int id);
41
 
  ~CD_Entity ();
42
 
private:
43
 
  int id_;
44
 
  ConnectDisconnect* cd_;
45
 
};
46
 
 
47
 
#define CD_DECLARE_ENTITY(X) \
48
 
class CD_##X : public TAO_Notify_##X, public CD_Entity \
49
 
{ \
50
 
public: \
51
 
  CD_##X (ConnectDisconnect* cd, int id); \
52
 
};
53
 
 
54
 
CD_DECLARE_ENTITY(PushConsumer)
55
 
CD_DECLARE_ENTITY(StructuredPushConsumer)
56
 
CD_DECLARE_ENTITY(SequencePushConsumer)
57
 
 
58
 
CD_DECLARE_ENTITY(PushSupplier)
59
 
CD_DECLARE_ENTITY(StructuredPushSupplier)
60
 
CD_DECLARE_ENTITY(SequencePushSupplier)
61
 
 
62
 
/***************************************************************************/
63
 
 
64
 
class ConnectDisconnect : public Notify_Test_Client
65
 
{
66
 
public:
67
 
  // Initialization and termination code.
68
 
  ConnectDisconnect (void);
69
 
  virtual ~ConnectDisconnect ();
70
 
 
71
 
  void on_entity_destroyed (void);
72
 
  // Keeps track of how many objects were destroyed.
73
 
 
74
 
  int parse_args (int argc,
75
 
                  char *argv[]);
76
 
 
77
 
  int init (int argc,
78
 
            char *argv []
79
 
            ACE_ENV_ARG_DECL);
80
 
  // initialization.
81
 
 
82
 
  void run_test (ACE_ENV_SINGLE_ARG_DECL);
83
 
  // Run the test.
84
 
 
85
 
  void end_test (ACE_ENV_SINGLE_ARG_DECL);
86
 
  // End the test.
87
 
 
88
 
  int check_results (void);
89
 
  // Check if we got the expected results.
90
 
 
91
 
protected:
92
 
  void create_EC (ACE_ENV_SINGLE_ARG_DECL);
93
 
  // Create EC.
94
 
 
95
 
  CosNotifyChannelAdmin::EventChannel_var ec_;
96
 
  // The one channel that we create using the factory.
97
 
 
98
 
  CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
99
 
  // The consumer admin used by consumers.
100
 
 
101
 
  CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
102
 
  // The supplier admin used by suppliers.
103
 
 
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.
108
 
 
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
113
 
 
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.
117
 
 
118
 
  int expected_count_; // (s+c)*t
119
 
 
120
 
  // = command line params
121
 
 
122
 
  int count_;
123
 
  // The number of iterations to connect disconnect.
124
 
 
125
 
  int consumers_;
126
 
  // The number of counsumers to create.
127
 
 
128
 
  int suppliers_;
129
 
  // The number of suppliers to create.
130
 
};
131
 
 
132
 
/***************************************************************************/
133
 
 
134
 
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
135
 
#pragma warning(pop)
136
 
#endif /* _MSC_VER */
137
 
 
138
 
#endif /* NOTIFY_TESTS_UPDATES_H */