fdhwlib
2.0.25
|
#include <aktimelib.h>
Library to handle the different time formats.
The class needs to reads it's basic information (about the leap seconds) from some configuration file. Before using the library the first time load these value with the function init.
The first implementation is based on a default number of leap second at the presend time and the time when the next leap second will occure. After this given occurence the ini file parameters have to be adjusted.
There are two values taken from the ini file (stanard FE.ini):
A sample entry is FE.ini looks like:
[GPSTime] ; number of leap seconds (before nextLeapSecond - time) leapSeconds = 13 ; Time when the next leap second occures (UTC seconds) nextLeapSecond = 1016534603
Definition at line 156 of file aktimelib.h.
akTimeLib::akTimeLib | ( | ) | [protected] |
akTimeLib::~akTimeLib | ( | ) | [inline] |
Definition at line 167 of file aktimelib.h.
References cleaner, and akSingletonCleaner::setObject().
int akTimeLib::addLeapSecond | ( | ) |
Add new leap second.
time_t akTimeLib::convertGPSToUTC | ( | unsigned long | t_gps | ) |
Convert the Hardware second counter the the format used by the PC (UTC time started at 1.1.1970)
t_gps | Second counter in GPS format |
unsigned long akTimeLib::convertUTCToGPS | ( | time_t | t_utc | ) |
Convert UTC to GPS time.
t_utc | Second counter in UTC format |
void akTimeLib::dump | ( | FILE * | fout = stdout | ) | [inline] |
Give information about class internals.
Definition at line 184 of file aktimelib.h.
{ fprintf(fout, "akTimeLib: \n"); // TODO: Give information about the next // change in the number of leap seconds // --> Table of second counters... }
static akTimeLib* akTimeLib::getReference | ( | ) | [static] |
Get the reference to the singleton.
void akTimeLib::init | ( | const char * | inifile = "aktimelib.ini" , |
FILE * | fout = 0 |
||
) |
Read the leap seconds table from an ini file.
int akTimeLib::isLeapSecond | ( | unsigned long | t_gps | ) |
Check if a gps second counter points to an leap second.
int akTimeLib::nLeapSeconds | ( | unsigned long | t_gps | ) |
Determine the number of leap seconds.
void akTimeLib::test | ( | ) |
Test the functions of the class.
friend class akSingletonCleaner [friend] |
Definition at line 160 of file aktimelib.h.
akSingletonCleaner akTimeLib::cleaner [static, private] |
Can the cleaner be defined in the singleton class? I fear, it will only be possible to have one singleton in a program ?!
Definition at line 239 of file aktimelib.h.
Referenced by ~akTimeLib().
unsigned long akTimeLib::gpsDelay [private] |
Delay between GPS and UTC second count gpsDelay = t(UTP) - t(GPS)
Definition at line 246 of file aktimelib.h.
akTimeLib akTimeLib::instance [static, private] |
The only instance of this singleton class.
Definition at line 235 of file aktimelib.h.
unsigned long* akTimeLib::leapSecGps [private] |
List of gps seconds where a leap second is added.
Definition at line 259 of file aktimelib.h.
int* akTimeLib::leapSecN [private] |
Number of leap second beginning from leapSecGps.
Definition at line 265 of file aktimelib.h.
int akTimeLib::leapSeconds [private] |
Number of actual leap seconds.
Definition at line 251 of file aktimelib.h.
unsigned long* akTimeLib::leapSecUtc [private] |
List of utc/ntp second where a leap second is added.
Definition at line 262 of file aktimelib.h.
unsigned long akTimeLib::nextLeapSecond [private] |
Time when the next leap second occures.
This time has to be given in UTC seconds.
Definition at line 256 of file aktimelib.h.
int akTimeLib::nLeapSecs [private] |
Number of entries in the leap list.
Definition at line 268 of file aktimelib.h.
int akTimeLib::noLeapSecTable [static, private] |
Flag to show if leap second table is missing.
Definition at line 271 of file aktimelib.h.