Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / examples / Simple / time-date / Time_Date_i.cpp
blobd19532eb481ec26769de515ecd252e48368377c5
1 // -*- C++ -*-
2 #include "Time_Date_i.h"
3 #include "ace/OS_NS_time.h"
4 #include "ace/Reactor.h"
6 // Obtain the time and date in binary format.
7 void
8 Time_Date_i::bin_date (CORBA::Long_out time_date)
10 time_date = static_cast<CORBA::Long> (ACE_OS::time (0));
13 // Obtain the time and date in string format.
14 void
15 Time_Date_i::str_date (CORBA::String_out time_date)
17 const time_t time = ACE_OS::time (0);
19 time_date = CORBA::string_dup (ACE_TEXT_ALWAYS_CHAR(ACE_OS::ctime (&time)));
22 // Shutdown.
23 void
24 Time_Date_i::shutdown ()
26 ACE_DEBUG ((LM_DEBUG,
27 ACE_TEXT ("Time_Date_i is shutting down\n")));
29 // Instruct the ORB to shutdown.
30 this->orb_var_->shutdown ();
31 // And shutdown the event loop from started in main.
32 ACE_Reactor::end_event_loop ();
35 void
36 Time_Date_i::orb (CORBA::ORB_ptr orb_ptr)
38 orb_var_ = CORBA::ORB::_duplicate (orb_ptr);