Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Basic / Sequence.h
blob420cf902d0e152c130690481c43512f9608f1c4c
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
38 protected:
39 Sequence* test_client_;
42 /***************************************************************************/
44 class SequencePushSupplier : public TAO_Notify_Tests_SequencePushSupplier
46 public:
47 /// Constructor.
48 SequencePushSupplier (Sequence * test_client);
50 /// Destructor.
51 virtual ~SequencePushSupplier (void);
53 protected:
54 Sequence* test_client_;
57 /***************************************************************************/
59 class Sequence : public Notify_Test_Client
61 public:
62 // Initialization and termination code.
63 Sequence (void);
64 virtual ~Sequence (void);
66 int parse_args (int argc,
67 ACE_TCHAR *argv[]) ;
69 /// Initialization.
70 int init (int argc,
71 ACE_TCHAR *argv []);
73 /// Called when an event is received.
74 void on_event_received (void);
76 /// Run the test.
77 void run_test (void);
79 /// End the test.
80 void end_test (void);
82 /// check if we got the expected results.
83 int check_results (void);
85 protected:
86 /// Create EC
87 void create_EC (void);
89 /// Number of events to send
90 int event_count_;
92 /// Batch size send by supplier.
93 CORBA::ULong supplier_batch_size_;
95 /// Max Batch size expected by consumer.
96 CORBA::ULong consumer_batch_size_;
98 TimeBase::TimeT pacing_;
100 CORBA::Short order_policy_;
102 /// Count the number of events received by the consumer.
103 ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> events_received_;
105 ACE_Time_Value consumer_delay_;
107 /// The one channel that we create using the factory.
108 CosNotifyChannelAdmin::EventChannel_var ec_;
110 /// The consumer admin used by consumers.
111 CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
113 /// The supplier admin used by suppliers.
114 CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
116 /// Consumer
117 TAO_Notify_Tests_SequencePushConsumer* consumer_;
119 /// Supplier
120 TAO_Notify_Tests_SequencePushSupplier* supplier_;
122 private:
123 friend class SequencePushSupplier;
124 friend class SequencePushConsumer;
127 /***************************************************************************/
129 #if defined(_MSC_VER)
130 #pragma warning(pop)
131 #endif /* _MSC_VER */
133 #endif /* NOTIFY_TESTS_SEQUENCE_H */