A Candidate Queue used in static routing. More...
#include <candidate-queue.h>
Public Member Functions | |
| CandidateQueue () | |
| Create an empty SPF Candidate Queue. | |
| void | Clear (void) |
| 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. | |
| void | Reorder (void) |
| Reorders the Candidate Queue according to the priority scheme. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const CandidateQueue &q) |
A Candidate Queue used in static routing.
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.
1.7.1