- 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:
elvez 2006-08-28 21:40:02 +00:00
parent c30a3674f2
commit 9e61332a12
5 changed files with 7 additions and 37 deletions

View File

@ -61,27 +61,10 @@ private:
PythonCPUPolicyManager::PythonCPUPolicyManager()
: _initialized(false)
{
PyEval_InitThreads();
}
PythonCPUPolicyManager::~PythonCPUPolicyManager()
{
for_each(_policies.begin(), _policies.end(), memory::deletor<CPUPolicy>());
}
void
PythonCPUPolicyManager::init()
{
if (_initialized)
// No-op
return;
Py_Initialize();
_initialized = true;
// The following lines are ugly, but necessary if we use
// non-standard installation directories. Theoretically,
@ -103,6 +86,13 @@ PythonCPUPolicyManager::init()
collect_policies();
}
PythonCPUPolicyManager::~PythonCPUPolicyManager()
{
for_each(_policies.begin(), _policies.end(), memory::deletor<CPUPolicy>());
}
const vector<CPUPolicy*>&
PythonCPUPolicyManager::get_avail_policies()
{

View File

@ -44,13 +44,6 @@ namespace sgpem
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();
protected:
@ -60,8 +53,6 @@ namespace sgpem
private:
PythonCPUPolicyManager(const PythonCPUPolicyManager&);
PythonCPUPolicyManager& operator=(const PythonCPUPolicyManager&);
bool _initialized;
};
}

View File

@ -70,7 +70,6 @@ main(int argc, char** argv)
// Self-register itself to PoliciesGatekeeper, however we don't care about it
PythonCPUPolicyManager polman;
polman.init();
Simulation& sim = Simulation::get_instance();
History& his = sim.get_history();

View File

@ -51,12 +51,6 @@ namespace sgpem
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;
protected:

View File

@ -120,10 +120,6 @@ parse_options(int argc, char** argv)
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)
{
// We don't return to main, instead we