Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Clean surf interface
[simgrid.git] / src / surf / storage_interface.cpp
index f39a118..dd50e5a 100644 (file)
@@ -19,6 +19,7 @@ StorageModelPtr surf_storage_model = NULL;
  *********/
 
 StorageModel::StorageModel() : Model("Storage") {
+  p_storageList = NULL;
 }
 
 StorageModel::~StorageModel(){
@@ -34,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(){
@@ -117,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);
 }
@@ -133,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) {
 }