Go to the documentation of this file.00001 #include "orbsvcs/Time/TAO_UTO.h"
00002 #include "orbsvcs/Time/TAO_TIO.h"
00003 #include "orbsvcs/Time/TAO_Time_Service_Server.h"
00004 #include "ace/OS_NS_sys_time.h"
00005 #include "orbsvcs/Time_Utilities.h"
00006
00007 #include "tao/debug.h"
00008
00009 ACE_RCSID (Time,
00010 TAO_Time_Service_Server,
00011 "$Id: TAO_Time_Service_Server.cpp 87147 2009-10-19 00:27:24Z schmidt $")
00012
00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00014
00015
00016 TAO_Time_Service_Server::TAO_Time_Service_Server (void)
00017 {
00018 }
00019
00020
00021 TAO_Time_Service_Server::~TAO_Time_Service_Server (void)
00022 {
00023 }
00024
00025
00026
00027
00028 CosTime::UTO_ptr
00029 TAO_Time_Service_Server::universal_time (void)
00030 {
00031 TAO_UTO *uto = 0;
00032
00033 TimeBase::TimeT timestamp;
00034 ORBSVCS_Time::Absolute_Time_Value_to_TimeT(timestamp, ACE_OS::gettimeofday());
00035
00036
00037 ACE_NEW_THROW_EX (uto,
00038 TAO_UTO (timestamp,
00039 0,
00040 0),
00041 CORBA::NO_MEMORY ());
00042 PortableServer::ServantBase_var xfer = uto;
00043
00044 if (TAO_debug_level > 0)
00045 ACE_DEBUG ((LM_DEBUG,
00046 "Returning a UTO\n"));
00047
00048 return uto->_this ();
00049 }
00050
00051
00052
00053
00054
00055 CosTime::UTO_ptr
00056 TAO_Time_Service_Server::secure_universal_time (void)
00057 {
00058 throw CORBA::NO_IMPLEMENT ();
00059 }
00060
00061
00062
00063 CosTime::UTO_ptr
00064 TAO_Time_Service_Server::new_universal_time (TimeBase::TimeT time,
00065 TimeBase::InaccuracyT inaccuracy,
00066 TimeBase::TdfT tdf)
00067 {
00068 TAO_UTO *uto = 0;
00069
00070 ACE_NEW_THROW_EX (uto,
00071 TAO_UTO (time,
00072 inaccuracy,
00073 tdf),
00074 CORBA::NO_MEMORY ());
00075 PortableServer::ServantBase_var xfer = uto;
00076
00077 return uto->_this ();
00078 }
00079
00080
00081
00082 CosTime::UTO_ptr
00083 TAO_Time_Service_Server::uto_from_utc (const TimeBase::UtcT &utc)
00084 {
00085 TAO_UTO *uto = 0;
00086
00087 ACE_NEW_THROW_EX (uto,
00088 TAO_UTO (utc.time,
00089 utc.inacclo + utc.inacchi,
00090 utc.tdf),
00091 CORBA::NO_MEMORY ());
00092 PortableServer::ServantBase_var xfer = uto;
00093
00094 return uto->_this ();
00095 }
00096
00097
00098
00099 CosTime::TIO_ptr
00100 TAO_Time_Service_Server::new_interval (TimeBase::TimeT lower,
00101 TimeBase::TimeT upper)
00102 {
00103 TAO_TIO *tio = 0;
00104
00105 ACE_NEW_THROW_EX (tio,
00106 TAO_TIO (lower,
00107 upper),
00108 CORBA::NO_MEMORY ());
00109 PortableServer::ServantBase_var xfer = tio;
00110 return tio->_this ();
00111 }
00112
00113 TAO_END_VERSIONED_NAMESPACE_DECL