Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / orbsvcs / tests / FtRtEvent / PushConsumer.cpp
blob341da48a700c85f65b562b35181e263bb19b9cda
1 #include "ace/OS_NS_sys_time.h"
2 #include "PushConsumer.h"
3 #include "orbsvcs/FtRtEvent/Utils/resolve_init.h"
4 #include "ace/OS_NS_stdio.h"
6 PushConsumer_impl::PushConsumer_impl(CORBA::ORB_ptr orb)
7 : orb_(CORBA::ORB::_duplicate(orb))
12 void
13 PushConsumer_impl::push (const RtecEventComm::EventSet & event)
15 CORBA::ULong x;
16 ACE_Time_Value time_val = ACE_OS::gettimeofday ();
18 if (event.length() >0) {
19 TimeBase::TimeT elaps =
20 time_val.sec () * 10000000 + time_val.usec ()* 10 - event[0].header.ec_send_time;
21 event[0].data.any_value >>= x;
22 ACE_OS::printf("Received data : %d, single trip time = %d usec\n", x, static_cast<int> (elaps/10));
27 void
28 PushConsumer_impl::disconnect_push_consumer ()
30 PortableServer::Current_var current =
31 resolve_init<PortableServer::Current>(orb_.in(), "POACurrent");
33 PortableServer::POA_var poa = current->get_POA();
35 PortableServer::ObjectId_var oid = current->get_object_id();
37 poa->deactivate_object(oid.in ());