sgpemv2/src/backend/schedulable.hh
elvez a1662de194 - Added the Schedulable interface
- Renamed SchedulableStatus to DynamicSchedulable
- Implemented almost all methods of DynamicSchedulable

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@630 3ecf2c5c-341e-0410-92b4-d18e462d057c
2006-06-13 16:37:57 +00:00

72 lines
2.1 KiB
C++

// 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"
#include "glibmm/ustring.h"
namespace sgpem
{
class Schedulable;
class SerializeVisitor;
class SG_DLLEXPORT Schedulable
{
public:
/** \brief This flag describes the actual state of the schedulable
*
* You can think of this flag as the particular stack in the OS where the
* process are placed during their lifetime. In the OS there are three
* main stacks that are Running processes, Read processes, and Blocked
* processes. These are emulated in a single list by this flag.
*/
enum state
{
state_running = 1<<0,
state_ready = 1<<1,
state_blocked = 1<<2,
state_future = 1<<3,
state_terminated = 1<<4
};
virtual ~Schedulable();
virtual Glib::ustring get_name() const = 0;
virtual unsigned int get_arrival_time() const = 0;
virtual unsigned int get_remaining_time() const = 0;
virtual int get_base_priority() const = 0;
virtual unsigned int get_total_cpu_time() const = 0;
virtual int get_current_priority() const = 0;
virtual state get_state() const = 0;
virtual void serialize(SerializeVisitor& translator) const = 0;
};
}
#endif