summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs')
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp300
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_TIO.h20
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp31
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.h41
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp29
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.h25
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp53
-rw-r--r--TAO/orbsvcs/orbsvcs/Time/TAO_UTO.h32
8 files changed, 291 insertions, 240 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp
index 53af7791ed0..87407d61c47 100644
--- a/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.cpp
@@ -5,7 +5,7 @@
// Constructor.
TAO_TIO::TAO_TIO (TimeBase::TimeT lower,
- TimeBase::TimeT upper)
+ TimeBase::TimeT upper)
{
this->attr_time_interval.lower_bound = lower;
this->attr_time_interval.upper_bound = upper;
@@ -20,6 +20,7 @@ TAO_TIO::~TAO_TIO (void)
TimeBase::IntervalT
TAO_TIO::time_interval (CORBA::Environment &)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
return attr_time_interval;
}
@@ -32,100 +33,101 @@ TAO_TIO::time_interval (CORBA::Environment &)
CosTime::OverlapType
TAO_TIO::spans (CosTime::UTO_ptr uto,
- CosTime::TIO_out overlap,
- CORBA::Environment &ACE_TRY_ENV)
+ CosTime::TIO_out overlap,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_TIO *tio = 0;
-
+
ACE_TRY
{
TimeBase::TimeT lb1 =
- this->time_interval (ACE_TRY_ENV).lower_bound;
+ this->time_interval (ACE_TRY_ENV).lower_bound;
ACE_TRY_CHECK;
-
+
TimeBase::TimeT up1 =
- this->time_interval (ACE_TRY_ENV).upper_bound;
+ this->time_interval (ACE_TRY_ENV).upper_bound;
ACE_TRY_CHECK;
-
+
TimeBase::TimeT lb2 =
- uto->time (ACE_TRY_ENV) - uto->inaccuracy (ACE_TRY_ENV);
+ uto->time (ACE_TRY_ENV) - uto->inaccuracy (ACE_TRY_ENV);
ACE_TRY_CHECK;
-
+
TimeBase::TimeT up2 =
- uto->time (ACE_TRY_ENV) + uto->inaccuracy (ACE_TRY_ENV);
+ uto->time (ACE_TRY_ENV) + uto->inaccuracy (ACE_TRY_ENV);
ACE_TRY_CHECK;
-
+
if (lb1 == lb2 && up1 == up2)
- {
- ACE_NEW_RETURN (tio,
- TAO_TIO (lb1, up1),
- CosTime::OTNoOverlap);
- overlap = tio->_this ();
-
- return CosTime::OTOverlap;
- }
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (lb1, up1),
+ CosTime::OTNoOverlap);
+ overlap = tio->_this ();
+
+ return CosTime::OTOverlap;
+ }
else if (lb1 > lb2 && up1 < up2)
- {
- ACE_NEW_RETURN (tio,
- TAO_TIO (lb1, up1),
- CosTime::OTNoOverlap);
-
- overlap = tio->_this ();
-
- return CosTime::OTContained;
- }
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (lb1, up1),
+ CosTime::OTNoOverlap);
+
+ overlap = tio->_this ();
+
+ return CosTime::OTContained;
+ }
else if (lb1 < lb2 && up1 > up2)
- {
- ACE_NEW_RETURN (tio,
- TAO_TIO (lb2, up2),
- CosTime::OTNoOverlap);
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (lb2, up2),
+ CosTime::OTNoOverlap);
- overlap = tio->_this ();
+ overlap = tio->_this ();
- return CosTime::OTContained;
- }
+ return CosTime::OTContained;
+ }
else if (lb1 < lb2)
- {
- if (up1 < lb2)
- {
- ACE_NEW_RETURN (tio,
- TAO_TIO (0, 0),
- CosTime::OTNoOverlap);
-
- overlap = tio->_this ();
-
- return CosTime::OTNoOverlap;
- }
- else
- {
- ACE_NEW_RETURN (tio,
- TAO_TIO (lb2, up1),
- CosTime::OTNoOverlap);
- overlap = tio->_this ();
-
- return CosTime::OTOverlap;
- }
- }
+ {
+ if (up1 < lb2)
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (0, 0),
+ CosTime::OTNoOverlap);
+
+ overlap = tio->_this ();
+
+ return CosTime::OTNoOverlap;
+ }
+ else
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (lb2, up1),
+ CosTime::OTNoOverlap);
+ overlap = tio->_this ();
+
+ return CosTime::OTOverlap;
+ }
+ }
else if (up2 < lb1)
- {
+ {
- ACE_NEW_RETURN (tio,
- TAO_TIO (0, 0),
- CosTime::OTNoOverlap);
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (0, 0),
+ CosTime::OTNoOverlap);
- overlap = tio->_this ();
+ overlap = tio->_this ();
- return CosTime::OTNoOverlap;
- }
+ return CosTime::OTNoOverlap;
+ }
else
- {
- ACE_NEW_RETURN (tio,
- TAO_TIO (lb1, up2),
- CosTime::OTNoOverlap);
+ {
+ ACE_NEW_RETURN (tio,
+ TAO_TIO (lb1, up2),
+ CosTime::OTNoOverlap);
- overlap = tio->_this ();
+ overlap = tio->_this ();
- }
+ }
}
ACE_CATCHANY
{
@@ -133,7 +135,7 @@ TAO_TIO::spans (CosTime::UTO_ptr uto,
}
ACE_ENDTRY;
ACE_CHECK_RETURN (CosTime::OTNoOverlap);
-
+
return CosTime::OTNoOverlap;
}
@@ -145,96 +147,97 @@ TAO_TIO::spans (CosTime::UTO_ptr uto,
CosTime::OverlapType
TAO_TIO::overlaps (CosTime::TIO_ptr tio,
- CosTime::TIO_out overlap,
- CORBA::Environment &ACE_TRY_ENV)
+ CosTime::TIO_out overlap,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_TIO *tio_i = 0;
-
+
ACE_TRY
{
TimeBase::TimeT lb1 =
- this->time_interval (ACE_TRY_ENV).lower_bound;
+ this->time_interval (ACE_TRY_ENV).lower_bound;
TimeBase::TimeT up1 =
- this->time_interval (ACE_TRY_ENV).upper_bound;
+ this->time_interval (ACE_TRY_ENV).upper_bound;
TimeBase::TimeT lb2 =
- tio->time_interval (ACE_TRY_ENV).lower_bound;
+ tio->time_interval (ACE_TRY_ENV).lower_bound;
TimeBase::TimeT up2 =
- tio->time_interval (ACE_TRY_ENV).upper_bound;
+ tio->time_interval (ACE_TRY_ENV).upper_bound;
ACE_TRY_CHECK;
if (lb1 == lb2 && up1 == up2)
- {
- ACE_NEW_RETURN (tio_i,
- TAO_TIO (lb1, up1),
- CosTime::OTNoOverlap);
-
- overlap = tio_i->_this ();
-
- return CosTime::OTOverlap;
- }
+ {
+ ACE_NEW_RETURN (tio_i,
+ TAO_TIO (lb1, up1),
+ CosTime::OTNoOverlap);
+
+ overlap = tio_i->_this ();
+
+ return CosTime::OTOverlap;
+ }
else if (lb1 > lb2 && up1 < up2)
- {
- ACE_NEW_RETURN (tio_i,
- TAO_TIO (lb1, up1),
- CosTime::OTNoOverlap);
-
- overlap = tio_i->_this ();
-
- return CosTime::OTContained;
- }
+ {
+ ACE_NEW_RETURN (tio_i,
+ TAO_TIO (lb1, up1),
+ CosTime::OTNoOverlap);
+
+ overlap = tio_i->_this ();
+
+ return CosTime::OTContained;
+ }
else if (lb1 < lb2 && up1 > up2)
- {
- ACE_NEW_RETURN (tio_i,
- TAO_TIO (lb2, up2),
- CosTime::OTNoOverlap);
+ {
+ ACE_NEW_RETURN (tio_i,
+ TAO_TIO (lb2, up2),
+ CosTime::OTNoOverlap);
- overlap = tio_i->_this ();
+ overlap = tio_i->_this ();
- return CosTime::OTContained;
- }
+ return CosTime::OTContained;
+ }
else if (lb1 < lb2)
- {
- if (up1 < lb2)
- {
- ACE_NEW_RETURN (tio_i,
- TAO_TIO (0, 0),
- CosTime::OTNoOverlap);
-
- overlap = tio_i->_this ();
-
- return CosTime::OTNoOverlap;
- }
- else
- {
- ACE_NEW_RETURN (tio_i,
- TAO_TIO (lb2, up1),
- CosTime::OTNoOverlap);
-
- overlap = tio_i->_this ();
-
- return CosTime::OTOverlap;
- }
- }
+ {
+ if (up1 < lb2)
+ {
+ ACE_NEW_RETURN (tio_i,
+ TAO_TIO (0, 0),
+ CosTime::OTNoOverlap);
+
+ overlap = tio_i->_this ();
+
+ return CosTime::OTNoOverlap;
+ }
+ else
+ {
+ ACE_NEW_RETURN (tio_i,
+ TAO_TIO (lb2, up1),
+ CosTime::OTNoOverlap);
+
+ overlap = tio_i->_this ();
+
+ return CosTime::OTOverlap;
+ }
+ }
else if (up2 < lb1)
- {
- ACE_NEW_RETURN (tio_i,
- TAO_TIO (0, 0),
- CosTime::OTNoOverlap);
+ {
+ ACE_NEW_RETURN (tio_i,
+ TAO_TIO (0, 0),
+ CosTime::OTNoOverlap);
- overlap = tio_i->_this ();
+ overlap = tio_i->_this ();
- return CosTime::OTNoOverlap;
- }
+ return CosTime::OTNoOverlap;
+ }
else
- {
- ACE_NEW_RETURN (tio_i,
- TAO_TIO (lb1, up2),
- CosTime::OTNoOverlap);
+ {
+ ACE_NEW_RETURN (tio_i,
+ TAO_TIO (lb1, up2),
+ CosTime::OTNoOverlap);
- overlap = tio_i->_this ();
+ overlap = tio_i->_this ();
- }
+ }
}
ACE_CATCHANY
{
@@ -242,25 +245,26 @@ TAO_TIO::overlaps (CosTime::TIO_ptr tio,
}
ACE_ENDTRY;
ACE_CHECK_RETURN (CosTime::OTNoOverlap);
-
+
return CosTime::OTNoOverlap;
}
CosTime::UTO_ptr
TAO_TIO::time (CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_UTO *uto = 0;
-
+
ACE_NEW_THROW_EX (uto,
- TAO_UTO ((this->time_interval (ACE_TRY_ENV).upper_bound -
- this->time_interval (ACE_TRY_ENV).lower_bound) / 2,
- this->time_interval (ACE_TRY_ENV).upper_bound -
- this->time_interval (ACE_TRY_ENV).lower_bound,
- 0),
- CORBA::NO_MEMORY ());
-
+ TAO_UTO ((this->time_interval (ACE_TRY_ENV).upper_bound -
+ this->time_interval (ACE_TRY_ENV).lower_bound) / 2,
+ this->time_interval (ACE_TRY_ENV).upper_bound -
+ this->time_interval (ACE_TRY_ENV).lower_bound,
+ 0),
+ CORBA::NO_MEMORY ());
+
ACE_CHECK_RETURN (CosTime::UTO::_nil ());
-
+
return uto->_this ();
}
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.h b/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.h
index b3c3abe09a4..cca8ce959d4 100644
--- a/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.h
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_TIO.h
@@ -18,7 +18,7 @@
// ============================================================================
#ifndef TAO_TIO_H
-#define TAO_TIO_H
+#define TAO_TIO_H
#include "tao/TAO.h"
#include "orbsvcs/TimeServiceS.h"
@@ -37,18 +37,20 @@ class TAO_ORBSVCS_Export TAO_TIO : public POA_CosTime::TIO
public:
// = Initialization and termination methods.
TAO_TIO (TimeBase::TimeT lower,
- TimeBase::TimeT upper);
+ TimeBase::TimeT upper);
// Constructor.
~TAO_TIO (void);
// Destructor.
- virtual TimeBase::IntervalT time_interval (CORBA::Environment &env);
+ virtual TimeBase::IntervalT time_interval (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// This is the get method for the attribute time interval.
virtual CosTime::OverlapType spans (CosTime::UTO_ptr time,
- CosTime::TIO_out overlap,
- CORBA::Environment &env);
+ CosTime::TIO_out overlap,
+ CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// This operation returns a value of type OverlapType depending on
// how the interval in the object and the time range represented by
// the parameter UTO overlap. If OverlapType is not OTNoOverlap,
@@ -57,15 +59,17 @@ public:
// intervals.
virtual CosTime::OverlapType overlaps (CosTime::TIO_ptr interval,
- CosTime::TIO_out overlap,
- CORBA::Environment &env);
+ CosTime::TIO_out overlap,
+ CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// This operation returns a value of type OverlapType depending on
// how the interval in the object and interval in the parameter TIO
// overlap. If OverlapType is not OTNoOverlap, then the out
// parameter overlap contains the overlap interval, otherwise the
// out parameter contains the gap between the two intervals.
- virtual CosTime::UTO_ptr time (CORBA::Environment &env);
+ virtual CosTime::UTO_ptr time (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// Returns a UTO in which the inaccuracy interval is equal to the
// time interval in the TIO and time value is the midpoint of the
// interval.
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp
index b1de20420ed..7ab3143518f 100644
--- a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.cpp
@@ -7,7 +7,7 @@
// Constructor.
TAO_Time_Service_Clerk::TAO_Time_Service_Clerk (int timer_value,
- const IORS& servers)
+ const IORS& servers)
: server_ (servers),
helper_ (this)
{
@@ -20,8 +20,8 @@ TAO_Time_Service_Clerk::TAO_Time_Service_Clerk (int timer_value,
ACE_Time_Value::zero,
ACE_Time_Value (timer_value)) == -1)
ACE_ERROR ((LM_ERROR,
- "%p\n",
- "schedule_timer ()"));
+ "%p\n",
+ "schedule_timer ()"));
}
// Destructor.
@@ -35,6 +35,8 @@ TAO_Time_Service_Clerk::~TAO_Time_Service_Clerk (void)
CosTime::UTO_ptr
TAO_Time_Service_Clerk::universal_time (CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable))
{
TAO_UTO *uto = 0;
@@ -55,6 +57,8 @@ TAO_Time_Service_Clerk::universal_time (CORBA::Environment &ACE_TRY_ENV)
CosTime::UTO_ptr
TAO_Time_Service_Clerk::secure_universal_time (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable))
{
env.exception (new CORBA::NO_IMPLEMENT ());
return 0;
@@ -64,9 +68,10 @@ TAO_Time_Service_Clerk::secure_universal_time (CORBA::Environment &env)
CosTime::UTO_ptr
TAO_Time_Service_Clerk::new_universal_time (TimeBase::TimeT time,
- TimeBase::InaccuracyT inaccuracy,
- TimeBase::TdfT tdf,
- CORBA::Environment &ACE_TRY_ENV)
+ TimeBase::InaccuracyT inaccuracy,
+ TimeBase::TdfT tdf,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_UTO *uto = 0;
@@ -83,7 +88,8 @@ TAO_Time_Service_Clerk::new_universal_time (TimeBase::TimeT time,
CosTime::UTO_ptr
TAO_Time_Service_Clerk::uto_from_utc (const TimeBase::UtcT &utc,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_UTO *uto = 0;
@@ -107,8 +113,9 @@ TAO_Time_Service_Clerk::uto_from_utc (const TimeBase::UtcT &utc,
CosTime::TIO_ptr
TAO_Time_Service_Clerk::new_interval (TimeBase::TimeT lower,
- TimeBase::TimeT upper,
- CORBA::Environment &ACE_TRY_ENV)
+ TimeBase::TimeT upper,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_TIO *tio = 0;
@@ -128,12 +135,12 @@ TAO_Time_Service_Clerk::get_time (void)
CORBA::ULongLong time;
time = (CORBA::ULongLong) (ACE_static_cast (CORBA::ULongLong,
- ACE_OS::gettimeofday ().sec ()) *
+ ACE_OS::gettimeofday ().sec ()) *
ACE_static_cast (ACE_UINT32,
10000000) +
- ACE_static_cast (CORBA::ULongLong,
+ ACE_static_cast (CORBA::ULongLong,
ACE_OS::gettimeofday ().usec () * 10))
- - this->update_timestamp_
+ - this->update_timestamp_
+ this->time_;
return time;
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.h b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.h
index bf1dc48e071..6805e8f844d 100644
--- a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.h
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Clerk.h
@@ -18,7 +18,7 @@
// ============================================================================
#ifndef TAO_TIME_SERVICE_CLERK_H
-#define TAO_TIME_SERVICE_CLERK_H
+#define TAO_TIME_SERVICE_CLERK_H
#include "ace/Reactor.h"
#include "orbsvcs/Naming/Naming_Utils.h"
@@ -48,35 +48,42 @@ public:
// = Initialization and termination methods.
TAO_Time_Service_Clerk (int timer_value,
- const IORS& server);
+ const IORS& server);
// Constructor.
~TAO_Time_Service_Clerk (void);
// Destructor.
- virtual CosTime::UTO_ptr universal_time (CORBA::Environment &env);
+ virtual CosTime::UTO_ptr universal_time (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable));
// This operation returns the global time and an estimate of
// inaccuracy in a UTO.
- virtual CosTime::UTO_ptr secure_universal_time (CORBA::Environment &env);
+ virtual CosTime::UTO_ptr secure_universal_time (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable));
// 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.
virtual CosTime::UTO_ptr new_universal_time (TimeBase::TimeT time,
- TimeBase::InaccuracyT inaccuracy,
- TimeBase::TdfT tdf,
- CORBA::Environment &env);
+ TimeBase::InaccuracyT inaccuracy,
+ TimeBase::TdfT tdf,
+ CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// This creates a new UTO based on the given parameters.
virtual CosTime::UTO_ptr uto_from_utc (const TimeBase::UtcT &utc,
- CORBA::Environment &env);
+ CORBA::Environment &env)
+ ACE_THROW_SPEC ((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,
- CORBA::Environment &env);
+ TimeBase::TimeT upper,
+ CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// This creates a new TIO with the given parameters.
virtual CORBA::ULongLong get_time (void);
@@ -85,19 +92,19 @@ public:
void name_server (TAO_Naming_Server &server);
// This method is called by the driver program to set the Naming
// Server instance.
-
+
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.
-
+ // GET method for inaccuracy.
+
void inaccuracy (TimeBase::InaccuracyT inaccuracy);
- // SET method for inaccuracy.
-
+ // SET method for inaccuracy.
+
CORBA::ULongLong time_;
// Clerk's notion of time.
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp
index 4603be30a86..5b94a8eebc3 100644
--- a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.cpp
@@ -21,13 +21,15 @@ TAO_Time_Service_Server::~TAO_Time_Service_Server (void)
CosTime::UTO_ptr
TAO_Time_Service_Server::universal_time (CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable))
{
TAO_UTO *uto = 0;
// Return the local time of the system as a UTO.
ACE_NEW_THROW_EX (uto,
TAO_UTO (ACE_static_cast(CORBA::ULongLong,
- ACE_OS::gettimeofday ().sec ()) *
+ ACE_OS::gettimeofday ().sec ()) *
ACE_static_cast(ACE_UINT32,
10000000) +
ACE_static_cast(CORBA::ULongLong,
@@ -39,17 +41,17 @@ TAO_Time_Service_Server::universal_time (CORBA::Environment &ACE_TRY_ENV)
ACE_CHECK_RETURN (CosTime::UTO::_nil ());
ACE_DEBUG ((LM_DEBUG,
- "Returning a UTO\n"));
+ "Returning a UTO\n"));
return uto->_this ();
// In case we are using the IR.
// if (this->shutdown_ != 0)
// {
- // TAO_ORB_Core_instance ()->orb ()->shutdown ();
+ // TAO_ORB_Core_instance ()->orb ()->shutdown ();
- // ACE_DEBUG ((LM_DEBUG,
- // "Shutting down the ORB\n"));
+ // ACE_DEBUG ((LM_DEBUG,
+ // "Shutting down the ORB\n"));
// }
}
@@ -60,6 +62,8 @@ TAO_Time_Service_Server::universal_time (CORBA::Environment &ACE_TRY_ENV)
CosTime::UTO_ptr
TAO_Time_Service_Server::secure_universal_time (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable))
{
env.exception (new CORBA::NO_IMPLEMENT ());
return 0;
@@ -69,9 +73,10 @@ TAO_Time_Service_Server::secure_universal_time (CORBA::Environment &env)
CosTime::UTO_ptr
TAO_Time_Service_Server::new_universal_time (TimeBase::TimeT time,
- TimeBase::InaccuracyT inaccuracy,
- TimeBase::TdfT tdf,
- CORBA::Environment &ACE_TRY_ENV)
+ TimeBase::InaccuracyT inaccuracy,
+ TimeBase::TdfT tdf,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_UTO *uto = 0;
@@ -90,7 +95,8 @@ TAO_Time_Service_Server::new_universal_time (TimeBase::TimeT time,
CosTime::UTO_ptr
TAO_Time_Service_Server::uto_from_utc (const TimeBase::UtcT &utc,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_UTO *uto = 0;
@@ -107,8 +113,9 @@ TAO_Time_Service_Server::uto_from_utc (const TimeBase::UtcT &utc,
CosTime::TIO_ptr
TAO_Time_Service_Server::new_interval (TimeBase::TimeT lower,
- TimeBase::TimeT upper,
- CORBA::Environment &ACE_TRY_ENV)
+ TimeBase::TimeT upper,
+ CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_TIO *tio = 0;
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.h b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.h
index bb7d0ee6297..6abb37123fb 100644
--- a/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.h
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_Time_Service_Server.h
@@ -18,7 +18,7 @@
// ============================================================================
#ifndef TAO_TIME_SERVICE_SERVER_H
-#define TAO_TIME_SERVICE_SERVER_H
+#define TAO_TIME_SERVICE_SERVER_H
#include "orbsvcs/TimeServiceS.h"
@@ -43,28 +43,35 @@ public:
~TAO_Time_Service_Server (void);
// Destructor.
- virtual CosTime::UTO_ptr universal_time (CORBA::Environment &env);
+ virtual CosTime::UTO_ptr universal_time (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable));
// This operation returns the current system time and an estimate of
// inaccuracy in a UTO.
- virtual CosTime::UTO_ptr secure_universal_time (CORBA::Environment &env);
+ virtual CosTime::UTO_ptr secure_universal_time (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTime::TimeUnavailable));
// 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.
virtual CosTime::UTO_ptr new_universal_time (TimeBase::TimeT time,
- TimeBase::InaccuracyT inaccuracy,
- TimeBase::TdfT tdf,
- CORBA::Environment &env);
+ TimeBase::InaccuracyT inaccuracy,
+ TimeBase::TdfT tdf,
+ CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// This creates a new UTO based on the given parameters.
virtual CosTime::UTO_ptr uto_from_utc (const TimeBase::UtcT &utc,
- CORBA::Environment &env);
+ CORBA::Environment &env)
+ ACE_THROW_SPEC ((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,
- CORBA::Environment &env);
+ TimeBase::TimeT upper,
+ CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// This creates a new TIO with the given parameters.
int shutdown_;
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp b/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp
index 6a00579ab62..a8bedd3c2f7 100644
--- a/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.cpp
@@ -41,6 +41,7 @@ TAO_UTO::~TAO_UTO (void)
TimeBase::TimeT
TAO_UTO::time (CORBA::Environment &)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
return attr_utc_time_.time;
}
@@ -49,6 +50,7 @@ TAO_UTO::time (CORBA::Environment &)
TimeBase::InaccuracyT
TAO_UTO::inaccuracy (CORBA::Environment &)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
// Construct the Inaccuracy from the
// inacchi and inacclo.
@@ -63,6 +65,7 @@ TAO_UTO::inaccuracy (CORBA::Environment &)
TimeBase::TdfT
TAO_UTO::tdf (CORBA::Environment &)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
return attr_utc_time_.tdf;
}
@@ -71,6 +74,7 @@ TAO_UTO::tdf (CORBA::Environment &)
TimeBase::UtcT
TAO_UTO::utc_time (CORBA::Environment &)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
return attr_utc_time_;
}
@@ -80,6 +84,7 @@ TAO_UTO::utc_time (CORBA::Environment &)
CosTime::UTO_ptr
TAO_UTO::absolute_time (CORBA::Environment &)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
return 0;
}
@@ -91,6 +96,7 @@ CosTime::TimeComparison
TAO_UTO::compare_time (CosTime::ComparisonType comparison_type,
CosTime::UTO_ptr uto,
CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_TRY
{
@@ -146,7 +152,7 @@ TAO_UTO::compare_time (CosTime::ComparisonType comparison_type,
}
ACE_ENDTRY;
ACE_CHECK_RETURN (CosTime::TCIndeterminate);
-
+
return CosTime::TCIndeterminate;
}
@@ -159,6 +165,7 @@ TAO_UTO::compare_time (CosTime::ComparisonType comparison_type,
CosTime::TIO_ptr
TAO_UTO::time_to_interval (CosTime::UTO_ptr uto,
CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_TIO *tio = 0;
@@ -166,22 +173,22 @@ TAO_UTO::time_to_interval (CosTime::UTO_ptr uto,
{
if (this->time (ACE_TRY_ENV) > uto->time (ACE_TRY_ENV))
{
- ACE_NEW_THROW_EX (tio,
- TAO_TIO (uto->time (ACE_TRY_ENV),
- this->time (ACE_TRY_ENV)),
- CORBA::NO_MEMORY ());
-
- ACE_TRY_CHECK;
- }
+ ACE_NEW_THROW_EX (tio,
+ TAO_TIO (uto->time (ACE_TRY_ENV),
+ this->time (ACE_TRY_ENV)),
+ CORBA::NO_MEMORY ());
+
+ ACE_TRY_CHECK;
+ }
else
{
- ACE_NEW_THROW_EX (tio,
- TAO_TIO (this->time (ACE_TRY_ENV),
- uto->time (ACE_TRY_ENV)),
- CORBA::NO_MEMORY ());
-
- ACE_TRY_CHECK;
- }
+ ACE_NEW_THROW_EX (tio,
+ TAO_TIO (this->time (ACE_TRY_ENV),
+ uto->time (ACE_TRY_ENV)),
+ CORBA::NO_MEMORY ());
+
+ ACE_TRY_CHECK;
+ }
}
ACE_CATCHANY
{
@@ -190,7 +197,7 @@ TAO_UTO::time_to_interval (CosTime::UTO_ptr uto,
}
ACE_ENDTRY;
ACE_CHECK_RETURN (CosTime::TIO::_nil ());
-
+
return tio->_this ();
}
@@ -199,9 +206,10 @@ TAO_UTO::time_to_interval (CosTime::UTO_ptr uto,
CosTime::TIO_ptr
TAO_UTO::interval (CORBA::Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
{
TAO_TIO *tio = 0;
-
+
ACE_TRY
{
TimeBase::TimeT lower =
@@ -213,10 +221,10 @@ TAO_UTO::interval (CORBA::Environment &ACE_TRY_ENV)
ACE_TRY_CHECK;
ACE_NEW_THROW_EX (tio,
- TAO_TIO (lower,
- upper),
- CORBA::NO_MEMORY ());
- ACE_TRY_CHECK;
+ TAO_TIO (lower,
+ upper),
+ CORBA::NO_MEMORY ());
+ ACE_TRY_CHECK;
}
ACE_CATCHANY
{
@@ -225,7 +233,6 @@ TAO_UTO::interval (CORBA::Environment &ACE_TRY_ENV)
}
ACE_ENDTRY;
ACE_CHECK_RETURN (CosTime::TIO::_nil ());
-
+
return tio->_this ();
}
-
diff --git a/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.h b/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.h
index 4360cf131b7..b141b453cd4 100644
--- a/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.h
+++ b/TAO/orbsvcs/orbsvcs/Time/TAO_UTO.h
@@ -18,7 +18,7 @@
// ============================================================================
#ifndef TAO_UTO_H
-#define TAO_UTO_H
+#define TAO_UTO_H
#include "orbsvcs/TimeServiceS.h"
@@ -46,46 +46,54 @@ class TAO_ORBSVCS_Export TAO_UTO : public POA_CosTime::UTO
public:
// = Initialization and termination methods.
TAO_UTO (TimeBase::TimeT time,
- TimeBase::InaccuracyT inaccuracy,
- TimeBase::TdfT tdf);
+ TimeBase::InaccuracyT inaccuracy,
+ TimeBase::TdfT tdf);
// Constructor.
~TAO_UTO (void);
// Destructor.
- virtual TimeBase::TimeT time (CORBA::Environment &env);
+ virtual TimeBase::TimeT time (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// For the readonly attribute <time>.
- virtual TimeBase::InaccuracyT inaccuracy (CORBA::Environment &env);
+ virtual TimeBase::InaccuracyT inaccuracy (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// For the readonly attribute <inaccuracy>.
- virtual TimeBase::TdfT tdf (CORBA::Environment &env);
+ virtual TimeBase::TdfT tdf (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// For the readonly attribute <tdf>, which is the "time displacement
// factor".
- virtual TimeBase::UtcT utc_time (CORBA::Environment &env);
+ virtual TimeBase::UtcT utc_time (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// For the readonly attribute <utc_time>.
- CosTime::UTO_ptr absolute_time (CORBA::Environment &env);
+ CosTime::UTO_ptr absolute_time (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// Absolute time = Relative time + Base time.
// ?? Find out more about the Base Time, UTC and
// Distributed Time Sync. Algos. [3
CosTime::TimeComparison compare_time (CosTime::ComparisonType comparison_type,
- CosTime::UTO_ptr uto,
- CORBA::Environment &env);
+ CosTime::UTO_ptr uto,
+ CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// Compares the time contained in the object with the time in the
// supplied uto according to the supplied comparison type.
CosTime::TIO_ptr time_to_interval (CosTime::UTO_ptr,
- CORBA::Environment &env);
+ CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// Returns a TIO representing the time interval between the time in
// the object and the time in the UTO passed as a parameter. The
// interval returned is the interval between the mid-points of the
// two UTOs. Inaccuracies are ignored. Note the result of this
// operation is meaningless if the base times of UTOs are different.
- CosTime::TIO_ptr interval (CORBA::Environment &env);
+ CosTime::TIO_ptr interval (CORBA::Environment &env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
// Returns a TIO object representing the error interval around the
// time value in the UTO.