- Removed CPUPolicyManager::init(), it was deprecated
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@953 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
c30a3674f2
commit
9e61332a12
|
@ -61,27 +61,10 @@ private:
|
||||||
|
|
||||||
|
|
||||||
PythonCPUPolicyManager::PythonCPUPolicyManager()
|
PythonCPUPolicyManager::PythonCPUPolicyManager()
|
||||||
: _initialized(false)
|
|
||||||
{
|
{
|
||||||
PyEval_InitThreads();
|
PyEval_InitThreads();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
PythonCPUPolicyManager::~PythonCPUPolicyManager()
|
|
||||||
{
|
|
||||||
for_each(_policies.begin(), _policies.end(), memory::deletor<CPUPolicy>());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
PythonCPUPolicyManager::init()
|
|
||||||
{
|
|
||||||
if (_initialized)
|
|
||||||
// No-op
|
|
||||||
return;
|
|
||||||
|
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
_initialized = true;
|
|
||||||
|
|
||||||
// The following lines are ugly, but necessary if we use
|
// The following lines are ugly, but necessary if we use
|
||||||
// non-standard installation directories. Theoretically,
|
// non-standard installation directories. Theoretically,
|
||||||
|
@ -103,6 +86,13 @@ PythonCPUPolicyManager::init()
|
||||||
collect_policies();
|
collect_policies();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PythonCPUPolicyManager::~PythonCPUPolicyManager()
|
||||||
|
{
|
||||||
|
for_each(_policies.begin(), _policies.end(), memory::deletor<CPUPolicy>());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const vector<CPUPolicy*>&
|
const vector<CPUPolicy*>&
|
||||||
PythonCPUPolicyManager::get_avail_policies()
|
PythonCPUPolicyManager::get_avail_policies()
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,13 +44,6 @@ namespace sgpem
|
||||||
PythonCPUPolicyManager();
|
PythonCPUPolicyManager();
|
||||||
~PythonCPUPolicyManager();
|
~PythonCPUPolicyManager();
|
||||||
|
|
||||||
/** \brief Initialize the Python interpreter.
|
|
||||||
*
|
|
||||||
* If the interpreter has already been initialized, it terminates it, cleanups old policies,
|
|
||||||
* and restarts it.
|
|
||||||
*/
|
|
||||||
void init();
|
|
||||||
|
|
||||||
const std::vector<CPUPolicy*>& get_avail_policies();
|
const std::vector<CPUPolicy*>& get_avail_policies();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -60,8 +53,6 @@ namespace sgpem
|
||||||
private:
|
private:
|
||||||
PythonCPUPolicyManager(const PythonCPUPolicyManager&);
|
PythonCPUPolicyManager(const PythonCPUPolicyManager&);
|
||||||
PythonCPUPolicyManager& operator=(const PythonCPUPolicyManager&);
|
PythonCPUPolicyManager& operator=(const PythonCPUPolicyManager&);
|
||||||
|
|
||||||
bool _initialized;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,6 @@ main(int argc, char** argv)
|
||||||
|
|
||||||
// Self-register itself to PoliciesGatekeeper, however we don't care about it
|
// Self-register itself to PoliciesGatekeeper, however we don't care about it
|
||||||
PythonCPUPolicyManager polman;
|
PythonCPUPolicyManager polman;
|
||||||
polman.init();
|
|
||||||
|
|
||||||
Simulation& sim = Simulation::get_instance();
|
Simulation& sim = Simulation::get_instance();
|
||||||
History& his = sim.get_history();
|
History& his = sim.get_history();
|
||||||
|
|
|
@ -51,12 +51,6 @@ namespace sgpem
|
||||||
|
|
||||||
virtual ~CPUPolicyManager() = 0;
|
virtual ~CPUPolicyManager() = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
Init (or reset if yet initialized) the manager.
|
|
||||||
FIXME deprecated
|
|
||||||
*/
|
|
||||||
virtual void init() = 0;
|
|
||||||
|
|
||||||
virtual const std::vector<CPUPolicy*>& get_avail_policies() = 0;
|
virtual const std::vector<CPUPolicy*>& get_avail_policies() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -120,10 +120,6 @@ parse_options(int argc, char** argv)
|
||||||
|
|
||||||
vector<CPUPolicyManager*> managers = CPUPoliciesGatekeeper::get_instance().get_registered();
|
vector<CPUPolicyManager*> managers = CPUPoliciesGatekeeper::get_instance().get_registered();
|
||||||
|
|
||||||
for (vector<CPUPolicyManager*>::iterator it = managers.begin(); it != managers.end(); ++it)
|
|
||||||
(*it)->init();
|
|
||||||
|
|
||||||
|
|
||||||
if (no_gui_enabled)
|
if (no_gui_enabled)
|
||||||
{
|
{
|
||||||
// We don't return to main, instead we
|
// We don't return to main, instead we
|
||||||
|
|
Loading…
Reference in New Issue