Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make s_lmm_constraint_t a class with its methods.
[simgrid.git] / src / surf / network_interface.cpp
index f88a72d..66e1e0b 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <algorithm>
 
+#include "maxmin_private.hpp"
 #include "network_interface.hpp"
 #include "simgrid/sg_config.h"
 
@@ -69,7 +70,7 @@ namespace simgrid {
 
     NetworkModel::~NetworkModel()
     {
-      lmm_system_free(maxminSystem_);
+      delete maxminSystem_;
       delete modifiedSet_;
     }
 
@@ -138,7 +139,7 @@ namespace simgrid {
 
     bool LinkImpl::isUsed()
     {
-      return lmm_constraint_used(model()->getMaxminSystem(), constraint());
+      return model()->getMaxminSystem()->constraint_used(constraint());
     }
 
     double LinkImpl::latency()
@@ -153,7 +154,7 @@ namespace simgrid {
 
     int LinkImpl::sharingPolicy()
     {
-      return lmm_constraint_sharing_policy(constraint());
+      return constraint()->get_sharing_policy();
     }
 
     void LinkImpl::turnOn()
@@ -207,7 +208,7 @@ namespace simgrid {
       for (int i = 0; i < llen; i++) {
         /* Beware of composite actions: ptasks put links and cpus together */
         // extra pb: we cannot dynamic_cast from void*...
-        Resource* resource = static_cast<Resource*>(lmm_constraint_id(lmm_get_cnst_from_var(sys, getVariable(), i)));
+        Resource* resource = static_cast<Resource*>(lmm_get_cnst_from_var(sys, getVariable(), i)->get_id());
         LinkImpl* link     = dynamic_cast<LinkImpl*>(resource);
         if (link != nullptr)
           retlist.push_back(link);