src/routing/olsr/olsr-state.cc
changeset 3970 8658841e4782
parent 2916 5d4ff983595b
child 5509 33d52e78605a
--- a/src/routing/olsr/olsr-state.cc	Tue Dec 02 07:42:33 2008 -0800
+++ b/src/routing/olsr/olsr-state.cc	Tue Dec 02 18:42:24 2008 +0000
@@ -83,6 +83,25 @@
   m_mprSelectorSet.push_back (tuple);
 }
 
+std::string
+OlsrState::PrintMprSelectorSet () const
+{
+  std::ostringstream os;
+  os << "[";
+  for (MprSelectorSet::const_iterator iter = m_mprSelectorSet.begin ();
+       iter != m_mprSelectorSet.end (); iter++)
+    {
+      MprSelectorSet::const_iterator next = iter;
+      next++;
+      os << iter->mainAddr;
+      if (next != m_mprSelectorSet.end ())
+        os << ", ";
+    }
+  os << "]";
+  return os.str ();
+}
+  
+
 /********** Neighbor Set Manipulation **********/
 
 NeighborTuple*
@@ -130,7 +149,6 @@
       if (*it == tuple)
         {
           m_neighborSet.erase (it);
-          m_modified = true;
           break;
         }
     }
@@ -145,7 +163,6 @@
       if (it->neighborMainAddr == mainAddr)
         {
           it = m_neighborSet.erase (it);
-          m_modified = true;
           break;
         }
     }
@@ -161,7 +178,6 @@
         {
           // Update it
           *it = tuple;
-          m_modified = true;
           return;
         }
     }
@@ -195,7 +211,6 @@
       if (*it == tuple)
         {
           m_twoHopNeighborSet.erase(it);
-          m_modified = true;
           break;
         }
     }
@@ -212,7 +227,6 @@
           && it->twoHopNeighborAddr == twoHopNeighborAddr)
         {
           it = m_twoHopNeighborSet.erase (it);
-          m_modified = true;
         }
       else
         {
@@ -230,7 +244,6 @@
       if (it->neighborMainAddr == neighborMainAddr)
         {
           it = m_twoHopNeighborSet.erase (it);
-          m_modified = true;
         }
       else
         {
@@ -243,7 +256,6 @@
 OlsrState::InsertTwoHopNeighborTuple (TwoHopNeighborTuple const &tuple)
 {
   m_twoHopNeighborSet.push_back (tuple);
-  m_modified = true;
 }
 
 /********** MPR Set Manipulation **********/
@@ -335,7 +347,6 @@
       if (*it == tuple)
         {
           m_linkSet.erase (it);
-          m_modified = true;
           break;
         }
     }
@@ -345,7 +356,6 @@
 OlsrState::InsertLinkTuple (LinkTuple const &tuple)
 {
   m_linkSet.push_back (tuple);
-  m_modified = true;
   return m_linkSet.back ();
 }
 
@@ -385,7 +395,6 @@
       if (*it == tuple)
         {
           m_topologySet.erase (it);
-          m_modified = true;
           break;
         }
     }
@@ -400,7 +409,6 @@
       if (it->lastAddr == lastAddr && it->sequenceNumber < ansn)
         {
           it = m_topologySet.erase (it);
-          m_modified = true;
         }
       else
         {
@@ -413,7 +421,6 @@
 OlsrState::InsertTopologyTuple (TopologyTuple const &tuple)
 {
   m_topologySet.push_back (tuple);
-  m_modified = true;
 }
 
 /********** Interface Association Set Manipulation **********/
@@ -451,7 +458,6 @@
       if (*it == tuple)
         {
           m_ifaceAssocSet.erase (it);
-          m_modified = true;
           break;
         }
     }
@@ -461,7 +467,6 @@
 OlsrState::InsertIfaceAssocTuple (const IfaceAssocTuple &tuple)
 {
   m_ifaceAssocSet.push_back (tuple);
-  m_modified = true;
 }
 
 std::vector<Ipv4Address>