Debian Codegraph @

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

raw
1 /*
2 * TaskList.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 _TaskList_h_
13 #define _TaskList_h_
14
15 #include "plantj_export.h"
16
17 #include "CoreAttributesList.h"
18
19 class QString;
20
21 namespace TJ
22 {
23
24 class Task;
25
26 /**
27 * @short The class stores a list of tasks.
28 * @see Task
29 * @author Chris Schlaeger <[email protected]>
30 */
31 class PLANTJ_EXPORT TaskList : public virtual CoreAttributesList
32 {
33 public:
34 TaskList() :
35 CoreAttributesList(),
36 sortScenario(0)
37 {
38 sorting[0] = CoreAttributesList::TreeMode;
39 sorting[1] = CoreAttributesList::StartUp;
40 sorting[2] = CoreAttributesList::EndUp;
41 }
42
43 TaskList(const TaskList& tl) :
44 CoreAttributesList(tl),
45 sortScenario(tl.sortScenario)
46 { }
47
48 ~TaskList() override { }
49
50 Task* getTask(const QString& id) const;
51
52 static bool isSupportedSortingCriteria(int sc);
53
54 int compareItemsLevel(CoreAttributes* c1, CoreAttributes* c2,
55 int level) override;
56
57 void setSortScenario(int sc) { sortScenario = sc; }
58
59 protected:
60 int sortScenario;
61 } ;
62
63 /**
64 * @short Iterator class for TaskList objects.
65 * @see TaskList
66 * @author Chris Schlaeger <[email protected]>
67 */
68 class PLANTJ_EXPORT TaskListIterator : public virtual CoreAttributesListIterator
69 {
70 public:
71 explicit TaskListIterator(const CoreAttributesList& l) :
72 CoreAttributesListIterator(l) { }
73 ~TaskListIterator() override { }
74 Task* operator*();
75 } ;
76
77 } // namespace TJ
78
79 #endif