domain::Reservation Class Reference

Class to represent a reservation. More...

#include <reservation.h>

Inheritance diagram for domain::Reservation:
Inheritance graph
[legend]
Collaboration diagram for domain::Reservation:
Collaboration graph
[legend]

List of all members.

Public Member Functions

const Tasktask () const
const Resourceresource () const
const QDateTime & time () const
const Durationduration () const
QDateTime endTime () const
bool overlapsWith (const Reservation *, const Duration &duration) const
bool isActive () const

Private Member Functions

 Reservation (Task *task, Resource *resource, const QDateTime &time, const Duration &duration)
 Creates new reservation with the given properties.
 ~Reservation ()
 Reservation (const Reservation &other)
Reservationoperator= (const Reservation &other)

Private Attributes

ReservationPrivate *const d

Friends

class TaskManagerData

Detailed Description

Class to represent a reservation.

A reservation is made between a Task and a Resource. This class provides the means to make and use such a reservation.

Constructors and destructor are private, creating and deleting reservations is handled by TaskManagerData.

Definition at line 27 of file reservation.h.


Constructor & Destructor Documentation

domain::Reservation::Reservation ( Task task,
Resource resource,
const QDateTime &  time,
const Duration duration 
) [private]

Creates new reservation with the given properties.

Parameters:
task The task this reservation is for
resource The resource for the reservation
time The starting time for the reservation
duration The schedule for which the reservation will last
Exceptions:
InvalidDataException If the resource already has a reservation for the specified time.
StringException If it is impossible to create the links with the given task or resource.
See also:
Resource::alreadyReserved(), Resource::addReservation(), Task::addReservation

Definition at line 20 of file reservation.cpp.

Here is the call graph for this function:

domain::Reservation::~Reservation (  )  [private]

Destructor for the reservation

Definition at line 50 of file reservation.cpp.

Here is the call graph for this function:


Member Function Documentation

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

Returns the duration for which the reservation is made.

Definition at line 72 of file reservation.cpp.

QDateTime domain::Reservation::endTime (  )  const

Returns the end time of this reservation.

Definition at line 77 of file reservation.cpp.

bool domain::Reservation::isActive (  )  const

Indicates whether this reservation is "active". A reservation is active when Clock::currentTime() is between time() and endTime().

Definition at line 101 of file reservation.cpp.

Here is the call graph for this function:

bool domain::Reservation::overlapsWith ( const Reservation res,
const Duration duration 
) const

Indicates whether the given reservation overlaps with this reservation for at least the given duration.

Definition at line 83 of file reservation.cpp.

Here is the call graph for this function:

const Resource * domain::Reservation::resource (  )  const

Returns the resource for which this reservation is made.

Definition at line 62 of file reservation.cpp.

const Task * domain::Reservation::task (  )  const

Returns the task this reservation is for.

Definition at line 57 of file reservation.cpp.

const QDateTime & domain::Reservation::time (  )  const

Returns the starting time of this reservation.

Definition at line 67 of file reservation.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:14 2010 for MopTaskManager by  doxygen 1.6.3