-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "ResourcesManager.hxx"
#include <Basics_Utils.hxx>
#include <fstream>
#define MAX_SIZE_FOR_HOSTNAME 256;
-using namespace std;
-
static LoadRateManagerFirst first;
static LoadRateManagerCycl cycl;
static LoadRateManagerAltCycl altcycl;
{
_path_resources.push_back(xmlFilePath);
#if defined(_DEBUG_) || defined(_DEBUG)
- cerr << "ResourcesManager_cpp constructor" << endl;
+ std::cerr << "ResourcesManager_cpp constructor" << std::endl;
#endif
_resourceManagerMap["first"]=&first;
_resourceManagerMap["cycl"]=&cycl;
li.sort();
vec.clear();
- for (list<ResourceDataToSort>::iterator iter2 = li.begin(); iter2 != li.end(); iter2++)
+ for (std::list<ResourceDataToSort>::iterator iter2 = li.begin(); iter2 != li.end(); iter2++)
vec.push_back((*iter2)._Name);
}
// Send an exception if return list is empty...
if (vec.size() == 0)
{
- std::string error("[GetFittingResources] ResourcesManager doesn't find any resource that feets to your parameters");
+ std::string error("[GetFittingResources] ResourcesManager doesn't find any resource that fits to your parameters");
throw ResourcesException(error);
}
}
else
{
- std::cerr << "ParseXmlFiles Warning, to resource with the same name was found, taking the first declaration : " << i->first << std::endl;
+ std::cerr << "ParseXmlFiles Warning, two resources with the same name were found, taking the first declaration : " << i->first << std::endl;
}
}
}
return _resourcesList;
}
-string ResourcesManager_cpp::Find(const std::string& policy, const std::vector<std::string>& listOfResources)
+std::string ResourcesManager_cpp::Find(const std::string& policy, const std::vector<std::string>& listOfResources)
{
if(_resourceManagerMap.count(policy)==0)
return _resourceManagerMap[""]->Find(listOfResources, _resourcesList);
// a computer list is given : take only resources with OS on those computers
std::vector<std::string> vec_tmp = resources;
resources.clear();
- vector<string>::iterator iter = vec_tmp.begin();
+ std::vector<std::string>::iterator iter = vec_tmp.begin();
for (; iter != vec_tmp.end(); iter++)
{
MapOfParserResourcesType::const_iterator it = _resourcesList.find(*iter);
//=============================================================================
void
ResourcesManager_cpp::KeepOnlyResourcesWithComponent(std::vector<std::string>& resources,
- const vector<string>& componentList)
+ const std::vector<std::string>& componentList)
{
std::vector<std::string>::iterator iter = resources.begin();
for (; iter != resources.end(); iter++)
{
MapOfParserResourcesType::const_iterator it = _resourcesList.find(*iter);
- const vector<string>& mapOfComponentsOfCurrentHost = (*it).second.ComponentsList;
+ const std::vector<std::string>& mapOfComponentsOfCurrentHost = (*it).second.ComponentsList;
bool erasedHost = false;
if( mapOfComponentsOfCurrentHost.size() > 0 )
for(unsigned int i=0; i<componentList.size(); i++)
{
const char* compoi = componentList[i].c_str();
- vector<string>::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(),
+ std::vector<std::string>::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(),
mapOfComponentsOfCurrentHost.end(),
compoi);
if (itt == mapOfComponentsOfCurrentHost.end())