domain::Schedule Class Reference

Class that represents a schedule. More...

#include <schedule.h>

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

List of all members.

Public Member Functions

 Schedule (const Duration &duration=Duration(), const QDateTime &startDate=Clock::currentTime(), const QDateTime &dueDate=Clock::currentTime().addSecs(1))
 Creates new schedule.
 Schedule (const Schedule &other)
 ~Schedule ()
const Durationduration () const
const QDateTime & startDate () const
const QDateTime & dueDate () const
void setDuration (const Duration &duration)
void setStartDate (const QDateTime &startDate)
void setDueDate (const QDateTime &dueDate)
Scheduleoperator= (const Schedule &other)
bool operator== (const Schedule &other) const

Static Public Member Functions

static bool isValid (const Duration &duration, const QDateTime &startDate, const QDateTime &dueDate)

Private Attributes

QSharedDataPointer
< SchedulePrivate
d

Detailed Description

Class that represents a schedule.

A schedule has a start date, a due date and a duration.

Definition at line 26 of file schedule.h.


Constructor & Destructor Documentation

domain::Schedule::Schedule ( const Duration duration = Duration(),
const QDateTime &  startDate = Clock::currentTime(),
const QDateTime &  dueDate = Clock::currentTime().addSecs(1) 
)

Creates new schedule.

The newly created schedule will have the given properties

Parameters:
duration The duration of the schedule
startDate The startdate for the schedule
dueDate The duedate for the schedule
Exceptions:
InvalidDataException The duedate falls before startdate + duration

Definition at line 11 of file schedule.cpp.

domain::Schedule::Schedule ( const Schedule other  ) 

Copy constructor.

Definition at line 24 of file schedule.cpp.

domain::Schedule::~Schedule (  ) 

Destructor for the schedule

Definition at line 28 of file schedule.cpp.


Member Function Documentation

const QDateTime & domain::Schedule::dueDate (  )  const

Returns the duedate of this schedule

Definition at line 47 of file schedule.cpp.

const domain::Duration & domain::Schedule::duration (  )  const

Returns the duration of this schedule

Definition at line 62 of file schedule.cpp.

bool domain::Schedule::isValid ( const Duration duration,
const QDateTime &  startDate,
const QDateTime &  dueDate 
) [static]

Check whether the given combination of startdate, duedate and duration is valid

Returns:
true if the duration 'fits' between the startdate and duedate
false otherwise

Definition at line 92 of file schedule.cpp.

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

Two schedules are equal if their startdate, duedate and duration are equal

Definition at line 40 of file schedule.cpp.

void domain::Schedule::setDueDate ( const QDateTime &  dueDate  ) 

Sets the duedate of this schedule to the given duedate

Parameters:
duration The new duedate for this schedule
Postcondition:
The schedule has the given v

Definition at line 52 of file schedule.cpp.

void domain::Schedule::setDuration ( const Duration duration  ) 

Sets the duration of this schedule to the given duration

Parameters:
duration The new duration for this schedule
Postcondition:
The schedule has the given duration

Definition at line 67 of file schedule.cpp.

void domain::Schedule::setStartDate ( const QDateTime &  startDate  ) 

Sets the startdate of this schedule to the given startdate

Parameters:
duration The new startdate for this schedule
Postcondition:
The schedule has the given startdate

Definition at line 82 of file schedule.cpp.

const QDateTime & domain::Schedule::startDate (  )  const

Returns the startdate of this schedule

Definition at line 77 of file schedule.cpp.


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:16 2010 for MopTaskManager by  doxygen 1.6.3