diff --git a/src/backend/pyloader/Policy.py b/src/backend/pyloader/Policy.py index e30cffc..b041828 100644 --- a/src/backend/pyloader/Policy.py +++ b/src/backend/pyloader/Policy.py @@ -1,4 +1,5 @@ -from Abstract import * +from Abstract import * +import sgpem ## @brief This is the abstract class a user-defined policy # should inherit from @@ -95,6 +96,15 @@ class Policy: # @return -1 If the policy doesn't want to use time slices # @return 0+ To specify a time slice duration for this policy get_time_slice = AbstractMethod('get_time_slice') + + + ## @brief Returns the PolicyParameters instance you can use in + # Policy::Policy::configure() + # + # @return A sgpem::PolicyParameters instance + def get_parameters(self): + return sgpem.Scheduler.get_instance().get_policy().get_parameters() + ## @brief This function implements an in-place stable sort # using directly SchedulableQueue methods @@ -127,6 +137,7 @@ class Policy: def sort(self, queue, cmpf): self.__recursive_qsort(queue, 0, queue.size()-1, cmpf) + ## @brief Recursive (private) call to perform quicksort on a # queue # @@ -139,7 +150,8 @@ class Policy: if(b>a): pivot = self.__partition(queue, a, b, cmpf) self.__recursive_qsort(queue, a, pivot-1, cmpf) - self.__recursive_qsort(queue, pivot+1, b, cmpf) + self.__recursive_qsort(queue, pivot+1, b, cmpf) + ## @brief Recursive (private) call to partition a slice of the queue # diff --git a/src/backend/pyloader/sgpem.i b/src/backend/pyloader/sgpem.i index fada4f8..3e22329 100644 --- a/src/backend/pyloader/sgpem.i +++ b/src/backend/pyloader/sgpem.i @@ -136,10 +136,10 @@ namespace sgpem { int get_priority() const; unsigned int get_total_cpu_time() const; - %ignore get_name() const; + %ignore Schedulable::get_name() const; %extend { const char* get_name() const - { return self->get_name().c_str(); } + { return self->get_name().c_str(); } } }; //~ class Schedulable @@ -185,6 +185,7 @@ namespace sgpem { // --------------------------------------------- class Scheduler { public: + sgpem::Policy* get_policy(); static sgpem::Scheduler& get_instance(); sgpem::SchedulableList* get_ready_queue(); private: