Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Clean surf interface
[simgrid.git] / src / surf / storage_interface.cpp
index b51503c..dd50e5a 100644 (file)
@@ -1,12 +1,8 @@
 #include "storage_interface.hpp"
 #include "surf_private.h"
 
-#define __STDC_FORMAT_MACROS
-
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf,
                                 "Logging specific to the SURF storage module");
-}
 
 xbt_lib_t storage_lib;
 int ROUTING_STORAGE_LEVEL;      //Routing for storagelevel
@@ -23,6 +19,7 @@ StorageModelPtr surf_storage_model = NULL;
  *********/
 
 StorageModel::StorageModel() : Model("Storage") {
+  p_storageList = NULL;
 }
 
 StorageModel::~StorageModel(){
@@ -38,10 +35,11 @@ StorageModel::~StorageModel(){
  ************/
 
 Storage::Storage(const char* type_id, char *content_name, char *content_type, sg_size_t size)
-:  p_content(parseContent(content_name)), p_contentType(content_type),
+:  p_contentType(content_type),
    m_size(size), m_usedSize(0), p_typeId(xbt_strdup(type_id)), p_writeActions(xbt_dynar_new(sizeof(ActionPtr),NULL))
 {
-  p_stateCurrent = SURF_RESOURCE_ON;
+  p_content = parseContent(content_name);
+  m_stateCurrent = SURF_RESOURCE_ON;
 }
 
 Storage::~Storage(){
@@ -121,10 +119,8 @@ sg_size_t Storage::getSize(){
 
 StorageLmm::StorageLmm(lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
             const char* type_id, char *content_name, char *content_type, sg_size_t size)
- :  ResourceLmm(), Storage(type_id, content_name, content_type, size) {
+ :  ResourceLmm(lmm_constraint_new(maxminSystem, this, bconnection)), Storage(type_id, content_name, content_type, size) {
   XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%llu'", bconnection, bread, bwrite, size);
-
-  p_constraint = lmm_constraint_new(maxminSystem, this, bconnection);
   p_constraintRead  = lmm_constraint_new(maxminSystem, this, bread);
   p_constraintWrite = lmm_constraint_new(maxminSystem, this, bwrite);
 }
@@ -137,7 +133,7 @@ StorageAction::StorageAction(StoragePtr storage, e_surf_action_storage_type_t ty
 {
 };
 
-StorageActionLmm::StorageActionLmm(StorageLmmPtr storage, e_surf_action_storage_type_t type)
-  : StorageAction(storage, type) {
+StorageActionLmm::StorageActionLmm(StorageLmmPtr storage, e_surf_action_storage_type_t type, lmm_variable_t var)
+  : StorageAction(storage, type), ActionLmm(var) {
 }