diff --git a/src/backend/python_policy.cc b/src/backend/python_policy.cc deleted file mode 100644 index d443c49..0000000 --- a/src/backend/python_policy.cc +++ /dev/null @@ -1,27 +0,0 @@ -// src/backend/python_policy.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 "python_policy.hh" -using namespace sgpem; -using namespace std; - -PythonPolicy::PythonPolicy() -{ -} diff --git a/src/backend/python_policy.hh b/src/backend/python_policy.hh deleted file mode 100644 index 4ecb560..0000000 --- a/src/backend/python_policy.hh +++ /dev/null @@ -1,61 +0,0 @@ -// src/backend/python_policy.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 PYTHON_POLICY_HH -#define PYTHON_POLICY_HH 1 - -#include "config.h" - -#include -#include - -#include "policy.hh" - - -namespace sgpem -{ - - class PythonPolicy; - class PythonPolicyManager; - - class SG_DLLEXPORT PythonPolicy : public Policy - { - public: - //only PythonPolicyManager can create a PythonPolicy object - friend class PythonPolicyManager; - - void configure() {} - void sort_queue(sgpem::Scheduler::event) const {} - Glib::ustring get_description() const {} - bool is_pre_emptive() const {} - int get_time_slice() const {} - void set_time_slice(const int&) {} - - - - private: - - PythonPolicy(); - - }; - -} - -#endif \ No newline at end of file diff --git a/src/backend/python_policy_manager.cc b/src/backend/python_policy_manager.cc deleted file mode 100644 index c5d1f59..0000000 --- a/src/backend/python_policy_manager.cc +++ /dev/null @@ -1,66 +0,0 @@ -// src/backend/python_policy_manager.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 "python_policy_manager.hh" - -using namespace sgpem; - - -//static object -PythonPolicyManager PythonPolicyManager::_instance(10); //dummy parameter - - -PythonPolicyManager::PythonPolicyManager(int) //private constructor. The parameter is discarded -{ -} - -PythonPolicyManager& -PythonPolicyManager::get_instance() -{ - return _instance; -} - -Policy* -PythonPolicyManager::get_policy() -{ - return &_python_policy; -} - -void -PythonPolicyManager::init() -{ - Py_Initialize(); - - // The following line is ugly, but necessary if we use - // non-standard installation directories. Theoretically, - // it should be up to the user to set correct - // environment variables. - // FIXME: find better way to achieve this. - - PyRun_SimpleString("import sys\n" - "sys.path[:0] = [ '" MODDIR "', '" PYCDIR "' ]\n" - "print '[II] Module search path is :', sys.path\n"); - - const char* filename = PYCDIR "/loadme.py"; - std::cout << "\n\n" << filename; - std::cout.flush(); -} - - diff --git a/src/backend/python_policy_manager.hh b/src/backend/python_policy_manager.hh deleted file mode 100644 index c73d0fc..0000000 --- a/src/backend/python_policy_manager.hh +++ /dev/null @@ -1,54 +0,0 @@ -// src/backend/python_policy_manager.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 PYTHON_POLICY_MANAGER_HH -#define PYTHON_POLICY_MANAGER_HH 1 - -#include "config.h" - -#include - -#include "policy_manager.hh" -#include "python_policy.hh" - -namespace sgpem -{ - //class PolicyManager; - class PythonPolicyManager; - - class SG_DLLEXPORT PythonPolicyManager : public PolicyManager - { - public: - - Policy* get_policy(); - void init(); - PyObject* get_py_dict(); - - static PythonPolicyManager& get_instance(); - - private: - PythonPolicyManager(int); //dummy parameter - static PythonPolicyManager _instance; - PythonPolicy _python_policy; - }; - -} - -#endif \ No newline at end of file