42#ifndef _DWMTIMEVALUE64_HH_
43#define _DWMTIMEVALUE64_HH_
46 #include <sys/types.h>
48#if ((! __APPLE__) && (! __linux__))
49 #include <sys/timespec.h>
103 void Set(
const struct timeval & tv);
108 void Set(uint64_t secs, uint32_t usecs);
120 struct tm LocalTime() const;
161 std::istream &
Read(std::istream & is);
166 std::ostream &
Write(std::ostream & os)
const;
219 operator double ()
const;
Dwm::TimeValue class definition.
This class encapsulates a time value beyond the UNIX epoch, with microsecond granularity.
Definition DwmTimeValue64.hh:67
int Write(gzFile gzf) const
Writes the TimeValue64 to a gzFile.
TimeValue64(const TimeValue &tv)
Construct from a TimeValue.
std::ostream & Write(std::ostream &os) const
Writes the TimeValue64 to an ostream. Returns the ostream.
bool operator<(const TimeValue64 &tv) const
Less-than operator.
int Read(gzFile gzf)
Reads the TimeValue64 from a gzFile.
void Set(uint64_t secs, uint32_t usecs)
Sets the TimeValue64 from the given secs and usecs.
bool operator<=(const TimeValue64 &tv) const
operator <=
TimeValue64(uint64_t secs, uint32_t usecs)
Construct from the given secs and usecs.
bool operator>=(const TimeValue64 &tv) const
operator >=
bool operator>(const TimeValue64 &tv) const
Greater-than operator.
int BZRead(BZFILE *bzf)
Reads the TimeValue64 from a BZFILE pointer.
void SetNow()
Sets the TimeValue64 to the current time.
bool operator==(const TimeValue64 &tv) const
Equal-to operator.
int BZWrite(BZFILE *bzf) const
Writes the TimeValue64 to a BZFILE pointer.
TimeValue64(const struct timeval &tv)
Construct from a struct timeval.
uint64_t StreamedLength() const
Returns the number of bytes that would be written if one of the Write() members were called.
std::istream & Read(std::istream &is)
Reads the TimeValue64 from an istream. Returns the istream.
TimeValue64(const struct timespec &ts)
Construct from a struct timespec.
uint32_t Usecs() const
Returns the residual microseconds.
size_t Read(FILE *f)
Reads the TimeValue64 from a FILE pointer.
TimeValue64(bool setNow=false)
Constructor.
ssize_t Write(int fd) const
Writes the TimeValue64 to a file descriptor.
ssize_t Read(int fd)
Reads the TimeValue64 from a file descriptor.
size_t Write(FILE *f) const
Writes the TimeValue64 to a FILE pointer.
void Set(const struct timeval &tv)
Sets the TimeValue64 from the given struct timeval tv.
uint64_t Secs() const
Returns the seconds.
This class encapsulates a time value beyond the UNIX epoch, with microsecond granularity.
Definition DwmTimeValue.hh:68