Merge pull request #2316 from jwillemsen/jwi-taskcommenttypo
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Basic / Events.h
blob49ae0f05c330bdbc3bdd554e94fd3c9cf37e963d
1 /* -*- C++ -*- */
2 //=============================================================================
3 /**
4 * @file Events.h
6 * Test to check if events are received by all 3 types of consumers.
7 * This is intended to be a simple test without any filters with default subscription (all events).
9 * @author Pradeep Gore <pradeep@cs.wustl.edu>
11 //=============================================================================
14 #ifndef NOTIFY_TESTS_EventS_H
15 #define NOTIFY_TESTS_EventS_H
17 #include "Notify_Test_Client.h"
18 #include "Notify_StructuredPushConsumer.h"
19 #include "Notify_StructuredPushSupplier.h"
21 #if defined(_MSC_VER)
22 #pragma warning(push)
23 #pragma warning(disable:4250)
24 #endif /* _MSC_VER */
26 class Events;
28 class Event_StructuredPushConsumer : public TAO_Notify_Tests_StructuredPushConsumer
30 public:
31 /// Constructor.
32 Event_StructuredPushConsumer (Events *test_client);
34 // = StructuredPushSupplier methods.
35 virtual void push_structured_event (
36 const CosNotification::StructuredEvent & notification);
38 protected:
39 Events * test_client_;
42 /***************************************************************************/
44 class Event_StructuredPushSupplier : public TAO_Notify_Tests_StructuredPushSupplier
46 public:
47 /// Constructor.
48 Event_StructuredPushSupplier (Events * test_client);
50 /// Destructor.
51 virtual ~Event_StructuredPushSupplier ();
53 protected:
54 Events* test_client_;
57 /***************************************************************************/
59 class Events : public Notify_Test_Client
61 public:
62 // Initialization and termination code.
63 Events ();
64 virtual ~Events ();
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 ();
76 /// Run the test.
77 void run_test ();
79 /// End the test.
80 void end_test ();
82 /// check if we got the expected results.
83 int check_results ();
85 protected:
86 /// Create EC
87 void create_EC ();
89 /// Number of events received so far.
90 ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> result_count_;
92 /// Use the default admins.
93 int use_default_admin_;
95 /// Number of events to send
96 int event_count_;
98 /// The one channel that we create using the factory.
99 CosNotifyChannelAdmin::EventChannel_var ec_;
101 /// The consumer admin used by consumers.
102 CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
104 /// The supplier admin used by suppliers.
105 CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
107 /// Consumer
108 TAO_Notify_Tests_StructuredPushConsumer* consumer_;
110 /// Supplier
111 TAO_Notify_Tests_StructuredPushSupplier* supplier_;
113 private:
114 friend class Event_StructuredPushSupplier;
115 friend class Event_StructuredPushConsumer;
118 /***************************************************************************/
120 #if defined(_MSC_VER)
121 #pragma warning(pop)
122 #endif /* _MSC_VER */
124 #endif /* NOTIFY_TESTS_EventS_H */