Non-default constructor for SPFVertex

This commit is contained in:
Tom Henderson
2007-07-11 22:54:47 -07:00
parent 33a0cc3759
commit e0399adca9
2 changed files with 12 additions and 7 deletions

View File

@@ -36,9 +36,17 @@ SPFVertex::SPFVertex () :
{
}
SPFVertex::SPFVertex (StaticRouterLSA* lsa) :
m_vertexType(VertexRouter),
m_vertexId(lsa->m_linkStateId),
m_lsa(lsa),
m_distanceFromRoot(SPF_INFINITY)
{
}
SPFVertex::~SPFVertex ()
{
delete m_lsa;
}
void
@@ -320,12 +328,8 @@ StaticRouteManager::SPFCalculate(Ipv4Address root)
// Initialize the shortest-path tree to only the router doing the
// calculation.
//
v= new SPFVertex();
v->m_vertexType = SPFVertex::VertexRouter;
v->m_vertexId = root;
v-> m_lsa = m_lsdb->GetLSA(root);
// Set LSA position to LSA_SPF_IN_SPFTREE. This vertex is the root of the
// spanning tree.
v= new SPFVertex(m_lsdb->GetLSA(root));
// This vertex is the root of the SPF tree
v->m_distanceFromRoot = 0;
for (;;)

View File

@@ -40,6 +40,7 @@ class SPFVertex
{
public:
SPFVertex();
SPFVertex(StaticRouterLSA*);
~SPFVertex();
void Initialize ();