X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5410c0dedd6e07e55c0a74a0664d1f8a73d69c1e..0236bbc683363a58fdef428ce7de140909de5db1:/src/surf/network_interface.cpp diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index 14bd060176..a6b79372c6 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -194,7 +194,8 @@ double NetworkModel::shareResourcesFull(double now) ************/ Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props) -: Resource(model, name, props) +: Resource(model, name), + p_properties(props) { links->insert({name, this}); @@ -205,7 +206,8 @@ Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t prop lmm_constraint_t constraint, tmgr_history_t history, tmgr_trace_t state_trace) -: Resource(model, name, props, constraint) +: Resource(model, name, constraint), + p_properties(props) { if (state_trace) p_stateEvent = tmgr_history_add_trace(history, state_trace, 0.0, 0, this); @@ -218,6 +220,7 @@ 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() @@ -246,6 +249,13 @@ 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 * **********/