libDwm-0.6.0
Dwm::TimeInterval Class Reference

This class encapsulates a time interval. More...

#include <DwmTimeInterval.hh>

Inheritance diagram for Dwm::TimeInterval:
Collaboration diagram for Dwm::TimeInterval:

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. More...
 
bool Contains (const TimeInterval &ti) const
 Returns true if the TimeInterval ti is completely contained within our time interval. More...
 
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. More...
 
uint32_t StreamedLength () const
 Returns the length of the time insterval, in bytes. More...
 
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. More...
 
size_t Write (FILE *f) const
 Writes the time interval to a FILE pointer. More...
 
ssize_t Read (int fd)
 Reads the time interval from a file descriptor. More...
 
ssize_t Write (int fd) const
 Wries the time interval to a file descriptor. More...
 
int Read (gzFile gzf)
 Reads the time interval from a gzFile. More...
 
int Write (gzFile gzf) const
 Writes the time interval to a gzFile. More...
 
int BZRead (BZFILE *bzf)
 Reads the time interval from a BZFILE pointer. More...
 
int BZWrite (BZFILE *bzf) const
 Writes the time interval to a BZFILE pointer. More...
 
- Public Member Functions inherited from Dwm::Readable
virtual ~Readable ()
 destructor
 
- Public Member Functions inherited from Dwm::Writable
virtual ~Writable ()
 Destructor.
 
- Public Member Functions inherited from Dwm::GZReadable
virtual ~GZReadable ()
 destructor
 
- Public Member Functions inherited from Dwm::GZWritable
virtual ~GZWritable ()
 destructor
 

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

Reads the time interval from a BZFILE pointer.

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

Implements Dwm::BZ2Readable.

◆ BZWrite()

int Dwm::TimeInterval::BZWrite ( BZFILE *  bzf) const
virtual

Writes the time interval to a BZFILE pointer.

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

Implements Dwm::BZ2Writable.

◆ Contains() [1/2]

bool Dwm::TimeInterval::Contains ( const TimeValue tv) const

Returns true if the TimeValue tv falls within the time interval, i.e.

is greater than or equal to the start and less than or equal to the end.

◆ Contains() [2/2]

bool Dwm::TimeInterval::Contains ( const TimeInterval ti) const

Returns true if the TimeInterval ti is completely contained within our time interval.

◆ Read() [1/3]

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

Reads the time interval from a FILE pointer.

Returns 1 on success, 0 on failure.

Implements Dwm::Readable.

◆ Read() [2/3]

ssize_t Dwm::TimeInterval::Read ( int  fd)
virtual

Reads the time interval from a file descriptor.

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

Implements Dwm::Readable.

◆ Read() [3/3]

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

Reads the time interval from a gzFile.

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

Implements Dwm::GZReadable.

◆ StreamedLength()

uint32_t Dwm::TimeInterval::StreamedLength ( ) const
virtual

Returns the length of the time insterval, in bytes.

This is used for some I/O functions.

Implements Dwm::Writable.

◆ Write() [1/3]

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

Writes the time interval to a FILE pointer.

Returns 1 on success, 0 on failure.

Implements Dwm::Writable.

◆ Write() [2/3]

ssize_t Dwm::TimeInterval::Write ( int  fd) const
virtual

Wries the time interval to a file descriptor.

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

Implements Dwm::Writable.

◆ Write() [3/3]

int Dwm::TimeInterval::Write ( gzFile  gzf) const
virtual

Writes the time interval to a gzFile.

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

Implements Dwm::GZWritable.


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