2006-02-16 23:50:32 +01:00
|
|
|
from Abstract import *
|
|
|
|
|
2006-02-22 22:35:26 +01:00
|
|
|
## @brief this function implements a quicksort in place
|
|
|
|
# using the SchedulableQueue methods
|
|
|
|
#
|
|
|
|
# The compare parameter should be a user defined function
|
|
|
|
# name returning either True or False, defined like:
|
|
|
|
# @code
|
|
|
|
# def compare(SchedulableA,SchedulableB):
|
|
|
|
# return SchedulableA.someProperty() < SchedulableB.someProperty()
|
|
|
|
# @endcode
|
|
|
|
#
|
|
|
|
# @param queue The SchedulableQueue to be sorted in place
|
|
|
|
# @param cmp The binary function to use to compare elements
|
|
|
|
# @returns None
|
|
|
|
def sort(queue, cmp):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2006-02-21 11:31:01 +01:00
|
|
|
class Policy:
|
2006-02-19 17:22:53 +01:00
|
|
|
## @var Avoid instantiation of an abstract class
|
2006-02-16 23:50:32 +01:00
|
|
|
__metaclass__ = Metaclass
|
|
|
|
|
|
|
|
configure = AbstractMethod('configure')
|
|
|
|
sort_queue = AbstractMethod('sort_queue')
|
|
|
|
is_preemptive = AbstractMethod('is_preemptive')
|
2006-02-22 16:16:08 +01:00
|
|
|
get_time_slice = AbstractMethod('get_time_slice')
|
2006-02-21 11:31:01 +01:00
|
|
|
|