Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / orbsvcs / DevGuideExamples / NotifyService / RTNotify / StructuredEventConsumer_i.cpp
blobe80efb54cee93517bbb87c6aa2885da81b3f8fc5
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
16 std::cout << "event received " << std::endl;
18 const char *value;
20 for (unsigned int i=0; i<event.filterable_data.length(); i++) {
21 event.filterable_data[i].value >>= value;
22 std::cout << event.filterable_data[i].name.in() << "\t" << value << std::endl;
27 void
28 StructuredEventConsumer_i::disconnect_structured_push_consumer()
31 CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
32 PortableServer::Current_var current =
33 PortableServer::Current::_narrow (obj.in());
34 PortableServer::POA_var poa = current->get_POA ();
35 PortableServer::ObjectId_var objectId = current->get_object_id ();
36 poa->deactivate_object (objectId.in());
40 void
41 StructuredEventConsumer_i::offer_change(
42 const CosNotification::EventTypeSeq &,
43 const CosNotification::EventTypeSeq &