}
communicator::communicator()
- : host((hostdata* )MSG_host_get_data(MSG_host_self()))
+ : host(static_cast<hostdata*>(MSG_host_get_data(MSG_host_self())))
, mutex(xbt_mutex_init())
, cond(xbt_cond_init())
, ctrl_task(NULL)
m_task_t task = received.front();
received.pop();
- msg = (message* )MSG_task_get_data(task);
+ msg = static_cast<message*>(MSG_task_get_data(task));
from = MSG_task_get_source(task);
MSG_task_destroy(task);
int communicator::receiver_wrapper(int, char* [])
{
communicator* comm;
- comm = (communicator* )MSG_process_get_data(MSG_process_self());
+ comm = static_cast<communicator*>(MSG_process_get_data(MSG_process_self()));
int result = comm->receiver();
DEBUG0("terminate");
#include "neighbor.h"
neighbor::neighbor(const char* hostname)
- : host((hostdata* )MSG_host_get_data(MSG_get_host_by_name(hostname)))
+ : host(static_cast<hostdata*>(MSG_host_get_data(MSG_get_host_by_name(hostname))))
, load(std::numeric_limits<double>::infinity())
, debt(0.0)
, to_send(0.0)
close_received = false;
finalizing = false;
+ comp_iter = lb_iter = 0;
+
e_xbt_log_priority_t logp = xbt_log_priority_verbose;
if (!LOG_ISENABLED(logp))
return;
double next_iter_after_date = 0.0;
INFO1("Initial load: %g", real_load);
VERB0("Starting...");
- comp_iter = lb_iter = 0;
while (true) {
if (get_load() > 0.0) {
double now = MSG_get_clock();
void send_all();
// Returns true if there remains neighbors to listen for
- bool may_receive() { return ctrl_close_pending || data_close_pending; }
+ bool may_receive() const {
+ return ctrl_close_pending || data_close_pending;
+ }
// Receive procedure
// Parameter "timeout" may be 0 for non-blocking operation, -1 for