Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Basic / Simple.h
blobad78485c81dc880ffcb6a03d5ea7e757ab26e921
1 /* -*- C++ -*- */
2 //=============================================================================
3 /**
4 * @file Simple.h
6 * Simple test any supplier to any consumer.
8 * @author Pradeep Gore <pradeep@cs.wustl.edu>
9 */
10 //=============================================================================
13 #ifndef NOTIFY_TESTS_SIMPLE_H
14 #define NOTIFY_TESTS_SIMPLE_H
16 #include "Notify_Test_Client.h"
17 #include "Notify_PushConsumer.h"
18 #include "Notify_PushSupplier.h"
20 #if defined(_MSC_VER)
21 #pragma warning(push)
22 #pragma warning(disable:4250)
23 #endif /* _MSC_VER */
25 class Simple_Test;
27 /***************************************************************************/
29 class Event_AnyPushConsumer : public TAO_Notify_Tests_PushConsumer
31 public:
32 /// Constructor.
33 Event_AnyPushConsumer (Simple_Test *test_client);
35 // = PushSupplier methods
36 virtual void push (
37 const CORBA::Any & data
40 protected:
41 Simple_Test * test_client_;
44 /***************************************************************************/
46 class Event_AnyPushSupplier : public TAO_Notify_Tests_PushSupplier
48 public:
49 /// Constructor.
50 Event_AnyPushSupplier (Simple_Test * test_client);
52 /// Destructor.
53 virtual ~Event_AnyPushSupplier (void);
55 protected:
56 Simple_Test* test_client_;
59 /***************************************************************************/
61 class Simple_Test : public Notify_Test_Client
63 public:
64 // Initialization and termination code
65 Simple_Test (void);
66 virtual ~Simple_Test (void);
68 int parse_args (int argc,
69 ACE_TCHAR *argv[]) ;
71 /// initialization.
72 int init (int argc,
73 ACE_TCHAR *argv []);
75 /// Called when an event is received.
76 void on_event_received (void);
78 /// Run the test.
79 void run_test (void);
81 /// End the test.
82 void end_test (void);
84 /// check if we got the expected results.
85 int check_results (void);
87 protected:
88 /// Create EC
89 void create_EC (void);
91 /// Number of events received so far.
92 ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> result_count_;
94 /// Number of events to send
95 int event_count_;
97 /// The one channel that we create using the factory.
98 CosNotifyChannelAdmin::EventChannel_var ec_;
100 /// The consumer admin used by consumers.
101 CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
103 /// The supplier admin used by suppliers.
104 CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
106 /// Consumer.
107 TAO_Notify_Tests_PushConsumer* consumer_;
109 /// Supplier.
110 TAO_Notify_Tests_PushSupplier* supplier_;
112 private:
113 friend class Event_AnyPushSupplier;
114 friend class Event_AnyPushConsumer;
117 /***************************************************************************/
119 #if defined(_MSC_VER)
120 #pragma warning(pop)
121 #endif /* _MSC_VER */
123 #endif /* NOTIFY_TESTS_SIMPLE_H */