From f7eb44bf649b5813744e99d70dd44d0114c6d193 Mon Sep 17 00:00:00 2001 From: tchernobog Date: Thu, 7 Sep 2006 19:12:19 +0000 Subject: [PATCH] - Fix ``make distcheck'' git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1051 3ecf2c5c-341e-0410-92b4-d18e462d057c --- Makefile.am | 6 +- configure.ac | 2 +- plugins/pyloader/configure.ac | 2 +- plugins/xmlsave/configure.ac | 2 +- plugins/xmlsave/po/POTFILES.in | 1 - po/POTFILES.in | 7 - po/sgpemv2.pot | 16 +-- src/backend/global_preferences_serializer.cc | 130 ------------------- src/testsuite/stubs/history.cc | 113 ---------------- src/testsuite/stubs/history.hh | 111 ---------------- src/testsuite/stubs/policy_manager.cc | 53 -------- src/testsuite/stubs/policy_manager.hh | 73 ----------- src/testsuite/stubs/prrpolicy.cc | 121 ----------------- src/testsuite/stubs/prrpolicy.hh | 129 ------------------ 14 files changed, 16 insertions(+), 750 deletions(-) delete mode 100644 src/backend/global_preferences_serializer.cc delete mode 100644 src/testsuite/stubs/history.cc delete mode 100644 src/testsuite/stubs/history.hh delete mode 100644 src/testsuite/stubs/policy_manager.cc delete mode 100644 src/testsuite/stubs/policy_manager.hh delete mode 100644 src/testsuite/stubs/prrpolicy.cc delete mode 100644 src/testsuite/stubs/prrpolicy.hh diff --git a/Makefile.am b/Makefile.am index 7a46ad3..ee11a9f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -360,6 +360,8 @@ glade_DATA = \ glade/jump-to-dialog.glade \ glade/main-window.glade +EXTRA_DIST += $(glade_DATA) + # ############################################################ # # source : templates @@ -539,7 +541,6 @@ endif #~ if COND_TESTS # ############################################################ noinst_DATA += \ - src/testsuite/scheduling-wizards \ src/testsuite/scheduling-wizards/wizard-deadlock-test \ src/testsuite/scheduling-wizards/wizard-gap-fail \ src/testsuite/scheduling-wizards/wizard-assert-fail \ @@ -559,3 +560,6 @@ noinst_DATA += \ src/testsuite/scheduling-wizards/environments/Porno_priority_inversion.xgp \ src/testsuite/scheduling-wizards/environments/ScuolaDiMileto_gap_fail.xgp \ src/testsuite/scheduling-wizards/environments/DiscWorld_unblock.xgp + +EXTRA_DIST += $(noinst_DATA) + diff --git a/configure.ac b/configure.ac index ee54296..8618e06 100644 --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ AC_CONFIG_AUX_DIR(config) AC_CANONICAL_TARGET dnl starting automake -AM_INIT_AUTOMAKE([dejagnu dist-bzip2]) +AM_INIT_AUTOMAKE([dejagnu dist-bzip2 subdir-objects]) dnl gettext & libtool AC_PROG_LIBTOOL diff --git a/plugins/pyloader/configure.ac b/plugins/pyloader/configure.ac index bbdc37d..10ffc0d 100644 --- a/plugins/pyloader/configure.ac +++ b/plugins/pyloader/configure.ac @@ -42,7 +42,7 @@ AC_CONFIG_AUX_DIR(config) AC_CANONICAL_TARGET dnl starting automake -AM_INIT_AUTOMAKE([dejagnu dist-bzip2]) +AM_INIT_AUTOMAKE([dejagnu dist-bzip2 subdir-objects]) dnl gettext & libtool AC_PROG_LIBTOOL diff --git a/plugins/xmlsave/configure.ac b/plugins/xmlsave/configure.ac index f7bd32d..ffe92e0 100644 --- a/plugins/xmlsave/configure.ac +++ b/plugins/xmlsave/configure.ac @@ -42,7 +42,7 @@ AC_CONFIG_AUX_DIR(config) AC_CANONICAL_TARGET dnl starting automake -AM_INIT_AUTOMAKE([dejagnu dist-bzip2]) +AM_INIT_AUTOMAKE([dejagnu dist-bzip2 subdir-objects]) dnl gettext & libtool AC_PROG_LIBTOOL diff --git a/plugins/xmlsave/po/POTFILES.in b/plugins/xmlsave/po/POTFILES.in index eafc5c4..b081211 100644 --- a/plugins/xmlsave/po/POTFILES.in +++ b/plugins/xmlsave/po/POTFILES.in @@ -1,5 +1,4 @@ src/xml_serializer.cc src/xml_serializer_factory.cc src/xml_visitor.cc -src/testsuite/test-xml_serializer.cc src/plugin.cc diff --git a/po/POTFILES.in b/po/POTFILES.in index 52869fd..da48915 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -27,7 +27,6 @@ src/backend/sgpemv2/templates/sequences.tcc src/backend/sgpemv2/templates/singleton.tcc src/backend/sgpemv2/templates/parameter.tcc src/backend/sgpemv2/templates/smartp.tcc -src/backend/sgpemv2/templates/prova.cc src/backend/sgpemv2/templates/deletor.tcc src/backend/policy_parameters.cc src/backend/resource.cc @@ -50,7 +49,6 @@ src/backend/static_process.cc src/backend/scheduler.cc src/backend/request.cc src/backend/simulation.cc -src/backend/global_preferences_serializer.cc src/backend/invalid_plugin_exception.cc src/backend/cpu_policy.cc src/backend/module.cc @@ -75,14 +73,9 @@ src/text_simulation.cc src/testsuite/test-holt_widget.cc src/testsuite/test-history.cc src/testsuite/test-simulation_widget.cc -src/testsuite/stubs/policy_manager.cc -src/testsuite/stubs/prrpolicy.cc -src/testsuite/stubs/history.cc src/testsuite/test-key_file.cc src/testsuite/test-cairo_widget.cc -src/testsuite/test-stepforward.cc src/testsuite/test-global_preferences_serialization.cc -src/testsuite/test-parse_command.cc src/jump_to_dialog.cc src/resources_widget.cc src/configure_policy_dialog.cc diff --git a/po/sgpemv2.pot b/po/sgpemv2.pot index b14ddf7..468ffc8 100644 --- a/po/sgpemv2.pot +++ b/po/sgpemv2.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: matteo@member.fsf.org\n" -"POT-Creation-Date: 2006-09-07 18:52+0200\n" +"POT-Creation-Date: 2006-09-07 20:35+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -111,29 +111,29 @@ msgstr "" msgid " } at instant " msgstr "" -#: src/simulation_controller.cc:194 src/jump_to_dialog.cc:108 +#: src/simulation_controller.cc:194 src/jump_to_dialog.cc:106 msgid "The selected user CPU policy stopped before returning:\n" msgstr "" -#: src/simulation_controller.cc:201 src/jump_to_dialog.cc:115 +#: src/simulation_controller.cc:201 src/jump_to_dialog.cc:113 msgid "" "The selected user CPU policy was malformed and failed to sort the queue:\n" msgstr "" -#: src/simulation_controller.cc:213 src/jump_to_dialog.cc:127 +#: src/simulation_controller.cc:213 src/jump_to_dialog.cc:125 msgid " [EE] Fatal error. Impossible to deactivate the policy in " msgstr "" -#: src/simulation_controller.cc:214 src/jump_to_dialog.cc:128 +#: src/simulation_controller.cc:214 src/jump_to_dialog.cc:126 msgid " [EE] " msgstr "" -#: src/simulation_controller.cc:221 src/jump_to_dialog.cc:135 +#: src/simulation_controller.cc:221 src/jump_to_dialog.cc:132 msgid "No active policy selected:\n" msgstr "" -#: src/simulation_controller.cc:228 src/jump_to_dialog.cc:142 +#: src/simulation_controller.cc:228 src/jump_to_dialog.cc:139 msgid "Unexpected error:\n" msgstr "" @@ -254,7 +254,7 @@ msgstr "" msgid "at " msgstr "" -#: src/simulation_widget.cc:156 +#: src/simulation_widget.cc:159 msgid "" "Nothing to see here... add some processes! Right-click on the Schedulables " "view in this window." diff --git a/src/backend/global_preferences_serializer.cc b/src/backend/global_preferences_serializer.cc deleted file mode 100644 index a2b6a96..0000000 --- a/src/backend/global_preferences_serializer.cc +++ /dev/null @@ -1,130 +0,0 @@ -// src/global_preferences.cc - Copyright 2005, 2006, University -// of Padova, dept. of Pure and Applied -// Mathematics -// -// This file is part of SGPEMv2. -// -// This is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// SGPEMv2 is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with SGPEMv2; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -#include "config.h" -#include -#include "global_preferences_serializer.hh" -#include - -namespace sgpem -{ - - GlobalPreferencesSerializer::GlobalPreferencesSerializer(GlobalPreferences &gp) - : _globalPreferences(gp) - {} - - - - void - GlobalPreferencesSerializer::file_read(const Glib::ustring& filename) - { - _globalPreferences._mod_dirs.clear(); - _globalPreferences._pol_dirs.clear(); - KeyFile::file_read(filename); - // read modules directories - { - const Glib::ustring* val = search_value(Glib::ustring("modules-dir-number")); - if (val) - { - std::istringstream istr(val->c_str()); - int n; - istr >> n; - for (int i = 1; i <= n; i++) - { - std::ostringstream ostr; - ostr << "modules-dir-" << i << std::ends; - Glib::ustring key(ostr.str()); - val = search_value(key); - if (val) - { - _globalPreferences.add_modules_dir(*val); - } - } - } - } - - // read policies directories - { - const Glib::ustring* val = search_value(Glib::ustring("policies-dir-number")); - if (val) - { - std::istringstream istr(val->c_str()); - int n; - istr >> n; - for (int i = 1; i <= n; i++) - { - std::ostringstream ostr; - ostr << "policies-dir-" << i << std::ends; - Glib::ustring key(ostr.str()); - val = search_value(key); - if (val) - { - _globalPreferences.add_policies_dir(*val); - } - } - } - } - } - - void - GlobalPreferencesSerializer::file_write(const Glib::ustring& filename) - { - // add modules directories - { - GlobalPreferences::dir_iterator iter = _globalPreferences.modules_dir_begin(); - int n = 0; - while (iter != _globalPreferences.modules_dir_end()) - { - std::ostringstream ostr; - n++; - ostr << "modules-dir-" << n << std::ends; - Glib::ustring key(ostr.str()); - insert_key_value(key, (*iter)); - ++iter; - } - Glib::ustring key("modules-dir-number"); - std::ostringstream ostr; - ostr << n << std::ends; - Glib::ustring value(ostr.str()); - insert_key_value(key, value); - } - // add policies directories - { - GlobalPreferences::dir_iterator iter = _globalPreferences.policies_dir_begin(); - int n = 0; - while (iter != _globalPreferences.policies_dir_end()) - { - std::ostringstream ostr; - n++; - ostr << "policies-dir-" << n << std::ends; - Glib::ustring key(ostr.str()); - insert_key_value(key, (*iter)); - ++iter; - } - Glib::ustring key("policies-dir-number"); - std::ostringstream ostr; - ostr << n << std::ends; - Glib::ustring value(ostr.str()); - insert_key_value(key, value); - } - - KeyFile::file_write(filename); - } -} diff --git a/src/testsuite/stubs/history.cc b/src/testsuite/stubs/history.cc deleted file mode 100644 index 583fc61..0000000 --- a/src/testsuite/stubs/history.cc +++ /dev/null @@ -1,113 +0,0 @@ -// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University -// of Padova, dept. of Pure and Applied -// Mathematics -// -// This file is part of SGPEMv2. -// -// This is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// SGPEMv2 is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with SGPEMv2; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -#include - -using namespace sgpem; - - -memory::smart_ptr -History::get_scheduled_at(int time) const -{ - using namespace memory; - smart_ptr scheduled_at = smart_ptr(); - if (0 <= time && time <= _total_time_elapsed) - { - smart_ptr sl = get_simulation_status_at(time); - bool found = false; - bool invalid = sl == smart_ptr(); - for (uint i = 0; !found && !invalid && i < sl->size(); i++) - { - const DynamicSchedulable* ss = sl->get_item_at(i); - if ((bool)ss && ss->get_state() == DynamicSchedulable::state_running) - { - scheduled_at = smart_ptr(new DynamicSchedulable(*(ss))); - found = true; - } - } - } - return scheduled_at; -} - - -memory::smart_ptr -History::get_simulation_status_at(int time) const -{ - using namespace memory; - smart_ptr simulation_status_at = smart_ptr(); - if (0 <= time && time <= _total_time_elapsed) - { - if (_slice == memory::smart_ptr()) - std::cout << "History::get_simulation_status_at.NULL.error"; - else - simulation_status_at = memory::smart_ptr - ( - new ReadyQueue - ( - *(_slice->get_simulation_status()) - ) - ); - } - return simulation_status_at; -} - - -int -History::get_current_time() const -{ - return _total_time_elapsed; -} - - -void -History::enqueue_slice(const sgpem::ReadyQueue& status) -{ - _slice = memory::smart_ptr(new Slice(_total_time_elapsed, 1, status)); - _total_time_elapsed++; -} - - -void -History::truncate_at(int instant) -{ - //std::cout << "\nRecreating a Singleton History"; - _slice = memory::smart_ptr(); - _total_time_elapsed = -1; -} - - -History& -History::get_instance() -{ - if (History::_instance == NULL) - History::_instance = new History(); - return *History::_instance; -} - - -History::History() -{ - _slice = memory::smart_ptr(); - _total_time_elapsed = -1; -} - - -History * History::_instance = NULL; diff --git a/src/testsuite/stubs/history.hh b/src/testsuite/stubs/history.hh deleted file mode 100644 index c91f3d9..0000000 --- a/src/testsuite/stubs/history.hh +++ /dev/null @@ -1,111 +0,0 @@ -// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University -// of Padova, dept. of Pure and Applied -// Mathematics -// -// This file is part of SGPEMv2. -// -// This is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// SGPEMv2 is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with SGPEMv2; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -#ifndef HISTORY_HH -#define HISTORY_HH 1 - -#include "backend/observed_subject.hh" -#include "backend/slice.hh" -#include -#include "templates/smartp.tcc" -#include - -/* -#include // ?? -#include -#include -#include "config.h" -#include "gettext.h" -#include "glibmm/ustring.h" -#include - -#include "backend/static_process.hh" - - -#include "backend/dynamic_schedulable.hh" - -#include -#include "backend/policy.hh" - -#include "prrpolicy.cc" -#include -*/ - -namespace sgpem -{ - - /** an History stub, should only save the last state included. - */ - class History : public ObservedSubject - { - - public: - - - /** Returns the DynamicSchedulable of the schedulable - * which was running at the time, if any. - */ - memory::smart_ptr - get_scheduled_at(int time) const; - - - /** Returns the last recorded instant, but may raise an error. - */ - memory::smart_ptr - get_simulation_status_at(int time) const; - - - /** Returns the total time recorded. - */ - int - get_current_time() const; - - - /** Extends the recorded history by one unit, overwriting the old value - */ - void - enqueue_slice(const sgpem::ReadyQueue& status); - - - /** STUB: THIS FEATURE IS NOT AVAILABLE - */ - void - truncate_at(int instant); - - - /** Returns the singleton instance. - */ - static History& - get_instance(); - - - private: - History(); - - static History * _instance; - int _total_time_elapsed; - memory::smart_ptr _slice; - }; - - -} //~ namespace sgpem - -#endif diff --git a/src/testsuite/stubs/policy_manager.cc b/src/testsuite/stubs/policy_manager.cc deleted file mode 100644 index 26ecda0..0000000 --- a/src/testsuite/stubs/policy_manager.cc +++ /dev/null @@ -1,53 +0,0 @@ -// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University -// of Padova, dept. of Pure and Applied -// Mathematics -// -// This file is part of SGPEMv2. -// -// This is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// SGPEMv2 is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with SGPEMv2; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -#include "policy_manager.hh" - -using namespace sgpem; - -PolicyManager::PolicyManager() -{} - -PolicyManager& -PolicyManager::get_registered_manager() -{ - if (_registered == NULL) - _registered = new PolicyManager(); - return *_registered; -} - -Policy& -PolicyManager::get_policy() -{ - return PRRPolicy::get_instance(); -} - -void -PolicyManager::init() -{} - -PolicyManager::~PolicyManager() -{ - if (_registered == this) _registered = NULL; -} - - -PolicyManager* -PolicyManager::_registered = NULL; diff --git a/src/testsuite/stubs/policy_manager.hh b/src/testsuite/stubs/policy_manager.hh deleted file mode 100644 index ba28375..0000000 --- a/src/testsuite/stubs/policy_manager.hh +++ /dev/null @@ -1,73 +0,0 @@ -// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University -// of Padova, dept. of Pure and Applied -// Mathematics -// -// This file is part of SGPEMv2. -// -// This is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// SGPEMv2 is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with SGPEMv2; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -#ifndef POLICY_MANAGER_HH -#define POLICY_MANAGER_HH 1 - -#include "prrpolicy.hh" -/* -#include // ?? -#include -#include -#include "config.h" -#include "gettext.h" -#include "glibmm/ustring.h" -#include -#include -#include "backend/static_process.hh" -#include "backend/observed_subject.hh" -#include -#include "backend/dynamic_schedulable.hh" -#include "templates/smartp.tcc" -#include -#include "backend/policy.hh" -#include "backend/slice.hh" -#include "prrpolicy.cc" -#include -*/ - -namespace sgpem -{ - /** A policyManager stub, provides access to the PRRPolicy. - */ - class PolicyManager - { - public: - - PolicyManager(); - - static PolicyManager& - get_registered_manager(); - - virtual Policy& - get_policy(); - - virtual void - init(); - - virtual - ~PolicyManager(); - - private: - static PolicyManager* _registered; - }; -} - -#endif diff --git a/src/testsuite/stubs/prrpolicy.cc b/src/testsuite/stubs/prrpolicy.cc deleted file mode 100644 index 157d204..0000000 --- a/src/testsuite/stubs/prrpolicy.cc +++ /dev/null @@ -1,121 +0,0 @@ -// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University -// of Padova, dept. of Pure and Applied -// Mathematics -// -// This file is part of SGPEMv2. -// -// This is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// SGPEMv2 is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with SGPEMv2; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -#include "prrpolicy.hh" - -using namespace sgpem; - -PRRPolicy::PRRPolicy() -{ - _instance = this; -} - -PRRPolicy::PRRPolicy(int quantum) - : _quantum(quantum) -{ - _instance = this; -} - -Policy& -PRRPolicy::get_instance() -{ - if (_instance == NULL) _instance = new PRRPolicy(3); // quantum size - return *_instance; -} - - -PRRPolicy::~PRRPolicy() -{} - -void -PRRPolicy::configure() -throw(UserInterruptException) -{} - -void -PRRPolicy::sort_queue() const -throw(UserInterruptException) -{ - ReadyQueue* local_sl = Scheduler::get_instance().get_ready_queue(); - for (uint useless = 0; useless < local_sl->size(); useless++) - for (uint i = 0; i < local_sl->size() - 1; i++) - if - ( - local_sl->get_item_at(i)->get_schedulable()->get_priority() > - local_sl->get_item_at(i + 1)->get_schedulable()->get_priority() - ) - local_sl->swap(i, i + 1); -} - -void -PRRPolicy::activate() -{} - -void -PRRPolicy::deactivate() -{} - -int -PRRPolicy::get_id() const -{ - return 42; -} - -sgpem::policy_sorts_type -PRRPolicy::wants() const -throw(UserInterruptException) -{ - return policy_sorts_processes; -} - -Glib::ustring -PRRPolicy::get_name() const -{ - return "42"; -} - -Glib::ustring -PRRPolicy::get_description() const -{ - return "42"; -} - -bool -PRRPolicy::is_pre_emptive() const -throw(UserInterruptException) -{ - return 1; -} - -int -PRRPolicy::get_time_slice() const -throw(UserInterruptException) -{ - return _quantum; -} - -PolicyParameters& -PRRPolicy::get_parameters() -{ - return _parameters; -} - -Policy* -PRRPolicy::_instance = NULL; diff --git a/src/testsuite/stubs/prrpolicy.hh b/src/testsuite/stubs/prrpolicy.hh deleted file mode 100644 index 424def4..0000000 --- a/src/testsuite/stubs/prrpolicy.hh +++ /dev/null @@ -1,129 +0,0 @@ -// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University -// of Padova, dept. of Pure and Applied -// Mathematics -// -// This file is part of SGPEMv2. -// -// This is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// SGPEMv2 is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with SGPEMv2; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -#ifndef PRRPOLICY_HH -#define PRRPOLICY_HH 1 - -#include "backend/policy.hh" -#include -#include -#include -#include "glibmm/ustring.h" - -/* -#include -#include "config.h" -#include "gettext.h" - -#include -#include -#include "backend/static_process.hh" -#include "backend/observed_subject.hh" - -#include "backend/dynamic_schedulable.hh" -#include "templates/smartp.tcc" -#include - -#include "backend/slice.hh" - -#include -*/ - -namespace sgpem -{ - /** An hard-coded Priority Round Robin policy - * It's actually called PRRPolicy, altough my personal taste would have suggested - * naming it - * Prioriy-Reliant Roughly-Realized Recently-Reimplemented Round-Robin Policy, - * i.e. PRRRRRRR-Policy. - * it adds a new constructor taking the quantum size (time slice) - */ - class PRRPolicy : public Policy - { - public: - - PRRPolicy(); - - PRRPolicy(int quantum); - - static Policy& - get_instance(); - - virtual - ~PRRPolicy(); - - virtual void - configure() - throw(UserInterruptException); - - virtual void - sort_queue() const - throw(UserInterruptException); - - - virtual void - activate(); - - virtual void - deactivate(); - - - virtual int - get_id() const; - - virtual sgpem::policy_sorts_type - wants() const - throw(UserInterruptException); - - - virtual Glib::ustring - get_name() const; - - virtual Glib::ustring - get_description() const; - - virtual bool - is_pre_emptive() const - throw(UserInterruptException); - - virtual int - get_time_slice() const - throw(UserInterruptException); - - - virtual PolicyParameters& - get_parameters(); - - - - protected: - - PolicyParameters _parameters; - int _id; - int _quantum; - - private: - - static Policy* _instance; - }; - -} - -#endif