|
LRAUV
revA
|
Represents absolute times. More...
#include <Timestamp.h>


Public Member Functions | |
| Timestamp (const double &seconds) | |
| Constructor, set time from double. More... | |
| Timestamp (const int seconds, const unsigned int microseconds) | |
| Constructor, set time from separate seconds and microseconds. More... | |
| Timestamp (const int year, const int month, const int day, const int hour, const int minute, const int second) | |
| Constructor, set time from separate date and time integers. More... | |
| Timestamp (const struct timeval &timeval) | |
| Constructor, set time from struct timeval. More... | |
| Timestamp (const char *timeString) | |
| Constructor, set time from simple y,m,d, h,m,s type formats including ISO9601. More... | |
| Timestamp (const Timestamp ©Me=NOT_SET_TIME) | |
| Copy constructor. More... | |
| void | addFromMicros (const long long µs) |
| add seconds << 20 + microseconds More... | |
| void | addFromMillis (const long long &millis) |
| add seconds << 10 + microseconds >> 10 More... | |
| void | round (int seconds) |
| virtual | ~Timestamp () |
| Destructor. More... | |
| Timespan | elapsed () const |
| Returns the time elapsed since this timestamp. More... | |
| virtual double | asDouble () const |
| Accessor, convert to double. More... | |
| virtual double | asFloat () const |
| Accessor, convert to float. More... | |
| long long | asMicros () const |
| Quickly returns the (seconds << 20) + microseconds (52 bits) More... | |
| long long | asMillis () const |
| Quickly returns the (seconds << 10) + (microseconds >> 10) (42 bits) More... | |
| time_t | asTimeT () const |
| *struct tm | asStructTm () const |
| Timestamp & | operator= (const Timestamp &rhs) |
| Copy operator. More... | |
| Timestamp & | operator= (const double &seconds) |
| Set from double. More... | |
| Timestamp & | operator= (const struct timeval &timeval) |
| Set from struct timeval. More... | |
| Timestamp & | operator+= (const Timespan &rhs) |
| Addition with a Timespan. More... | |
| Timestamp & | operator-= (const Timespan &rhs) |
| Subtraction of a Timespan. More... | |
| Timestamp | operator+ (const Timespan &rhs) const |
| Addition to Timespan. More... | |
| Timestamp | operator- (const Timespan &rhs) const |
| Subtraction from Timespan. More... | |
| Timespan | operator- (const struct timeval &rhs) const |
| Subtraction from struct timeval. More... | |
| Timespan | operator- (const Timestamp &rhs) const |
| Subtraction of two times yields a timespan. More... | |
| bool | operator== (const Timestamp &rhs) const |
| Equalities/inequalities. More... | |
| bool | operator!= (const Timestamp &rhs) const |
| Equalities/inequalities. More... | |
| bool | operator> (const Timestamp &rhs) const |
| Greater-than operator. More... | |
| bool | operator< (const Timestamp &rhs) const |
| Less-than operator. More... | |
| bool | operator<= (const Timestamp &rhs) const |
| Greater-than-equal operator. More... | |
| bool | operator>= (const Timestamp &rhs) const |
| Less-than-equal operator. More... | |
| Timestamp & | setToCurrentTime () |
| Set to the current time. More... | |
| Timestamp & | setToMonoTime () |
| Set to clock that represents monotonic time since some unspecified starting point. More... | |
| void | sleepTill () |
| Sleep until the given time. More... | |
| void | toTimespec (struct timespec *) const |
| Internal conversion function. More... | |
| void | fromTimespec (const struct timespec *in) |
| Internal conversion function. More... | |
| const struct timeval & | getTimeval () const |
| Get the internal storage. More... | |
| const char * | toString (char *buf, int buflen, int precision=3) const |
| Writes the Timestamp as to a unsigned char buffer. More... | |
| const Str | toString (int precision=3) const |
| Writes the Timestamp as a Str. More... | |
| const Str | toSmallString () const |
| Writes the Timestamp as a small Str (YYYYmmdd'T'HHMMSS). More... | |
| const Str | toSmallerString () const |
| Writes the Timestamp as a smaller Str (YYYYmmddHHMM). More... | |
| const Str | toDateHourString () const |
| Writes the Timestamp as a date-hour Str (YYYYmmddHH). More... | |
Static Public Member Functions | |
| static Timestamp | FromMicros (const long long µs) |
| Named Constructor, set from seconds << 20 + microseconds,. More... | |
| static Timestamp | FromMillis (const long long &millis) |
| Named Constructor, set from seconds << 10 + milliseconds >> 10. More... | |
| static Timestamp | Now () |
| Static for current time for use on RHS. More... | |
Public Attributes | |
| *int | tm_min |
| Returns value as struct tm: int tm_sec; /* seconds. More... | |
| *int | tm_hour |
| *int | tm_mday |
| *int | tm_mon |
| *int | tm_year |
| *int | tm_wday |
| *int | tm_yday |
| *int | tm_isdst |
Static Public Attributes | |
| static const Timestamp | NOT_SET_TIME |
| Constant value to represent "no time". More... | |
| static const Timestamp | EPOCH_START_TIME |
| Constant value to represent beginning of (1970 Jan 1) epoch. More... | |
Protected Member Functions | |
| struct timeval & | fromDouble (const double &seconds) |
| Set the internal storage to the specified value. More... | |
| struct timeval & | fromIntegers (const int seconds, const unsigned int microseconds) |
| Set the internal storage to the specified values. More... | |
| struct timeval & | fromIntegers (const int year, const int month, const int day, const int hour, const int minute, const int second) |
| Set the internal storage to the specified values. More... | |
| struct timeval & | fromString (const char *timeString) |
| Set the internal storage to the specified ISO9601 string value. More... | |
Static Protected Member Functions | |
| static struct timeval | TimevalFromIntegers (const int seconds, const unsigned int microseconds) |
| Returns a struct timeval from the specified values. More... | |
| static struct timeval | TimevalFromMicros (const long long µs) |
| Returns a struct timeval from asMicros() result. More... | |
| static struct timeval | TimevalFromMillis (const long long &millis) |
| Returns a struct timeval from asMillis() result. More... | |
Protected Attributes | |
| struct timeval | timeval_ |
| Internal storage for time. More... | |
Represents absolute times.
Accomplishes two goals. First, it provides a first-class abstraction for storing time/date information, including sensical access and math functions.
Second, it abstracts many time-related library calls (current time, sleep) through a controlled interface. We can then manipulate this interface behind the scenes to do faster- than-realtime simulation.
| Timestamp::Timestamp | ( | const double & | seconds | ) |
Constructor, set time from double.
Constructor, set from seconds.
Referenced by FromMicros(), FromMillis(), Now(), operator+(), and operator-().
| Timestamp::Timestamp | ( | const int | seconds, |
| const unsigned int | microseconds | ||
| ) |
Constructor, set time from separate seconds and microseconds.
| Timestamp::Timestamp | ( | const int | year, |
| const int | month, | ||
| const int | day, | ||
| const int | hour, | ||
| const int | minute, | ||
| const int | second | ||
| ) |
Constructor, set time from separate date and time integers.
| Timestamp::Timestamp | ( | const struct timeval & | timeval | ) |
Constructor, set time from struct timeval.
| Timestamp::Timestamp | ( | const char * | timeString | ) |
Constructor, set time from simple y,m,d, h,m,s type formats including ISO9601.
Constructor, set time from ISO9601 string.
| Timestamp::Timestamp | ( | const Timestamp & | rhs = NOT_SET_TIME | ) |
Copy constructor.
Tests:
Create new object copied from another object.
asDouble == asDouble
|
inlinevirtual |
Destructor.
| void Timestamp::addFromMicros | ( | const long long & | micros | ) |
add seconds << 20 + microseconds
References __suseconds_t, __time_t, and timeval_.
Referenced by LogEntry::ReadTimestamp().
| void Timestamp::addFromMillis | ( | const long long & | millis | ) |
add seconds << 10 + microseconds >> 10
References __suseconds_t, __time_t, and timeval_.
Referenced by LogEntry::ReadTimestamp().
|
virtual |
Accessor, convert to double.
Reimplemented in Timespan.
References timeval_.
Referenced by Timespan::asDouble(), PeakDetectHorizontal::calcSatisfied(), HFRadarCompactModelForecaster::forecast(), HFRadarModelPoint::initialize(), TableLogWriter::interpolateDataEntry(), HFRadarModelCalc::lookup(), HFRCMTimeInterpolator::lookupExpansionCoefficients(), NAL9602::needFix(), AcousticModem_Benthos_ATM900::parseDebugRxMessage(), AcousticModem_Benthos_ATM900::parseDebugTxMessage(), DAT::publishData(), HFRCMReconstructedInterpolator::publishSurfaceCurrentAtVehicleLocation(), ReadDataComponent::requestData(), CycleStarter::run(), PAR_Licor::run(), HFRadarModelCalc::run(), HFRadarModelPoint::run(), Handler::runBetween(), Timestamp_Test::testConstructorCopyArg(), Timestamp_Test::testConstructorDoubleArg(), Timestamp_Test::testConstructorNoArguments(), Timestamp_Test::testConstructorStringArg(), Timespan_Test::testCopyOperator(), Timestamp_Test::testInPlaceAdditionToTimespan(), Timestamp_Test::testInPlaceSubtractionByTimespan(), Timestamp_Test::testSetOperatorOne(), Timespan_Test::testSetOperatorOne(), Timestamp_Test::testSetOperatorTwo(), Timespan_Test::testSetOperatorTwo(), SyslogEntry::toString(), DataEntry::toString(), EventEntry::toString(), JsonLogWriter::writeData(), NetCdfLogWriter::writeData(), HDF5LogWriter::writeData(), ISUS::writeData(), Rowe_600::writeData(), NetCdfWriter::writeRecord(), and TextTableLogWriter::writeRow().
|
virtual |
Accessor, convert to float.
Reimplemented in Timespan.
References timeval_.
Referenced by Timespan::asFloat().
| long long Timestamp::asMicros | ( | ) | const |
Quickly returns the (seconds << 20) + microseconds (52 bits)
Quickly returns the (seconds << 20) + microseconds.
References timeval_.
Referenced by EventEntry::write().
| long long Timestamp::asMillis | ( | ) | const |
Quickly returns the (seconds << 10) + (microseconds >> 10) (42 bits)
Quickly returns the (seconds << 10) + (microseconds >> 10)
References timeval_.
Referenced by AnalogToDigital::readCounts(), and Rowe_600LCM::runnable().
| *struct tm Timestamp::asStructTm | ( | ) | const |
Referenced by HDF5File::finalize(), and AHRS_sp3003D::setCalMode().
|
inline |
References timeval_.
Referenced by MagneticVariation::Degree(), MagneticVariation::Radian(), and Timestamp_Test::testToString().
| Timespan Timestamp::elapsed | ( | ) | const |
Returns the time elapsed since this timestamp.
References Now().
Referenced by ESPClient::advanceInteraction(), GoToSurface::calcSatisfied(), ESPClient::checkCmdCompleteTimeout(), ESPClient::checkCmdResultTimeout(), CBIT::checkDepth(), CBIT::checkLocation(), GoToSurface::checkPitchAndAltitude(), NAL9602::cmdMode(), CommandLine::commandIbitMcp3553(), ESPClient::consumeResult(), DataOverHttps::dataRead(), CBIT::empiricalFaultClassification(), ValueClause::evalSide(), ESPComponent::getLine(), NAL9602::getMTQueueSignalStrength(), NAL9602::getReceivedSignalStrength(), CANONSampler::getSimulatedData(), ESPComponent::getSimulatedData(), AcousticModem_Benthos_ATM900::gotNewQuery(), DAT::gotNewQuery(), CBIT::handleComponentFaults(), ESPClient::handleException(), BuoyancyServo::isNeeded(), ReadDataComponent::isSatisfied(), CBIT::monitorBatteryTemps(), CBIT::monitorEnvironmentals(), NAL9602::needFix(), VerticalControl::overrideVertical(), NAL9602::pause(), BPC1::pausing(), CTD_NeilBrown::preprocessData(), LogEngine::processQueue(), ExternalSim::publishState(), UartStream::read(), AnalogToDigital::readCounts(), Navigator::readExternalFix(), UartStream::readUntil(), Navigator::readVehicleOrientation(), DeadReckonUsingMultipleVelocitySources::readVehicleVelocity(), Turbulence_NPS::receive(), NAL9602::requestFix(), NAL9602::requestGSV(), LoadControl::requestVoltageAndCurrent(), MassServo::resuming(), PNI_TCM::resuming(), DropWeight::run(), NavChartDb::run(), Batt_Ocean_Server::run(), IBIT::run(), SBIT::run(), HFRadarModelPoint::run(), DataOverHttps::run(), InternalSim::run(), NavigationSim::run(), Tracking::run(), MissionItem::run(), GoToSurface::runIfUnsatisfied(), OffshoreEnvelope::runIfUnsatisfied(), MissionItem::runIfUnsatisfied(), DVL_micro::runnable(), SCPI::runnable(), MassServo::runnable(), Aanderaa_O2::runnable(), CANONSampler::runnable(), ISUS::runnable(), Radio_Surface::runnable(), AcousticModem_Benthos_ATM900::runnable(), WetLabsBB2FL::runnable(), DAT::runnable(), PNI_TCM::runnable(), ThrusterServo::runnable(), AHRS_3DMGX3::runnable(), CTD_NeilBrown::runnable(), Rowe_600LCM::runnable(), BPC1::runnable(), Rowe_600::runnable(), MissionItem::satisfied(), CBIT::scanGFChan(), NAL9602::sendingTransmit(), NAL9602::sendingVerify(), UartStream::serGetChar(), NAL9602::sessionMTQueueVerify(), DataOverHttps::sslConnecting(), AcousticModem_Benthos_ATM900::start(), DAT::start(), NAL9602::start(), SCPI::starting(), ElevatorServo::starting(), MassServo::starting(), RudderServo::starting(), BuoyancyServo::starting(), Aanderaa_O2::starting(), ISUS::starting(), Radio_Surface::starting(), AcousticModem_Benthos_ATM900::starting(), DVL_micro::starting(), WetLabsBB2FL::starting(), DAT::starting(), ESPComponent::starting(), ThrusterServo::starting(), PNI_TCM::starting(), AHRS_sp3003D::starting(), Rowe_600LCM::starting(), BPC1::starting(), Rowe_600::starting(), NAL9602::starting(), Rowe_600::stop(), Radio_Surface::stopped(), BuoyancyServo::stopping(), CANONSampler::stopping(), PNI_TCM::stopping(), AHRS_sp3003D::stopping(), DataOverHttps::tcpConnecting(), NavChartDb::updateClosest(), UartStream::waitForBufferEmpty(), ESPComponent::waitForESPConnection(), and Navigator::writeVehiclePosition().
|
protected |
Set the internal storage to the specified value.
References __suseconds_t, __time_t, and timeval_.
Referenced by operator=().
|
protected |
Set the internal storage to the specified values.
References __suseconds_t, __time_t, and timeval_.
|
protected |
Set the internal storage to the specified values.
References timeval_.
|
static |
Named Constructor, set from seconds << 20 + microseconds,.
Named Constructor, set from seconds << 20 + microseconds.
References Timestamp(), and TimevalFromMicros().
Referenced by EventEntry::Read().
|
static |
Named Constructor, set from seconds << 10 + milliseconds >> 10.
References Timestamp(), and TimevalFromMillis().
|
protected |
Set the internal storage to the specified ISO9601 string value.
References NOT_SET_TIME, and timeval_.
| void Timestamp::fromTimespec | ( | const struct timespec * | in | ) |
|
inline |
|
static |
Static for current time for use on RHS.
Static function.
References Timestamp().
Referenced by MissionItem::addCall(), ConfigDataElement::applyConfigValue(), BPC1::BPC1(), Wait::calcSatisfied(), CBIT::checkDepth(), CBIT::checkLocation(), GoToSurface::checkPitchAndAltitude(), CommandLine::commandBang(), CommandLine::commandBurn(), CommandLine::commandIbitMcp3553(), CommandLine::commandSchedule(), CommandLine::commandStop(), DataOverHttps::dataRead(), ScheduledItem::DoScheduled(), elapsed(), CBIT::empiricalFaultClassification(), Component::execute(), Behavior::executeIfUnsatisfied(), HDF5File::finalize(), Supervisor::GenerateDataDir(), CommandLine::getLines(), PNI_TCM::getMagneticVariation(), NAL9602::getMTQueueSignalStrength(), NAL9602::getReceivedSignalStrength(), CANONSampler::getSimulatedData(), CTD_NeilBrown::getSimulatedData(), ESPComponent::getSimulatedData(), DAT::getSimulatedMeasurements(), NAL9602::goToSleep(), DeadReckonUsingSpeedCalculator::initialize(), DeadReckonWithRespectToWater::initialize(), DeadReckonUsingDVLWaterTrack::initialize(), DeadReckonWithRespectToSeafloor::initialize(), DeadReckonUsingCompactModelForecast::initialize(), Batt_Ocean_Server::initialize(), SBIT::initialize(), HFRadarModelPoint::initialize(), VerticalControl::initialize(), DeadReckonUsingMultipleVelocitySources::initialize(), OffshoreEnvelope::initialize(), CBIT::initialize(), ReadDataComponent::initialize(), ExternalSim::initialize(), Tracking::initialize(), MissionItem::initialize(), ESPClient::issueCommand(), HFRadarCompactModelForecaster::loadHistory(), LogEntry::LogEntry(), HFRadarModelCalc::lookup(), HFRCMSurfaceCurrentAtVehicleLocation::lookupExpansionCoefficients(), HFRCMVirtualSurfaceDrifter::lookupExpansionCoefficients(), CBIT::monitorBatteryTemps(), CBIT::monitorEnvironmentals(), NAL9602::NAL9602(), NAL9602::needFix(), Reporter::ReportItem::needsReporting(), VerticalControl::overrideVertical(), AcousticModem_Benthos_ATM900::parseDebugRxMessage(), AcousticModem_Benthos_ATM900::parseDebugTxMessage(), BPC1::pause(), NAL9602::paused(), BPC1::pausing(), LogEngine::processQueue(), HFRadarCompactModelForecaster::publishForecast(), ExternalSim::publishState(), HFRCMReconstructedInterpolator::publishSurfaceCurrentAtVehicleLocation(), HFRadarModelCalc::publishSurfaceCurrentAtVehicleLocation(), Tracking::queryDAT(), UartStream::read(), AnalogToDigital::readCounts(), Rowe_600::readEnsemble(), UartStream::readUntil(), Navigator::readVehicleOrientation(), DeadReckonUsingSpeedCalculator::readVehicleVelocity(), DeadReckonWithRespectToWater::readVehicleVelocity(), DeadReckonWithRespectToSeafloor::readVehicleVelocity(), DeadReckonUsingCompactModelForecast::readVehicleVelocity(), DeadReckonUsingMultipleVelocitySources::readVehicleVelocity(), Turbulence_NPS::receive(), Reporter::ReportItem::report(), Reporter::ReportItem::ReportItem(), ReadDataComponent::requestData(), NAL9602::requestFix(), NAL9602::requestGSV(), AcousticModem_Benthos_ATM900::requestRange(), DAT::requestRange(), LoadControl::requestVoltageAndCurrent(), GoToSurface::resetTimeouts(), MassServo::resume(), AcousticModem_Benthos_ATM900::resume(), DAT::resume(), PNI_TCM::resume(), BPC1::resume(), Rowe_600::resume(), Turbulence_NPS::resuming(), PNI_TCM::resuming(), CTD_NeilBrown::resuming(), Rowe_600::resuming(), CycleStarter::run(), Assign::run(), SendDataComponent::run(), DropWeight::run(), PAR_Licor::run(), NavChartDb::run(), DeadReckoner::run(), Batt_Ocean_Server::run(), IBIT::run(), SBIT::run(), HFRadarModelCalc::run(), HFRCMSurfaceCurrentAtVehicleLocation::run(), DataOverHttps::run(), HFRCMVirtualSurfaceDrifter::run(), Handler::runBetween(), Wait::runIfUnsatisfied(), PeakDetectVsDepth::runIfUnsatisfied(), ValueDetect::runIfUnsatisfied(), OffshoreEnvelope::runIfUnsatisfied(), DVL_micro::runnable(), SCPI::runnable(), CANONSampler::runnable(), BuoyancyServo::runnable(), ISUS::runnable(), VemcoVR2C::runnable(), Turner_Cyclops_rhodamine::runnable(), Aanderaa_O2::runnable(), Radio_Surface::runnable(), AcousticModem_Benthos_ATM900::runnable(), WetLabsBB2FL::runnable(), DAT::runnable(), ESPComponent::runnable(), ThrusterServo::runnable(), AHRS_3DMGX3::runnable(), PNI_TCM::runnable(), CTD_NeilBrown::runnable(), AHRS_sp3003D::runnable(), Rowe_600LCM::runnable(), BPC1::runnable(), Rowe_600::runnable(), Handler::runOnce(), CBIT::scanGFChan(), NAL9602::sendingFillBuffer(), NAL9602::sendingTransmit(), UartStream::serGetChar(), AHRS_sp3003D::setCalMode(), ESPComm::setEspLogFile(), Component::setFailure(), HFRCMVirtualSurfaceDrifter::setLocation(), DataElement::setTimestamp(), sleepTill(), SCPI::start(), ElevatorServo::start(), MassServo::start(), ISUS::start(), RudderServo::start(), BuoyancyServo::start(), Aanderaa_O2::start(), Radio_Surface::start(), AcousticModem_Benthos_ATM900::start(), WetLabsBB2FL::start(), Turbulence_NPS::start(), DAT::start(), DVL_micro::start(), AHRS_3DMGX3::start(), PNI_TCM::start(), ThrusterServo::start(), CTD_NeilBrown::start(), AHRS_sp3003D::start(), Rowe_600LCM::start(), BPC1::start(), Rowe_600::start(), NAL9602::start(), MassServo::starting(), ElevatorServo::starting(), BuoyancyServo::starting(), Aanderaa_O2::starting(), ISUS::starting(), RudderServo::starting(), WetLabsBB2FL::starting(), ESPComponent::starting(), AHRS_3DMGX3::starting(), ThrusterServo::starting(), PNI_TCM::starting(), AHRS_sp3003D::starting(), BPC1::starting(), DVL_micro::startPing(), AnalogToDigital::startRead(), ESPClient::startSampling(), ESPComponent::startSamplingPhase(), BuoyancyServo::stop(), CANONSampler::stop(), AcousticModem_Benthos_ATM900::stop(), DAT::stop(), PNI_TCM::stop(), AHRS_sp3003D::stop(), Radio_Surface::stopping(), DataOverHttps::tcpConnect(), Timestamp_Test::testNow(), Timespan_Test::testSleepFor(), Timestamp_Test::testSleepNow(), Timestamp_Test::testToString(), AcousticModem_Benthos_ATM900::uninitialize(), DAT::uninitialize(), NAL9602::uninitialize(), NavChartDb::updateClosest(), UartStream::waitForBufferEmpty(), ESPComponent::waitForESPConnection(), NAL9602::waking(), VerticalTemperatureHomogeneityIndexCalculator::writeData(), DVL_micro::writeData(), Tracking::writeData(), and HFRadarModelCalc::writeExpansionCoefficientsToSlate().
| bool Timestamp::operator!= | ( | const Timestamp & | rhs | ) | const |
Equalities/inequalities.
References timeval_.
Addition to Timespan.
Standard addition/subtraction functions.
I do wonder if i could return a Timestamp object rather than a stack double. Hmm...
Tests for each:
References Timestamp(), and timeval_.
Addition with a Timespan.
Addition of a Timespan.
Tests:
References timeval_.
| Timespan Timestamp::operator- | ( | const struct timeval & | rhs | ) | const |
Subtraction from struct timeval.
References timeval_.
Subtraction of two times yields a timespan.
References timeval_.
Subtraction of a Timespan.
Tests:
References timeval_.
| bool Timestamp::operator<= | ( | const Timestamp & | rhs | ) | const |
Greater-than-equal operator.
References timeval_.
Copy operator.
Tests:
References getTimeval(), and timeval_.
| Timestamp & Timestamp::operator= | ( | const double & | seconds | ) |
Set from double.
Set operator.
Tests:
References fromDouble().
| Timestamp & Timestamp::operator= | ( | const struct timeval & | timeval | ) |
| bool Timestamp::operator== | ( | const Timestamp & | rhs | ) | const |
| bool Timestamp::operator> | ( | const Timestamp & | rhs | ) | const |
Greater-than operator.
Inequality operator.
Tests:
References timeval_.
| bool Timestamp::operator>= | ( | const Timestamp & | rhs | ) | const |
Less-than-equal operator.
References timeval_.
| void Timestamp::round | ( | int | seconds | ) |
| Timestamp & Timestamp::setToCurrentTime | ( | void | ) |
Set to the current time.
Set this object to current time.
Tests:
References timeval_.
| Timestamp & Timestamp::setToMonoTime | ( | void | ) |
Set to clock that represents monotonic time since some unspecified starting point.
References fromTimespec().
| void Timestamp::sleepTill | ( | void | ) |
Sleep until the given time.
Quite a few ways to run this algorithm.
What's the most precise under standard Linux
Tests:
References Now(), operator-(), and Timespan::sleepFor().
Referenced by Handler::runBetween(), and Timestamp_Test::testSleepNow().
|
staticprotected |
Returns a struct timeval from the specified values.
References __suseconds_t, and __time_t.
|
staticprotected |
Returns a struct timeval from asMicros() result.
References __suseconds_t, and __time_t.
Referenced by FromMicros(), and Timespan::FromMicros().
|
staticprotected |
Returns a struct timeval from asMillis() result.
References __suseconds_t, and __time_t.
Referenced by FromMillis(), and Timespan::FromMillis().
| const Str Timestamp::toDateHourString | ( | ) | const |
Writes the Timestamp as a date-hour Str (YYYYmmddHH).
References timeval_.
Referenced by Rowe_600::appendEnsembleToFile().
| const Str Timestamp::toSmallerString | ( | ) | const |
Writes the Timestamp as a smaller Str (YYYYmmddHHMM).
References timeval_.
Referenced by HFRadarCompactModelForecaster::publishForecast(), and Unserialize::Run().
| const Str Timestamp::toSmallString | ( | ) | const |
Writes the Timestamp as a small Str (YYYYmmdd'T'HHMMSS).
References timeval_.
Referenced by Supervisor::GenerateDataDir(), HFRadarCompactModelForecaster::loadHistory(), NAL9602::needFix(), SyslogEntry::toKmlString(), ParsedCommand::toString(), and HFRadarModelCalc::writeExpansionCoefficientsToSlate().
| const char * Timestamp::toString | ( | char * | buf, |
| int | buflen, | ||
| int | precision = 3 |
||
| ) | const |
Writes the Timestamp as to a unsigned char buffer.
| buf | Buffer to write to |
| buflen | Maximum number of characters to write the buffer |
| precision | Number of decimal places to include in the seconds value |
References MAX, MIN, and timeval_.
Referenced by ScheduledItem::AddTimed(), Rowe_600::appendEnsembleToFile(), HFRCMReconstructedInterpolator::getPreviousTimeIndex(), ScheduledItem::List(), HFRadarModelCalc::lookup(), HFRCMTimeInterpolator::lookupExpansionCoefficients(), Rowe_600::readEnsembleDataMatrix(), ScheduledItem::Remove(), HFRCMVirtualSurfaceDrifter::run(), ESPComm::setEspLogFile(), MissionItem::setTimedOut(), ScheduledItem::ShowPaused(), Timestamp_Test::testToString(), SyslogEntry::toString(), DataEntry::toString(), EventEntry::toString(), toString(), KmlLogWriter::write(), KmlLogWriter::writeFooter(), TextTableLogWriter::writeRow(), and KmlLogWriter::writeSyslogItems().
| const Str Timestamp::toString | ( | int | precision = 3 | ) | const |
Writes the Timestamp as a Str.
References toString().
| void Timestamp::toTimespec | ( | struct timespec * | out | ) | const |
Internal conversion function.
References timeval_.
Referenced by Timespan::sleepFor(), and ThreadCondition::timedWait().
|
static |
Constant value to represent beginning of (1970 Jan 1) epoch.
Referenced by ScheduledItem::AddTimed(), CommandLine::commandSchedule(), ScheduledItem::DoScheduled(), and ScheduledItem::List().
|
static |
Constant value to represent "no time".
Set to > 1 year before beginning of (1970 Jan 1) epoch, so if clock resets, uninitialized items still have an "old" timestamp.
Referenced by CBIT::checkCriticals(), Logger::ClearCrtiticalErrorReceived(), CommandLine::commandBurn(), Component::execute(), Behavior::executeIfUnsatisfied(), fromString(), CommandLine::getLines(), UniversalDataElement::getTimestamp(), HFRadarCompactModelForecaster::loadHistory(), LogEntry::LogEntry(), ParsedCommand::matchTimestamp(), VerticalControl::overrideVertical(), BinaryLogReader::read(), DeadReckonUsingDVLWaterTrack::readVehicleVelocity(), BinaryLogWriter::resetTimeBase(), ScheduledItem::Resume(), DropWeight::run(), DataOverHttps::run(), Unserialize::Run(), DataElement::setTimestamp(), Timestamp_Test::testConstructorNoArguments(), ParsedCommand::undefTopArg(), DataElement::wasTouchedSinceLastRun(), MostRecentLogWriter::wipe(), TableLogWriter::write(), FilterLogWriter::write(), and SplitFileLogWriter::write().
|
protected |
Internal storage for time.
Referenced by addFromMicros(), addFromMillis(), asDouble(), asFloat(), asMicros(), asMillis(), asTimeT(), fromDouble(), fromIntegers(), fromString(), fromTimespec(), getTimeval(), operator!=(), operator+(), operator+=(), Timespan::operator+=(), operator-(), operator-=(), Timespan::operator-=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), round(), setToCurrentTime(), toDateHourString(), toSmallerString(), toSmallString(), toString(), Timespan::toString(), and toTimespec().
| * int Timestamp::tm_hour |
| * int Timestamp::tm_isdst |
| * int Timestamp::tm_mday |
| * int Timestamp::tm_min |
Returns value as struct tm: int tm_sec; /* seconds.
| * int Timestamp::tm_mon |
| * int Timestamp::tm_wday |
| * int Timestamp::tm_yday |
| * int Timestamp::tm_year |