SPFVertex constructor
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
#include "ns3/assert.h"
|
||||
#include "ns3/fatal-error.h"
|
||||
#include "ns3/debug.h"
|
||||
@@ -26,6 +27,15 @@ NS_DEBUG_COMPONENT_DEFINE ("StaticRouteManager");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
SPFVertex::SPFVertex () :
|
||||
m_vertexType(VertexUnknown),
|
||||
m_vertexId("255.255.255.255"),
|
||||
m_lsa(0),
|
||||
m_distanceFromRoot(SPF_INFINITY),
|
||||
m_stat(false)
|
||||
{
|
||||
}
|
||||
|
||||
SPFVertex::~SPFVertex ()
|
||||
{
|
||||
delete m_lsa;
|
||||
@@ -191,6 +201,9 @@ void
|
||||
StaticRouteManager::SPFCalculate(Ipv4Address root)
|
||||
{
|
||||
NS_DEBUG("StaticRouteManager::SPFCalculate ()");
|
||||
// Make a priority queue of int using a vector container
|
||||
// priority_queue<int, vector<int>, less<int> > pq;
|
||||
//priority_queue<SPFVertex*, vector<SPFVertex*>, less<int> > candidate;
|
||||
/*
|
||||
* struct pqueue* candidate;
|
||||
* struct vertex* v;
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
const uint32_t SPF_INFINITY = 0xffffffff;
|
||||
|
||||
/**
|
||||
* \brief Vertex used in shortest path first (SPF) computations
|
||||
*
|
||||
@@ -34,10 +36,12 @@ namespace ns3 {
|
||||
class SPFVertex
|
||||
{
|
||||
public:
|
||||
SPFVertex();
|
||||
~SPFVertex();
|
||||
|
||||
enum VertexType {
|
||||
VertexRouter = 1,
|
||||
VertexUnknown = 0,
|
||||
VertexRouter,
|
||||
VertexNetwork
|
||||
} m_vertexType;
|
||||
|
||||
@@ -51,6 +55,8 @@ public:
|
||||
type_listOfSPFVertex::iterator m_iter;
|
||||
|
||||
uint32_t m_distanceFromRoot;
|
||||
|
||||
bool m_stat; // true if LSA is in SPF tree already
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user