Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / orbsvcs / examples / Notify / Lanes / Supplier.h
blobbf0746c0b804aa63564e2c9f989855501d4fbcb1
1 /* -*- C++ -*- */
2 /**
3 * @file Supplier.h
5 * @author Pradeep Gore <pradeep@oomworks.com>
6 */
8 #ifndef TAO_Notify_SUPPLIER_H
9 #define TAO_Notify_SUPPLIER_H
10 #include /**/ "ace/pre.h"
12 #include "ORB_Objects.h"
13 #include "tao/RTCORBA/RTCORBA.h"
14 #include "orbsvcs/CosNotifyChannelAdminS.h"
15 #include "orbsvcs/CosNotifyCommC.h"
16 #include "ace/SString.h"
17 #include "ace/Condition_Thread_Mutex.h"
19 /**
20 * @class TAO_Notify_Lanes_Supplier
22 * @brief Implement a Structured Supplier.
24 class TAO_Notify_Lanes_Supplier
25 : public POA_CosNotifyComm::StructuredPushSupplier
27 public:
28 /// Constructor.
29 TAO_Notify_Lanes_Supplier (TAO_Notify_ORB_Objects& orb_objects);
31 /// Init
32 void init (CosNotifyChannelAdmin::SupplierAdmin_var& admin, int count);
34 /// Run
35 void run ();
37 protected:
38 // = Protected Methods
40 /// Connect the Supplier to the EventChannel.
41 /// Creates a new proxy consumer and connects to it.
42 void connect ();
44 /// Disconnect the supplier.
45 void disconnect ();
47 /// Deactivate.
48 void deactivate ();
50 /// Send one event.
51 virtual void send_event (const CosNotification::StructuredEvent& event);
53 /// Destructor
54 virtual ~TAO_Notify_Lanes_Supplier ();
56 // = NotifySubscribe
57 virtual void subscription_change (
58 const CosNotification::EventTypeSeq & added,
59 const CosNotification::EventTypeSeq & removed);
61 // = StructuredPushSupplier method
62 virtual void disconnect_structured_push_supplier ();
63 /// = Data members
65 /// ORB Objects.
66 TAO_Notify_ORB_Objects orb_objects_;
68 /// The proxy that we are connected to.
69 CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxy_consumer_;
71 /// This supplier's id.
72 CosNotifyChannelAdmin::ProxyID proxy_consumer_id_;
74 /// Number of Consumers expected to connect.
75 int expected_consumer_count_;
77 // The ORB that we use.
78 CORBA::ORB_var orb_;
80 // The Supplier Admin
81 CosNotifyChannelAdmin::SupplierAdmin_var admin_;
83 /// Lock to serialize internal state.
84 TAO_SYNCH_MUTEX lock_;
86 /// Condition that consumers are connected.
87 TAO_SYNCH_CONDITION consumers_connected_;
89 /// Number of consumers connected.
90 int consumer_count_;
93 #include /**/ "ace/post.h"
94 #endif /* TAO_Notify_SUPPLIER_H */