]> AND Private Git Repository - loba.git/blobdiff - process.h
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Wip++...
[loba.git] / process.h
index a49c6efcd41e376189683c7761126db8abe0d859..58024265d8b0ac06fb43755966f0eaff02d814f2 100644 (file)
--- a/process.h
+++ b/process.h
@@ -1,8 +1,17 @@
 #ifndef PROCESS_H
 #define PROCESS_H
 
-#include <map>
+#define USE_UNORDERED_MAP 1
+//#undef USE_UNORDERED_MAP
+
 #include <vector>
+#ifdef USE_UNORDERED_MAP
+#  include <tr1/unordered_map>
+#  define MAP_TEMPLATE std::tr1::unordered_map
+#else
+#  include <map>
+#  define MAP_TEMPLATE std::map
+#endif
 #include <msg/msg.h>
 #include "communicator.h"
 #include "neighbor.h"
 class process {
 public:
     process(int argc, char* argv[]);
-    ~process() { };
+    ~process();
     int run();
 
 private:
     std::vector<neighbor> neigh;
-    std::map<m_host_t, neighbor*> rev_neigh;
+    MAP_TEMPLATE<m_host_t, neighbor*> rev_neigh;
+    std::vector<neighbor*> pneigh;
 
     communicator comm;
     int ctrl_close_pending;