//File: TimeBase.idl
//Part of the Time Service

#ifndef _TIME_BASE_IDL_
#define _TIME_BASE_IDL_

/**
 * TimeBase definition
 */
module TimeBase {

  typePrefix TimeBase "omg.org";

  /**
	  * TimeT represents a simple time value, whitch is 64 bits in size, and holds the number
	  * of 100 nanoseconds that have passed since the base time. For absolute time the base is
	  * 15 October 1582 00:00
	  */
	 typedef unsigned long long	TimeT;

	
 	/**
  	* InaccuracyT represents the value of inaccuracy in time in units of 100 nanoseconds. As per the
  	* definition of the inaccuracy field in the X/Open DCE Time Service, 48 bits is sufficient to hold this value
  	*
  	*/
 	typedef TimeT 			InaccuracyT;
	
 	/**
  	* Tdft is of size 16 bits short type and holds the time displacement factor in the form of minutes of
  	* displacement from the Greenwich Meridian. Displacements East of the meridian is positive, while those to 
  	* the West are negative
  	*/
 	typedef short 			TdfT;
	
 	/**
  	* Utct defines the structure of the time value that is used universally in this service.
  	* The basic value of time is of type TimeT that is held in the time field. Whether a Utct structure
  	* is holding a relativeor absolute time is determined by its history. There is no explicit flag whithin
  	* the object holding that state information. The inacclo and inacchi field together hold a 48-bit estimate
  	* of inaccuracy in the time field. These two fields together hold a value of type InaccuracyT packed into 48 bits.
  	* The tdf field hold time zone information. Implementation must place the time displacement factor for the local
  	* time zone in this field whenever they create a UTO.
  	*/
 	struct UtcT {
 		TimeT			time;		// 8 octets
 		unsigned long	inacclo;	// 4 octets
 		unsigned short	inacchi;	// 2 octets
 		TdfT			tdf;		// 2 octets 
 									// total 16 octets.
 	};

 	/**
  	* This type holds a time interval represented as two TimeT values corresponding to the lower and upper bound of the interval.
  	* An IntervalT structure containing a lower bound greater than the upper bound is invalid. For the interval to be meaningful,
  	* the time base used for the lower and upper bound must be same, and the time base itself must not be spanned by the interval
  	*/
 	struct IntervalT {
 		TimeT			lower_bound;
 		TimeT			upper_bound;
 	};
};
#endif // _TIME_BASE_IDL_ 
