sgpemv2/src/backend/dynamic_schedulable.cc
elvez 401c569a9f - Updated interface of pyloader to comply with the new plugin management system`s requirements
- Commented a lot of code to make it compile-able. But still it doesn`t link (at least for me...)

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@710 3ecf2c5c-341e-0410-92b4-d18e462d057c
2006-07-04 15:05:04 +00:00

84 lines
2 KiB
C++

// src/backend/dynamic_schedulable.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 "dynamic_schedulable.hh"
#include "smartp.tcc"
#include <cassert>
using namespace sgpem;
using namespace std;
DynamicSchedulable::DynamicSchedulable()
: _priority_push(0)
{}
bool
DynamicSchedulable::operator==(const Schedulable& op2) const
{
assert(dynamic_cast<const DynamicSchedulable*>(&op2) != NULL);
return &get_core() == &(dynamic_cast<const DynamicSchedulable&>(op2).get_core());
}
Glib::ustring
DynamicSchedulable::get_name() const
{
return get_core().get_name();
}
unsigned int
DynamicSchedulable::get_arrival_time() const
{
return get_core().get_arrival_time();
}
int
DynamicSchedulable::get_base_priority() const
{
return get_core().get_priority();
}
unsigned int
DynamicSchedulable::get_total_cpu_time() const
{
return get_core().get_total_cpu_time();
}
int
DynamicSchedulable::set_priority_push(int new_value)
{
int old_priority_push = _priority_push;
_priority_push = new_value;
return old_priority_push;
}
int
DynamicSchedulable::get_priority_push() const
{
return _priority_push;
}
int
DynamicSchedulable::get_current_priority() const
{
return get_base_priority() + get_priority_push();
}