domain::Duration Class Reference

Class that represents duration. More...

#include <duration.h>

Collaboration diagram for domain::Duration:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Duration (int seconds=1)
 Duration (int weeks, int days, int hours=0, int minutes=0, int seconds=0)
int weeks () const
int days () const
int hours () const
int minutes () const
int seconds () const
int totalSeconds () const
QString toString () const
bool operator== (const Duration &other) const
bool operator< (const Duration &other) const
bool operator> (const Duration &other) const

Private Attributes

int secs

Related Functions

(Note that these are not member functions.)



QDateTime operator+ (const QDateTime &left, const domain::Duration &right)

Detailed Description

Class that represents duration.

A duration can either be represented as a time in seconds or a time as a combination of weeks/days/hours/minutes/seconds.

Definition at line 19 of file duration.h.


Constructor & Destructor Documentation

domain::Duration::Duration ( int  seconds = 1  ) 

Creates new Duration

Parameters:
seconds The total number of seconds for this duration

Definition at line 29 of file duration.cpp.

domain::Duration::Duration ( int  weeks,
int  days,
int  hours = 0,
int  minutes = 0,
int  seconds = 0 
)

Creates new Duration.

Parameters:
weeks The number of weeks for this duration
days The number of days for this duration
hours The number of hours for this duration
minutes The number of minutes for this duration
seconds The number of seconds for this duration

Definition at line 41 of file duration.cpp.


Member Function Documentation

int domain::Duration::days (  )  const

Returns the number of days of this duration

Definition at line 78 of file duration.cpp.

Here is the call graph for this function:

int domain::Duration::hours (  )  const

Returns the number of hours of this duration

Definition at line 83 of file duration.cpp.

Here is the call graph for this function:

int domain::Duration::minutes (  )  const

Returns the number of minutes of this duration

Definition at line 89 of file duration.cpp.

Here is the call graph for this function:

bool domain::Duration::operator< ( const Duration other  )  const

Indicates whether this duration is shorter than the given duration.

Definition at line 128 of file duration.cpp.

bool domain::Duration::operator== ( const Duration other  )  const

Indicates whether this duration is equal to the given duration.

Definition at line 123 of file duration.cpp.

bool domain::Duration::operator> ( const Duration other  )  const

Indicates whether this duration is longer than the given duration.

Definition at line 133 of file duration.cpp.

int domain::Duration::seconds (  )  const

Returns the number of seconds of this duration

Definition at line 95 of file duration.cpp.

QString domain::Duration::toString (  )  const

Returns a string representation of this duration

Definition at line 105 of file duration.cpp.

Here is the call graph for this function:

int domain::Duration::totalSeconds (  )  const

Returns the total number of seconds of this duration

Definition at line 100 of file duration.cpp.

int domain::Duration::weeks (  )  const

Returns the number of weeks of this duration

Definition at line 73 of file duration.cpp.


Friends And Related Function Documentation

QDateTime operator+ ( const QDateTime &  left,
const domain::Duration right 
) [related]

Returns the time that is the given duration after the given time.

Definition at line 140 of file duration.cpp.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations Enumerator
Generated on Thu May 27 14:20:09 2010 for MopTaskManager by  doxygen 1.6.3