- 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 ## @brief This is the abstract class a user-defined policy
# should inherit from # should inherit from
@ -96,6 +97,15 @@ class Policy:
# @return 0+ To specify a time slice duration for this policy # @return 0+ To specify a time slice duration for this policy
get_time_slice = AbstractMethod('get_time_slice') 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 ## @brief This function implements an in-place stable sort
# using directly SchedulableQueue methods # using directly SchedulableQueue methods
# #
@ -127,6 +137,7 @@ class Policy:
def sort(self, queue, cmpf): def sort(self, queue, cmpf):
self.__recursive_qsort(queue, 0, queue.size()-1, cmpf) self.__recursive_qsort(queue, 0, queue.size()-1, cmpf)
## @brief Recursive (private) call to perform quicksort on a ## @brief Recursive (private) call to perform quicksort on a
# queue # queue
# #
@ -141,6 +152,7 @@ class Policy:
self.__recursive_qsort(queue, a, pivot-1, 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 ## @brief Recursive (private) call to partition a slice of the queue
# #
# This private function (the name mangling should work) # This private function (the name mangling should work)

View File

@ -136,7 +136,7 @@ namespace sgpem {
int get_priority() const; int get_priority() const;
unsigned int get_total_cpu_time() const; unsigned int get_total_cpu_time() const;
%ignore get_name() const; %ignore Schedulable::get_name() const;
%extend { %extend {
const char* get_name() const const char* get_name() const
{ return self->get_name().c_str(); } { return self->get_name().c_str(); }
@ -185,6 +185,7 @@ namespace sgpem {
// --------------------------------------------- // ---------------------------------------------
class Scheduler { class Scheduler {
public: public:
sgpem::Policy* get_policy();
static sgpem::Scheduler& get_instance(); static sgpem::Scheduler& get_instance();
sgpem::SchedulableList* get_ready_queue(); sgpem::SchedulableList* get_ready_queue();
private: private: