- Fix Schedulable::get_name() in SWIG export interface

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@431 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-02-24 09:02:32 +00:00
parent dc84bfd16c
commit 1395347b1a
2 changed files with 17 additions and 4 deletions

View File

@ -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
#

View File

@ -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: