-#include <xbt/sysdep.h>
#include "neighbor.h"
+#include <limits>
+#include <msg/msg.h>
+
neighbor::neighbor(const char* hostname)
+ : host((hostdata* )MSG_host_get_data(MSG_get_host_by_name(hostname)))
+ , load(std::numeric_limits<double>::infinity())
+ , debt(0.0)
+ , to_send(0.0)
{
- load = std::numeric_limits<double>::infinity();
- debt = 0.0;
- name = xbt_strdup(hostname);
- ctrl_mbox = bprintf("%s_ctrl", hostname);
- data_mbox = bprintf("%s_data", hostname);
}
neighbor::~neighbor()
{
- free(data_mbox);
- free(ctrl_mbox);
- free(name);
}