#ifndef GLOBAL_SCHEDULER_HH #define GLOBAL_SCHEDULER_HH #include "task_scheduler.hh" #include "main.hh" #include "time_io.hh" #include "log.hh" #include #include extern bool crash; class Global_Scheduler { private: Log logger; FILE* get_log_file(); void log_time(); ms_t scheduling_rate; ms_t lifetime; ms_t period, period_left; void resupply(); int number_of_schedulers; Task_Scheduler** schedulers; std::string scheduling_algorithm; static const std::string scheduling_algorithms[]; void set_tasks_path(); void read_parameters_from_keyboard(); void read_tasks_from_keyboard(); std::string tasks_path; std::string filename; long long sum_memory_budget(); int number_of_periods(); public: Global_Scheduler(); ~Global_Scheduler(); static void check_schedulers(Global_Scheduler* gs, Task_Scheduler* ts[]); void load(std::string file); void schedule(); void schedule_EDF(); void tick(ms_t tick_time, int llc_fd); void check_period(ms_t tick_time); void run(); void store(); friend std::ostream& operator<<(std::ostream& os, Global_Scheduler& gs); void get_system_file(std::ifstream& f, std::string file); void set_global_scheduler_parameters(std::ifstream& f); void set_global_scheduling_algorithm(std::ifstream& f); void set_task_schedulers(std::ifstream& f); void init_from_file(std::string file); void init_from_keyboard(); }; #endif