ldas-tools-al  2.5.7
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | List of all members
LDASTools::AL::GPSTime Class Reference

GPS time class. More...

#include <gpstime.hh>

Public Types

enum  unit_type { UTC = 0, GPS }
 Enumerated type to specify time format. More...
 
typedef INT_4U seconds_type
 Type representing the second portion.
 
typedef INT_4U nanoseconds_type
 Type representing the nanosecond portion.
 
typedef INT_8U gpsnanoseconds_type
 Type represting the whole GPS time in nanoseconds.
 

Public Member Functions

 GPSTime ()
 Constructor - default.
 
 GPSTime (const GPSTime &)
 Constructor - copy.
 
 GPSTime (const seconds_type seconds, const nanoseconds_type nanoseconds, unit_type Units=DEFAULT_TIME_UNIT_TYPE)
 Constructor. More...
 
 ~GPSTime ()
 Destructor.
 
seconds_type GetSeconds () const
 Second portion of GPS time.
 
nanoseconds_type GetSeconds (const unit_type Units) const
 Second portion of GPS time according to units.
 
nanoseconds_type GetNanoseconds () const
 Nanosecond portion of GPS time.
 
REAL_8 GetTime () const
 GPS as a floating point number.
 
INT_2U GetLeapSeconds () const
 Retrieve the number of leap seconds for stored time.
 
gpsnanoseconds_type GPSNanoseconds () const
 Return the time in nanosecond units. More...
 
void Now ()
 Sets the object to the current GPS time.
 
seconds_type getSec () const
 
nanoseconds_type getNSec () const
 
GPSTimeoperator= (const GPSTime &)
 Assignment operator.
 
GPSTimeoperator+= (const double &)
 Addition assignment.
 
GPSTimeoperator-= (const double &)
 Subtraction assignment.
 

Static Public Member Functions

static GPSTime NowGPSTime ()
 Returns the time "now" as a GPSTime. More...
 

Static Public Attributes

static const unit_type DEFAULT_TIME_UNIT_TYPE = GPSTime::GPS
 The default time unit.
 

Static Protected Member Functions

static GPSTime now ()
 Returns the time "now" as a GPSTime. More...
 

Detailed Description

GPS time class.

This class is designed to maintain GPS time information. A UTC time can be used to seed the value.

Note
  • Example source http://maia.usno.navy.mil/ser7/tai-utc.dat

  • The environment variable GPS_LEAPSECOND_FILE can be set to specify a local GPS leap second data file.

  • If a data file exists, it is checked perioticly for updates.

  • The class is only valid for times on or after January 1st, 1970 at 00:00 GMT.

Member Enumeration Documentation

◆ unit_type

Enumerated type to specify time format.

Enumerator
UTC 

Universal Time Coordinated.

GPS 

Global Positioning System Time.

Constructor & Destructor Documentation

◆ GPSTime()

LDASTools::AL::GPSTime::GPSTime ( const seconds_type  seconds,
const nanoseconds_type  nanoseconds,
unit_type  Units = DEFAULT_TIME_UNIT_TYPE 
)

Constructor.

Do nothing for the time in in the proper order.

Member Function Documentation

◆ getNSec()

GPSTime::nanoseconds_type LDASTools::AL::GPSTime::getNSec ( ) const
inline

Helper function to make it compatable with Time class of framecpp

◆ getSec()

GPSTime::seconds_type LDASTools::AL::GPSTime::getSec ( ) const
inline

Helper function to make it compatable with Time class of framecpp

◆ GPSNanoseconds()

GPSTime::gpsnanoseconds_type LDASTools::AL::GPSTime::GPSNanoseconds ( ) const
inline

Return the time in nanosecond units.

Returns
The time value as the number of nanoseconds since the start of GPS time.

This routine returns the time value as the number of nanoseconds that have elapsed since the start of GPS time.

◆ now()

GPSTime LDASTools::AL::GPSTime::now ( )
staticprotected

Returns the time "now" as a GPSTime.

Returns
GPSTime the current time, in GPSTime form

Normalize here to ensure that there will be no exceptions

Create the structure.

◆ NowGPSTime()

GPSTime LDASTools::AL::GPSTime::NowGPSTime ( )
static

Returns the time "now" as a GPSTime.

Returns
GPSTime the current time, in GPSTime form

The documentation for this class was generated from the following files: