Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] new (abstract) class: PropertyHolder, with only one purpose
[simgrid.git] / src / surf / network_interface.cpp
index a6b7937..5ae5679 100644 (file)
@@ -195,7 +195,7 @@ double NetworkModel::shareResourcesFull(double now)
 
 Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props)
 : Resource(model, name),
-  p_properties(props)
+  PropertyHolder(props)
 {
   links->insert({name, this});
 
@@ -207,7 +207,7 @@ Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t prop
                             tmgr_history_t history,
                             tmgr_trace_t state_trace)
 : Resource(model, name, constraint),
-  p_properties(props)
+  PropertyHolder(props)
 {
   if (state_trace)
     p_stateEvent = tmgr_history_add_trace(history, state_trace, 0.0, 0, this);
@@ -220,7 +220,6 @@ Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t prop
 Link::~Link()
 {
   surf_callback_emit(networkLinkDestructedCallbacks, this);
-  xbt_dict_free(&p_properties);
 }
 
 bool Link::isUsed()
@@ -249,13 +248,6 @@ void Link::setState(e_surf_resource_state_t state){
   surf_callback_emit(networkLinkStateChangedCallbacks, this, old, state);
 }
 
-xbt_dict_t Link::getProperties()
-{
-       if (p_properties==NULL)
-               p_properties = xbt_dict_new();
-       return p_properties;
-}
-
 /**********
  * Action *
  **********/