- Fix ``make distcheck''
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1051 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
8271a880b2
commit
f7eb44bf64
14 changed files with 16 additions and 750 deletions
|
@ -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 <sgpemv2/key_file.hh>
|
||||
#include "global_preferences_serializer.hh"
|
||||
#include <sstream>
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
|
@ -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 <sgpemv2/history.hh>
|
||||
|
||||
using namespace sgpem;
|
||||
|
||||
|
||||
memory::smart_ptr<sgpem::DynamicSchedulable>
|
||||
History::get_scheduled_at(int time) const
|
||||
{
|
||||
using namespace memory;
|
||||
smart_ptr<DynamicSchedulable> scheduled_at = smart_ptr<DynamicSchedulable>();
|
||||
if (0 <= time && time <= _total_time_elapsed)
|
||||
{
|
||||
smart_ptr<ReadyQueue> sl = get_simulation_status_at(time);
|
||||
bool found = false;
|
||||
bool invalid = sl == smart_ptr<ReadyQueue>();
|
||||
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<DynamicSchedulable>(new DynamicSchedulable(*(ss)));
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return scheduled_at;
|
||||
}
|
||||
|
||||
|
||||
memory::smart_ptr<sgpem::ReadyQueue>
|
||||
History::get_simulation_status_at(int time) const
|
||||
{
|
||||
using namespace memory;
|
||||
smart_ptr<ReadyQueue> simulation_status_at = smart_ptr<ReadyQueue>();
|
||||
if (0 <= time && time <= _total_time_elapsed)
|
||||
{
|
||||
if (_slice == memory::smart_ptr<Slice>())
|
||||
std::cout << "History::get_simulation_status_at.NULL.error";
|
||||
else
|
||||
simulation_status_at = memory::smart_ptr<ReadyQueue>
|
||||
(
|
||||
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<Slice>(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<Slice>();
|
||||
_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<Slice>();
|
||||
_total_time_elapsed = -1;
|
||||
}
|
||||
|
||||
|
||||
History * History::_instance = 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 <sgpemv2/ready_queue.hh>
|
||||
#include "templates/smartp.tcc"
|
||||
#include <iostream>
|
||||
|
||||
/*
|
||||
#include <glibmm/module.h> // ??
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
#include "config.h"
|
||||
#include "gettext.h"
|
||||
#include "glibmm/ustring.h"
|
||||
#include <vector>
|
||||
|
||||
#include "backend/static_process.hh"
|
||||
|
||||
|
||||
#include "backend/dynamic_schedulable.hh"
|
||||
|
||||
#include <sgpemv2/user_interrupt_exception.hh>
|
||||
#include "backend/policy.hh"
|
||||
|
||||
#include "prrpolicy.cc"
|
||||
#include <iostream>
|
||||
*/
|
||||
|
||||
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<sgpem::DynamicSchedulable>
|
||||
get_scheduled_at(int time) const;
|
||||
|
||||
|
||||
/** Returns the last recorded instant, but may raise an error.
|
||||
*/
|
||||
memory::smart_ptr<sgpem::ReadyQueue>
|
||||
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> _slice;
|
||||
};
|
||||
|
||||
|
||||
} //~ namespace sgpem
|
||||
|
||||
#endif
|
|
@ -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;
|
|
@ -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 <glibmm/module.h> // ??
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
#include "config.h"
|
||||
#include "gettext.h"
|
||||
#include "glibmm/ustring.h"
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include "backend/static_process.hh"
|
||||
#include "backend/observed_subject.hh"
|
||||
#include <sgpemv2/ready_queue.hh>
|
||||
#include "backend/dynamic_schedulable.hh"
|
||||
#include "templates/smartp.tcc"
|
||||
#include <sgpemv2/user_interrupt_exception.hh>
|
||||
#include "backend/policy.hh"
|
||||
#include "backend/slice.hh"
|
||||
#include "prrpolicy.cc"
|
||||
#include <iostream>
|
||||
*/
|
||||
|
||||
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
|
|
@ -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;
|
|
@ -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 <sgpemv2/user_interrupt_exception.hh>
|
||||
#include <sgpemv2/ready_queue.hh>
|
||||
#include <sgpemv2/scheduler.hh>
|
||||
#include "glibmm/ustring.h"
|
||||
|
||||
/*
|
||||
#include <string>
|
||||
#include "config.h"
|
||||
#include "gettext.h"
|
||||
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include "backend/static_process.hh"
|
||||
#include "backend/observed_subject.hh"
|
||||
|
||||
#include "backend/dynamic_schedulable.hh"
|
||||
#include "templates/smartp.tcc"
|
||||
#include <sgpemv2/user_interrupt_exception.hh>
|
||||
|
||||
#include "backend/slice.hh"
|
||||
|
||||
#include <iostream>
|
||||
*/
|
||||
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue