00001 // -*- C++ -*- 00002 // TimeService.idl,v 1.6 1999/09/13 23:48:28 irfan Exp 00003 00004 #ifndef TAO_TIME_IDL 00005 #define TAO_TIME_IDL 00006 00007 #include "TimeBase.idl" 00008 00009 #pragma prefix "omg.org" 00010 00011 module CosTime 00012 { 00013 // = TITLE 00014 // CosTime Module 00015 // 00016 // = DESCRIPTION 00017 // This module has all the interfaces, and associated enum 00018 // and exception declarations for the time service. 00019 00020 enum TimeComparison 00021 { 00022 // = TITLE 00023 // TimeComparison defines the possible values that can be 00024 // returned as a result of comparing two UTOs. 00025 00026 TCEqualTo, 00027 TCLessThan, 00028 TCGreaterThan, 00029 TCIndeterminate 00030 }; 00031 00032 enum ComparisonType 00033 { 00034 // = TITLE 00035 // ComparisonType defines the possible ways in which the times can 00036 // be compared. 00037 00038 IntervalC, 00039 MidC 00040 }; 00041 00042 enum OverlapType 00043 { 00044 // = TITLE 00045 // OverlapType specifies the type of overlap between two time 00046 // intervals. 00047 00048 OTContainer, 00049 OTContained, 00050 OTOverlap, 00051 OTNoOverlap 00052 }; 00053 00054 exception TimeUnavailable 00055 { 00056 // = TITLE 00057 // TimeUnavailable exception is raised by the Timeservice when 00058 // it cannot successfully return time. 00059 }; 00060 00061 interface TIO; // forward declaration. 00062 00063 interface UTO 00064 { 00065 // = TITLE 00066 // The interface UTO is an encapsulation of time. 00067 // 00068 // = DESCRIPTION 00069 // This interface provides the following 00070 // operations on basic time : 00071 // - Construction of a UTO from piece parts, and extraction of the 00072 // piece parts from a UTO. The piece parts are the readonly 00073 // attributes : 00074 // time 00075 // inaccuracy 00076 // time displacement factor 00077 // structure with all the above. 00078 // 00079 // - Comparison of time. 00080 // 00081 // - Conversion from relative to absolute time, and conversion to 00082 // an interval (TIO) 00083 00084 readonly attribute TimeBase::TimeT time; 00085 // absolute tine value. 00086 00087 readonly attribute TimeBase::InaccuracyT inaccuracy; 00088 // inaccuracy in the time. 00089 00090 readonly attribute TimeBase::TdfT tdf; 00091 // the time displacement factor. 00092 00093 readonly attribute TimeBase::UtcT utc_time; 00094 // structure having the absolute time, the inaccuracy and the time 00095 // displacement factor. 00096 00097 UTO absolute_time (); 00098 // This returns the absolute time by adding the base time to the 00099 // relative time in the object. 00100 00101 TimeComparison compare_time (in ComparisonType comparison_type, 00102 in UTO otu); 00103 // Compares the time contained in the object with the time in 00104 // the supplied uto according to the supplied comparison type. 00105 00106 TIO time_to_interval (in UTO otu); 00107 // Returns a TIO representing the time interval between the time 00108 // in the object and the time in the UTO passed as a 00109 // parameter. The interval returned is the interval between the 00110 // mid-points of the two UTOs. Inaccuracies are ignored. Note 00111 // the result of this operation is meaningless if the base times 00112 // of UTOs are different. 00113 00114 TIO interval (); 00115 // Returns a TIO object representing the error interval around 00116 // the time value in the UTO. 00117 }; 00118 00119 interface TIO 00120 { 00121 // = TITLE 00122 // The TIO represents a time interval. 00123 // 00124 // = DESCRIPTION 00125 // This interface has operations to compare itself with a UTO or 00126 // another TIO. It also has an operation to create a UTO from 00127 // the value of it's time interval. 00128 00129 readonly attribute TimeBase::IntervalT time_interval; 00130 // Consists of a lower and an upper bound for the time interval. 00131 00132 CosTime::OverlapType spans (in UTO time, 00133 out TIO overlap); 00134 // This operation compares the time in this interface with the time 00135 // in the supplied UTO and returns the overlap type as well as the 00136 // interval of overlap in the form of a TIO. 00137 00138 CosTime::OverlapType overlaps (in TIO interval, 00139 out TIO overlap); 00140 // This operation compares the time in this interface with the time 00141 // in the supplied TIO and returns the overlap type as well as the 00142 // interval of overlap in the form of a TIO. 00143 00144 UTO time (); 00145 // Converts the time interval in this interface into a UTO object by 00146 // taking the midpoint of the interval as the time and the interval 00147 // as the error envelope around the time. 00148 00149 }; 00150 00151 interface TimeService 00152 { 00153 // = TITLE 00154 // The time service manages the UTOs and the TIOs. This is the first 00155 // interface seen by the clients requesting time. 00156 00157 UTO universal_time () raises (TimeUnavailable); 00158 // This operation returns the current time and an estimate of 00159 // inaccuracy in a UTO. 00160 00161 UTO secure_universal_time () raises(TimeUnavailable); 00162 // This operation returns the current time in a UTO only if the 00163 // time can be guaranteed to have been obtained securely. 00164 00165 UTO new_universal_time (in TimeBase::TimeT time, 00166 in TimeBase::InaccuracyT inaccuracy, 00167 in TimeBase::TdfT tdf); 00168 // This creates a new UTO based on the given parameters. 00169 00170 UTO uto_from_utc (in TimeBase::UtcT utc); 00171 // This creates a new UTO given a time in the UtcT form. 00172 00173 TIO new_interval (in TimeBase::TimeT lower, 00174 in TimeBase::TimeT upper ); 00175 // This creates a new TIO with the given parameters. 00176 }; 00177 }; 00178 00179 #endif /* TAO_TIME_IDL */