Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
std::unordered_map are sufficient, no need for boost here
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 2 Oct 2016 11:04:39 +0000 (13:04 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 2 Oct 2016 11:05:16 +0000 (13:05 +0200)
+ cosmetics in Floyd

src/kernel/routing/AsFloyd.cpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp

index 07d2c6c..f92328c 100644 (file)
@@ -3,6 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <limits>
+
 #include "xbt/log.h"
 #include "src/kernel/routing/AsFloyd.hpp"
 #include "src/surf/network_interface.hpp"
@@ -26,9 +28,9 @@ AsFloyd::AsFloyd(const char*name)
 }
 
 AsFloyd::~AsFloyd(){
-  int table_size = static_cast<int>(vertices_.size());
   if (linkTable_ == nullptr) // Dealing with a parse error in the file?
     return;
+  int table_size = vertices_.size();
   /* Delete link_table */
   for (int i = 0; i < table_size; i++)
     for (int j = 0; j < table_size; j++)
index 86ebe14..6a0a74a 100644 (file)
@@ -61,7 +61,7 @@ extern "C" {
 namespace simgrid {
   namespace surf {
 
-    boost::unordered_map<std::string,Link *> *Link::links = new boost::unordered_map<std::string,Link *>();
+    std::unordered_map<std::string,Link *> *Link::links = new std::unordered_map<std::string,Link *>();
     Link *Link::byName(const char* name) {
       if (links->find(name) == links->end())
         return nullptr;
index fdf56e4..4c71d84 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <xbt/base.h>
 
-#include <boost/unordered_map.hpp>
+#include <unordered_map>
 
 #include "xbt/fifo.h"
 #include "xbt/dict.h"
@@ -203,9 +203,9 @@ namespace simgrid {
         private:
       void *userData = nullptr;
 
-      /* List of all links */
+      /* List of all links. FIXME: should move to the Engine */
         private:
-      static boost::unordered_map<std::string, Link *> *links;
+      static std::unordered_map<std::string, Link *> *links;
         public:
       static Link *byName(const char* name);
       static int linksCount();