*/
void AddResource(in ResourceDefinition new_resource, in boolean write, in string xml_file)
raises (SALOME::SALOME_Exception);
+
+ //! Remove a new resource to the resource_manager
+ /*!
+ write -> true, resource manager will write a new xml_file
+ xml_file -> could be empty, in this case if write is true, resource manager will write
+ the resource in its first ResourceCatalog file
+ */
+ void RemoveResource(in string resource_name, in boolean write, in string xml_file)
+ raises (SALOME::SALOME_Exception);
};
void ResourcesManager_cpp::DeleteResourceInCatalog(const char * name)
{
- _resourcesList.erase(name);
+ MapOfParserResourcesType_it it = _resourcesList.find(name);
+ if (it != _resourcesList.end())
+ _resourcesList.erase(name);
+ else
+ RES_INFOS("You try to delete a resource that does not exist... : " << name);
}
//=============================================================================
}
}
+void
+SALOME_ResourcesManager::RemoveResource(const char * resource_name,
+ CORBA::Boolean write,
+ const char * xml_file)
+{
+ _rm.DeleteResourceInCatalog(resource_name);
+ if (write)
+ {
+ _rm.WriteInXmlFile(std::string(xml_file));
+ _rm.ParseXmlFiles();
+ }
+}
+
std::string
SALOME_ResourcesManager::getMachineFile(std::string hostname,
CORBA::Long nb_procs,
CORBA::Boolean write,
const char * xml_file);
+ void RemoveResource(const char * resource_name,
+ CORBA::Boolean write,
+ const char * xml_file);
+
// Cpp Methods
void Shutdown();
ResourcesManager_cpp *GetImpl() { return &_rm; }