Defines a priority queue specially made for tokens and this simulator.
Public Methods
-
TokenPQ()
- Default constructor
-
~TokenPQ()
- Destructor
-
bool enqueue(const Token& token)
- Enqueue a job
-
bool dequeue()
- Dequeue a job
-
Token front()
- Inspect the next available job
-
void setComparison(bool (*newComparison) (const Token&, const Token&))
- Set the function that will be used to sort the priority queue
-
bool comparisonSet()
- Checks if the comparison (sorting) function of the queue has been set yet.
-
bool empty()
- Checks if the queue is empty
-
unsigned int size()
-
-
bool search(SIZE PEs, TIME reqTime, Token& output, unsigned int& pos)
- Searches for processes that use the specified number of PEs or less
-
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.
TokenPQ()
-
~TokenPQ()
-
bool enqueue(const Token& token)
-
bool dequeue()
-
Token front()
-
void 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.
bool comparisonSet()
-
- Returns:
- true if the function has been set. False otherwise.
bool empty()
-
- Returns:
- True if the queue does not contain any jobs. False otherwise.
unsigned int size()
-
- Returns:
- the length of the priority queue
bool search(SIZE PEs, TIME reqTime, Token& output, unsigned int& pos)
-
This function would be used for backfilling purposes.
bool 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++.