Debian Codegraph @

src/plugins/schedulers/tj/taskjuggler/ShiftSelection.h

raw
1 /*
2 * ShiftSelection.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 _ShiftSelection_h_
13 #define _ShiftSelection_h_
14
15 #include "Shift.h"
16 #include "Interval.h"
17
18 namespace TJ
19 {
20
21 class ShiftSelectionList;
22
23 /**
24 * @short Stores shift selection related information.
25 * @author Chris Schlaeger <[email protected]>
26 */
27 class ShiftSelection
28 {
29 friend class ShiftSelectionList;
30
31 public:
32 ShiftSelection(const Interval& p, Shift* s) :
33 period(new Interval(p)),
34 shift(s)
35 { }
36
37 ShiftSelection(Interval* p, Shift* s) :
38 period(p),
39 shift(s)
40 { }
41
42 ShiftSelection(const ShiftSelection& sl);
43
44 ~ShiftSelection()
45 {
46 delete period;
47 }
48
49 const Interval& getPeriod() const { return *period; }
50 Shift* getShift() const { return shift; }
51
52 bool isVacationDay(time_t day) const;
53
54 private:
55 Interval* period;
56 Shift* shift;
57 };
58
59 } // namespace TJ
60
61 PLANTJ_EXPORT QDebug operator<<(QDebug dbg, const TJ::ShiftSelection &s);
62 PLANTJ_EXPORT QDebug operator<<(QDebug dbg, const TJ::ShiftSelection *s);
63
64 #endif