pelib
2.0.0
|
00001 /* 00002 Copyright 2015 Nicolas Melot 00003 00004 This file is part of Pelib. 00005 00006 Pelib is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 Pelib is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with Pelib. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 00021 #include <set> 00022 #include <string> 00023 00024 #include <pelib/Algebra.hpp> 00025 #include <pelib/Task.hpp> 00026 #include <pelib/Link.hpp> 00027 #include <pelib/Platform.hpp> 00028 00029 extern "C"{ 00030 #include <igraph.h> 00031 } 00032 00033 #ifndef PELIB_TASKGRAPH 00034 #define PELIB_TASKGRAPH 00035 00036 namespace pelib 00037 { 00038 using namespace std; 00039 00041 class Taskgraph: public Record 00042 { 00043 public: 00045 Taskgraph(); 00046 00048 Taskgraph(const Taskgraph *graph); 00050 Taskgraph(const Taskgraph &graph); 00055 Taskgraph(const set<Task> &tasks, const set<Link> &links); 00059 Taskgraph(const Algebra &algebra); 00060 00062 virtual ~Taskgraph(); 00063 00065 virtual 00066 Taskgraph* 00067 clone() const; 00068 00070 virtual Algebra buildAlgebra() const; 00071 00073 virtual Algebra buildAlgebra(const Platform &arch) const; 00074 00076 virtual string 00077 getName() const; 00078 00080 virtual void 00081 setName(const string name); 00082 00084 virtual string 00085 getDeadlineCalculator() const; 00086 00088 virtual double 00089 getDeadline(const Platform &arch) const; 00090 00092 virtual void 00093 setDeadlineCalculator(const string deadlineCalculator); 00094 00096 virtual const set<Task>& 00097 getTasks() const; 00098 00100 virtual set<Task>& 00101 getTasks(); 00102 00104 virtual const Task& 00105 findTask(const string &taskId) const; 00106 00108 virtual const set<Link>& 00109 getLinks() const; 00110 00112 virtual set<Link>& 00113 getLinks(); 00114 00116 virtual Taskgraph& 00117 operator=(const Taskgraph& copy); 00118 00119 protected: 00120 string name, deadlineCalculator; 00121 set<Task> tasks; 00122 set<Link> links; 00123 00124 virtual void 00125 setLinks(const set<Link> &link); 00126 private: 00127 }; 00128 } 00129 00130 #endif