9#ifndef CANDIDATE_QUEUE_H
10#define CANDIDATE_QUEUE_H
14#include "ns3/ipv4-address.h"
15#include "ns3/ipv6-address.h"
55 static_assert(std::is_same_v<T, Ipv4Manager> || std::is_same_v<T, Ipv6Manager>,
56 "T must be either Ipv4Manager or Ipv6Manager when calling CandidateQueue");
59 static constexpr bool IsIpv4 = std::is_same_v<Ipv4Manager, T>;
62 using IpManager =
typename std::conditional_t<IsIpv4, Ipv4Manager, Ipv6Manager>;
65 using Ip =
typename std::conditional_t<IsIpv4, Ipv4, Ipv6>;
68 using IpAddress =
typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address>;
202 friend std::ostream& operator<< <T>(std::ostream& os,
const CandidateQueue&
q);
A Candidate Queue used in routing calculations.
void Push(SPFVertex< T > *vNew)
Push a Shortest Path First Vertex pointer onto the queue according to the priority scheme.
typename std::conditional_t< IsIpv4, Ipv4, Ipv6 > Ip
Alias for Ipv4 and Ipv6 classes.
CandidateList_t m_candidates
SPFVertex candidates.
SPFVertex< T > * Top() const
Return the Shortest Path First Vertex pointer at the top of the queue.
SPFVertex< T > * Find(const IpAddress addr) const
Searches the Candidate Queue for a Shortest Path First Vertex pointer that points to a vertex having ...
CandidateQueue()
Create an empty SPF Candidate Queue.
bool Empty() const
Test the Candidate Queue to determine if it is empty.
virtual ~CandidateQueue()
Destroy an SPF Candidate Queue and release any resources held by the contents.
SPFVertex< T > * Pop()
Pop the Shortest Path First Vertex pointer at the top of the queue.
typename std::conditional_t< IsIpv4, Ipv4Address, Ipv6Address > IpAddress
Alias for Ipv4Address and Ipv6Address classes.
uint32_t Size() const
Return the number of Shortest Path First Vertex pointers presently stored in the Candidate Queue.
static constexpr bool IsIpv4
Alias for determining whether the parent is Ipv4RoutingProtocol or Ipv6RoutingProtocol.
CandidateQueue(const CandidateQueue &)=delete
void Clear()
Empty the Candidate Queue and release all of the resources associated with the Shortest Path First Ve...
CandidateQueue & operator=(const CandidateQueue &)=delete
void Reorder()
Reorders the Candidate Queue according to the priority scheme.
typename std::conditional_t< IsIpv4, Ipv4Manager, Ipv6Manager > IpManager
Alias for Ipv4Manager and Ipv6Manager classes.
std::list< SPFVertex< T > * > CandidateList_t
container of SPFVertex pointers
static bool CompareSPFVertex(const SPFVertex< T > *v1, const SPFVertex< T > *v2)
return true if v1 < v2
Vertex used in shortest path first (SPF) computations.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)