class TokenPQ

Defines a priority queue specially made for tokens and this simulator.

Public Methods

[more] TokenPQ()
Default constructor
[more] ~TokenPQ()
Destructor
[more]bool enqueue(const Token& token)
Enqueue a job
[more]bool dequeue()
Dequeue a job
[more]Token front()
Inspect the next available job
[more]void setComparison(bool (*newComparison) (const Token&, const Token&))
Set the function that will be used to sort the priority queue
[more]bool comparisonSet()
Checks if the comparison (sorting) function of the queue has been set yet.
[more]bool empty()
Checks if the queue is empty
[more]unsigned int size()
[more]bool search(SIZE PEs, TIME reqTime, Token& output, unsigned int& pos)
Searches for processes that use the specified number of PEs or less
[more]bool erase(const unsigned int pos)
Erases the element in the queue at postition pos


Documentation

This queue allows greater control over sorting algorithms and inspection of all contents - something STL priority_queue doesn't offer.
o TokenPQ()

o ~TokenPQ()

obool enqueue(const Token& token)

obool dequeue()

oToken front()

ovoid setComparison(bool (*newComparison) (const Token&, const Token&))
A side effect of this function is that the priority_queue will be resorted according to the new function. If this function is used before any objects are put in the queue, the sorting will not hurt runtime.

obool comparisonSet()
Returns:
true if the function has been set. False otherwise.

obool empty()
Returns:
True if the queue does not contain any jobs. False otherwise.

ounsigned int size()
Returns:
the length of the priority queue

obool search(SIZE PEs, TIME reqTime, Token& output, unsigned int& pos)
This function would be used for backfilling purposes.

obool erase(const unsigned int pos)


This class has no child classes.
Author:
John Oleszkiewicz

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.