コード例 #1
0
CosTime::UTO_ptr
TAO_Time_Service_Server::uto_from_utc (const TimeBase::UtcT &utc)
{
  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 ();
}
コード例 #2
0
CosTime::UTO_ptr
TAO_Time_Service_Clerk::universal_time (void)
{
  TAO_UTO *uto = 0;

  ACE_NEW_THROW_EX (uto,
                    TAO_UTO (this->get_time (),
                             this->inaccuracy (),
                             this->time_displacement_factor ()),
                    CORBA::NO_MEMORY ());
  // Return the global time as a UTO.

  return uto->_this ();
}
コード例 #3
0
CosTime::UTO_ptr
TAO_Time_Service_Clerk::new_universal_time (TimeBase::TimeT time,
                                            TimeBase::InaccuracyT inaccuracy,
                                            TimeBase::TdfT tdf)
{
  TAO_UTO *uto = 0;

  ACE_NEW_THROW_EX (uto,
                    TAO_UTO (time,
                             inaccuracy,
                             tdf),
                    CORBA::NO_MEMORY ());

  return uto->_this ();
}
コード例 #4
0
CosTime::UTO_ptr
TAO_Time_Service_Clerk::uto_from_utc (const TimeBase::UtcT &utc)
{
  TAO_UTO *uto = 0;

  // Use the low and high values of inaccuracy
  // to calculate the total inaccuracy.

  TimeBase::InaccuracyT inaccuracy = utc.inacchi;
  inaccuracy <<= 32;
  inaccuracy |= utc.inacclo;

  ACE_NEW_THROW_EX (uto,
                    TAO_UTO (utc.time,
                             inaccuracy,
                             utc.tdf),
                    CORBA::NO_MEMORY ());
  return uto->_this ();
}
コード例 #5
0
CosTime::UTO_ptr
TAO_Time_Service_Server::universal_time (void)
{
  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)
    ORBSVCS_DEBUG ((LM_DEBUG,
                "Returning a UTO\n"));

  return uto->_this ();
}