Package driver :: Module utils :: Class PriorityQueue
[show private | hide private]
[frames | no frames]

Class PriorityQueue


This is a pretty basic priority queue.
Method Summary
  __init__(self)
  add(self, func, priority)
Adds a function to the prioritymap and marks the PriorityQueue as "dirty" which means it needs to regenerate the ordered list before it hands it out.
int count(self)
Returns how many functions are in the list.
  getList(self)
Retrieves the list.
  remove(self, func)
Removes a func from the priority map.

Method Details

add(self, func, priority=99)

Adds a function to the prioritymap and marks the PriorityQueue as "dirty" which means it needs to regenerate the ordered list before it hands it out.
Parameters:
func - the function to call when the hook is spammed
           (type=function)
priority - the function will get this place in the call order. functions with the same priority specified will get arbitrary ordering. defaults to 99.
           (type=int)

count(self)

Returns how many functions are in the list.
Returns:
the number of functions registered
           (type=int)

getList(self)

Retrieves the list. It might regenerate it if the prioritymap has been adjusted since the last time we regenerated the list.

remove(self, func)

Removes a func from the priority map.
Parameters:
func - the function to unregister
           (type=function)

Generated by Epydoc 2.0 on Wed Jan 21 21:00:06 2004 http://epydoc.sf.net