X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FResourcesManager%2FResourcesManager.hxx;h=5e8c54d664fd388bb3aac7c4bd9a29863a5a75e7;hb=82668fe5e4d077072402d253497f96d4c53391f9;hp=50a651786e894c6b90c0a73e2dd3f0d4daa062d5;hpb=63414a08d9492c25c206579c1953ec6f390679fd;p=modules%2Fkernel.git diff --git a/src/ResourcesManager/ResourcesManager.hxx b/src/ResourcesManager/ResourcesManager.hxx index 50a651786..5e8c54d66 100644 --- a/src/ResourcesManager/ResourcesManager.hxx +++ b/src/ResourcesManager/ResourcesManager.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -48,8 +48,10 @@ // in a critical section to be sure to be clean. // Only one thread should use the SALOME_ResourcesManager class in a SALOME // session. -struct resourceParams +struct RESOURCESMANAGER_EXPORT resourceParams { + resourceParams(); + std::string name; std::string hostname; bool can_launch_batch_jobs; @@ -64,14 +66,6 @@ struct resourceParams std::vector resourceList; }; -class RESOURCESMANAGER_EXPORT ResourcesException -{ -public: - const std::string msg; - - ResourcesException(const std::string m) : msg(m) {} -}; - class RESOURCESMANAGER_EXPORT ResourcesManager_cpp { @@ -85,8 +79,7 @@ class RESOURCESMANAGER_EXPORT ResourcesManager_cpp std::vector GetFittingResources(const resourceParams& params) throw(ResourcesException); - std::string Find(const std::string& policy, - const std::vector& listOfResources); + std::string Find(const std::string& policy, const std::vector& listOfResources) const; void AddResourceInCatalog (const ParserResourcesType & new_resource); @@ -98,7 +91,8 @@ class RESOURCESMANAGER_EXPORT ResourcesManager_cpp const MapOfParserResourcesType& GetList() const; - ParserResourcesType GetResourcesDescr(const std::string & name); + //! thread safe + ParserResourcesType GetResourcesDescr(const std::string & name) const; protected: @@ -112,11 +106,11 @@ class RESOURCESMANAGER_EXPORT ResourcesManager_cpp */ void AddDefaultResourceInCatalog(); - //! will contain the path to the ressources catalog + //! will contain the path to the resources catalog std::list _path_resources; std::list::iterator _path_resources_it; - //! will contain the informations on the data type catalog(after parsing) + //! will contain the information on the data type catalog(after parsing) MapOfParserResourcesType _resourcesList; //! a map that contains all the available load rate managers (the key is the name)