- added source files

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1050 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
fpaparel 2006-09-07 18:05:40 +00:00
parent 81c34f5ce8
commit 8271a880b2
9 changed files with 361 additions and 2 deletions

View file

@ -0,0 +1,34 @@
// src/backend/concrete_statistics.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 "concrete_statistics.hh"
using namespace sgpem;
ConcreteStatistics::ConcreteStatistics()
{}
std::vector<SchedulableStatistics*>
ConcreteStatistics::get_schedulable_statistics(const int& instant) const
{
return std::vector<SchedulableStatistics*>();
}

View file

@ -0,0 +1,45 @@
// src/backend/concrete_statistics.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 CONCRETE_STATISTICS_HH
#define CONCRETE_STATISTICS_HH 1
#include "config.h"
#include "sgpemv2/statistics.hh"
#include <glibmm/ustring.h>
namespace sgpem
{
class ConcreteStatistics;
class ConcreteStatistics : public Statistics
{
public:
ConcreteStatistics();
std::vector<SchedulableStatistics*> get_schedulable_statistics(const int& instant) const;
};
}
#endif

View file

@ -0,0 +1,30 @@
// src/backend/schedulable_statistics.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 "sgpemv2/schedulable_statistics.hh"
using namespace sgpem;
SchedulableStatistics::SchedulableStatistics()
{}
SchedulableStatistics::~SchedulableStatistics()
{}

View file

@ -0,0 +1,50 @@
// src/backend/schedulable_statistics.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_STATISTICS_HH
#define SCHEDULABLE_STATISTICS_HH 1
#include "config.h"
#include "schedulable.hh"
#include <glibmm/ustring.h>
namespace sgpem
{
class SchedulableStatistics
{
public:
virtual ~SchedulableStatistics();
virtual int get_execution_time() const =0;
/*virtual int get_total_waitings() const =0;
virtual int get_response_time() const =0;
virtual int get_turn_around() const =0;
*/
virtual const Schedulable* get_core() const =0;
protected:
SchedulableStatistics();
};
}
#endif

View file

@ -0,0 +1,53 @@
// src/backend/statistics.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 STATISTICS_HH
#define STATISTICS_HH 1
#include "config.h"
#include "sgpemv2/templates/singleton.hh"
#include "schedulable_statistics.hh"
#include <vector>
#include <glibmm/ustring.h>
namespace sgpem
{
class Statistics;
class ConcreteStatistics;
class SG_DLLEXPORT Statistics : public Singleton<ConcreteStatistics>
{
public:
//typedef std::vector<int> SchedulableStatistics;
virtual ~Statistics() = 0;
static Statistics& get_instance();
virtual std::vector<SchedulableStatistics*> get_schedulable_statistics(const int& instant) const = 0;
protected:
Statistics(); // Constructor
};
}
#endif

39
src/backend/statistics.cc Executable file
View file

@ -0,0 +1,39 @@
// src/backend/statistics.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 "sgpemv2/statistics.hh"
#include "concrete_statistics.hh"
// Do not include in header file:
#include "sgpemv2/templates/singleton.tcc"
using namespace sgpem;
Statistics::~Statistics()
{}
Statistics::Statistics()
{}
Statistics&
Statistics::get_instance()
{
return Singleton<ConcreteStatistics>::get_instance();
}

View file

@ -0,0 +1,49 @@
// src/backend/thread_statistics.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 "thread_statistics.hh"
#include "sgpemv2/simulation.hh"
#include "sgpemv2/history.hh"
#include "sgpemv2/environment.hh"
using namespace sgpem;
ThreadStatistics::ThreadStatistics(const Thread* core, const int& instant): _core(core)
{
}
ThreadStatistics::~ThreadStatistics()
{
}
int
ThreadStatistics::get_execution_time() const
{
return 99;
}
const Thread*
ThreadStatistics::get_core() const
{
return _core;
}

View file

@ -0,0 +1,51 @@
// src/backend/thread_statistics.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 CONCRETE_STATISTICS_HH
#define CONCRETE_STATISTICS_HH 1
#include "config.h"
#include "sgpemv2/schedulable_statistics.hh"
#include "sgpemv2/thread.hh"
#include <glibmm/ustring.h>
namespace sgpem
{
class ThreadStatistics : public SchedulableStatistics
{
public:
ThreadStatistics(const Thread* core, const int& instant);
~ThreadStatistics();
int get_execution_time() const;
/* int get_total_waitings() const;
int get_response_time() const;
int get_turn_around() const;
*/ const Thread* get_core() const;
private:
const Thread* _core;
};
}
#endif