Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Basic / Sequence.h
blob564cce98dba51d5821ce91ce522129bcb460a7c0
1 /* -*- C++ -*- */
2 //=============================================================================
3 /**
4 * @file Sequence.h
6 * Test Sequence support in Notification.
8 * @author Pradeep Gore <pradeep@cs.wustl.edu>
9 */
10 //=============================================================================
13 #ifndef NOTIFY_TESTS_SEQUENCE_H
14 #define NOTIFY_TESTS_SEQUENCE_H
16 #include "Notify_Test_Client.h"
17 #include "Notify_SequencePushConsumer.h"
18 #include "Notify_SequencePushSupplier.h"
19 #include "orbsvcs/TimeBaseC.h"
21 #if defined(_MSC_VER)
22 #pragma warning(push)
23 #pragma warning(disable:4250)
24 #endif /* _MSC_VER */
26 class Sequence;
28 class SequencePushConsumer : public TAO_Notify_Tests_SequencePushConsumer
30 public:
31 SequencePushConsumer (Sequence* client);
33 // = SequencePushConsumer methods
34 virtual void push_structured_events (
35 const CosNotification::EventBatch & notifications);
37 protected:
38 Sequence* test_client_;
41 /***************************************************************************/
43 class SequencePushSupplier : public TAO_Notify_Tests_SequencePushSupplier
45 public:
46 /// Constructor.
47 SequencePushSupplier (Sequence * test_client);
49 /// Destructor.
50 virtual ~SequencePushSupplier ();
52 protected:
53 Sequence* test_client_;
56 /***************************************************************************/
58 class Sequence : public Notify_Test_Client
60 public:
61 // Initialization and termination code.
62 Sequence ();
63 virtual ~Sequence ();
65 int parse_args (int argc,
66 ACE_TCHAR *argv[]) ;
68 /// Initialization.
69 int init (int argc,
70 ACE_TCHAR *argv []);
72 /// Called when an event is received.
73 void on_event_received ();
75 /// Run the test.
76 void run_test ();
78 /// End the test.
79 void end_test ();
81 /// check if we got the expected results.
82 int check_results ();
84 protected:
85 /// Create EC
86 void create_EC ();
88 /// Number of events to send
89 int event_count_;
91 /// Batch size send by supplier.
92 CORBA::ULong supplier_batch_size_;
94 /// Max Batch size expected by consumer.
95 CORBA::ULong consumer_batch_size_;
97 TimeBase::TimeT pacing_;
99 CORBA::Short order_policy_;
101 /// Count the number of events received by the consumer.
102 ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> events_received_;
104 ACE_Time_Value consumer_delay_;
106 /// The one channel that we create using the factory.
107 CosNotifyChannelAdmin::EventChannel_var ec_;
109 /// The consumer admin used by consumers.
110 CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
112 /// The supplier admin used by suppliers.
113 CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
115 /// Consumer
116 TAO_Notify_Tests_SequencePushConsumer* consumer_;
118 /// Supplier
119 TAO_Notify_Tests_SequencePushSupplier* supplier_;
121 private:
122 friend class SequencePushSupplier;
123 friend class SequencePushConsumer;
126 /***************************************************************************/
128 #if defined(_MSC_VER)
129 #pragma warning(pop)
130 #endif /* _MSC_VER */
132 #endif /* NOTIFY_TESTS_SEQUENCE_H */