- Added SETPOLICY and LISTPOLICIES commands to text-based interface

- Fixed a bug preventing registration of managers in PoliciesGatekeeper

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@634 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-06-15 20:07:03 +00:00
parent 9642918dd8
commit 30d070a420
11 changed files with 96 additions and 11 deletions

View file

@ -120,6 +120,12 @@ PythonPolicy::get_description() const
}
Glib::ustring
PythonPolicy::get_name() const
{
return _name;
}
bool
PythonPolicy::is_pre_emptive() const throw(UserInterruptException)
{

View file

@ -63,6 +63,8 @@ namespace sgpem
*/
Glib::ustring get_description() const;
Glib::ustring get_name() const;
/**
\returns \c TRUE if the policy is preemptive.
\returns \c FALSE if the policy is not preemptive.

View file

@ -20,6 +20,7 @@
#include "python_policy_manager.hh"
#include "global_preferences.hh"
#include "policies_gatekeeper.hh"
#include <Python.h>
#include <glibmm/ustring.h>
@ -82,12 +83,12 @@ PythonPolicyManager::get_instance()
}
Policy&
PythonPolicyManager::get_policy()
{
// FIXME : assumes that _python_policy is always != NULL!
return *_python_policy;
}
// Policy&
// PythonPolicyManager::get_policy()
// {
// // FIXME : assumes that _python_policy is always != NULL!
// return *_python_policy;
// }
void
@ -158,7 +159,10 @@ PythonPolicyManager::collect_policies()
//FIXME remove me when get_policy is dropped
if(policy_name == "fcfs")
{
_python_policy = pypolicy;
PoliciesGatekeeper::get_instance().activate_policy(&History::get_instance(), pypolicy);
}
}
}
}

View file

@ -48,8 +48,9 @@ namespace sgpem
* In the next milestones it will be possible to manage
* more than one, and to retrieve the correct Policy by
* passing a unique ID.
FIXME depreceated
*/
Policy& get_policy();
//Policy& get_policy();
/** \brief Initialize the Python interpreter.
*

View file

@ -44,6 +44,11 @@ public:
void test_init(const char* policy_name) {
init();
_python_policy = new PythonPolicy(policy_name);
}
Policy& get_policy() {
return *_python_policy;
}
};