TimeService Object Implementation. More...
#include <TAO_Time_Service_Server.h>
Public Member Functions | |
TAO_Time_Service_Server (void) | |
Constructor. | |
~TAO_Time_Service_Server (void) | |
Destructor. | |
virtual CosTime::UTO_ptr | universal_time (void) |
virtual CosTime::UTO_ptr | secure_universal_time (void) |
virtual CosTime::UTO_ptr | new_universal_time (TimeBase::TimeT time, TimeBase::InaccuracyT inaccuracy, TimeBase::TdfT tdf) |
This creates a new UTO based on the given parameters. | |
virtual CosTime::UTO_ptr | uto_from_utc (const TimeBase::UtcT &utc) |
This creates a new UTO given a time in the UtcT form. | |
virtual CosTime::TIO_ptr | new_interval (TimeBase::TimeT lower, TimeBase::TimeT upper) |
This creates a new TIO with the given parameters. |
TimeService Object Implementation.
The Object implementation implements methods to retrieve current time as well as secure current time. The times are retrieved as UTOs. The object also allows creation of a TIO for a given time interval. In general, the TimeService manages the UTOs and the TIOs. The notion of time returned here is the local time of the system.
Definition at line 38 of file TAO_Time_Service_Server.h.
TAO_Time_Service_Server::TAO_Time_Service_Server | ( | void | ) |
TAO_Time_Service_Server::~TAO_Time_Service_Server | ( | void | ) |
CosTime::TIO_ptr TAO_Time_Service_Server::new_interval | ( | TimeBase::TimeT | lower, | |
TimeBase::TimeT | upper | |||
) | [virtual] |
This creates a new TIO with the given parameters.
Definition at line 100 of file TAO_Time_Service_Server.cpp.
{ TAO_TIO *tio = 0; ACE_NEW_THROW_EX (tio, TAO_TIO (lower, upper), CORBA::NO_MEMORY ()); PortableServer::ServantBase_var xfer = tio; return tio->_this (); }
CosTime::UTO_ptr TAO_Time_Service_Server::new_universal_time | ( | TimeBase::TimeT | time, | |
TimeBase::InaccuracyT | inaccuracy, | |||
TimeBase::TdfT | tdf | |||
) | [virtual] |
This creates a new UTO based on the given parameters.
Definition at line 64 of file TAO_Time_Service_Server.cpp.
{ TAO_UTO *uto = 0; ACE_NEW_THROW_EX (uto, TAO_UTO (time, inaccuracy, tdf), CORBA::NO_MEMORY ()); PortableServer::ServantBase_var xfer = uto; return uto->_this (); }
CosTime::UTO_ptr TAO_Time_Service_Server::secure_universal_time | ( | void | ) | [virtual] |
This operation returns the current time in a UTO only if the time can be guaranteed to have been obtained securely. Currently this operation is not implemented and throws a CORBA::NO_IMPLEMENT exception, if called.
Definition at line 56 of file TAO_Time_Service_Server.cpp.
{
throw CORBA::NO_IMPLEMENT ();
}
CosTime::UTO_ptr TAO_Time_Service_Server::universal_time | ( | void | ) | [virtual] |
This operation returns the current system time and an estimate of inaccuracy in a UTO.
Definition at line 29 of file TAO_Time_Service_Server.cpp.
{ TAO_UTO *uto = 0; TimeBase::TimeT timestamp; ORBSVCS_Time::Absolute_Time_Value_to_TimeT(timestamp, ACE_OS::gettimeofday()); // Return the local time of the system as a UTO. ACE_NEW_THROW_EX (uto, TAO_UTO (timestamp, 0, 0), CORBA::NO_MEMORY ()); PortableServer::ServantBase_var xfer = uto; if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Returning a UTO\n")); return uto->_this (); }
CosTime::UTO_ptr TAO_Time_Service_Server::uto_from_utc | ( | const TimeBase::UtcT & | utc | ) | [virtual] |
This creates a new UTO given a time in the UtcT form.
Definition at line 83 of file TAO_Time_Service_Server.cpp.
{ TAO_UTO *uto = 0; ACE_NEW_THROW_EX (uto, TAO_UTO (utc.time, utc.inacclo + utc.inacchi, utc.tdf), CORBA::NO_MEMORY ()); PortableServer::ServantBase_var xfer = uto; return uto->_this (); }