domain::Resource Class Reference

Class to represent a resource. More...

#include <resource.h>

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

List of all members.

Public Member Functions

const QString & description () const
QList< StorableData * > dependentData () const
QList< const Reservation * > reservations () const
QString resourceTypeName () const
ResourceTyperesourceType () const
bool alreadyReserved (QDateTime startTime, Duration duration) const

Private Member Functions

 Resource (ResourceType *type, const QString &description)
 Creates new resource.
 Resource (const Resource &other)
virtual ~Resource ()
Resourceoperator= (const Resource &other)
void addReservation (Reservation *reservation)
void removeReservation (Reservation *reservation)

Private Attributes

ResourcePrivate *const d

Friends

class Reservation
class TaskManagerData

Detailed Description

Class to represent a resource.

A resource has a type and a description. It can be reserved by users for certain tasks.

Constructors and destructor are private, creating and deleting resources is handled by the class TaskManagerData.

See also:
TaskManagerData::createResource

Definition at line 30 of file resource.h.


Constructor & Destructor Documentation

domain::Resource::Resource ( ResourceType type,
const QString &  description 
) [private]

Creates new resource.

The newly created resource will have the given properties

Parameters:
description The description for the resource

Definition at line 17 of file resource.cpp.

domain::Resource::Resource ( const Resource other  )  [private]

Copy constructor.

Definition at line 26 of file resource.cpp.

domain::Resource::~Resource (  )  [private, virtual]

Destructor for the resource

Definition at line 33 of file resource.cpp.


Member Function Documentation

bool domain::Resource::alreadyReserved ( QDateTime  startTime,
Duration  duration 
) const

Checks whether the resource was already reserved for the specified time period.

Parameters:
startTime The start time of the specified time period
duration The duration of the specified time period

Definition at line 84 of file resource.cpp.

QList< StorableData * > domain::Resource::dependentData (  )  const [virtual]

Returns a QList of the StorableData on which this resource depends A resource is dependent on all the reservations that are made for it

Reimplemented from domain::StorableData.

Definition at line 64 of file resource.cpp.

const QString & domain::Resource::description (  )  const

Returns the description of this resource

Definition at line 40 of file resource.cpp.

QList< const Reservation * > domain::Resource::reservations (  )  const

Returns a QList of the reservations made on this resource

Definition at line 59 of file resource.cpp.

ResourceType * domain::Resource::resourceType (  )  const

Returns the resourcetype of this resource.

Definition at line 74 of file resource.cpp.

QString domain::Resource::resourceTypeName (  )  const

Returns a QString representation of the resourcetype

Definition at line 79 of file resource.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