- Renamed Schedulable to StaticSchedulable
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@626 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
c381ee8875
commit
1f7972c308
|
@ -148,7 +148,7 @@ src_backend_libbackend_la_SOURCES = \
|
||||||
src/backend/policy_manager.cc \
|
src/backend/policy_manager.cc \
|
||||||
src/backend/policy_parameters.cc \
|
src/backend/policy_parameters.cc \
|
||||||
src/backend/process.cc \
|
src/backend/process.cc \
|
||||||
src/backend/schedulable.cc \
|
src/backend/static_schedulable.cc \
|
||||||
src/backend/schedulable_queue.cc \
|
src/backend/schedulable_queue.cc \
|
||||||
src/backend/schedulable_status.cc \
|
src/backend/schedulable_status.cc \
|
||||||
src/backend/scheduler.cc \
|
src/backend/scheduler.cc \
|
||||||
|
@ -167,7 +167,7 @@ pkginclude_HEADERS = \
|
||||||
src/backend/policy_manager.hh \
|
src/backend/policy_manager.hh \
|
||||||
src/backend/policy_parameters.hh \
|
src/backend/policy_parameters.hh \
|
||||||
src/backend/process.hh \
|
src/backend/process.hh \
|
||||||
src/backend/schedulable.hh \
|
src/backend/static_schedulable.hh \
|
||||||
src/backend/schedulable_queue.hh \
|
src/backend/schedulable_queue.hh \
|
||||||
src/backend/schedulable_status.hh \
|
src/backend/schedulable_status.hh \
|
||||||
src/backend/scheduler.hh \
|
src/backend/scheduler.hh \
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
%{
|
%{
|
||||||
#include "policy.hh"
|
#include "policy.hh"
|
||||||
#include "policy_parameters.hh"
|
#include "policy_parameters.hh"
|
||||||
#include "schedulable.hh"
|
#include "static_schedulable.hh"
|
||||||
#include "schedulable_queue.hh"
|
#include "schedulable_queue.hh"
|
||||||
#include "schedulable_status.hh"
|
#include "schedulable_status.hh"
|
||||||
#include "scheduler.hh"
|
#include "scheduler.hh"
|
||||||
|
@ -130,21 +130,21 @@ namespace sgpem {
|
||||||
}; //~ class PolicyParameters
|
}; //~ class PolicyParameters
|
||||||
|
|
||||||
// --------------------------------------------
|
// --------------------------------------------
|
||||||
class Schedulable
|
class StaticSchedulable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Schedulable() = 0;
|
virtual ~StaticSchedulable() = 0;
|
||||||
|
|
||||||
virtual unsigned int get_arrival_time() const;
|
virtual unsigned int get_arrival_time() const;
|
||||||
int get_priority() const;
|
int get_priority() const;
|
||||||
unsigned int get_total_cpu_time() const;
|
unsigned int get_total_cpu_time() const;
|
||||||
|
|
||||||
%ignore Schedulable::get_name() const;
|
%ignore StaticSchedulable::get_name() const;
|
||||||
%extend {
|
%extend {
|
||||||
const char* get_name() const
|
const char* get_name() const
|
||||||
{ return self->get_name().c_str(); }
|
{ return self->get_name().c_str(); }
|
||||||
}
|
}
|
||||||
}; //~ class Schedulable
|
}; //~ class StaticSchedulable
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------
|
// --------------------------------------------
|
||||||
|
@ -181,7 +181,7 @@ namespace sgpem {
|
||||||
int get_cpu_time_left() const;
|
int get_cpu_time_left() const;
|
||||||
int get_last_scheduled() const;
|
int get_last_scheduled() const;
|
||||||
state get_state() const;
|
state get_state() const;
|
||||||
const sgpem::Schedulable* get_schedulable() const;
|
const sgpem::StaticSchedulable* get_schedulable() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ---------------------------------------------
|
// ---------------------------------------------
|
||||||
|
|
|
@ -23,7 +23,7 @@ using namespace sgpem;
|
||||||
|
|
||||||
|
|
||||||
Process::Process(const Glib::ustring& name, const unsigned int& arrival, const unsigned int& total, const int& priority)
|
Process::Process(const Glib::ustring& name, const unsigned int& arrival, const unsigned int& total, const int& priority)
|
||||||
: Schedulable(name, arrival, total, priority)
|
: StaticSchedulable(name, arrival, total, priority)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
#include "glibmm/ustring.h"
|
#include "glibmm/ustring.h"
|
||||||
|
|
||||||
#include "schedulable.hh"
|
#include "static_schedulable.hh"
|
||||||
|
|
||||||
namespace sgpem
|
namespace sgpem
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,7 @@ namespace sgpem
|
||||||
|
|
||||||
It IS a Schedulable object.
|
It IS a Schedulable object.
|
||||||
*/
|
*/
|
||||||
class SG_DLLEXPORT Process : public Schedulable
|
class SG_DLLEXPORT Process : public StaticSchedulable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** \brief Creates a new object with the given parameters. */
|
/** \brief Creates a new object with the given parameters. */
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
using namespace sgpem;
|
using namespace sgpem;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
SchedulableStatus::SchedulableStatus(const Schedulable& obj) :
|
SchedulableStatus::SchedulableStatus(const StaticSchedulable& obj) :
|
||||||
_ref(&obj), _last(-1), _time_left(obj.get_total_cpu_time()),
|
_ref(&obj), _last(-1), _time_left(obj.get_total_cpu_time()),
|
||||||
_my_state(state_future)
|
_my_state(state_future)
|
||||||
{
|
{
|
||||||
|
@ -73,7 +73,7 @@ SchedulableStatus::set_state(state s)
|
||||||
_my_state = s;
|
_my_state = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Schedulable*
|
const StaticSchedulable*
|
||||||
SchedulableStatus::get_schedulable() const
|
SchedulableStatus::get_schedulable() const
|
||||||
{
|
{
|
||||||
return _ref;
|
return _ref;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#define SCHEDULABLESTATUS_HH 1
|
#define SCHEDULABLESTATUS_HH 1
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "schedulable.hh"
|
#include "static_schedulable.hh"
|
||||||
|
|
||||||
namespace sgpem
|
namespace sgpem
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ namespace sgpem
|
||||||
};
|
};
|
||||||
|
|
||||||
/** \brief Object constructor */
|
/** \brief Object constructor */
|
||||||
SchedulableStatus(const Schedulable& obj);
|
SchedulableStatus(const StaticSchedulable& obj);
|
||||||
|
|
||||||
//SchedulableStatus(const SchedulableStatus& obj); //copy constructor
|
//SchedulableStatus(const SchedulableStatus& obj); //copy constructor
|
||||||
|
|
||||||
|
@ -94,10 +94,10 @@ namespace sgpem
|
||||||
* This function returns a pointer to the actual schedable object
|
* This function returns a pointer to the actual schedable object
|
||||||
* represented, along with its status, by this instance.
|
* represented, along with its status, by this instance.
|
||||||
*/
|
*/
|
||||||
const Schedulable* get_schedulable() const;
|
const StaticSchedulable* get_schedulable() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const Schedulable* _ref;
|
const StaticSchedulable* _ref;
|
||||||
int _last;
|
int _last;
|
||||||
int _time_left;
|
int _time_left;
|
||||||
state _my_state;
|
state _my_state;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// src/backend/schedulable.cc - Copyright 2005, 2006, University
|
// src/backend/static_schedulable.cc - Copyright 2005, 2006, University
|
||||||
// of Padova, dept. of Pure and Applied
|
// of Padova, dept. of Pure and Applied
|
||||||
// Mathematics
|
// Mathematics
|
||||||
//
|
//
|
||||||
|
@ -18,11 +18,11 @@
|
||||||
// along with SGPEMv2; if not, write to the Free Software
|
// along with SGPEMv2; if not, write to the Free Software
|
||||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
#include "schedulable.hh"
|
#include "static_schedulable.hh"
|
||||||
|
|
||||||
using namespace sgpem;
|
using namespace sgpem;
|
||||||
|
|
||||||
Schedulable::Schedulable(const Glib::ustring& name,
|
StaticSchedulable::StaticSchedulable(const Glib::ustring& name,
|
||||||
const unsigned int& arrival,
|
const unsigned int& arrival,
|
||||||
const unsigned int& total,
|
const unsigned int& total,
|
||||||
const int& priority) :
|
const int& priority) :
|
||||||
|
@ -30,32 +30,32 @@ Schedulable::Schedulable(const Glib::ustring& name,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Schedulable::~Schedulable()
|
StaticSchedulable::~StaticSchedulable()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
Schedulable::get_arrival_time() const
|
StaticSchedulable::get_arrival_time() const
|
||||||
{
|
{
|
||||||
return _arrival_time;
|
return _arrival_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
Schedulable::get_total_cpu_time() const
|
StaticSchedulable::get_total_cpu_time() const
|
||||||
{
|
{
|
||||||
return _total_time;
|
return _total_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
Schedulable::get_priority() const
|
StaticSchedulable::get_priority() const
|
||||||
{
|
{
|
||||||
return _priority;
|
return _priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
Glib::ustring
|
Glib::ustring
|
||||||
Schedulable::get_name() const
|
StaticSchedulable::get_name() const
|
||||||
{
|
{
|
||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
// src/backend/schedulable.hh - Copyright 2005, 2006, University
|
// src/backend/static_schedulable.hh - Copyright 2005, 2006, University
|
||||||
// of Padova, dept. of Pure and Applied
|
// of Padova, dept. of Pure and Applied
|
||||||
// Mathematics
|
// Mathematics
|
||||||
//
|
//
|
||||||
|
@ -18,15 +18,15 @@
|
||||||
// along with SGPEMv2; if not, write to the Free Software
|
// along with SGPEMv2; if not, write to the Free Software
|
||||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
#ifndef SCHEDULABLE_HH
|
#ifndef STATIC_SCHEDULABLE_HH
|
||||||
#define SCHEDULABLE_HH 1
|
#define STATIC_SCHEDULABLE_HH 1
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "glibmm/ustring.h"
|
#include "glibmm/ustring.h"
|
||||||
|
|
||||||
namespace sgpem
|
namespace sgpem
|
||||||
{
|
{
|
||||||
class Schedulable;
|
class StaticSchedulable;
|
||||||
|
|
||||||
/** \brief An entity that can use the processor
|
/** \brief An entity that can use the processor
|
||||||
*
|
*
|
||||||
|
@ -38,13 +38,13 @@ namespace sgpem
|
||||||
*
|
*
|
||||||
* \see SchedulableStatus
|
* \see SchedulableStatus
|
||||||
*/
|
*/
|
||||||
class SG_DLLEXPORT Schedulable
|
class SG_DLLEXPORT StaticSchedulable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** \brief Create a new object with the given parameters */
|
/** \brief Create a new object with the given parameters */
|
||||||
Schedulable(const Glib::ustring& name, const unsigned int& arrival,
|
StaticSchedulable(const Glib::ustring& name, const unsigned int& arrival,
|
||||||
const unsigned int& total, const int& priority);
|
const unsigned int& total, const int& priority);
|
||||||
virtual ~Schedulable();
|
virtual ~StaticSchedulable();
|
||||||
|
|
||||||
/** \brief Returns the arrival time for this process
|
/** \brief Returns the arrival time for this process
|
||||||
*
|
*
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#include "templates/smartp.hh"
|
#include "templates/smartp.hh"
|
||||||
#include "backend/history.hh"
|
#include "backend/history.hh"
|
||||||
#include "backend/schedulable.hh"
|
#include "backend/static_schedulable.hh"
|
||||||
#include "backend/schedulable_queue.hh"
|
#include "backend/schedulable_queue.hh"
|
||||||
#include "backend/schedulable_status.hh"
|
#include "backend/schedulable_status.hh"
|
||||||
#include "backend/slice.hh"
|
#include "backend/slice.hh"
|
||||||
|
|
Loading…
Reference in New Issue