42#ifndef _DWMTIMEINTERVAL_HH_
43#define _DWMTIMEINTERVAL_HH_
78 : _data(timeInterval._data)
117 return (_data.second - _data.first);
154 std::istream &
Read(std::istream & is);
159 std::ostream &
Write(std::ostream & os)
const;
210 std::pair<TimeValue, TimeValue> _data;
Dwm::TimeValue class definition.
This class encapsulates a time interval.
Definition DwmTimeInterval.hh:56
TimeInterval(const TimeValue &start, const TimeValue &end)
Construct from a start and end time.
Definition DwmTimeInterval.hh:68
std::istream & Read(std::istream &is)
Reads the time interval from an istream. Returns the istream.
bool Overlaps(const TimeInterval &ti) const
Returns true if ti overlaps the time interval.
size_t Write(FILE *f) const
Writes the time interval to a FILE pointer.
const TimeValue & End(const TimeValue &end)
Sets and returns the end time.
const TimeValue & End() const
Returns the end time.
Definition DwmTimeInterval.hh:97
std::ostream & Write(std::ostream &os) const
Writes the time interval to an ostream. Returns the ostream.
int Write(gzFile gzf) const
Writes the time interval to a gzFile.
const TimeValue & Start() const
Returns the start time.
Definition DwmTimeInterval.hh:84
bool Contains(const TimeValue &tv) const
Returns true if the TimeValue tv falls within the time interval, i.e.
bool operator==(const TimeInterval &ti) const
operator ==
ssize_t Write(int fd) const
Wries the time interval to a file descriptor.
uint64_t StreamedLength() const
Returns the length of the time insterval, in bytes.
TimeInterval(const TimeInterval &timeInterval)
Copy constructor.
Definition DwmTimeInterval.hh:77
ssize_t Read(int fd)
Reads the time interval from a file descriptor.
int BZWrite(BZFILE *bzf) const
Writes the time interval to a BZFILE pointer.
TimeInterval()
Contructor.
Definition DwmTimeInterval.hh:61
size_t Read(FILE *f)
Reads the time interval from a FILE pointer.
int BZRead(BZFILE *bzf)
Reads the time interval from a BZFILE pointer.
int Read(gzFile gzf)
Reads the time interval from a gzFile.
bool Adjacent(const TimeInterval &ti) const
Returns true if ti is immediately adjacent our time interval, i.e.
const TimeValue & Start(const TimeValue &start)
Sets and returns the start time.
bool Contains(const TimeInterval &ti) const
Returns true if the TimeInterval ti is completely contained within our time interval.
This class encapsulates a time value beyond the UNIX epoch, with microsecond granularity.
Definition DwmTimeValue.hh:68