do not use templates.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 24 Mar 2008 11:28:42 -0700
changeset 2702 6800982bef15
parent 2701 11e0e961ac86
child 2703 7c3bc29d8514
child 2704 183585d224b4
do not use templates.
src/helper/olsr-helper.cc
src/helper/olsr-helper.h
--- a/src/helper/olsr-helper.cc	Mon Mar 24 11:14:05 2008 -0700
+++ b/src/helper/olsr-helper.cc	Mon Mar 24 11:28:42 2008 -0700
@@ -34,7 +34,11 @@
 void 
 OlsrHelper::Enable (NodeContainer container)
 {
-  Enable (container.Begin (), container.End ());
+  for (NodeContainer::Iterator i = container.Begin (); i != container.End (); ++i)
+    {
+      Ptr<Node> node = *i;
+      Enable (node);
+    }
 }
 void 
 OlsrHelper::Enable (Ptr<Node> node)
@@ -47,7 +51,7 @@
 void 
 OlsrHelper::EnableAll (void)
 {
-  Enable (NodeList::Begin (), NodeList::End ());
+  Enable (NodeContainer::GetGlobal ());
 }
 
 } // namespace ns3
--- a/src/helper/olsr-helper.h	Mon Mar 24 11:14:05 2008 -0700
+++ b/src/helper/olsr-helper.h	Mon Mar 24 11:28:42 2008 -0700
@@ -22,8 +22,6 @@
 		 std::string n6 = "", Attribute v6 = Attribute (),
 		 std::string n7 = "", Attribute v7 = Attribute ());
 
-  template <typename InputIterator>
-  void Enable (InputIterator begin, InputIterator end);
   void Enable (NodeContainer container);
   void Enable (Ptr<Node> node);
   void EnableAll (void);
@@ -33,20 +31,4 @@
 
 } // namespace ns3
 
-namespace ns3 {
-
-template <typename T>
-void 
-OlsrHelper::Enable (T begin, T end)
-{
-  for (T i = begin; i != end; i++)
-    {
-      Ptr<Object> obj = (*i);
-      Ptr<Node> node = obj->GetObject<Node> ();
-      Enable (node);
-    }
-}
-
-} // namespace ns3
-
 #endif /* OLSR_HELPER_H */