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