Time Class Reference

List of all members.

Detailed Description

Provides an easy way to compare time values.

This class provides comparison operators for the standard time types, struct timeval, and time_t. Should possibly be extended to work with the structures produced by the ctime set of libraries.

Todo:
Consider using the Boost time class, if it is equivalent.
Todo:
May be useful to add a few more operators

Definition at line 44 of file old-Time.H.

Public Member Functions

 Time ()
 The standard constructor sets the value to the current time.
 Time (const Time &m)
 Time (time_t value)
 Takes a time_t value, and leaves internal microseconds set to 0.
 Time (struct timeval _tv)
 Sets time to the value contained in struct timeval _tv.
 Time (struct timespec _ts)
 ~Time ()
const Timeoperator= (const Time &right)
bool operator== (const Time &right) const
bool operator!= (const Time &right) const
bool operator< (const Time &right) const
bool operator> (const Time &right) const
bool operator<= (const Time &right) const
bool operator>= (const Time &right) const
Time operator+ (const Time &right) const
Time operator- (const Time &right) const
const Timeoperator= (const struct timeval &right)
bool operator== (const struct timeval &right) const
bool operator!= (const struct timeval &right) const
bool operator< (const struct timeval &right) const
bool operator> (const struct timeval &right) const
bool operator<= (const struct timeval &right) const
bool operator>= (const struct timeval &right) const
Time operator+ (const struct timeval &right) const
Time operator- (const struct timeval &right) const
const Timeoperator= (const time_t &right)
bool operator== (const time_t &right) const
bool operator!= (const time_t &right) const
bool operator< (const time_t &right) const
bool operator> (const time_t &right) const
bool operator<= (const time_t &right) const
bool operator>= (const time_t &right) const
Time operator+ (const time_t &right) const
Time operator- (const time_t &right) const
const Timeoperator= (const struct timespec &right)
bool operator== (const struct timespec &right) const
bool operator!= (const struct timespec &right) const
bool operator< (const struct timespec &right) const
bool operator> (const struct timespec &right) const
bool operator<= (const struct timespec &right) const
bool operator>= (const struct timespec &right) const
Time operator+ (const struct timespec &right) const
Time operator- (const struct timespec &right) const
void now ()
 Sets the value of the object to the current time.
void zero ()
 Sets the time value to zero.
time_t getSeconds () const
 Returns the value of the seconds field.
time_t getUSeconds () const
 Returns the value of the microseconds field.
void setSeconds (time_t sec)
 Set the seconds value.
void setUSeconds (time_t usec)
 Set the usec value.
timeval getTimeval ()
 Returns the timeval structure value.
timespec timespec ()
 Time ()
 Time (const Time &m)
 Time (time_t value)
 Time (struct timeval _tv)
 Time (struct timespec ts)
 ~Time ()
const Timeoperator= (const Time &right)
bool operator== (const Time &right) const
bool operator!= (const Time &right) const
bool operator< (const Time &right) const
bool operator> (const Time &right) const
bool operator<= (const Time &right) const
bool operator>= (const Time &right) const
Time operator+ (const Time &right) const
Time operator- (const Time &right) const
const Timeoperator= (const struct timeval &right)
bool operator== (const struct timeval &right) const
bool operator!= (const struct timeval &right) const
bool operator< (const struct timeval &right) const
bool operator> (const struct timeval &right) const
bool operator<= (const struct timeval &right) const
bool operator>= (const struct timeval &right) const
Time operator+ (const struct timeval &right) const
Time operator- (const struct timeval &right) const
const Timeoperator= (const time_t &right)
bool operator== (const time_t &right) const
bool operator< (const time_t &right) const
bool operator> (const time_t &right) const
bool operator<= (const time_t &right) const
bool operator>= (const time_t &right) const
Time operator+ (const time_t &right) const
Time operator- (const time_t &right) const
const Timeoperator= (const struct timespec &right)
bool operator== (const struct timespec &right) const
bool operator!= (const struct timespec &right) const
bool operator< (const struct timespec &right) const
bool operator> (const struct timespec &right) const
bool operator<= (const struct timespec &right) const
bool operator>= (const struct timespec &right) const
Time operator+ (const struct timespec &right) const
Time operator- (const struct timespec &right) const
const Timeoperator= (const double &right)
Time operator * (const float &right) const
void now ()
 Sets the value of the object to the current time.
void zero ()
 Sets the time value to zero.
time_t getSeconds () const
 Returns the value of the seconds field.
time_t getUSeconds () const
 Returns the value of the microseconds field.
void setSeconds (time_t sec)
 Set the seconds value.
void setUSeconds (time_t usec)
 Set the usec value.
timeval getTimeval ()
 Returns the timeval structure value.
timespec timespec ()

Protected Attributes

timeval m_tv
timezone m_tz
timeval m_tv
timezone m_tz


Constructor & Destructor Documentation

Time (  ) 

The standard constructor sets the value to the current time.

Definition at line 34 of file Time.cpp.

References Time::m_tv, and Time::m_tz.

Referenced by Time::Time().

Time ( const Time m  ) 

Definition at line 38 of file Time.cpp.

References Time::m_tv, and Time::m_tz.

Time ( time_t  value  ) 

Takes a time_t value, and leaves internal microseconds set to 0.

Definition at line 43 of file Time.cpp.

References Time::m_tv, and Time::Time().

Time ( struct timeval  _tv  ) 

Sets time to the value contained in struct timeval _tv.

Definition at line 50 of file Time.cpp.

References Time::m_tv, and Time::Time().

Time ( struct timespec  _ts  ) 

Definition at line 56 of file Time.cpp.

References Time::m_tv, and Time::Time().

~Time (  ) 

Definition at line 63 of file Time.cpp.

Time (  )  [inline]

Definition at line 48 of file Time.H.

References Time::m_tv, and Time::m_tz.

Time ( const Time m  )  [inline]

Definition at line 52 of file Time.H.

References Time::m_tv, and Time::m_tz.

Time ( time_t  value  )  [inline]

Definition at line 57 of file Time.H.

References Time::m_tv, and Time::Time().

Time ( struct timeval  _tv  )  [inline]

Definition at line 64 of file Time.H.

References Time::m_tv, and Time::Time().

Time ( struct timespec  ts  )  [inline]

Definition at line 69 of file Time.H.

References Time::m_tv, and Time::Time().

~Time (  )  [inline]

Definition at line 76 of file Time.H.


Member Function Documentation

const Time & operator= ( const Time right  ) 

Definition at line 68 of file Time.cpp.

References Time::m_tv, and Time::m_tz.

bool operator== ( const Time right  )  const

Definition at line 75 of file Time.cpp.

References Time::m_tv.

bool operator!= ( const Time right  )  const

Definition at line 84 of file Time.cpp.

References Time::m_tv.

bool operator< ( const Time right  )  const

Definition at line 93 of file Time.cpp.

References Time::m_tv.

bool operator> ( const Time right  )  const

Definition at line 103 of file Time.cpp.

References Time::m_tv.

bool operator<= ( const Time right  )  const

Definition at line 113 of file Time.cpp.

References Time::m_tv.

bool operator>= ( const Time right  )  const

Definition at line 122 of file Time.cpp.

References Time::m_tv.

Time operator+ ( const Time right  )  const

Definition at line 131 of file Time.cpp.

References Time::m_tv, and Time::m_tz.

Time operator- ( const Time right  )  const

Definition at line 139 of file Time.cpp.

References Time::m_tv, and Time::m_tz.

const Time & operator= ( const struct timeval &  right  ) 

Definition at line 149 of file Time.cpp.

References Time::m_tv.

bool operator== ( const struct timeval &  right  )  const

Definition at line 154 of file Time.cpp.

References Time::m_tv.

bool operator!= ( const struct timeval &  right  )  const

Definition at line 163 of file Time.cpp.

References Time::m_tv.

bool operator< ( const struct timeval &  right  )  const

Definition at line 173 of file Time.cpp.

References Time::m_tv.

bool operator> ( const struct timeval &  right  )  const

Definition at line 184 of file Time.cpp.

References Time::m_tv.

bool operator<= ( const struct timeval &  right  )  const

Definition at line 194 of file Time.cpp.

References Time::m_tv.

bool operator>= ( const struct timeval &  right  )  const

Definition at line 204 of file Time.cpp.

References Time::m_tv.

Time operator+ ( const struct timeval &  right  )  const

Definition at line 214 of file Time.cpp.

References Time::m_tv, and Time::m_tz.

Time operator- ( const struct timeval &  right  )  const

Definition at line 223 of file Time.cpp.

References Time::m_tv, and Time::m_tz.

const Time & operator= ( const time_t &  right  ) 

Definition at line 233 of file Time.cpp.

References Time::m_tv.

bool operator== ( const time_t &  right  )  const

Definition at line 240 of file Time.cpp.

References Time::m_tv.

bool operator!= ( const time_t &  right  )  const

bool operator< ( const time_t &  right  )  const

Definition at line 248 of file Time.cpp.

References Time::m_tv.

bool operator> ( const time_t &  right  )  const

Definition at line 257 of file Time.cpp.

References Time::m_tv.

bool operator<= ( const time_t &  right  )  const

Definition at line 265 of file Time.cpp.

References Time::m_tv.

bool operator>= ( const time_t &  right  )  const

Definition at line 273 of file Time.cpp.

References Time::m_tv.

Time operator+ ( const time_t &  right  )  const

Definition at line 281 of file Time.cpp.

References Time::m_tv, and Time::m_tz.

Time operator- ( const time_t &  right  )  const

Definition at line 288 of file Time.cpp.

References Time::m_tv, and Time::m_tz.

const Time & operator= ( const struct timespec &  right  ) 

Definition at line 297 of file Time.cpp.

References Time::m_tv.

bool operator== ( const struct timespec &  right  )  const

Definition at line 303 of file Time.cpp.

References Time::m_tv.

bool operator!= ( const struct timespec &  right  )  const

Definition at line 312 of file Time.cpp.

References Time::m_tv.

bool operator< ( const struct timespec &  right  )  const

Definition at line 322 of file Time.cpp.

References Time::m_tv.

bool operator> ( const struct timespec &  right  )  const

Definition at line 333 of file Time.cpp.

References Time::m_tv.

bool operator<= ( const struct timespec &  right  )  const

Definition at line 343 of file Time.cpp.

References Time::m_tv.

bool operator>= ( const struct timespec &  right  )  const

Definition at line 353 of file Time.cpp.

References Time::m_tv.

Time operator+ ( const struct timespec &  right  )  const

Definition at line 363 of file Time.cpp.

References Time::m_tv, and Time::m_tz.

Time operator- ( const struct timespec &  right  )  const

Definition at line 372 of file Time.cpp.

References Time::m_tv, and Time::m_tz.

void now (  )  [inline]

Sets the value of the object to the current time.

Definition at line 116 of file old-Time.H.

References Time::m_tv, and Time::m_tz.

Referenced by WURDE1394Camera::captureGray(), WURDE1394Camera::captureRGB(), WURDE1394Camera::captureYUV24(), WURDE1394Camera::captureYUV422(), CommsManager::CommsManager(), WallBuilder::init(), VisionControl::init(), VectorMoverTransport::init(), SoundController::init(), RobotDrive::init(), RangeFinder::init(), PTUnit::init(), Power::init(), PlaybackControl::init(), ObstacleAvoiderTransport::init(), McpRequest::init(), MCPControl::init(), LoggerTransport::init(), ImageTransport::init(), ImageDisplay::init(), Heartbeat::init(), Foo::init(), FaceDetector::init(), Egomotion::init(), Bumper::init(), BlobFinder::init(), main(), WallBuilder::publishData(), VisionControl::publishData(), VectorMoverTransport::publishData(), SoundController::publishData(), RobotDrive::publishData(), RangeFinder::publishData(), PTUnit::publishData(), Power::publishData(), PlaybackControl::publishData(), ObstacleAvoiderTransport::publishData(), McpRequest::publishData(), MCPControl::publishData(), LoggerTransport::publishData(), ImageTransport::publishData(), ImageDisplay::publishData(), Heartbeat::publishData(), Foo::publishData(), FaceDetector::publishData(), Egomotion::publishData(), Bumper::publishData(), BlobFinder::publishData(), ImageSource::publishImage(), WallBuilder::publishInfo(), VisionControl::publishInfo(), VectorMoverTransport::publishInfo(), SoundController::publishInfo(), RobotDrive::publishInfo(), RangeFinder::publishInfo(), PTUnit::publishInfo(), Power::publishInfo(), PlaybackControl::publishInfo(), ObstacleAvoiderTransport::publishInfo(), McpRequest::publishInfo(), MCPControl::publishInfo(), LoggerTransport::publishInfo(), ImageTransport::publishInfo(), ImageDisplay::publishInfo(), Heartbeat::publishInfo(), Foo::publishInfo(), FaceDetector::publishInfo(), Egomotion::publishInfo(), Bumper::publishInfo(), BlobFinder::publishInfo(), Trigger::reset(), CommsManager::runUpdate(), Logger::setNetworkLogging(), Timer::sleep(), Module::stale(), Module::startUp(), and Timer::Timer().

void zero (  )  [inline]

Sets the time value to zero.

Useful in certain situations

Definition at line 120 of file old-Time.H.

References Time::m_tv.

Referenced by Module::Module(), PlaybackTimer::sleep(), Timer::sleep(), and CommsManager::sleep().

time_t getSeconds (  )  const [inline]

Returns the value of the seconds field.

Definition at line 125 of file old-Time.H.

References Time::m_tv.

Referenced by WURDE1394Camera::captureYUV24(), StereoDataCollector::fileWriterThread(), ImageWriter::fileWriterThread1(), DataCollector::fileWriterThread1(), ImageWriter::fileWriterThread2(), DataCollector::fileWriterThread2(), ImageWriter::fileWriterThread3(), DataCollector::fileWriterThread3(), main(), and FileEntry::operator<().

time_t getUSeconds (  )  const [inline]

Returns the value of the microseconds field.

Definition at line 130 of file old-Time.H.

References Time::m_tv.

Referenced by WURDE1394Camera::captureYUV24(), StereoDataCollector::fileWriterThread(), ImageWriter::fileWriterThread1(), DataCollector::fileWriterThread1(), ImageWriter::fileWriterThread2(), DataCollector::fileWriterThread2(), ImageWriter::fileWriterThread3(), DataCollector::fileWriterThread3(), main(), and FileEntry::operator<().

void setSeconds ( time_t  sec  )  [inline]

Set the seconds value.

Definition at line 136 of file old-Time.H.

References Time::m_tv.

Referenced by DirectoryScanner::openDirectory(), Timer::setFrequency(), and CommsManager::setMinSleep().

void setUSeconds ( time_t  usec  )  [inline]

Set the usec value.

Definition at line 141 of file old-Time.H.

References Time::m_tv.

Referenced by DirectoryScanner::openDirectory(), Timer::setFrequency(), and CommsManager::setMinSleep().

struct timeval getTimeval (  )  [inline]

Returns the timeval structure value.

Definition at line 146 of file old-Time.H.

References Time::m_tv.

struct timespec timespec (  )  [inline]

Definition at line 148 of file old-Time.H.

References Time::m_tv.

Referenced by PlaybackTimer::sleep(), Timer::sleep(), and CommsManager::sleep().

const Time& operator= ( const Time right  )  [inline]

Definition at line 81 of file Time.H.

References Time::m_tv, and Time::m_tz.

bool operator== ( const Time right  )  const [inline]

Definition at line 88 of file Time.H.

References Time::m_tv.

bool operator!= ( const Time right  )  const [inline]

Definition at line 97 of file Time.H.

References Time::m_tv.

bool operator< ( const Time right  )  const [inline]

Definition at line 106 of file Time.H.

References Time::m_tv.

bool operator> ( const Time right  )  const [inline]

Definition at line 116 of file Time.H.

References Time::m_tv.

bool operator<= ( const Time right  )  const [inline]

Definition at line 126 of file Time.H.

References Time::m_tv.

bool operator>= ( const Time right  )  const [inline]

Definition at line 135 of file Time.H.

References Time::m_tv.

Time operator+ ( const Time right  )  const [inline]

Definition at line 144 of file Time.H.

References Time::m_tv, and Time::m_tz.

Time operator- ( const Time right  )  const [inline]

Definition at line 152 of file Time.H.

References Time::m_tv, and Time::m_tz.

const Time& operator= ( const struct timeval &  right  )  [inline]

Definition at line 162 of file Time.H.

References Time::m_tv.

bool operator== ( const struct timeval &  right  )  const [inline]

Definition at line 167 of file Time.H.

References Time::m_tv.

bool operator!= ( const struct timeval &  right  )  const [inline]

Definition at line 176 of file Time.H.

References Time::m_tv.

bool operator< ( const struct timeval &  right  )  const [inline]

Definition at line 186 of file Time.H.

References Time::m_tv.

bool operator> ( const struct timeval &  right  )  const [inline]

Definition at line 197 of file Time.H.

References Time::m_tv.

bool operator<= ( const struct timeval &  right  )  const [inline]

Definition at line 207 of file Time.H.

References Time::m_tv.

bool operator>= ( const struct timeval &  right  )  const [inline]

Definition at line 217 of file Time.H.

References Time::m_tv.

Time operator+ ( const struct timeval &  right  )  const [inline]

Definition at line 227 of file Time.H.

References Time::m_tv, and Time::m_tz.

Time operator- ( const struct timeval &  right  )  const [inline]

Definition at line 236 of file Time.H.

References Time::m_tv, and Time::m_tz.

const Time& operator= ( const time_t &  right  )  [inline]

Definition at line 246 of file Time.H.

References Time::m_tv.

bool operator== ( const time_t &  right  )  const [inline]

Definition at line 253 of file Time.H.

References Time::m_tv.

bool operator< ( const time_t &  right  )  const [inline]

Definition at line 261 of file Time.H.

References Time::m_tv.

bool operator> ( const time_t &  right  )  const [inline]

Definition at line 270 of file Time.H.

References Time::m_tv.

bool operator<= ( const time_t &  right  )  const [inline]

Definition at line 278 of file Time.H.

References Time::m_tv.

bool operator>= ( const time_t &  right  )  const [inline]

Definition at line 286 of file Time.H.

References Time::m_tv.

Time operator+ ( const time_t &  right  )  const [inline]

Definition at line 294 of file Time.H.

References Time::m_tv, and Time::m_tz.

Time operator- ( const time_t &  right  )  const [inline]

Definition at line 301 of file Time.H.

References Time::m_tv, and Time::m_tz.

const Time& operator= ( const struct timespec &  right  )  [inline]

Definition at line 310 of file Time.H.

References Time::m_tv.

bool operator== ( const struct timespec &  right  )  const [inline]

Definition at line 316 of file Time.H.

References Time::m_tv.

bool operator!= ( const struct timespec &  right  )  const [inline]

Definition at line 325 of file Time.H.

References Time::m_tv.

bool operator< ( const struct timespec &  right  )  const [inline]

Definition at line 335 of file Time.H.

References Time::m_tv.

bool operator> ( const struct timespec &  right  )  const [inline]

Definition at line 346 of file Time.H.

References Time::m_tv.

bool operator<= ( const struct timespec &  right  )  const [inline]

Definition at line 356 of file Time.H.

References Time::m_tv.

bool operator>= ( const struct timespec &  right  )  const [inline]

Definition at line 366 of file Time.H.

References Time::m_tv.

Time operator+ ( const struct timespec &  right  )  const [inline]

Definition at line 376 of file Time.H.

References Time::m_tv, and Time::m_tz.

Time operator- ( const struct timespec &  right  )  const [inline]

Definition at line 385 of file Time.H.

References Time::m_tv, and Time::m_tz.

const Time& operator= ( const double &  right  )  [inline]

Definition at line 395 of file Time.H.

References Time::m_tv.

Time operator * ( const float &  right  )  const [inline]

Definition at line 410 of file Time.H.

References Time::m_tv.

void now (  )  [inline]

Sets the value of the object to the current time.

Definition at line 425 of file Time.H.

References Time::m_tv, and Time::m_tz.

void zero (  )  [inline]

Sets the time value to zero.

Useful in certain situations

Definition at line 429 of file Time.H.

References Time::m_tv.

time_t getSeconds (  )  const [inline]

Returns the value of the seconds field.

Definition at line 434 of file Time.H.

References Time::m_tv.

time_t getUSeconds (  )  const [inline]

Returns the value of the microseconds field.

Definition at line 439 of file Time.H.

References Time::m_tv.

void setSeconds ( time_t  sec  )  [inline]

Set the seconds value.

Definition at line 445 of file Time.H.

References Time::m_tv.

void setUSeconds ( time_t  usec  )  [inline]

Set the usec value.

Definition at line 450 of file Time.H.

References Time::m_tv.

struct timeval getTimeval (  )  [inline]

Returns the timeval structure value.

Definition at line 455 of file Time.H.

References Time::m_tv.

struct timespec timespec (  )  [inline]

Definition at line 457 of file Time.H.

References Time::m_tv.


Member Data Documentation

struct timeval m_tv [protected]

Definition at line 157 of file old-Time.H.

Referenced by Time::getSeconds(), Time::getTimeval(), Time::getUSeconds(), Time::now(), Time::operator *(), Time::operator!=(), Time::operator+(), Time::operator-(), Time::operator<(), Time::operator<=(), Time::operator=(), Time::operator==(), Time::operator>(), Time::operator>=(), Time::setSeconds(), Time::setUSeconds(), Time::Time(), Time::timespec(), and Time::zero().

struct timezone m_tz [protected]

Definition at line 159 of file old-Time.H.

Referenced by Time::now(), Time::operator+(), Time::operator-(), Time::operator=(), and Time::Time().

struct timeval m_tv [protected]

Definition at line 466 of file Time.H.

struct timezone m_tz [protected]

Definition at line 468 of file Time.H.


The documentation for this class was generated from the following files:
Generated on Thu Feb 1 15:31:56 2007 for WURDE by  doxygen 1.5.1