Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / orbsvcs / tests / Bug_3387_Regression / StructuredEventConsumer_i.cpp
blob053fb8d0f343faa09c42d198f6781a6af49c951d
1 #include "StructuredEventConsumer_i.h"
2 #include "tao/PortableServer/PS_CurrentC.h"
3 #include <iostream>
5 int consumerStop();
7 StructuredEventConsumer_i::StructuredEventConsumer_i(CORBA::ORB_ptr orb)
8 : orb_(CORBA::ORB::_duplicate(orb)), count_(0)
12 void
13 StructuredEventConsumer_i::push_structured_event(
14 const CosNotification::StructuredEvent &event
18 std::cout << "event received " << std::endl;
20 const char *value;
22 for (unsigned int i=0; i<event.filterable_data.length(); i++) {
23 event.filterable_data[i].value >>= value;
24 std::cout << event.filterable_data[i].name.in() << "\t" << value << std::endl;
26 count_++;
27 if ( count_ >= 3 )
29 consumerStop();
34 void
35 StructuredEventConsumer_i::disconnect_structured_push_consumer()
38 CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
39 PortableServer::Current_var current =
40 PortableServer::Current::_narrow (obj.in());
41 PortableServer::POA_var poa = current->get_POA ();
42 PortableServer::ObjectId_var objectId = current->get_object_id ();
43 poa->deactivate_object (objectId.in());
47 void
48 StructuredEventConsumer_i::offer_change(
49 const CosNotification::EventTypeSeq &,
50 const CosNotification::EventTypeSeq &
55 int
56 StructuredEventConsumer_i::nummsgs()
58 return count_;