79 lines
1.7 KiB
C++
79 lines
1.7 KiB
C++
|
// src/frontend/simulation.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 SIMULATION_HH
|
||
|
#define SIMULATION_HH 1
|
||
|
|
||
|
#include "config.h"
|
||
|
|
||
|
#include <glibmm/timer.h>
|
||
|
|
||
|
#include "observer.hh"
|
||
|
#include "backend/policy.hh"
|
||
|
#include "backend/history.hh"
|
||
|
#include "backend/scheduler.hh"
|
||
|
|
||
|
namespace sgpem
|
||
|
{
|
||
|
class Simulation;
|
||
|
|
||
|
/**
|
||
|
|
||
|
*/
|
||
|
class SG_DLLEXPORT Simulation : public Observer
|
||
|
{
|
||
|
public:
|
||
|
enum state
|
||
|
{
|
||
|
state_running,
|
||
|
state_paused,
|
||
|
state_stopped
|
||
|
};
|
||
|
|
||
|
Simulation();
|
||
|
|
||
|
void run();
|
||
|
void pause();
|
||
|
void stop();
|
||
|
void reset();
|
||
|
void jump_to(const uint&);
|
||
|
|
||
|
void set_timer(const int&);
|
||
|
int get_timer() const;
|
||
|
void set_mode(const bool&);
|
||
|
bool get_mode() const;
|
||
|
|
||
|
void set_policy(Policy*);
|
||
|
Policy* get_policy();
|
||
|
std::vector<Policy*> get_avaiable_policies();
|
||
|
|
||
|
|
||
|
private:
|
||
|
state _state;
|
||
|
bool _mode;
|
||
|
int _timer_interval;
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
#endif
|