| 1 |
/* |
| 2 |
* Booking.h - TaskJuggler |
| 3 |
* |
| 4 |
* SPDX-FileCopyrightText: 2001, 2002, 2003, 2004 Chris Schlaeger <[email protected]> |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of version 2 of the GNU General Public License as |
| 8 |
* published by the Free Software Foundation. |
| 9 |
* |
| 10 |
* $Id$ |
| 11 |
*/ |
| 12 |
#ifndef _Booking_h_ |
| 13 |
#define _Booking_h_ |
| 14 |
|
| 15 |
#include "Interval.h" |
| 16 |
#include "SbBooking.h" |
| 17 |
|
| 18 |
namespace TJ |
| 19 |
{ |
| 20 |
|
| 21 |
/** |
| 22 |
* @short Booking information for an interval of the resource. |
| 23 |
* @author Chris Schlaeger <[email protected]> |
| 24 |
*/ |
| 25 |
class Booking : public SbBooking |
| 26 |
{ |
| 27 |
public: |
| 28 |
Booking(const Interval& iv, Task* t) : |
| 29 |
SbBooking(t), |
| 30 |
interval(new Interval(iv)) |
| 31 |
{ } |
| 32 |
|
| 33 |
Booking(Interval* iv, Task* t) : |
| 34 |
SbBooking(t), |
| 35 |
interval(iv) |
| 36 |
{ } |
| 37 |
|
| 38 |
Booking(const Interval& iv, SbBooking* sb) : |
| 39 |
SbBooking(*sb), |
| 40 |
interval(new Interval(iv)) |
| 41 |
{ } |
| 42 |
|
| 43 |
~Booking() override { delete interval; } |
| 44 |
|
| 45 |
time_t getStart() const { return interval->getStart(); } |
| 46 |
time_t getEnd() const { return interval->getEnd(); } |
| 47 |
time_t getDuration() const { return interval->getDuration(); } |
| 48 |
Interval& getInterval() { return *interval; } |
| 49 |
|
| 50 |
void setLockTS(const QString& ts) { lockTS = ts; } |
| 51 |
const QString& getLockTS() const { return lockTS; } |
| 52 |
|
| 53 |
void setLockerId(const QString& id) { lockerId = id; } |
| 54 |
const QString& getLockerId() const { return lockerId; } |
| 55 |
|
| 56 |
private: |
| 57 |
/// The booked time period. |
| 58 |
Interval* interval; |
| 59 |
/// The database lock timestamp |
| 60 |
QString lockTS; |
| 61 |
|
| 62 |
/// the lockers ID |
| 63 |
QString lockerId; |
| 64 |
} ; |
| 65 |
|
| 66 |
} // namespace TJ |
| 67 |
|
| 68 |
#endif |
| 69 |
|