2006-01-28 21:39:29 +01:00
|
|
|
// src/backend/schedulable.hh - 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 SCHEDULABLE_HH
|
|
|
|
#define SCHEDULABLE_HH 1
|
|
|
|
|
|
|
|
#include "config.h"
|
2006-02-06 22:37:32 +01:00
|
|
|
#include "glibmm/ustring.h"
|
2006-01-28 21:39:29 +01:00
|
|
|
|
|
|
|
namespace sgpem
|
|
|
|
{
|
|
|
|
class Schedulable;
|
|
|
|
|
|
|
|
/** \brief An entity that can use the processor
|
2006-01-31 12:59:38 +01:00
|
|
|
*
|
2006-01-28 21:39:29 +01:00
|
|
|
* This abstract class describes an entity that can use the
|
|
|
|
* processor. It describes the parameters that don't change
|
|
|
|
* during a simulation.
|
|
|
|
* All subclasses are ... (FIXME: teach Luca and Marco what's
|
|
|
|
* the Italian language for, damn them! -- they must have
|
|
|
|
* *smoked* mushrooms! :-) ) */
|
2006-02-07 21:41:59 +01:00
|
|
|
class SG_DLLEXPORT Schedulable
|
2006-01-28 21:39:29 +01:00
|
|
|
{
|
|
|
|
public:
|
2006-02-09 20:33:35 +01:00
|
|
|
Schedulable(const Glib::ustring& name, const unsigned int& arrival, const unsigned int& total, const int& priority);
|
2006-01-28 21:39:29 +01:00
|
|
|
virtual ~Schedulable() = 0;
|
|
|
|
|
2006-02-12 18:12:54 +01:00
|
|
|
virtual unsigned int get_arrival_time() const;
|
2006-02-09 20:33:35 +01:00
|
|
|
unsigned int get_total_cpu_time() const;
|
2006-02-12 18:12:54 +01:00
|
|
|
int get_priority() const;
|
|
|
|
Glib::ustring get_name() const;
|
|
|
|
virtual Glib::ustring get_type() const = 0;
|
2006-02-06 22:37:32 +01:00
|
|
|
|
2006-01-28 21:39:29 +01:00
|
|
|
private:
|
2006-02-06 22:37:32 +01:00
|
|
|
Glib::ustring _name;
|
2006-02-09 20:33:35 +01:00
|
|
|
unsigned int _arrival_time;
|
2006-01-28 21:39:29 +01:00
|
|
|
unsigned int _total_time;
|
|
|
|
int _priority;
|
2006-02-06 22:37:32 +01:00
|
|
|
|
2006-01-28 21:39:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2006-02-19 23:36:24 +01:00
|
|
|
|