Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / orbsvcs / DevGuideExamples / NotifyService / RTNotify / StructuredEventConsumer_i.cpp
blobf242d528c438884698f5162e984afe3e25afac44
1 #include "StructuredEventConsumer_i.h"
2 #include "tao/PortableServer/PS_CurrentC.h"
3 #include <iostream>
5 StructuredEventConsumer_i::StructuredEventConsumer_i(CORBA::ORB_ptr orb)
6 : orb_(CORBA::ORB::_duplicate(orb))
10 void
11 StructuredEventConsumer_i::push_structured_event(
12 const CosNotification::StructuredEvent &event
15 std::cout << "event received " << std::endl;
17 const char *value;
19 for (unsigned int i=0; i<event.filterable_data.length(); i++) {
20 event.filterable_data[i].value >>= value;
21 std::cout << event.filterable_data[i].name.in() << "\t" << value << std::endl;
26 void
27 StructuredEventConsumer_i::disconnect_structured_push_consumer()
29 CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
30 PortableServer::Current_var current =
31 PortableServer::Current::_narrow (obj.in());
32 PortableServer::POA_var poa = current->get_POA ();
33 PortableServer::ObjectId_var objectId = current->get_object_id ();
34 poa->deactivate_object (objectId.in());
37 void
38 StructuredEventConsumer_i::offer_change(
39 const CosNotification::EventTypeSeq &,
40 const CosNotification::EventTypeSeq &