This class encapsulates a time interval. More...
#include <DwmTimeInterval.hh>
Public Member Functions | |
| TimeInterval () | |
| Contructor. | |
| TimeInterval (const TimeValue &start, const TimeValue &end) | |
| Construct from a start and end time. | |
| TimeInterval (const TimeInterval &timeInterval) | |
| Copy constructor. | |
| const TimeValue & | Start () const |
| Returns the start time. | |
| const TimeValue & | Start (const TimeValue &start) |
| Sets and returns the start time. | |
| const TimeValue & | End () const |
| Returns the end time. | |
| const TimeValue & | End (const TimeValue &end) |
| Sets and returns the end time. | |
| bool | operator== (const TimeInterval &ti) const |
| operator == | |
| TimeValue | Duration () const |
| bool | Contains (const TimeValue &tv) const |
Returns true if the TimeValue tv falls within the time interval, i.e. | |
| bool | Contains (const TimeInterval &ti) const |
Returns true if the TimeInterval ti is completely contained within our time interval. | |
| bool | Overlaps (const TimeInterval &ti) const |
Returns true if ti overlaps the time interval. | |
| bool | Adjacent (const TimeInterval &ti) const |
Returns true if ti is immediately adjacent our time interval, i.e. | |
| uint64_t | StreamedLength () const |
| Returns the length of the time insterval, in bytes. | |
| std::istream & | Read (std::istream &is) |
| Reads the time interval from an istream. Returns the istream. | |
| std::ostream & | Write (std::ostream &os) const |
| Writes the time interval to an ostream. Returns the ostream. | |
| size_t | Read (FILE *f) |
| Reads the time interval from a FILE pointer. | |
| size_t | Write (FILE *f) const |
| Writes the time interval to a FILE pointer. | |
| ssize_t | Read (int fd) |
| Reads the time interval from a file descriptor. | |
| ssize_t | Write (int fd) const |
| Wries the time interval to a file descriptor. | |
| int | Read (gzFile gzf) |
| Reads the time interval from a gzFile. | |
| int | Write (gzFile gzf) const |
| Writes the time interval to a gzFile. | |
| int | BZRead (BZFILE *bzf) |
| Reads the time interval from a BZFILE pointer. | |
| int | BZWrite (BZFILE *bzf) const |
| Writes the time interval to a BZFILE pointer. | |
This class encapsulates a time interval.
| bool Dwm::TimeInterval::Adjacent | ( | const TimeInterval & | ti | ) | const |
Returns true if ti is immediately adjacent our time interval, i.e.
our start is equal to ti.End() or our end is equal to ti.Start()
| int Dwm::TimeInterval::BZRead | ( | BZFILE * | bzf | ) |
Reads the time interval from a BZFILE pointer.
Returns the number of bytes read on success, -1 on failure.
| int Dwm::TimeInterval::BZWrite | ( | BZFILE * | bzf | ) | const |
Writes the time interval to a BZFILE pointer.
Returns the number of bytes written on success, -1 on failure.
| bool Dwm::TimeInterval::Contains | ( | const TimeValue & | tv | ) | const |
Returns true if the TimeValue tv falls within the time interval, i.e.
\tv is greater than or equal to the start and less than or equal to the end.
| size_t Dwm::TimeInterval::Read | ( | FILE * | f | ) |
Reads the time interval from a FILE pointer.
Returns 1 on success, 0 on failure.
| int Dwm::TimeInterval::Read | ( | gzFile | gzf | ) |
Reads the time interval from a gzFile.
Returns the number of bytes read on success, -1 on failure.
| ssize_t Dwm::TimeInterval::Read | ( | int | fd | ) |
Reads the time interval from a file descriptor.
Returns the number of bytes read on success, -1 on failure.
| uint64_t Dwm::TimeInterval::StreamedLength | ( | ) | const |
Returns the length of the time insterval, in bytes.
This is used for some I/O functions.
| size_t Dwm::TimeInterval::Write | ( | FILE * | f | ) | const |
Writes the time interval to a FILE pointer.
Returns 1 on success, 0 on failure.
| int Dwm::TimeInterval::Write | ( | gzFile | gzf | ) | const |
Writes the time interval to a gzFile.
Returns the number of bytes written on success, -1 on failure.
| ssize_t Dwm::TimeInterval::Write | ( | int | fd | ) | const |
Wries the time interval to a file descriptor.
Returns the number of bytes written on success, -1 on failure.