Class to represent a resource. More...
#include <resource.h>
Public Member Functions | |
const QString & | description () const |
QList< StorableData * > | dependentData () const |
QList< const Reservation * > | reservations () const |
QString | resourceTypeName () const |
ResourceType * | resourceType () 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 () |
Resource & | operator= (const Resource &other) |
void | addReservation (Reservation *reservation) |
void | removeReservation (Reservation *reservation) |
Private Attributes | |
ResourcePrivate *const | d |
Friends | |
class | Reservation |
class | TaskManagerData |
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.
Definition at line 30 of file resource.h.
domain::Resource::Resource | ( | ResourceType * | type, | |
const QString & | description | |||
) | [private] |
Creates new resource.
The newly created resource will have the given properties
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.
bool domain::Resource::alreadyReserved | ( | QDateTime | startTime, | |
Duration | duration | |||
) | const |
Checks whether the resource was already reserved for the specified time period.
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.