blob: 69b8b1bc3b18019655336bdf730837d4408301cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#include "StructuredEventConsumer_i.h"
#include "tao/PortableServer/PS_CurrentC.h"
#include <iostream>
StructuredEventConsumer_i::StructuredEventConsumer_i(CORBA::ORB_ptr orb)
: orb_(CORBA::ORB::_duplicate(orb))
{
}
void
StructuredEventConsumer_i::push_structured_event(
const CosNotification::StructuredEvent &event
)
{
const char *value;
for (unsigned int i=0; i<event.filterable_data.length(); i++) {
event.filterable_data[i].value >>= value;
std::cout << event.filterable_data[i].name << "\t" <<value<< std::endl;
}
std::cerr << "MessengerConsumer: success" << std::endl;
}
void
StructuredEventConsumer_i::disconnect_structured_push_consumer(
)
{
CORBA::Object_var obj = orb_->resolve_initial_references ("POACurrent");
PortableServer::Current_var current =
PortableServer::Current::_narrow (obj.in());
PortableServer::POA_var poa = current->get_POA ();
PortableServer::ObjectId_var objectId = current->get_object_id ();
poa->deactivate_object (objectId.in());
}
void
StructuredEventConsumer_i::offer_change(
const CosNotification::EventTypeSeq &,
const CosNotification::EventTypeSeq &
)
{
//Noop
}
|