00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file TAO_UTO.h 00006 * 00007 * TAO_UTO.h,v 1.16 2006/03/14 06:14:35 jtc Exp 00008 * 00009 * This class implements the CosTime::UTO IDL interface. 00010 * 00011 * 00012 * @author Vishal Kachroo <vishal@cs.wustl.edu> 00013 */ 00014 //============================================================================= 00015 00016 00017 #ifndef TAO_UTO_H 00018 #define TAO_UTO_H 00019 #include /**/ "ace/pre.h" 00020 00021 #include "orbsvcs/TimeServiceS.h" 00022 #include "orbsvcs/Time/time_export.h" 00023 00024 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00025 00026 /** 00027 * @class TAO_UTO 00028 * 00029 * @brief Universal Time Object Implementation. 00030 * 00031 * This is an encapsulation of the time. It provides the following 00032 * operations on basic time. 00033 * - Construction of a UTO from piece parts, and extraction of the 00034 * piece parts from a UTO. The piece parts are the readonly 00035 * attributes : 00036 * time 00037 * inaccuracy 00038 * time displacement factor 00039 * structure with all the above. 00040 * - Comparison of time. 00041 * - Conversion from relative to absolute time, and conversion to 00042 * an interval (TIO). 00043 */ 00044 class TAO_Time_Export TAO_UTO : public POA_CosTime::UTO 00045 { 00046 public: 00047 // = Initialization and termination methods. 00048 /// Constructor. 00049 TAO_UTO (TimeBase::TimeT time, 00050 TimeBase::InaccuracyT inaccuracy, 00051 TimeBase::TdfT tdf); 00052 00053 /// Destructor. 00054 ~TAO_UTO (void); 00055 00056 /// For the readonly attribute <time>. 00057 virtual TimeBase::TimeT time ( 00058 ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) 00059 ACE_THROW_SPEC ((CORBA::SystemException)); 00060 00061 /// For the readonly attribute <inaccuracy>. 00062 virtual TimeBase::InaccuracyT inaccuracy (ACE_ENV_SINGLE_ARG_DECL) 00063 ACE_THROW_SPEC ((CORBA::SystemException)); 00064 00065 /// For the readonly attribute <tdf>, which is the "time displacement 00066 /// factor". 00067 virtual TimeBase::TdfT tdf (ACE_ENV_SINGLE_ARG_DECL) 00068 ACE_THROW_SPEC ((CORBA::SystemException)); 00069 00070 /// For the readonly attribute <utc_time>. 00071 virtual TimeBase::UtcT utc_time (ACE_ENV_SINGLE_ARG_DECL) 00072 ACE_THROW_SPEC ((CORBA::SystemException)); 00073 00074 /** 00075 * Absolute time = Relative time + Base time. 00076 * ?? Find out more about the Base Time, UTC and 00077 * Distributed Time Sync. Algos. [3 00078 */ 00079 CosTime::UTO_ptr absolute_time (ACE_ENV_SINGLE_ARG_DECL) 00080 ACE_THROW_SPEC ((CORBA::SystemException)); 00081 00082 /// Compares the time contained in the object with the time in the 00083 /// supplied uto according to the supplied comparison type. 00084 CosTime::TimeComparison compare_time (CosTime::ComparisonType comparison_type, 00085 CosTime::UTO_ptr uto 00086 ACE_ENV_ARG_DECL) 00087 ACE_THROW_SPEC ((CORBA::SystemException)); 00088 00089 /** 00090 * Returns a TIO representing the time interval between the time in 00091 * the object and the time in the UTO passed as a parameter. The 00092 * interval returned is the interval between the mid-points of the 00093 * two UTOs. Inaccuracies are ignored. Note the result of this 00094 * operation is meaningless if the base times of UTOs are different. 00095 */ 00096 CosTime::TIO_ptr time_to_interval (CosTime::UTO_ptr 00097 ACE_ENV_ARG_DECL) 00098 ACE_THROW_SPEC ((CORBA::SystemException)); 00099 00100 /// Returns a TIO object representing the error interval around the 00101 /// time value in the UTO. 00102 CosTime::TIO_ptr interval (ACE_ENV_SINGLE_ARG_DECL) 00103 ACE_THROW_SPEC ((CORBA::SystemException)); 00104 00105 private: 00106 /** 00107 * The readonly attribute structure having the time, inaccuracy and 00108 * displacement. The get methods for other readonly attributes 00109 * (time, inaccuracy, tdf) defined in the IDL use the members of 00110 * this structure and hence need not have separate member variables 00111 * for them. 00112 */ 00113 TimeBase::UtcT attr_utc_time_; 00114 }; 00115 00116 TAO_END_VERSIONED_NAMESPACE_DECL 00117 00118 #include /**/ "ace/post.h" 00119 #endif /* TAO_UTO_H */