Debian Codegraph @

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

raw
1 /*
2 * TaskDependency.h - TaskJuggler
3 *
4 * SPDX-FileCopyrightText: 2001, 2002, 2003, 2004 Chris Schlaeger <[email protected]>
5 * SPDX-FileCopyrightText: 2011 Dag Andersen <[email protected]>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of version 2 of the GNU General Public License as
9 * published by the Free Software Foundation.
10 *
11 * $Id$
12 */
13
14 #ifndef _TaskDependency_h_
15 #define _TaskDependency_h_
16
17 #include <QString>
18
19 namespace TJ
20 {
21
22 class Task;
23
24 /**
25 * Besides a reference to the dependent task it also stores information about
26 * a minimum required time gap to this task. The gap can be specified in
27 * calendar time (duration) or working time (length). If more than one gap
28 * criteria is specified all are honored.
29 *
30 * @short The class is used to store a dependency of a task.
31 * @see Task
32 * @author Chris Schlaeger <[email protected]>
33 */
34 class TaskDependency
35 {
36 public:
37 TaskDependency(QString tri, int maxScenarios);
38 ~TaskDependency();
39
40 const QString getTaskRefId() const { return taskRefId; }
41
42 void setTaskRef(const Task* tr) { taskRef = tr; }
43 const Task* getTaskRef() const { return taskRef; }
44
45 void setGapDuration(int sc, long d) { gapDuration[sc] = d; }
46 long getGapDuration(int sc) const;
47 long getGapDurationNR(int sc) const { return gapDuration[sc]; }
48
49 void setGapLength(int sc, long l) { gapLength[sc] = l; }
50 long getGapLength(int sc) const;
51 long getGapLengthNR(int sc) const { return gapLength[sc]; }
52
53 private:
54 /**
55 * When we read in the project file, we don't know all tasks yet. So we
56 * need to store the ID of the dependency and later resolve this to the
57 * pointer to the Task.
58 */
59 QString taskRefId;
60 // The pointer to the dependent Task.
61 const Task* taskRef;
62 // Minimum required gap in calendar time.
63 long* gapDuration;
64 // Minimum required gap in working time.
65 long* gapLength;
66 } ;
67
68 } // namespace TJ
69
70 QDebug operator<<(QDebug dbg, const TJ::TaskDependency* dep);
71 QDebug operator<<(QDebug dbg, const TJ::TaskDependency& dep);
72
73 #endif
74