Scheduler
system.h
Go to the documentation of this file.
1 
10 #ifndef SYSTEM_H
11 #define SYSTEM_H
12 
13 #include <memory>
14 
15 #include "governor/freqGovernor.h"
16 
17 namespace Scheduler
18 {
19 
20 class Processor;
21 class SchedulerConfiguration;
22 class Process;
23 class TaskScheduler;
24 
25 class System
26 {
27 public:
28  static void buildSystem(std::shared_ptr<SchedulerConfiguration> conf);
29  static System *getInstance();
30 private:
31  static System *instance;
32 public:
33  ~System();
41  void updateTemperature(double timeInterval);
44  void updateFreq();
47  Processor *getProc();
50  void end();
54  void addRealTimeTask(std::shared_ptr<Process> p);
57  std::vector<std::shared_ptr<Process>> getStaticTaskSet();
60  long long int getJobsArrivalCount();
64  void printProcessesReport();
65 private:
66  void printReports();
67  System();
68  std::string reportsFolder;
69  std::shared_ptr<SchedulerConfiguration> conf;
70  Processor *proc{nullptr};
71  TaskScheduler *scheduler{nullptr};
72  FreqGovernor *governor{nullptr};
75  std::vector<std::shared_ptr<Process>> staticTaskSet;
76 
77  long long int jobsArrivalCount;
78 };
79 
80 }
81 
82 
83 
84 
85 #endif
86 
87 
88 
89 
90 
91 
static void buildSystem(std::shared_ptr< SchedulerConfiguration > conf)
Definition: system.cpp:34
void updateTemperature(double timeInterval)
updates and logs the temperature of the processor. This function has to be called at least every time...
Definition: system.cpp:71
void addRealTimeTask(std::shared_ptr< Process > p)
add a real-time task to the system&#39;s list
Definition: system.cpp:127
static System * getInstance()
Definition: system.cpp:28
long long int getJobsArrivalCount()
returns the number of jobs issued since the beginning of the simulation
Definition: system.cpp:139
void printProcessesReport()
Definition: system.cpp:89
void end()
prints reports
Definition: system.cpp:120
TaskScheduler * getScheduler()
returns the task scheduler object
Definition: system.cpp:110
void incrementJobsArrivalCount()
increments the number of jobs issued since the beginning of simulation
Definition: system.cpp:144
Processor * getProc()
return the processor
Definition: system.cpp:76
std::vector< std::shared_ptr< Process > > getStaticTaskSet()
get the list of real-time tasks in the system
Definition: system.cpp:133
void updateFreq()
invokes the frequency governor to changes the frequency of the processor
Definition: system.cpp:102