From: Anthony Geay Date: Wed, 26 Jun 2024 06:30:27 +0000 (+0200) Subject: [EDF30382] : ease access remotely to list of ressources X-Git-Tag: V9_13_0b1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=883764df0a7109c45cc1c1319484f25fa7beb408;p=modules%2Fkernel.git [EDF30382] : ease access remotely to list of ressources --- diff --git a/idl/SALOME_ResourcesManager.idl b/idl/SALOME_ResourcesManager.idl index fc9693621..e6f0b81f9 100644 --- a/idl/SALOME_ResourcesManager.idl +++ b/idl/SALOME_ResourcesManager.idl @@ -198,6 +198,8 @@ interface ResourcesManager void ListAllAvailableResources(out ResourceList machines, out IntegerList nbProcsOfMachines) raises (SALOME::SALOME_Exception); ResourceList ListAllResourcesInCatalog() raises (SALOME::SALOME_Exception); + + ResourceList ListAllResourceEntriesInCatalog() raises (SALOME::SALOME_Exception); }; }; diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 7c20fc425..2299a7aa7 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -146,7 +146,7 @@ void SALOME_ResourcesManager::Shutdown() * Return list of resources available (regarding content of CatalogResources.xml) but select only those with canRunContainers attribute set to true. * And for each resource the number of proc available of it. * - * \sa SALOME_ResourcesManager::ListAllResourcesInCatalog + * \sa SALOME_ResourcesManager::ListAllResourcesInCatalog, SALOME_ResourcesManager::ListAllResourceEntriesInCatalog */ void SALOME_ResourcesManager::ListAllAvailableResources(Engines::ResourceList_out machines, Engines::IntegerList_out nbProcsOfMachines) { @@ -176,7 +176,7 @@ void SALOME_ResourcesManager::ListAllAvailableResources(Engines::ResourceList_ou /*! * Return list of resources available (regarding content of CatalogResources.xml) whatever canRunContainers attribute value. * - * \sa SALOME_ResourcesManager::ListAllAvailableResources + * \sa SALOME_ResourcesManager::ListAllAvailableResources, SALOME_ResourcesManager::ListAllResourceEntriesInCatalog */ Engines::ResourceList *SALOME_ResourcesManager::ListAllResourcesInCatalog() { @@ -192,6 +192,23 @@ Engines::ResourceList *SALOME_ResourcesManager::ListAllResourcesInCatalog() return ret; } +/*! + * Return list of resources entries available. Useful to scan remotely the content of the playground + */ +Engines::ResourceList *SALOME_ResourcesManager::ListAllResourceEntriesInCatalog() +{ + const MapOfParserResourcesType& zeList(_rm->GetList()); + auto sz = zeList.size(); + Engines::ResourceList *ret(new Engines::ResourceList); + ret->length( sz ); + CORBA::ULong i(0); + for(auto it : zeList) + { + (*ret)[i++] = CORBA::string_dup( it.first.c_str() ); + } + return ret; +} + //============================================================================= //! get the name of resources fitting the specified constraints (params) /*! diff --git a/src/ResourcesManager/SALOME_ResourcesManager.hxx b/src/ResourcesManager/SALOME_ResourcesManager.hxx index ae7ea6595..3ef01a9f1 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.hxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.hxx @@ -76,6 +76,9 @@ class SALOMERESOURCESMANAGER_EXPORT SALOME_ResourcesManager: void ListAllAvailableResources(Engines::ResourceList_out machines, Engines::IntegerList_out nbProcsOfMachines); Engines::ResourceList *ListAllResourcesInCatalog(); + + Engines::ResourceList *ListAllResourceEntriesInCatalog() override; + // Cpp Methods void Shutdown(); std::shared_ptr& GetImpl() { return _rm; }