The callbacks were called in the Host constructor which is at the very
beginning og the object construction: the fields of the derived
classes are not initialized at this point and the correct virtual
methods are not available.
(xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
sg_host_edge(sg_host),
sg_host_surfcpu(sg_host));
(xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
sg_host_edge(sg_host),
sg_host_surfcpu(sg_host));
+ surf_callback_emit(hostCreatedCallbacks, host);
XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->p_storage));
xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, host);
return host;
XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->p_storage));
xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, host);
return host;
, p_storage(storage), p_netElm(netElm), p_cpu(cpu)
{
p_params.ramsize = 0;
, p_storage(storage), p_netElm(netElm), p_cpu(cpu)
{
p_params.ramsize = 0;
- surf_callback_emit(hostCreatedCallbacks, this);
}
Host::Host(Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint,
}
Host::Host(Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint,
, p_storage(storage), p_netElm(netElm), p_cpu(cpu)
{
p_params.ramsize = 0;
, p_storage(storage), p_netElm(netElm), p_cpu(cpu)
{
p_params.ramsize = 0;
- surf_callback_emit(hostCreatedCallbacks, this);
wk = new HostL07(this, name, NULL,
sg_host_edge(sg_host),
sg_host_surfcpu(sg_host));
wk = new HostL07(this, name, NULL,
sg_host_edge(sg_host),
sg_host_surfcpu(sg_host));
+ surf_callback_emit(hostCreatedCallbacks, wk);
xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, wk);
return wk;
xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, wk);
return wk;