commit c55bacf1c9c6e97d954d9b63bcab1c1139721e7d
parent 724387f01fd1145b77d18c9e912a415a9364d038
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 27 Feb 2019 09:49:52 +0100
Add the sdis_estimator_get_path accessor
Diffstat:
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/src/sdis.h b/src/sdis.h
@@ -733,6 +733,12 @@ sdis_estimator_get_paths_count
size_t* npaths);
SDIS_API res_T
+sdis_estimator_get_path
+ (const struct sdis_estimator* estimator,
+ const size_t ipath,
+ const struct sdis_heat_path** path);
+
+SDIS_API res_T
sdis_estimator_for_each_path
(const struct sdis_estimator* estimator,
sdis_process_heat_path_T func,
diff --git a/src/sdis_estimator.c b/src/sdis_estimator.c
@@ -133,6 +133,19 @@ sdis_estimator_get_paths_count
return RES_OK;
}
+SDIS_API res_T
+sdis_estimator_get_path
+ (const struct sdis_estimator* estimator,
+ const size_t ipath,
+ const struct sdis_heat_path** path)
+{
+ if(!estimator || !path
+ || ipath >= darray_heat_path_size_get(&estimator->paths))
+ return RES_BAD_ARG;
+ *path = darray_heat_path_cdata_get(&estimator->paths) + ipath;
+ return RES_OK;
+}
+
res_T
sdis_estimator_for_each_path
(const struct sdis_estimator* estimator,