- Remove spurious files left from previous commit (these
files were moved to the pyloader directory) git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@336 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
b6c49d98d6
commit
6e15465e16
|
@ -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()
|
|
||||||
{
|
|
||||||
}
|
|
|
@ -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 <iostream>
|
|
||||||
#include <Python.h>
|
|
||||||
|
|
||||||
#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
|
|
|
@ -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();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -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 <Python.h>
|
|
||||||
|
|
||||||
#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
|
|
Loading…
Reference in New Issue