- added source files
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1050 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
81c34f5ce8
commit
8271a880b2
12
Makefile.am
12
Makefile.am
|
@ -157,6 +157,7 @@ src_backend_libbackend_la_SOURCES = \
|
|||
src/backend/concrete_environment.cc \
|
||||
src/backend/concrete_history.cc \
|
||||
src/backend/concrete_simulation.cc \
|
||||
src/backend/concrete_statistics.cc \
|
||||
src/backend/cpu_policies_gatekeeper.cc \
|
||||
src/backend/cpu_policy.cc \
|
||||
src/backend/cpu_policy_exception.cc \
|
||||
|
@ -189,6 +190,7 @@ src_backend_libbackend_la_SOURCES = \
|
|||
src/backend/resource_policy_lifo.cc \
|
||||
src/backend/resource_policy_manager.cc \
|
||||
src/backend/schedulable.cc \
|
||||
src/backend/schedulable_statistics.cc \
|
||||
src/backend/scheduler.cc \
|
||||
src/backend/serialize_visitor.cc \
|
||||
src/backend/serializer.cc \
|
||||
|
@ -202,9 +204,11 @@ src_backend_libbackend_la_SOURCES = \
|
|||
src/backend/static_schedulable.cc \
|
||||
src/backend/static_sub_request.cc \
|
||||
src/backend/static_thread.cc \
|
||||
src/backend/statistics.cc \
|
||||
src/backend/string_utils.cc \
|
||||
src/backend/sub_request.cc \
|
||||
src/backend/thread.cc \
|
||||
src/backend/thread_statistics.cc \
|
||||
src/backend/user_interrupt_exception.cc
|
||||
|
||||
# Put here header files that will be installed for the user
|
||||
|
@ -238,13 +242,15 @@ pkginclude_HEADERS += \
|
|||
src/backend/sgpemv2/resource_policy_manager.hh \
|
||||
src/backend/sgpemv2/process.hh \
|
||||
src/backend/sgpemv2/schedulable.hh \
|
||||
src/backend/sgpemv2/scheduler.hh \
|
||||
src/backend/sgpemv2/schedulable_statistics.hh \
|
||||
src/backend/sgpemv2/scheduler.hh \
|
||||
src/backend/sgpemv2/serialize_visitor.hh \
|
||||
src/backend/sgpemv2/serializer.hh \
|
||||
src/backend/sgpemv2/serializer_error.hh \
|
||||
src/backend/sgpemv2/serializers_gatekeeper.hh \
|
||||
src/backend/sgpemv2/simulation.hh \
|
||||
src/backend/sgpemv2/simulation_observer.hh \
|
||||
src/backend/sgpemv2/statistics.hh \
|
||||
src/backend/sgpemv2/string_utils.hh \
|
||||
src/backend/sgpemv2/sub_request.hh \
|
||||
src/backend/sgpemv2/thread.hh \
|
||||
|
@ -257,6 +263,7 @@ noinst_HEADERS += \
|
|||
src/backend/concrete_environment.hh \
|
||||
src/backend/concrete_history.hh \
|
||||
src/backend/concrete_simulation.hh \
|
||||
src/backend/concrete_statistics.hh \
|
||||
src/backend/dynamic_process.hh \
|
||||
src/backend/dynamic_request.hh \
|
||||
src/backend/dynamic_resource.hh \
|
||||
|
@ -268,7 +275,8 @@ noinst_HEADERS += \
|
|||
src/backend/static_resource.hh \
|
||||
src/backend/static_schedulable.hh \
|
||||
src/backend/static_sub_request.hh \
|
||||
src/backend/static_thread.hh
|
||||
src/backend/static_thread.hh \
|
||||
src/backend/thread_statistics.hh
|
||||
|
||||
|
||||
# ############################################################
|
||||
|
|
|
@ -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*>();
|
||||
}
|
||||
|
|
@ -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
|
|
@ -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()
|
||||
{}
|
||||
|
|
@ -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
|
|
@ -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
|
|
@ -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();
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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
|
Loading…
Reference in New Issue