#include <TAO_Time_Service_Clerk.h>
Collaboration diagram for TAO_Time_Service_Clerk:
Public Types | |
typedef ACE_Array_Base< CosTime::TimeService_var > | IORS |
Unbounded set of IORs. | |
Public Member Functions | |
TAO_Time_Service_Clerk (int timer_value, int timer_value_usecs, const IORS &server) | |
Constructor. | |
~TAO_Time_Service_Clerk (void) | |
Destructor. | |
virtual CosTime::UTO_ptr | universal_time (ACE_ENV_SINGLE_ARG_DECL) throw (CORBA::SystemException, CosTime::TimeUnavailable) |
virtual CosTime::UTO_ptr | secure_universal_time (ACE_ENV_SINGLE_ARG_DECL) throw (CORBA::SystemException, CosTime::TimeUnavailable) |
virtual CosTime::UTO_ptr | new_universal_time (TimeBase::TimeT time, TimeBase::InaccuracyT inaccuracy, TimeBase::TdfT tdf ACE_ENV_ARG_DECL) throw (CORBA::SystemException) |
This creates a new UTO based on the given parameters. | |
virtual CosTime::UTO_ptr | uto_from_utc (const TimeBase::UtcT &utc ACE_ENV_ARG_DECL) throw (CORBA::SystemException) |
This creates a new UTO given a time in the UtcT form. | |
virtual CosTime::TIO_ptr | new_interval (TimeBase::TimeT lower, TimeBase::TimeT upper ACE_ENV_ARG_DECL) throw (CORBA::SystemException) |
This creates a new TIO with the given parameters. | |
virtual CORBA::ULongLong | get_time (void) |
Return the globally synchronized time. | |
CORBA::Short | time_displacement_factor (void) |
Returns the time displacement factor. | |
void | time_displacement_factor (CORBA::Short) |
Set the TDF. | |
TimeBase::InaccuracyT | inaccuracy (void) |
Get method for inaccuracy. | |
void | inaccuracy (TimeBase::InaccuracyT inaccuracy) |
Set method for inaccuracy. | |
Public Attributes | |
CORBA::ULongLong | time_ |
Clerk's notion of time. | |
Private Attributes | |
CORBA::Short | time_displacement_factor_ |
Time displacement factor in minutes. | |
TimeBase::InaccuracyT | inaccuracy_ |
Inaccuracy in the time. | |
IORS | server_ |
Set of server Time Server IORs. | |
CORBA::ULongLong | update_timestamp_ |
Time when last global synchronization was done. | |
Timer_Helper | helper_ |
Friends | |
class | Timer_Helper |
Helper class to help in the updation of time. |
The Object implementation implements methods to retrieve GLOBAL time as well as secure GLOBAL time. The times are retrieved as UTOs. The object also allows creation of a TIO for a given time interval. In general, the TimeService clerk manages the UTOs and the TIOs. The notion of time returned here is the globally synchronized time.
Definition at line 42 of file TAO_Time_Service_Clerk.h.
|
Unbounded set of IORs.
Definition at line 50 of file TAO_Time_Service_Clerk.h. Referenced by TAO_Time_Service_Clerk(). |
|
Constructor.
Definition at line 14 of file TAO_Time_Service_Clerk.cpp. References ACE_ERROR, ACE_Time_Value, helper_, IORS, LM_ERROR, TAO_ORB_Core::reactor(), ACE_Reactor::schedule_timer(), and TAO_ORB_Core_instance().
00017 : server_ (servers), 00018 helper_ (this) 00019 { 00020 // Schedule the helper to be invoked by the reactor 00021 // periodically. 00022 00023 if (TAO_ORB_Core_instance ()->reactor ()->schedule_timer 00024 (&helper_, 00025 0, 00026 ACE_Time_Value::zero, 00027 ACE_Time_Value(timer_value,timer_value_usecs)) == -1) 00028 ACE_ERROR ((LM_ERROR, 00029 "%p\n", 00030 "schedule_timer ()")); 00031 } |
|
Destructor.
Definition at line 35 of file TAO_Time_Service_Clerk.cpp.
00036 { 00037 } |
|
Return the globally synchronized time.
Definition at line 138 of file TAO_Time_Service_Clerk.cpp. References ACE_OS::gettimeofday(), ACE_Time_Value::sec(), update_timestamp_, and ACE_Time_Value::usec().
00139 { 00140 // Globally sync. time is the latest global time plus the time 00141 // elapsed since last updation was done. 00142 00143 const ACE_Time_Value timeofday = ACE_OS::gettimeofday (); 00144 00145 return (CORBA::ULongLong) (static_cast<CORBA::ULongLong> (timeofday.sec ()) * 00146 static_cast<ACE_UINT32> (10000000) + 00147 static_cast<CORBA::ULongLong> (timeofday.usec () * 10)) 00148 - this->update_timestamp_ 00149 + this->time_; 00150 } |
|
Set method for inaccuracy.
Definition at line 176 of file TAO_Time_Service_Clerk.cpp. References inaccuracy_.
00177 { 00178 this->inaccuracy_ = inaccuracy; 00179 } |
|
Get method for inaccuracy.
Definition at line 169 of file TAO_Time_Service_Clerk.cpp. References inaccuracy_. Referenced by Timer_Helper::handle_timeout().
00170 { 00171 return this->inaccuracy_; 00172 } |
|
This creates a new TIO with the given parameters.
Definition at line 122 of file TAO_Time_Service_Clerk.cpp. References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_NEW_THROW_EX.
00126 { 00127 TAO_TIO *tio = 0; 00128 00129 ACE_NEW_THROW_EX (tio, 00130 TAO_TIO (lower, 00131 upper), 00132 CORBA::NO_MEMORY ()); 00133 ACE_CHECK_RETURN (CosTime::TIO::_nil ()); 00134 return tio->_this (ACE_ENV_SINGLE_ARG_PARAMETER); 00135 } |
|
This creates a new UTO based on the given parameters.
Definition at line 76 of file TAO_Time_Service_Clerk.cpp. References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_NEW_THROW_EX.
00081 { 00082 TAO_UTO *uto = 0; 00083 00084 ACE_NEW_THROW_EX (uto, 00085 TAO_UTO (time, 00086 inaccuracy, 00087 tdf), 00088 CORBA::NO_MEMORY ()); 00089 ACE_CHECK_RETURN (CosTime::UTO::_nil ()); 00090 00091 return uto->_this (ACE_ENV_SINGLE_ARG_PARAMETER); 00092 } |
|
This operation returns the global 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. |
|
Set the TDF.
Definition at line 162 of file TAO_Time_Service_Clerk.cpp. References time_displacement_factor_.
00163 { 00164 this->time_displacement_factor_ = tdf; 00165 } |
|
Returns the time displacement factor.
Definition at line 155 of file TAO_Time_Service_Clerk.cpp. References time_displacement_factor_. Referenced by Timer_Helper::handle_timeout().
00156 { 00157 return time_displacement_factor_; 00158 } |
|
This operation returns the global time and an estimate of inaccuracy in a UTO. |
|
This creates a new UTO given a time in the UtcT form.
|
|
Helper class to help in the updation of time.
Definition at line 47 of file TAO_Time_Service_Clerk.h. |
|
This is a friend class that inherits from the Event Handler class. The handle_timeout method of this class is scheduled for periodic invocation by the reactor. This method, in turn, updates the clerks notion of time. Using this class obviates the need for the clerk to multiple inherit from the servant base as well as the event handler. Definition at line 135 of file TAO_Time_Service_Clerk.h. Referenced by TAO_Time_Service_Clerk(). |
|
Inaccuracy in the time.
Definition at line 119 of file TAO_Time_Service_Clerk.h. Referenced by inaccuracy(). |
|
Set of server Time Server IORs.
Definition at line 122 of file TAO_Time_Service_Clerk.h. |
|
Clerk's notion of time.
Definition at line 111 of file TAO_Time_Service_Clerk.h. Referenced by Timer_Helper::handle_timeout(). |
|
Time displacement factor in minutes.
Definition at line 116 of file TAO_Time_Service_Clerk.h. Referenced by time_displacement_factor(). |
|
Time when last global synchronization was done.
Definition at line 125 of file TAO_Time_Service_Clerk.h. Referenced by get_time(), and Timer_Helper::handle_timeout(). |