libDwm-0.9.45
Dwm::TimeInterval Class Reference

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 TimeValueStart () const
 Returns the start time.
 
const TimeValueStart (const TimeValue &start)
 Sets and returns the start time.
 
const TimeValueEnd () const
 Returns the end time.
 
const TimeValueEnd (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.
 

Detailed Description

This class encapsulates a time interval.

Member Function Documentation

◆ Adjacent()

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()

◆ BZRead()

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.

◆ BZWrite()

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.

◆ Contains()

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.

◆ Read() [1/3]

size_t Dwm::TimeInterval::Read ( FILE * f)

Reads the time interval from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Read() [2/3]

int Dwm::TimeInterval::Read ( gzFile gzf)

Reads the time interval from a gzFile.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [3/3]

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.

◆ StreamedLength()

uint64_t Dwm::TimeInterval::StreamedLength ( ) const

Returns the length of the time insterval, in bytes.

This is used for some I/O functions.

◆ Write() [1/3]

size_t Dwm::TimeInterval::Write ( FILE * f) const

Writes the time interval to a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Write() [2/3]

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.

◆ Write() [3/3]

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.


The documentation for this class was generated from the following file: