Before
e22da6010c6499813ff88c76041cf499ffbf2b67 the list of models
could be accessed using the global `all_existing_models`
This patch exposes two methods to get the list of models in the
s4u::Engine, they wrap those of `EngineImpl`.
*/
void add_model(simgrid::kernel::resource::Model::Type type, std::shared_ptr<simgrid::kernel::resource::Model> model);
+ /** @brief Get list of models created for a resource type */
+ const std::vector<simgrid::kernel::resource::Model*>& get_model_list(simgrid::kernel::resource::Model::Type type);
+
+ /** @brief Get list of all models managed by this engine */
+ const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& get_all_models();
+
/** @brief Retrieves all netzones of the type indicated by the template argument */
template <class T> std::vector<T*> get_filtered_netzones() const
{
{
simgrid::kernel::actor::simcall([this, type, &model] { pimpl->add_model(type, std::move(model)); });
}
+
+/** @brief Get list of models created for a resource type */
+const std::vector<simgrid::kernel::resource::Model*>& Engine::get_model_list(simgrid::kernel::resource::Model::Type type)
+{
+ return pimpl->get_model_list(type);
+}
+
+const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& Engine::get_all_models()
+{
+ return pimpl->get_all_models();
+}
+
/**
* Creates a new platform, including hosts, links, and the routing table.
*