From 9e61332a125e3653b9aa82d1606f553ae7eab34c Mon Sep 17 00:00:00 2001 From: elvez Date: Mon, 28 Aug 2006 21:40:02 +0000 Subject: [PATCH] - Removed CPUPolicyManager::init(), it was deprecated git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@953 3ecf2c5c-341e-0410-92b4-d18e462d057c --- .../pyloader/src/python_cpu_policy_manager.cc | 24 ++++++------------- .../pyloader/src/python_cpu_policy_manager.hh | 9 ------- .../src/testsuite/test-python_loader.cc | 1 - src/backend/cpu_policy_manager.hh | 6 ----- src/parse_opts.cc | 4 ---- 5 files changed, 7 insertions(+), 37 deletions(-) diff --git a/plugins/pyloader/src/python_cpu_policy_manager.cc b/plugins/pyloader/src/python_cpu_policy_manager.cc index 7090d53..a97d6ab 100644 --- a/plugins/pyloader/src/python_cpu_policy_manager.cc +++ b/plugins/pyloader/src/python_cpu_policy_manager.cc @@ -61,27 +61,10 @@ private: PythonCPUPolicyManager::PythonCPUPolicyManager() - : _initialized(false) { PyEval_InitThreads(); -} - - -PythonCPUPolicyManager::~PythonCPUPolicyManager() -{ - for_each(_policies.begin(), _policies.end(), memory::deletor()); -} - - -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()); +} + + const vector& PythonCPUPolicyManager::get_avail_policies() { diff --git a/plugins/pyloader/src/python_cpu_policy_manager.hh b/plugins/pyloader/src/python_cpu_policy_manager.hh index 0aafba6..d21308f 100644 --- a/plugins/pyloader/src/python_cpu_policy_manager.hh +++ b/plugins/pyloader/src/python_cpu_policy_manager.hh @@ -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& get_avail_policies(); protected: @@ -60,8 +53,6 @@ namespace sgpem private: PythonCPUPolicyManager(const PythonCPUPolicyManager&); PythonCPUPolicyManager& operator=(const PythonCPUPolicyManager&); - - bool _initialized; }; } diff --git a/plugins/pyloader/src/testsuite/test-python_loader.cc b/plugins/pyloader/src/testsuite/test-python_loader.cc index 8d64bea..f7db62a 100644 --- a/plugins/pyloader/src/testsuite/test-python_loader.cc +++ b/plugins/pyloader/src/testsuite/test-python_loader.cc @@ -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(); diff --git a/src/backend/cpu_policy_manager.hh b/src/backend/cpu_policy_manager.hh index 1195b8b..a99a422 100644 --- a/src/backend/cpu_policy_manager.hh +++ b/src/backend/cpu_policy_manager.hh @@ -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& get_avail_policies() = 0; protected: diff --git a/src/parse_opts.cc b/src/parse_opts.cc index cf75bce..f54faa0 100644 --- a/src/parse_opts.cc +++ b/src/parse_opts.cc @@ -120,10 +120,6 @@ parse_options(int argc, char** argv) vector managers = CPUPoliciesGatekeeper::get_instance().get_registered(); - for (vector::iterator it = managers.begin(); it != managers.end(); ++it) - (*it)->init(); - - if (no_gui_enabled) { // We don't return to main, instead we