Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #45 from mpoquet/master
[simgrid.git] / src / include / surf / surf.h
index cf58fce..e9ead8a 100644 (file)
@@ -303,17 +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);
-
-static XBT_INLINE e_surf_resource_state_t surf_host_get_state(surf_host_t host) {
-       return surf_resource_get_state((surf_cpp_resource_t)host);
-}
-
+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 */