X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/073f8bce5afb1febdc3580607be8819b90705280..e33bfee8391fbf3a1a0b4cd5cd33f14a291c8052:/src/simdag/sd_workstation.c diff --git a/src/simdag/sd_workstation.c b/src/simdag/sd_workstation.c index eb42434df8..af29f84ff4 100644 --- a/src/simdag/sd_workstation.c +++ b/src/simdag/sd_workstation.c @@ -126,9 +126,38 @@ void SD_workstation_set_data(SD_workstation_t workstation, void *data) { const char* SD_workstation_get_name(SD_workstation_t workstation) { SD_CHECK_INIT_DONE(); xbt_assert0(workstation != NULL, "Invalid parameter"); - return surf_workstation_model->common_public->get_model_name(workstation->surf_workstation); + return surf_workstation_model->common_public->get_resource_name(workstation->surf_workstation); } +/** + * \brief Returns the value of a given workstation property + * + * \param ws a workstation + * \param name a property name + * \return value of a property (or NULL if property not set) + */ +const char* SD_workstation_get_property_value(SD_workstation_t ws, const char* name) +{ + return xbt_dict_get_or_null(SD_workstation_get_properties(ws), name); +} + + +/** + * \brief Returns a #xbt_dict_t consisting of the list of properties assigned to this workstation + * + * \param workstation a workstation + * \return the dictionary containing the properties associated with the workstation + */ +xbt_dict_t SD_workstation_get_properties(SD_workstation_t workstation) +{ + SD_CHECK_INIT_DONE(); + xbt_assert0((workstation != NULL), "Invalid parameters"); + + return (surf_workstation_model->common_public->get_properties(workstation->surf_workstation)); + +} + + /** * \brief Returns the route between two workstations *