#ifndef NETWORK_INTERFACE_CPP_
#define NETWORK_INTERFACE_CPP_
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
- "Logging specific to the SURF network module");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf, "Logging specific to the SURF network module");
/*********
* C API *
boost::unordered_map<std::string,Link *> *Link::links = new boost::unordered_map<std::string,Link *>();
Link *Link::byName(const char* name) {
- Link * res = NULL;
- try {
- res = links->at(name);
- } catch (std::out_of_range& e) {}
-
- return res;
+ if (links->find(name) == links->end())
+ return NULL;
+ return links->at(name);
}
/** @brief Returns the amount of links in the platform */
int Link::linksCount() {
ActionList *runningActions = surf_network_model->getRunningActionSet();
double minRes;
- minRes = shareResourcesMaxMin(runningActions, surf_network_model->p_maxminSystem, surf_network_model->f_networkSolve);
+ minRes = shareResourcesMaxMin(runningActions, surf_network_model->maxminSystem_, surf_network_model->f_networkSolve);
for(ActionList::iterator it(runningActions->begin()), itend(runningActions->end())
; it != itend ; ++it) {