X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b7630a950a6b865fcc195c58e39e6c3cfa550ccb..33e5b0ceeb953cc2fbdb7b7ffa3e9f9325629292:/src/include/surf/surf.h diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 6d3265fec3..c5f4f048e9 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -303,12 +303,19 @@ XBT_PUBLIC(xbt_dict_t) sg_host_get_properties(sg_host_t host); /** @brief Get the state of a surf resource (cpu, host, network, …) */ -XBT_PUBLIC(e_surf_resource_state_t) surf_resource_get_state(surf_cpp_resource_t resource); +XBT_PUBLIC(int) surf_resource_is_on(surf_cpp_resource_t resource); +/** @brief Get the state of a surf resource (cpu, host, network, …) */ +XBT_PUBLIC(int) surf_resource_is_off(surf_cpp_resource_t resource); /** @brief Set the state of a surf resource (cpu, host, network, …) */ -XBT_PUBLIC(void) surf_resource_set_state(surf_cpp_resource_t resource, e_surf_resource_state_t state); -static inline void surf_host_set_state(surf_host_t host, e_surf_resource_state_t state) { - surf_resource_set_state((surf_cpp_resource_t)host, state); +XBT_PUBLIC(void) surf_resource_turn_on(surf_cpp_resource_t resource); +/** @brief Set the state of a surf resource (cpu, host, network, …) */ +XBT_PUBLIC(void) surf_resource_turn_off(surf_cpp_resource_t resource); +static inline void surf_host_turn_on(surf_host_t host) { + surf_resource_turn_on((surf_cpp_resource_t)host); +} +static inline void surf_host_turn_off(surf_host_t host) { + surf_resource_turn_off((surf_cpp_resource_t)host); } /** @brief Get the available speed of cpu associated to a host */ @@ -608,13 +615,6 @@ XBT_PUBLIC(void*) surf_action_get_data(surf_action_t action); */ XBT_PUBLIC(void) surf_action_set_data(surf_action_t action, void *data); -/** - * @brief Unreference an action - * - * @param action The surf action - */ -XBT_PUBLIC(void) surf_action_unref(surf_action_t action); - /** * @brief Get the start time of an action *