diff options
author | vishal <vishal@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-01-01 17:51:17 +0000 |
---|---|---|
committer | vishal <vishal@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-01-01 17:51:17 +0000 |
commit | dbf85027b5b706179f2d670cc6c60b41134b2720 (patch) | |
tree | 27f9155fcc43bf584b25bd41e9d186f0089c2cd1 /TAO | |
parent | 80f13861d1f043f15f5a6d2fd8a8966c161c69e5 (diff) | |
download | ATCD-dbf85027b5b706179f2d670cc6c60b41134b2720.tar.gz |
*** empty log message ***
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp | 5 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp | 27 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp | 11 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp | 30 |
4 files changed, 36 insertions, 37 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp index 96fbbbcbbfc..8ef8c645785 100644 --- a/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp +++ b/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp @@ -48,6 +48,8 @@ TAO_TIO::spans (CosTime::UTO_ptr uto, TimeBase::TimeT up2 = uto->time (TAO_TRY_ENV) + uto->inaccuracy (TAO_TRY_ENV); + TAO_CHECK_ENV; + if (lb1 == lb2 && up1 == up2) { ACE_NEW_RETURN (tio, @@ -153,6 +155,8 @@ TAO_TIO::overlaps (CosTime::TIO_ptr tio, TimeBase::TimeT up2 = tio->time_interval (TAO_TRY_ENV).upper_bound; + TAO_CHECK_ENV; + if (lb1 == lb2 && up1 == up2) { ACE_NEW_RETURN (tio_i, @@ -250,6 +254,7 @@ TAO_TIO::time (CORBA::Environment &_env) 0), CORBA::NO_MEMORY (CORBA::COMPLETED_NO), CosTime::UTO::_nil ()); + TAO_CHECK_ENV; } TAO_CATCHANY { diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp index aa631ee307f..dcf53d3ca55 100644 --- a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp +++ b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp @@ -11,12 +11,10 @@ TAO_Time_Service_Clerk::TAO_Time_Service_Clerk (int timer_value, : server_ (servers), helper_ (this) { - TAO_TRY - { + // Schedule the helper to be invoked by the reactor // periodically. - ACE_DEBUG ((LM_DEBUG, - "In the constructor of Clerk\n")); + if (TAO_ORB_Core_instance ()->reactor ()->schedule_timer (&helper_, 0, @@ -25,12 +23,6 @@ TAO_Time_Service_Clerk::TAO_Time_Service_Clerk (int timer_value, ACE_ERROR ((LM_ERROR, "%p\n", "schedule_timer ()")); - } - TAO_CATCHANY - { - TAO_TRY_ENV.print_exception ("(%P|%t) Exception in Clerk_i::run ()\n"); - } - TAO_ENDTRY; } // Destructor. @@ -65,16 +57,7 @@ TAO_Time_Service_Clerk::universal_time (CORBA::Environment &_env) CosTime::UTO_ptr TAO_Time_Service_Clerk::secure_universal_time (CORBA::Environment &env) { - TAO_TRY - { - TAO_TRY_ENV.exception (new CORBA::NO_IMPLEMENT (CORBA::COMPLETED_NO)); - } - TAO_CATCHANY - { - TAO_TRY_ENV.print_exception ("Exception:"); - } - TAO_ENDTRY; - + env.exception (new CORBA::NO_IMPLEMENT (CORBA::COMPLETED_NO)); return 0; } @@ -136,8 +119,10 @@ TAO_Time_Service_Clerk::get_time (void) { // Globally sync. time is the latest global time plus the time // elapsed since last updation was done. + CORBA::ULongLong time; - return ACE_OS::gettimeofday ().sec () + time = (CORBA::ULongLong) ACE_OS::gettimeofday ().sec () - this->update_timestamp_ + this->time_; + return time; } diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp index f900354f303..70df83bbfc5 100644 --- a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp +++ b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp @@ -41,16 +41,7 @@ TAO_Time_Service_Server::universal_time (CORBA::Environment &_env) CosTime::UTO_ptr TAO_Time_Service_Server::secure_universal_time (CORBA::Environment &env) { - TAO_TRY - { - TAO_TRY_ENV.exception (new CORBA::NO_IMPLEMENT (CORBA::COMPLETED_NO)); - } - TAO_CATCHANY - { - TAO_TRY_ENV.print_exception ("Exception:"); - } - TAO_ENDTRY; - + env.exception (new CORBA::NO_IMPLEMENT (CORBA::COMPLETED_NO)); return 0; } diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp index f7c937640e7..9bcdb2dc896 100644 --- a/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp +++ b/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp @@ -12,7 +12,7 @@ TAO_UTO::TAO_UTO (TimeBase::TimeT time, { this->attr_utc_time_.time = time; this->attr_utc_time_.inacchi = inaccuracy / 2; - this->attr_utc_time_.inacclo = inaccuracy - inaccuracy / 2; + this->attr_utc_time_.inacclo = (CORBA::ULong)(inaccuracy - (inaccuracy/2)); this->attr_utc_time_.tdf = tdf; } @@ -76,28 +76,46 @@ TAO_UTO::compare_time (CosTime::ComparisonType comparison_type, if (comparison_type == CosTime::MidC) { if (this->time (TAO_TRY_ENV) == uto->time (TAO_TRY_ENV)) - return CosTime::TCEqualTo; + { + TAO_CHECK_ENV; + return CosTime::TCEqualTo; + } else if (this->time (TAO_TRY_ENV) > uto->time (TAO_TRY_ENV)) - return CosTime::TCGreaterThan; + { + TAO_CHECK_ENV; + return CosTime::TCGreaterThan; + } else return CosTime::TCLessThan; } else if (this->time (TAO_TRY_ENV) == uto->time (TAO_TRY_ENV)) { + TAO_CHECK_ENV; if (this->inaccuracy (TAO_TRY_ENV) == 0 && uto->inaccuracy (TAO_TRY_ENV) == 0) - return CosTime::TCEqualTo; + { + TAO_CHECK_ENV; + return CosTime::TCEqualTo; + } } else { if (this->time (TAO_TRY_ENV) > uto->time (TAO_TRY_ENV)) { + TAO_CHECK_ENV; if (this->time (TAO_TRY_ENV) - this->inaccuracy (TAO_TRY_ENV) > uto->time (TAO_TRY_ENV) - uto->inaccuracy (TAO_TRY_ENV)) - return CosTime::TCGreaterThan; + { + TAO_CHECK_ENV; + return CosTime::TCGreaterThan; + } } else if (this->time (TAO_TRY_ENV) + this->inaccuracy (TAO_TRY_ENV) < uto->time (TAO_TRY_ENV) - uto->inaccuracy (TAO_TRY_ENV)) - return CosTime::TCLessThan; + + { + TAO_CHECK_ENV; + return CosTime::TCLessThan; + } } } |