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

GPS time class. More...

#include <gpstime.hh>

Public Types

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

Public Member Functions

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

Static Public Member Functions

static GPSTime NowGPSTime ()
 Returns the time "now" as a GPSTime. More...
 
static GPSTime NowGPSTime ()
 Returns the time "now" as a GPSTime. More...
 
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. More...
 

Static Protected Member Functions

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

Private Attributes

seconds_type m_seconds
 
nanoseconds_type m_nanoseconds
 

Friends

void ErrorLog::operator() (state State, const char *Filename, const int Line, const std::string &Message, bool EOL)
 
void ErrorLog::operator() (state State, const char *Filename, const int Line, const std::string &Message, bool EOL)
 
void ErrorLog::operator() (state State, const char *Filename, const int Line, const std::string &Message, bool EOL)
 

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 Typedef Documentation

◆ gpsnanoseconds_type [1/3]

Type represting the whole GPS time in nanoseconds.

◆ gpsnanoseconds_type [2/3]

Type represting the whole GPS time in nanoseconds.

◆ gpsnanoseconds_type [3/3]

Type represting the whole GPS time in nanoseconds.

◆ nanoseconds_type [1/3]

Type representing the nanosecond portion.

◆ nanoseconds_type [2/3]

Type representing the nanosecond portion.

◆ nanoseconds_type [3/3]

Type representing the nanosecond portion.

◆ seconds_type [1/3]

Type representing the second portion.

◆ seconds_type [2/3]

Type representing the second portion.

◆ seconds_type [3/3]

Type representing the second portion.

Member Enumeration Documentation

◆ unit_type [1/3]

Enumerated type to specify time format.

Enumerator
UTC 

Universal Time Coordinated.

GPS 

Global Positioning System Time.

UTC 

Universal Time Coordinated.

GPS 

Global Positioning System Time.

UTC 

Universal Time Coordinated.

GPS 

Global Positioning System Time.

◆ unit_type [2/3]

Enumerated type to specify time format.

Enumerator
UTC 

Universal Time Coordinated.

GPS 

Global Positioning System Time.

UTC 

Universal Time Coordinated.

GPS 

Global Positioning System Time.

UTC 

Universal Time Coordinated.

GPS 

Global Positioning System Time.

◆ unit_type [3/3]

Enumerated type to specify time format.

Enumerator
UTC 

Universal Time Coordinated.

GPS 

Global Positioning System Time.

UTC 

Universal Time Coordinated.

GPS 

Global Positioning System Time.

UTC 

Universal Time Coordinated.

GPS 

Global Positioning System Time.

Constructor & Destructor Documentation

◆ GPSTime() [1/9]

LDASTools::AL::GPSTime::GPSTime ( )

Constructor - default.

◆ GPSTime() [2/9]

LDASTools::AL::GPSTime::GPSTime ( const GPSTime argument)

Constructor - copy.

◆ GPSTime() [3/9]

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.

◆ ~GPSTime() [1/3]

LDASTools::AL::GPSTime::~GPSTime ( )

Destructor.

◆ GPSTime() [4/9]

LDASTools::AL::GPSTime::GPSTime ( )

Constructor - default.

◆ GPSTime() [5/9]

LDASTools::AL::GPSTime::GPSTime ( const GPSTime )

Constructor - copy.

◆ GPSTime() [6/9]

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

Constructor.

◆ ~GPSTime() [2/3]

LDASTools::AL::GPSTime::~GPSTime ( )

Destructor.

◆ GPSTime() [7/9]

LDASTools::AL::GPSTime::GPSTime ( )

Constructor - default.

◆ GPSTime() [8/9]

LDASTools::AL::GPSTime::GPSTime ( const GPSTime )

Constructor - copy.

◆ GPSTime() [9/9]

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

Constructor.

◆ ~GPSTime() [3/3]

LDASTools::AL::GPSTime::~GPSTime ( )

Destructor.

Member Function Documentation

◆ GetLeapSeconds() [1/3]

INT_2U LDASTools::AL::GPSTime::GetLeapSeconds ( ) const

Retrieve the number of leap seconds for stored time.

◆ GetLeapSeconds() [2/3]

INT_2U LDASTools::AL::GPSTime::GetLeapSeconds ( ) const

Retrieve the number of leap seconds for stored time.

◆ GetLeapSeconds() [3/3]

INT_2U LDASTools::AL::GPSTime::GetLeapSeconds ( ) const

Retrieve the number of leap seconds for stored time.

◆ GetNanoseconds() [1/3]

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

Nanosecond portion of GPS time.

◆ GetNanoseconds() [2/3]

nanoseconds_type LDASTools::AL::GPSTime::GetNanoseconds ( ) const

Nanosecond portion of GPS time.

◆ GetNanoseconds() [3/3]

nanoseconds_type LDASTools::AL::GPSTime::GetNanoseconds ( ) const

Nanosecond portion of GPS time.

◆ getNSec() [1/3]

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

Helper function to make it compatable with Time class of framecpp

◆ getNSec() [2/3]

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

Helper function to make it compatable with Time class of framecpp

◆ getNSec() [3/3]

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

Helper function to make it compatable with Time class of framecpp

◆ getSec() [1/3]

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

Helper function to make it compatable with Time class of framecpp

◆ getSec() [2/3]

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

Helper function to make it compatable with Time class of framecpp

◆ getSec() [3/3]

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

Helper function to make it compatable with Time class of framecpp

◆ GetSeconds() [1/6]

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

Second portion of GPS time.

◆ GetSeconds() [2/6]

seconds_type LDASTools::AL::GPSTime::GetSeconds ( ) const

Second portion of GPS time.

◆ GetSeconds() [3/6]

seconds_type LDASTools::AL::GPSTime::GetSeconds ( ) const

Second portion of GPS time.

◆ GetSeconds() [4/6]

nanoseconds_type LDASTools::AL::GPSTime::GetSeconds ( const unit_type  Units) const

Second portion of GPS time according to units.

◆ GetSeconds() [5/6]

INT_4U LDASTools::AL::GPSTime::GetSeconds ( const unit_type  Units) const

Second portion of GPS time according to units.

◆ GetSeconds() [6/6]

nanoseconds_type LDASTools::AL::GPSTime::GetSeconds ( const unit_type  Units) const

Second portion of GPS time according to units.

◆ GetTime() [1/3]

REAL_8 LDASTools::AL::GPSTime::GetTime ( ) const

GPS as a floating point number.

◆ GetTime() [2/3]

REAL_8 LDASTools::AL::GPSTime::GetTime ( ) const
inline

GPS as a floating point number.

◆ GetTime() [3/3]

REAL_8 LDASTools::AL::GPSTime::GetTime ( ) const

GPS as a floating point number.

◆ GPSNanoseconds() [1/3]

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

Return the time in nanosecond units.

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

◆ GPSNanoseconds() [2/3]

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

Return the time in nanosecond units.

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

◆ GPSNanoseconds() [3/3]

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() [1/3]

void LDASTools::AL::GPSTime::Now ( )

Sets the object to the current GPS time.

◆ Now() [2/3]

void LDASTools::AL::GPSTime::Now ( )

Sets the object to the current GPS time.

◆ Now() [3/3]

void LDASTools::AL::GPSTime::Now ( )

Sets the object to the current GPS time.

◆ now() [1/3]

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

Returns the time "now" as a GPSTime.

Returns
GPSTime the current time, in GPSTime form

◆ now() [2/3]

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

Returns the time "now" as a GPSTime.

Returns
GPSTime the current time, in GPSTime form

◆ now() [3/3]

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() [1/3]

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

Returns the time "now" as a GPSTime.

Returns
GPSTime the current time, in GPSTime form

◆ NowGPSTime() [2/3]

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

Returns the time "now" as a GPSTime.

Returns
GPSTime the current time, in GPSTime form

◆ NowGPSTime() [3/3]

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

Returns the time "now" as a GPSTime.

Returns
GPSTime the current time, in GPSTime form

◆ operator+=() [1/3]

GPSTime& LDASTools::AL::GPSTime::operator+= ( const double )

Addition assignment.

◆ operator+=() [2/3]

GPSTime& LDASTools::AL::GPSTime::operator+= ( const double )

Addition assignment.

◆ operator+=() [3/3]

GPSTime & LDASTools::AL::GPSTime::operator+= ( const double offset)

Addition assignment.

◆ operator-=() [1/3]

GPSTime& LDASTools::AL::GPSTime::operator-= ( const double )

Subtraction assignment.

◆ operator-=() [2/3]

GPSTime & LDASTools::AL::GPSTime::operator-= ( const double rhs)

Subtraction assignment.

◆ operator-=() [3/3]

GPSTime& LDASTools::AL::GPSTime::operator-= ( const double )

Subtraction assignment.

◆ operator=() [1/3]

GPSTime& LDASTools::AL::GPSTime::operator= ( const GPSTime )

Assignment operator.

◆ operator=() [2/3]

GPSTime& LDASTools::AL::GPSTime::operator= ( const GPSTime )

Assignment operator.

◆ operator=() [3/3]

GPSTime & LDASTools::AL::GPSTime::operator= ( const GPSTime rhs)

Assignment operator.

Friends And Related Function Documentation

◆ ErrorLog::operator() [1/3]

void ErrorLog::operator() ( state  State,
const char *  Filename,
const int  Line,
const std::string &  Message,
bool  EOL 
)
friend

◆ ErrorLog::operator() [2/3]

void ErrorLog::operator() ( state  State,
const char *  Filename,
const int  Line,
const std::string &  Message,
bool  EOL 
)
friend

◆ ErrorLog::operator() [3/3]

void ErrorLog::operator() ( state  State,
const char *  Filename,
const int  Line,
const std::string &  Message,
bool  EOL 
)
friend

Member Data Documentation

◆ DEFAULT_TIME_UNIT_TYPE

static const unit_type LDASTools::AL::GPSTime::DEFAULT_TIME_UNIT_TYPE = GPSTime::GPS
static

The default time unit.

◆ m_nanoseconds

nanoseconds_type LDASTools::AL::GPSTime::m_nanoseconds
private

◆ m_seconds

seconds_type LDASTools::AL::GPSTime::m_seconds
private

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