Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / EC_MT_Mcast / Supplier.cpp
blob0b4c78f6b543da808437f7caecc82d547fd9aa38
1 // Reused from: $TAO_ROOT/orbsvcs/examples/RtEC/MCast
3 #include "Supplier.h"
4 #include "orbsvcs/RtecEventChannelAdminS.h"
5 #include "orbsvcs/Event_Service_Constants.h"
7 Supplier::Supplier ()
11 void
12 Supplier::connect (RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin)
14 this->proxy_ =
15 supplier_admin->obtain_push_consumer ();
17 RtecEventComm::PushSupplier_var me =
18 this->_this ();
20 // Simple publication, but usually the helper classes in
21 // $TAO_ROOT/orbsvcs/Event_Utils.h are a better way to do this.
22 RtecEventChannelAdmin::SupplierQOS qos;
23 qos.is_gateway = 0;
25 qos.publications.length (1);
26 RtecEventComm::EventHeader& h0 =
27 qos.publications[0].event.header;
28 h0.type = ACE_ES_EVENT_UNDEFINED; // first free event type
29 h0.source = 1; // first free event source
31 this->proxy_->connect_push_supplier (me.in (), qos);
34 void
35 Supplier::disconnect ()
37 // Disconnect from the EC
38 try
40 this->proxy_->disconnect_push_consumer ();
42 catch (const CORBA::Exception&)
46 PortableServer::POA_var poa =
47 this->_default_POA ();
48 PortableServer::ObjectId_var id =
49 poa->servant_to_id (this);
50 poa->deactivate_object (id.in ());
53 void
54 Supplier::perform_push ()
56 try
58 // The event type and source must match our publications
59 RtecEventComm::EventSet event (1);
60 event.length (1);
61 event[0].header.type = ACE_ES_EVENT_UNDEFINED;
62 event[0].header.source = 1;
63 // Avoid loops throught the event channel federations
64 event[0].header.ttl = 1;
66 this->proxy_->push (event);
68 catch (const CORBA::Exception&)
73 void
74 Supplier::disconnect_push_supplier ()