List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Private Member Functions | Private Attributes | Friends
utl::UTCDateTime Class Reference

#include <utl/UTCDateTime.h>

Inheritance diagram for utl::UTCDateTime:
Inheritance graph
[legend]

Public Types

enum  Month {
  eJan = 1, eFeb = 2, eMar = 3, eApr = 4,
  eMay = 5, eJun = 6, eJul = 7, eAug = 8,
  eSep = 9, eOct = 10, eNov = 11, eDec = 12
}
 

Public Member Functions

int GetDay () const
 
int GetHour () const
 
std::string GetInAugerFormat () const
 
std::string GetInMySQLFormat () const
 
std::string GetInXMLFormat () const
 
int GetMinute () const
 
int GetMonth () const
 
double GetNanosecond () const
 
int GetSecond () const
 
TimeStamp GetTimeStamp () const
 
std::time_t GetUnixSecond () const
 seconds after Unix epoch (1 Jan 1970) without any leap corrections More...
 
int GetYear () const
 
 operator bool () const
 
bool operator!= (const UTCDate &d) const
 
bool operator== (const UTCDate &d) const
 
void Set (const int year, const int month, const int day, const int hour, const int minute, const int second, const double nanosecond=0)
 
void Set (const int year, const int month, const int day)
 
 UTCDateTime ()
 
 UTCDateTime (const UTCDate &date, const int hour=0, const int minute=0, const int second=0, const double nanosecond=0)
 
 UTCDateTime (const int year, const int month, const int day, const int hour=0, const int minute=0, const int second=0, const double nanosecond=0)
 
 UTCDateTime (const TimeStamp &time)
 

Static Public Member Functions

static UTCDateTime GetGPSEpoch ()
 
static UTCDateTime GetUnixEpoch ()
 
static UTCDateTime Max ()
 
static UTCDateTime Min ()
 

Protected Member Functions

std::string GetInXMLFormatZone (const char *const zone) const
 
std::istream & Parse (std::istream &is, const bool zone=true)
 

Static Protected Member Functions

static std::time_t GetUnixSecond (const int year, const int month, const int day, const int hour, const int minute, const int second)
 

Static Protected Attributes

static const char *const fgMonthNames []
 

Private Member Functions

std::istream & Parse (std::istream &is)
 
void SetHMS (const int hour, const int minute, const int second, const double nanosecond=0)
 

Private Attributes

int fHour
 
int fMinute
 
double fNanosecond
 
int fSecond
 

Friends

std::istream & operator>> (std::istream &, UTCDateTime &)
 

Detailed Description

Author
Darko Veberic
Date
22 Jul 2009

Definition at line 18 of file UTCDateTime.h.

Member Enumeration Documentation

enum utl::UTCDate::Month
inherited
Enumerator
eJan 
eFeb 
eMar 
eApr 
eMay 
eJun 
eJul 
eAug 
eSep 
eOct 
eNov 
eDec 

Definition at line 21 of file UTCDate.h.

Constructor & Destructor Documentation

utl::UTCDateTime::UTCDateTime ( )
inline

Definition at line 20 of file UTCDateTime.h.

utl::UTCDateTime::UTCDateTime ( const UTCDate date,
const int  hour = 0,
const int  minute = 0,
const int  second = 0,
const double  nanosecond = 0 
)
inline

Definition at line 23 of file UTCDateTime.h.

References utl::hour, utl::minute, utl::nanosecond, utl::second, and SetHMS().

utl::UTCDateTime::UTCDateTime ( const int  year,
const int  month,
const int  day,
const int  hour = 0,
const int  minute = 0,
const int  second = 0,
const double  nanosecond = 0 
)
inline

Definition at line 29 of file UTCDateTime.h.

References utl::hour, utl::minute, utl::nanosecond, utl::second, and SetHMS().

UTCDateTime::UTCDateTime ( const TimeStamp time)

Member Function Documentation

int utl::UTCDate::GetDay ( ) const
inlineinherited
static UTCDateTime utl::UTCDateTime::GetGPSEpoch ( )
inlinestatic

Definition at line 68 of file UTCDateTime.h.

References utl::UTCDate::GetGPSEpoch().

Referenced by Min(), and TestTime::TestTimeConsistency().

int utl::UTCDateTime::GetHour ( ) const
inline
string UTCDateTime::GetInAugerFormat ( ) const

Definition at line 78 of file UTCDateTime.cc.

Referenced by TestTime::TestTimeStampInitialization().

string UTCDateTime::GetInMySQLFormat ( ) const
string UTCDateTime::GetInXMLFormat ( ) const
string UTCDate::GetInXMLFormatZone ( const char *const  zone) const
protectedinherited

Definition at line 83 of file UTCDate.cc.

Referenced by utl::UTCDate::GetInXMLFormat().

int utl::UTCDateTime::GetMinute ( ) const
inline
int utl::UTCDate::GetMonth ( ) const
inlineinherited
double utl::UTCDateTime::GetNanosecond ( ) const
inline
int utl::UTCDateTime::GetSecond ( ) const
inline
TimeStamp UTCDateTime::GetTimeStamp ( ) const

Definition at line 115 of file UTCDateTime.cc.

Referenced by testSEventImpl::checkEventTriggerValues(), testSEventImpl::checkStationRecDataValues(), testSEventImpl::checkStationSimDataValues(), testSEventImpl::checkStationValues(), rdet::RBadStationSQLManager::GetBadPeriodFromBuffer(), utl::GetCurrentSystemTime(), RdChannelNoiseImporter_AERA::RdChannelNoiseImporter_AERA::GetNoiseFileName(), fdet::FdAlwaysUpManager::GetStatus(), FdTriggerSimulatorOG::FdTriggerSimulator::Init(), main(), Parser::ReadStrToTime(), GeometryExampleNS::GeometryExample::Run(), ShowerInventorNS::ShowerInventor::Run(), RdChannelNoisePowerAnalyser::RdChannelNoisePowerAnalyser::Run(), RdEventInitializer::RdEventInitializer::SetSignalSearchWindowFromFile(), testSEventImpl::setStationSimDataValues(), testSEventImpl::setUp(), testREventImpl::setUp(), testMEventImpl::setUp(), testFEventImpl::setUp(), FdTriggerSimulatorOG::FdTriggerSimulator::T3Sim(), RDetectorTest::testAntennaType(), SDetectorTest::testBasic(), MDetectorTest::testBasic(), RSQLManagerTest::testBeaconManager(), MDetectorTest::testComponentAssignment(), TestTime::TestConversions(), TestTime::TestConversions2(), TestTime::TestConversions3(), TestTime::TestConversions5(), SDetectorTest::testCrowns(), SDetectorTest::testGroups(), testMagneticFieldModel::testIGRFValues(), SDetectorTest::testOffGridStations(), RDetectorTest::testRModel(), testSEventImpl::testSEventSimData(), RSQLManagerTest::testStationListManager(), RDetectorTest::testStationListManager(), SDetectorTest::testStationListManager(), SDetectorTest::testStationNotCommissioned(), TestTime::TestTimeConsistency(), and TestTime::TestTimeStampInitialization().

static UTCDateTime utl::UTCDateTime::GetUnixEpoch ( )
inlinestatic

Definition at line 66 of file UTCDateTime.h.

References utl::UTCDate::GetUnixEpoch().

std::time_t utl::UTCDateTime::GetUnixSecond ( ) const
inline

seconds after Unix epoch (1 Jan 1970) without any leap corrections

Definition at line 63 of file UTCDateTime.h.

References fHour, fMinute, fSecond, utl::UTCDate::GetDay(), utl::UTCDate::GetMonth(), utl::UTCDate::GetUnixSecond(), and utl::UTCDate::GetYear().

Referenced by RdAirplane::Util::ApproximatedUnixTimeStampFromTimestamp(), and utl::ModifiedJulianDate().

time_t UTCDate::GetUnixSecond ( const int  year,
const int  month,
const int  day,
const int  hour,
const int  minute,
const int  second 
)
staticprotectedinherited

Definition at line 46 of file UTCDate.cc.

References utl::day, utl::hour, utl::minute, and galactic::second.

int utl::UTCDate::GetYear ( ) const
inlineinherited
UTCDateTime UTCDateTime::Max ( )
static

Definition at line 156 of file UTCDateTime.cc.

Referenced by TestTime::TestTimeConsistency().

static UTCDateTime utl::UTCDateTime::Min ( )
inlinestatic

Definition at line 72 of file UTCDateTime.h.

References GetGPSEpoch().

Referenced by TestTime::TestTimeConsistency().

utl::UTCDate::operator bool ( ) const
inlineexplicitinherited

Definition at line 55 of file UTCDate.h.

References utl::UTCDate::fDay, utl::UTCDate::fMonth, and utl::UTCDate::fYear.

bool utl::UTCDate::operator!= ( const UTCDate d) const
inlineinherited

Definition at line 60 of file UTCDate.h.

References utl::UTCDate::operator==().

bool utl::UTCDate::operator== ( const UTCDate d) const
inlineinherited

Definition at line 57 of file UTCDate.h.

References utl::UTCDate::fDay, utl::UTCDate::fMonth, and utl::UTCDate::fYear.

Referenced by utl::UTCDate::operator!=().

istream & UTCDateTime::Parse ( std::istream &  is)
private

Definition at line 128 of file UTCDateTime.cc.

References utl::hour, is(), utl::minute, utl::nanosecond, and galactic::second.

Referenced by utl::operator>>().

istream & UTCDate::Parse ( std::istream &  is,
const bool  zone = true 
)
protectedinherited

Definition at line 97 of file UTCDate.cc.

References utl::day, ERROR, is(), and galactic::year.

Referenced by utl::operator>>().

void utl::UTCDateTime::Set ( const int  year,
const int  month,
const int  day,
const int  hour,
const int  minute,
const int  second,
const double  nanosecond = 0 
)
inline

Definition at line 38 of file UTCDateTime.h.

References utl::nanosecond, utl::UTCDate::Set(), and SetHMS().

void UTCDate::Set ( const int  year,
const int  month,
const int  day 
)
inherited

Definition at line 19 of file UTCDate.cc.

References utl::day, ERROR, and galactic::year.

Referenced by Set(), and utl::UTCDate::UTCDate().

void UTCDateTime::SetHMS ( const int  hour,
const int  minute,
const int  second,
const double  nanosecond = 0 
)
private

Definition at line 31 of file UTCDateTime.cc.

References ERROR, utl::hour, utl::minute, utl::nanosecond, and galactic::second.

Referenced by Set(), and UTCDateTime().

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  is,
UTCDateTime utc 
)
friend

Definition at line 93 of file UTCDateTime.h.

Member Data Documentation

const char *const UTCDate::fgMonthNames
staticprotectedinherited
Initial value:
= {
"JAN", "FEB", "MAR", "APR", "MAY", "JUN",
"JUL", "AUG", "SEP", "OCT", "NOV", "DEC"
}

Definition at line 72 of file UTCDate.h.

int utl::UTCDateTime::fHour
private

Definition at line 80 of file UTCDateTime.h.

Referenced by GetHour(), and GetUnixSecond().

int utl::UTCDateTime::fMinute
private

Definition at line 81 of file UTCDateTime.h.

Referenced by GetMinute(), and GetUnixSecond().

double utl::UTCDateTime::fNanosecond
private

Definition at line 83 of file UTCDateTime.h.

Referenced by GetNanosecond().

int utl::UTCDateTime::fSecond
private

Definition at line 82 of file UTCDateTime.h.

Referenced by GetSecond(), and GetUnixSecond().


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

, generated on Tue Sep 26 2023.