Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
These defines are useless.
[simgrid.git] / src / surf / surf.hpp
index 2afb2ce..8f4d918 100644 (file)
@@ -6,11 +6,9 @@
 #include <xbt.h>
 #include <string>
 #include <vector>
+#include <iostream>
 #include <memory>
-#include <boost/smart_ptr.hpp>
 #include <boost/function.hpp>
-#include <boost/functional/factory.hpp>
-#include <boost/bind.hpp>
 #include "surf/trace_mgr.h"
 #include "xbt/lib.h"
 #include "surf/surf_routing.h"
@@ -169,7 +167,10 @@ class Resource {
 public:
   Resource();
   Resource(ModelPtr model, const char *name, xbt_dict_t properties);
-  virtual ~Resource() {};
+  virtual ~Resource() {
+       xbt_free((void*)m_name);
+    xbt_dict_free(&m_properties);
+  };
 
   virtual void updateState(tmgr_trace_event_t event_type, double value, double date)=0;
 
@@ -204,15 +205,18 @@ private:
 
 class ResourceLmm: virtual public Resource {
 public:
-  ResourceLmm() {};
-  ResourceLmm(surf_model_t model, const char *name, xbt_dict_t props,
-                           lmm_system_t system,
-                           double constraint_value,
-                           tmgr_history_t history,
-                           e_surf_resource_state_t state_init,
-                           tmgr_trace_t state_trace,
-                           double metric_peak,
-                           tmgr_trace_t metric_trace);
+  ResourceLmm() : p_constraint(NULL) {
+       p_power.event = NULL;
+  };
+  ResourceLmm(lmm_system_t system,
+              double constraint_value,
+              tmgr_history_t history,
+              e_surf_resource_state_t state_init,
+              tmgr_trace_t state_trace,
+              double metric_peak,
+              tmgr_trace_t metric_trace);
+  ~ResourceLmm() {
+  };
   lmm_constraint_t p_constraint;
   tmgr_trace_event_t p_stateEvent;
   s_surf_metric_t p_power;
@@ -274,7 +278,6 @@ protected:
   int    m_refcount;
 #ifdef HAVE_TRACING
 #endif
-  e_UM_t p_updateMechanism;
 
 private:
   int resourceUsed(void *resource_id);
@@ -299,10 +302,14 @@ public:
   ActionLmm() : m_suspended(false) {
        p_actionListHookup.prev = 0;
        p_actionListHookup.next = 0;
+        m_lastUpdate = 0;
+        m_lastValue = 0;
   };
-  ActionLmm(ModelPtr model, double cost, bool failed) : m_suspended(false) {
+  ActionLmm(ModelPtr /*model*/, double /*cost*/, bool /*failed*/) : m_suspended(false) {
        p_actionListHookup.prev = 0;
        p_actionListHookup.next = 0;
+        m_lastUpdate = 0;
+        m_lastValue = 0;
   };
 
   virtual void updateRemainingLazy(double now);