XBT_PUBLIC(int) sg_host_get_nb_pstates(sg_host_t host);
XBT_PUBLIC(int) sg_host_get_pstate(sg_host_t host);
XBT_PUBLIC(void) sg_host_set_pstate(sg_host_t host,int pstate);
+XBT_PUBLIC(xbt_dict_t) sg_host_get_properties(sg_host_t host);
SG_END_DECL()
return surf_resource_name((surf_cpp_resource_t)cpu);
}
-/** @brief Get the properties of an host */
-XBT_PUBLIC(xbt_dict_t) sg_host_get_properties(sg_host_t host);
-
/** @brief Get the available speed of cpu associated to a host */
XBT_PUBLIC(double) surf_host_get_available_speed(sg_host_t host);
host->setPState(pstate);
}
+/** @brief Get the properties of an host */
+xbt_dict_t sg_host_get_properties(sg_host_t host) {
+ return host->getProperties();
+}
+
+
namespace simgrid {
Host::Host(std::string const& id)
/** Get the properties assigned to a host */
xbt_dict_t Host::getProperties()
{
- return simgrid::simix::kernel(std::bind(sg_host_get_properties, this));
+ return simgrid::simix::kernel(std::bind(&simgrid::surf::Host::getProperties, this->extension(simgrid::surf::Host::EXTENSION_ID)));
}
/** Get the processes attached to the host */
return host->pimpl_cpu->sleep(duration);
}
-xbt_dict_t sg_host_get_properties(sg_host_t host) {
- return get_casted_host(host)->getProperties();
-}
double surf_host_get_available_speed(sg_host_t host){
return host->pimpl_cpu->getAvailableSpeed();