Public Member Functions
|Create an empty SPF Candidate Queue. |
|Empty the Candidate Queue and release all of the resources associated with the Shortest Path First Vertex pointers in the queue. |
|void||Push (SPFVertex *vNew)|
|Push a Shortest Path First Vertex pointer onto the queue according to the priority scheme. |
|SPFVertex *||Pop (void)|
|Pop the Shortest Path First Vertex pointer at the top of the queue. |
|SPFVertex *||Top (void) const|
|Return the Shortest Path First Vertex pointer at the top of the queue. |
|bool||Empty (void) const|
|Test the Candidate Queue to determine if it is empty. |
|uint32_t||Size (void) const|
|Return the number of Shortest Path First Vertex pointers presently stored in the Candidate Queue. |
|SPFVertex *||Find (const Ipv4Address addr) const|
|Searches the Candidate Queue for a Shortest Path First Vertex pointer that points to a vertex having the given IP address. |
|Reorders the Candidate Queue according to the priority scheme. |
Private Member Functions
|CandidateQueue (CandidateQueue &sr)|
|CandidateQueue &||operator= (CandidateQueue &sr)|
The CandidateQueue is used in the OSPF shortest path computations. It is a priority queue used to store candidates for the shortest path to a given network.
The queue holds Shortest Path First Vertex pointers and orders them according to the lowest value of the field m_distanceFromRoot. Remaining vertices are ordered according to increasing distance. This implements a priority queue.
Although a STL priority_queue almost does what we want, the requirement for a Find () operation, the dynamic nature of the data and the derived requirement for a Reorder () operation led us to implement this simple enhanced priority queue.
Candidate Queue copy construction is disallowed (not implemented) to prevent the compiler from slipping in incorrect versions that don't properly deal with deep copies.
Candidate Queue assignment operator is disallowed (not implemented) to prevent the compiler from slipping in incorrect versions that don't properly deal with deep copies.