Merge pull request #2258 from likema/log-msg-reset-ostream
[ACE_TAO.git] / TAO / orbsvcs / examples / Notify / Federation / Gate / Gate.h
blob049662855bddb07f51d2c7eba1587c55b47a1774
1 // file : Gate.h
2 // author : Boris Kolpackov <boris@dre.vanderbilt.edu>
3 #ifndef GATE_H
4 #define GATE_H
6 #include "ace/INET_Addr.h"
7 #include "ace/UUID.h"
9 #include "ace/Thread_Mutex.h"
10 #include "ace/Thread_Manager.h"
12 #include "tao/corba.h"
14 #include "orbsvcs/CosNotificationC.h"
15 #include "orbsvcs/CosNotifyChannelAdminC.h"
16 #include "orbsvcs/CosNotifyCommC.h"
17 #include "orbsvcs/CosNotifyCommS.h"
19 #include "ace/RMCast/Socket.h"
21 #include "Export.h"
23 class Gate_Export Gate : public POA_CosNotifyComm::StructuredPushConsumer
25 public:
26 virtual
27 ~Gate ();
29 Gate (ACE_INET_Addr const& group,
30 CosNotifyChannelAdmin::EventChannel_ptr ch);
32 Gate (ACE_INET_Addr const& group,
33 CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin,
34 CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin);
36 private:
37 void
38 init (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin,
39 CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin);
41 static ACE_THR_FUNC_RETURN
42 tracker_thunk (void* arg);
44 void
45 tracker ();
47 private:
48 // NotifyPublish interface.
50 virtual void
51 offer_change (CosNotification::EventTypeSeq const&,
52 CosNotification::EventTypeSeq const&);
54 // StructuredPushSupplier interface.
56 virtual void
57 push_structured_event (CosNotification::StructuredEvent const& e);
60 virtual void
61 disconnect_structured_push_consumer ();
63 private:
64 ACE_thread_t thread_;
66 CosNotifyChannelAdmin::ProxyID consumer_id_;
67 CosNotifyChannelAdmin::StructuredProxyPushConsumer_var consumer_;
69 CosNotifyChannelAdmin::ProxyID supplier_id_;
70 CosNotifyChannelAdmin::StructuredProxyPushSupplier_var supplier_;
72 ACE_RMCast::Socket socket_;
73 CORBA::String_var id_;
75 bool stop_;
76 TAO_SYNCH_MUTEX mutex_;
77 ACE_Thread_Manager thread_mgr_;
80 #endif // GATE_H