From: ana Date: Tue, 13 Apr 2010 12:29:42 +0000 (+0000) Subject: Use the prefix std:: instead of the directive using namespace std; X-Git-Tag: V5_1_4a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a9f15b311179bdedb5db7f02c42d76e85693a6c4;p=modules%2Fkernel.git Use the prefix std:: instead of the directive using namespace std; --- diff --git a/src/Basics/BasicsGenericDestructor.cxx b/src/Basics/BasicsGenericDestructor.cxx index 92f22c2b7..93e41d5ce 100644 --- a/src/Basics/BasicsGenericDestructor.cxx +++ b/src/Basics/BasicsGenericDestructor.cxx @@ -31,8 +31,6 @@ #include "BasicsGenericDestructor.hxx" -using namespace std; - void HouseKeeping(); std::list PROTECTED_DELETE::_objList; diff --git a/src/Basics/Basics_DirUtils.cxx b/src/Basics/Basics_DirUtils.cxx index a666317ed..6d526a019 100644 --- a/src/Basics/Basics_DirUtils.cxx +++ b/src/Basics/Basics_DirUtils.cxx @@ -36,8 +36,6 @@ # include #endif -using namespace std; - #ifdef WIN32 # define _separator_ '\\' #else @@ -46,7 +44,7 @@ using namespace std; namespace Kernel_Utils { - string GetBaseName( const std::string& file_path ) + std::string GetBaseName( const std::string& file_path ) { int pos = file_path.rfind( _separator_ ); if ( pos >= 0 ) @@ -54,17 +52,17 @@ namespace Kernel_Utils return file_path; } - string GetTmpDirByEnv( const std::string& tmp_path_env ) + std::string GetTmpDirByEnv( const std::string& tmp_path_env ) { - string dir; + std::string dir; char* val = getenv( tmp_path_env.c_str() ); - val ? dir = string( val ) : ""; + val ? dir = std::string( val ) : ""; return GetTmpDirByPath( dir ); } - string GetTmpDirByPath( const std::string& tmp_path ) + std::string GetTmpDirByPath( const std::string& tmp_path ) { - string aTmpDir = tmp_path; + std::string aTmpDir = tmp_path; if ( aTmpDir == "" ) { #ifdef WIN32 @@ -73,14 +71,14 @@ namespace Kernel_Utils { Tmp_dir = getenv("TMP"); if (Tmp_dir == NULL) - aTmpDir = string("C:\\"); + aTmpDir = std::string("C:\\"); else - aTmpDir = string(Tmp_dir); + aTmpDir = std::string(Tmp_dir); } else - aTmpDir = string(Tmp_dir); + aTmpDir = std::string(Tmp_dir); #else - aTmpDir = string("/tmp/"); + aTmpDir = std::string("/tmp/"); #endif } @@ -91,12 +89,12 @@ namespace Kernel_Utils int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory char buffer[127]; sprintf(buffer, "%d", aRND); - string aSubDir(buffer); - if(aSubDir.size() <= 1) aSubDir = string("123409876"); + std::string aSubDir(buffer); + if(aSubDir.size() <= 1) aSubDir = std::string("123409876"); aTmpDir += aSubDir; //Get RND sub directory - string aDir = aTmpDir; + std::string aDir = aTmpDir; if(IsExists(aDir)) { for(aRND = 0; IsExists(aDir); aRND++) { @@ -120,7 +118,7 @@ namespace Kernel_Utils // function : GetTempDir // purpose : Returns a temp directory to store created files like "/tmp/sub_dir/" //============================================================================ - string GetTmpDir() + std::string GetTmpDir() { return GetTmpDirByPath( "" ); } @@ -129,17 +127,17 @@ namespace Kernel_Utils // function : GetTempFileName // purpose : Returns the unique temporary file name without any extension /tmp/something/file for Unix or c:\something\file for WIN32 //============================================================================ - string GetTmpFileName() + std::string GetTmpFileName() { - string tmpDir = GetTmpDir(); - string aFilePath = ""; + std::string tmpDir = GetTmpDir(); + std::string aFilePath = ""; if(IsExists(tmpDir)) { srand((unsigned int)time(NULL)); int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory char buffer[127]; sprintf(buffer, "%d", aRND); - string aSubDir(buffer); - if(aSubDir.size() <= 1) aSubDir = string("123409876"); + std::string aSubDir(buffer); + if(aSubDir.size() <= 1) aSubDir = std::string("123409876"); aFilePath = tmpDir; for(aRND = 0; IsExists(aFilePath); aRND++) { @@ -154,7 +152,7 @@ namespace Kernel_Utils // function : IsExists // purpose : Returns True(False) if the path (not)exists //============================================================================ - bool IsExists(const string& thePath) + bool IsExists(const std::string& thePath) { #ifdef WIN32 if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { @@ -173,12 +171,12 @@ namespace Kernel_Utils // function : GetDirByPath // purpose : Returns directory by path and converts it to native system format //============================================================================ - string GetDirByPath(const string& thePath) + std::string GetDirByPath(const std::string& thePath) { if (thePath.empty()) return ""; - string path = thePath; - string::size_type length = path.length(); + std::string path = thePath; + std::string::size_type length = path.length(); //detect all separators in Unix format for ( unsigned int i = 0; i < length; i++ ) @@ -195,8 +193,8 @@ namespace Kernel_Utils } - string::size_type pos = path.rfind('|'); - if ( pos == string::npos ) + std::string::size_type pos = path.rfind('|'); + if ( pos == std::string::npos ) { #ifdef WIN32 //check for disk letter ( C: ) @@ -227,7 +225,7 @@ namespace Kernel_Utils // purpose : Returns True(False) if the path (not) empty // Also returns False if the path is not valid //============================================================================ - bool IsEmptyDir(const string& thePath) + bool IsEmptyDir(const std::string& thePath) { if ( thePath.empty() || !IsExists(thePath)) return false; @@ -260,7 +258,7 @@ namespace Kernel_Utils result = true; //empty if no file found while ((dirp = readdir(dp)) != NULL && result ) { - string file_name(dirp->d_name); + std::string file_name(dirp->d_name); result = file_name.empty() || file_name == "." || file_name == ".."; //if any file - break and return false } closedir(dp); diff --git a/src/Basics/Basics_Utils.cxx b/src/Basics/Basics_Utils.cxx index 8d05d65e5..43d880a50 100644 --- a/src/Basics/Basics_Utils.cxx +++ b/src/Basics/Basics_Utils.cxx @@ -33,11 +33,9 @@ #include #endif -using namespace std; - namespace Kernel_Utils { - string GetHostname() + std::string GetHostname() { int ls = 100, r = 1; char *s; @@ -77,7 +75,7 @@ namespace Kernel_Utils char *aDot = (strchr(s,'.')); if (aDot) aDot[0] = '\0'; - string p = s; + std::string p = s; delete [] s; return p; } diff --git a/src/Communication/MultiCommException.cxx b/src/Communication/MultiCommException.cxx index c55ae0c7b..e05ce7663 100644 --- a/src/Communication/MultiCommException.cxx +++ b/src/Communication/MultiCommException.cxx @@ -20,7 +20,6 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "MultiCommException.hxx" -using namespace std; MultiCommException::MultiCommException(const char *message) { diff --git a/src/Communication/Receiver.cxx b/src/Communication/Receiver.cxx index d632318d4..57e5fbae9 100644 --- a/src/Communication/Receiver.cxx +++ b/src/Communication/Receiver.cxx @@ -21,7 +21,6 @@ // #include "Receiver.hxx" #include -using namespace std; /*! return a deep copy of the array contained in the servant. diff --git a/src/Communication/ReceiverFactory.cxx b/src/Communication/ReceiverFactory.cxx index 4f86849dd..748c1f6f0 100644 --- a/src/Communication/ReceiverFactory.cxx +++ b/src/Communication/ReceiverFactory.cxx @@ -24,7 +24,6 @@ #endif #include "ReceiverFactory.hxx" #include "Receivers.hxx" -using namespace std; #ifdef COMP_CORBA_DOUBLE #define CorbaDNoCopyReceiver CorbaNCNoCopyReceiver diff --git a/src/Communication/Receivers.cxx b/src/Communication/Receivers.cxx index e00b27bd8..861dfcd37 100644 --- a/src/Communication/Receivers.cxx +++ b/src/Communication/Receivers.cxx @@ -21,7 +21,6 @@ // #include "omniORB4/poa.h" #include "utilities.h" -using namespace std; #define TAILLE_SPLIT 100000 #define TIMEOUT 20 @@ -301,7 +300,7 @@ T* SocketReceiver::getDistValue(long &siz if( ex.details.type == SALOME::COMM ) { _senderDestruc=false; - cout << ex.details.text << endl; + std::cout << ex.details.text << std::endl; throw MultiCommException("Unknown sender protocol"); } else @@ -331,7 +330,7 @@ void SocketReceiver::initCom() if( ex.details.type == SALOME::COMM ) { _senderDestruc=false; - cout << ex.details.text << endl; + std::cout << ex.details.text << std::endl; throw MultiCommException("Unknown sender protocol"); } else @@ -382,7 +381,7 @@ void SocketReceiver::connectCom(const cha if( ex.details.type == SALOME::COMM ) { _senderDestruc=false; - cout << ex.details.text << endl; + std::cout << ex.details.text << std::endl; throw MultiCommException("Unknown sender protocol"); } else diff --git a/src/Communication/SALOME_Comm_i.cxx b/src/Communication/SALOME_Comm_i.cxx index f2643d2be..4918fab84 100644 --- a/src/Communication/SALOME_Comm_i.cxx +++ b/src/Communication/SALOME_Comm_i.cxx @@ -30,7 +30,6 @@ #include "utilities.h" #include "SenderFactory.hxx" -using namespace std; #ifndef WIN32 CORBA::ORB_var &getGlobalORB(){ diff --git a/src/Communication/SenderFactory.cxx b/src/Communication/SenderFactory.cxx index b272679c3..9ff6dbd1e 100644 --- a/src/Communication/SenderFactory.cxx +++ b/src/Communication/SenderFactory.cxx @@ -23,7 +23,6 @@ #include "SenderFactory.hxx" #include "utilities.h" #include "SALOMEMultiComm.hxx" -using namespace std; #ifdef COMP_CORBA_DOUBLE #define SALOME_CorbaDoubleSender SALOME_CorbaDoubleNCSender_i diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index 813bf74fb..3e24e0d64 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -47,9 +47,6 @@ int SIGUSR11 = 1000; #include #endif - -using namespace std; - extern bool _Sleeping ; static Engines_Component_i * theEngines_Component ; @@ -325,7 +322,7 @@ Engines::FieldsDict* Engines_Component_i::getProperties() { Engines::FieldsDict_var copie = new Engines::FieldsDict; copie->length(_fieldsDict.size()); - map::iterator it; + std::map::iterator it; CORBA::ULong i = 0; for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++, i++) { @@ -397,14 +394,14 @@ bool Engines_Component_i::Stop_impl() MESSAGE("Engines_Component_i::Stop_i() pthread_t "<< pthread_self() << " pid " << getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id - << dec << " _ThreadId " << _ThreadId ); + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id + << std::dec << " _ThreadId " << _ThreadId ); #else MESSAGE("Engines_Component_i::Stop_i() pthread_t "<< pthread_self().p << " pid " << _getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id - << dec << " _ThreadId " << _ThreadId ); + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id + << std::dec << " _ThreadId " << _ThreadId ); #endif @@ -437,14 +434,14 @@ bool Engines_Component_i::Suspend_impl() MESSAGE("Engines_Component_i::Suspend_i() pthread_t "<< pthread_self() << " pid " << getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id - << dec << " _ThreadId " << _ThreadId ); + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id + << std::dec << " _ThreadId " << _ThreadId ); #else MESSAGE("Engines_Component_i::Suspend_i() pthread_t "<< pthread_self().p << " pid " << _getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id - << dec << " _ThreadId " << _ThreadId ); + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id + << std::dec << " _ThreadId " << _ThreadId ); #endif bool RetVal = false ; @@ -484,14 +481,14 @@ bool Engines_Component_i::Resume_impl() MESSAGE("Engines_Component_i::Resume_i() pthread_t "<< pthread_self() << " pid " << getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id - << dec << " _ThreadId " << _ThreadId ); + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id + << std::dec << " _ThreadId " << _ThreadId ); #else MESSAGE("Engines_Component_i::Resume_i() pthread_t "<< pthread_self().p << " pid " << _getpid() << " instanceName " << _instanceName.c_str() << " interface " << _interfaceName.c_str() - << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << hex << _id - << dec << " _ThreadId " << _ThreadId ); + << " machineName " << Kernel_Utils::GetHostname().c_str()<< " _id " << std::hex << _id + << std::dec << " _ThreadId " << _ThreadId ); #endif bool RetVal = false ; #ifndef WIN32 @@ -656,7 +653,7 @@ void Engines_Component_i::beginService(const char *serviceName) } // --- all strings given with setProperties are set in environment - map::iterator it; + std::map::iterator it; for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++) { std::string cle((*it).first); @@ -688,8 +685,8 @@ void Engines_Component_i::endService(const char *serviceName) std::cerr << "endService for " << serviceName << " Component instance : " << _instanceName ; std::cerr << " Cpu Used: " << cpus << " (s) " << std::endl; MESSAGE("Send EndService notification for " << serviceName - << endl << " Component instance : " << _instanceName << " StartUsed " - << _StartUsed << " _ThreadCpuUsed "<< _ThreadCpuUsed << endl <name(); std::string name(containerName); name.erase(0,12); - string::size_type slash =name.find_first_of('/'); + std::string::size_type slash =name.find_first_of('/'); if(slash != std::string::npos) name[slash]='_'; _containerName=name; diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 99e4a4284..6ef25085f 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -58,8 +58,6 @@ int SIGUSR1 = 1000; #include #include "Container_init_python.hxx" -using namespace std; - bool _Sleeping = false ; // // Needed by multi-threaded Python --- Supervision @@ -89,9 +87,9 @@ extern "C" {void SigIntHandler( int ) ; } #define SLASH '/' #endif -map Engines_Container_i::_cntInstances_map; -map Engines_Container_i::_library_map; -map Engines_Container_i::_toRemove_map; +std::map Engines_Container_i::_cntInstances_map; +std::map Engines_Container_i::_library_map; +std::map Engines_Container_i::_toRemove_map; omni_mutex Engines_Container_i::_numInstanceMutex ; static PyObject* _pyCont; @@ -139,7 +137,7 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb, _argc = argc ; _argv = argv ; - string hostname = Kernel_Utils::GetHostname(); + std::string hostname = Kernel_Utils::GetHostname(); #ifndef WIN32 MESSAGE(hostname << " " << getpid() << " Engines_Container_i starting argc " << @@ -192,7 +190,7 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb, // pycont = SALOME_Container.SALOME_Container_i(containerIORStr) CORBA::String_var sior = _orb->object_to_string(pCont); - string myCommand="pyCont = SALOME_Container.SALOME_Container_i('"; + std::string myCommand="pyCont = SALOME_Container.SALOME_Container_i('"; myCommand += _containerName + "','"; myCommand += sior; myCommand += "')\n"; @@ -291,7 +289,7 @@ void Engines_Container_i::logfilename(const char* name) char* Engines_Container_i::getHostName() { - string s = Kernel_Utils::GetHostname(); + std::string s = Kernel_Utils::GetHostname(); // MESSAGE("Engines_Container_i::getHostName " << s); return CORBA::string_dup(s.c_str()) ; } @@ -394,7 +392,7 @@ Engines_Container_i::load_component_Library(const char* componentName, CORBA::St retso="Component "; retso+=componentName; retso+=": Can't find C++ implementation "; - retso+=string(LIB) + componentName + ENGINESO; + retso+=std::string(LIB) + componentName + ENGINESO; //================================================================= // --- Python implementation section @@ -464,7 +462,7 @@ bool Engines_Container_i::load_component_CppImplementation(const char* componentName, std::string& reason) { std::string aCompName(componentName); - string impl_name = string(LIB) + aCompName + ENGINESO; + std::string impl_name = std::string(LIB) + aCompName + ENGINESO; SCRUTE(impl_name); _numInstanceMutex.lock(); // lock to be alone @@ -688,7 +686,7 @@ Engines_Container_i::create_component_instance_env(const char*genericRegisterNam return compo; } - string impl_name = string(LIB) + genericRegisterName + ENGINESO; + std::string impl_name = std::string(LIB) + genericRegisterName + ENGINESO; if (_library_map.count(impl_name) != 0) { // It's a C++ component @@ -698,7 +696,7 @@ Engines_Container_i::create_component_instance_env(const char*genericRegisterNam return compo; } - impl_name = string(genericRegisterName) + ".exe"; + impl_name = std::string(genericRegisterName) + ".exe"; if (_library_map.count(impl_name) != 0) { //It's an executable component @@ -743,8 +741,8 @@ Engines_Container_i::createExecutableInstance(std::string CompName, int studyId, char aNumI[12]; sprintf( aNumI , "%d" , numInstance ) ; - string instanceName = CompName + "_inst_" + aNumI ; - string component_registerName = _containerName + "/" + instanceName; + std::string instanceName = CompName + "_inst_" + aNumI ; + std::string component_registerName = _containerName + "/" + instanceName; //check if an entry exist in naming service CORBA::Object_var nsobj = _NS->Resolve(component_registerName.c_str()); @@ -888,8 +886,8 @@ Engines_Container_i::createPythonInstance(std::string CompName, int studyId, char aNumI[12]; sprintf( aNumI , "%d" , numInstance ) ; - string instanceName = CompName + "_inst_" + aNumI ; - string component_registerName = _containerName + "/" + instanceName; + std::string instanceName = CompName + "_inst_" + aNumI ; + std::string component_registerName = _containerName + "/" + instanceName; PyGILState_STATE gstate = PyGILState_Ensure(); PyObject *result = PyObject_CallMethod(_pyCont, @@ -901,7 +899,7 @@ Engines_Container_i::createPythonInstance(std::string CompName, int studyId, const char *ior; const char *error; PyArg_ParseTuple(result,"ss", &ior, &error); - string iors = ior; + std::string iors = ior; reason=error; Py_DECREF(result); PyGILState_Release(gstate); @@ -945,8 +943,8 @@ Engines_Container_i::createInstance(std::string genericRegisterName, { // --- find the factory - string aGenRegisterName = genericRegisterName; - string factory_name = aGenRegisterName + string("Engine_factory"); + std::string aGenRegisterName = genericRegisterName; + std::string factory_name = aGenRegisterName + std::string("Engine_factory"); SCRUTE(factory_name) ; typedef PortableServer::ObjectId* (*FACTORY_FUNCTION) (CORBA::ORB_ptr, @@ -984,8 +982,8 @@ Engines_Container_i::createInstance(std::string genericRegisterName, char aNumI[12]; sprintf( aNumI , "%d" , numInstance ) ; - string instanceName = aGenRegisterName + "_inst_" + aNumI ; - string component_registerName = + std::string instanceName = aGenRegisterName + "_inst_" + aNumI ; + std::string component_registerName = _containerName + "/" + instanceName; // --- Instanciate required CORBA object @@ -1049,10 +1047,10 @@ Engines_Container_i::find_component_instance( const char* registeredName, CORBA::Long studyId) { Engines::Component_var anEngine = Engines::Component::_nil(); - map::iterator itm =_listInstances_map.begin(); + std::map::iterator itm =_listInstances_map.begin(); while (itm != _listInstances_map.end()) { - string instance = (*itm).first; + std::string instance = (*itm).first; SCRUTE(instance); if (instance.find(registeredName) == 0) { @@ -1078,7 +1076,7 @@ Engines_Container_i::find_component_instance( const char* registeredName, void Engines_Container_i::remove_impl(Engines::Component_ptr component_i) { ASSERT(! CORBA::is_nil(component_i)); - string instanceName = component_i->instanceName() ; + std::string instanceName = component_i->instanceName() ; MESSAGE("unload component " << instanceName); _numInstanceMutex.lock() ; // lock to be alone (stl container write) _listInstances_map.erase(instanceName); @@ -1098,11 +1096,11 @@ void Engines_Container_i::finalize_removal() MESSAGE("finalize unload : dlclose"); _numInstanceMutex.lock(); // lock to be alone // (see decInstanceCnt, load_component_Library) - map::iterator ith; + std::map::iterator ith; for (ith = _toRemove_map.begin(); ith != _toRemove_map.end(); ith++) { void *handle = (*ith).second; - string impl_name= (*ith).first; + std::string impl_name= (*ith).first; if (handle) { SCRUTE(handle); @@ -1125,7 +1123,7 @@ void Engines_Container_i::decInstanceCnt(std::string genericRegisterName) { if(_cntInstances_map.count(genericRegisterName)==0) return; - string aGenRegisterName =genericRegisterName; + std::string aGenRegisterName =genericRegisterName; MESSAGE("Engines_Container_i::decInstanceCnt " << aGenRegisterName); ASSERT(_cntInstances_map[aGenRegisterName] > 0); _numInstanceMutex.lock(); // lock to be alone @@ -1134,7 +1132,7 @@ void Engines_Container_i::decInstanceCnt(std::string genericRegisterName) SCRUTE(_cntInstances_map[aGenRegisterName]); if (_cntInstances_map[aGenRegisterName] == 0) { - string impl_name = + std::string impl_name = Engines_Component_i::GetDynLibraryName(aGenRegisterName.c_str()); SCRUTE(impl_name); void* handle = _library_map[impl_name]; @@ -1167,7 +1165,7 @@ Engines_Container_i::load_impl( const char* genericRegisterName, const char* componentName ) { char* reason; - string impl_name = string(LIB) + genericRegisterName + ENGINESO; + std::string impl_name = std::string(LIB) + genericRegisterName + ENGINESO; Engines::Component_var iobject = Engines::Component::_nil() ; if (load_component_Library(genericRegisterName,reason)) iobject = find_or_create_instance(genericRegisterName, impl_name); @@ -1202,8 +1200,8 @@ Engines::Component_ptr Engines_Container_i::find_or_create_instance(std::string genericRegisterName, std::string componentLibraryName) { - string aGenRegisterName = genericRegisterName; - string impl_name = componentLibraryName; + std::string aGenRegisterName = genericRegisterName; + std::string impl_name = componentLibraryName; if (_library_map.count(impl_name) == 0) { INFOS("shared library " << impl_name <<" must be loaded before creating instance"); @@ -1214,7 +1212,7 @@ Engines_Container_i::find_or_create_instance(std::string genericRegisterName, // --- find a registered instance in naming service, or create void* handle = _library_map[impl_name]; - string component_registerBase = + std::string component_registerBase = _containerName + "/" + aGenRegisterName; Engines::Component_var iobject = Engines::Component::_nil() ; std::string reason; @@ -1360,9 +1358,9 @@ void SigIntHandler(int what , // A stream operation may be interrupted by a signal and if the Handler use stream we // may have a "Dead-Lock" ===HangUp //==MESSAGE is commented - // MESSAGE(pthread_self() << "SigIntHandler what " << what << endl - // << " si_signo " << siginfo->si_signo << endl - // << " si_code " << siginfo->si_code << endl + // MESSAGE(pthread_self() << "SigIntHandler what " << what << std::endl + // << " si_signo " << siginfo->si_signo << std::endl + // << " si_code " << siginfo->si_code << std::endl // << " si_pid " << siginfo->si_pid) ; if ( _Sleeping ) @@ -1401,9 +1399,9 @@ void SigIntHandler(int what , void SigIntHandler( int what ) { #ifndef WIN32 - MESSAGE( pthread_self() << "SigIntHandler what " << what << endl ); + MESSAGE( pthread_self() << "SigIntHandler what " << what << std::endl ); #else - MESSAGE( "SigIntHandler what " << what << endl ); + MESSAGE( "SigIntHandler what " << what << std::endl ); #endif if ( _Sleeping ) { @@ -1450,7 +1448,7 @@ void SigIntHandler( int what ) Engines::fileRef_ptr Engines_Container_i::createFileRef(const char* origFileName) { - string origName(origFileName); + std::string origName(origFileName); Engines::fileRef_var theFileRef = Engines::fileRef::_nil(); if (origName[0] != '/') @@ -1496,7 +1494,7 @@ Engines_Container_i::getFileTransfer() Engines::Salome_file_ptr Engines_Container_i::createSalome_file(const char* origFileName) { - string origName(origFileName); + std::string origName(origFileName); if (CORBA::is_nil(_Salome_file_map[origName])) { Salome_file_i* aSalome_file = new Salome_file_i(); @@ -1625,7 +1623,7 @@ Engines::PyNode_ptr Engines_Container_i::createPyNode(const char* nodeName, cons * zero if it is not executable, or if it does not exist. */ //============================================================================= -int checkifexecutable(const string& filename) +int checkifexecutable(const std::string& filename) { int result; struct stat statinfo; @@ -1672,7 +1670,7 @@ int findpathof(const std::string& path, std::string& pth, const std::string& fil int result=stat(pth.c_str(), &statinfo); if(result == 0) found=1; } - if (pos == string::npos) break; + if (pos == std::string::npos) break; offset = pos+1; } return found; diff --git a/src/Container/Container_init_python.cxx b/src/Container/Container_init_python.cxx index e5e1369db..9bcec0d1b 100644 --- a/src/Container/Container_init_python.cxx +++ b/src/Container/Container_init_python.cxx @@ -34,8 +34,6 @@ #include "Container_init_python.hxx" -using namespace std; - PyThreadState *KERNEL_PYTHON::_gtstate = 0; PyObject *KERNEL_PYTHON::salome_shared_modules_module = NULL; PyInterpreterState *KERNEL_PYTHON::_interp = NULL; diff --git a/src/Container/SALOME_Container.cxx b/src/Container/SALOME_Container.cxx index 5ec639d12..50d0d3b17 100644 --- a/src/Container/SALOME_Container.cxx +++ b/src/Container/SALOME_Container.cxx @@ -59,8 +59,6 @@ #include "Container_init_python.hxx" -using namespace std; - extern "C" void HandleServerSideSignals(CORBA::ORB_ptr theORB); #include @@ -137,8 +135,8 @@ int main(int argc, char* argv[]) if(getenv ("DEBUGGER")) { setsig(SIGSEGV,&Handler); - set_terminate(&terminateHandler); - set_unexpected(&unexpectedHandler); + std::set_terminate(&terminateHandler); + std::set_unexpected(&unexpectedHandler); } #endif @@ -174,8 +172,8 @@ int main(int argc, char* argv[]) // add new container to the kill list #ifndef WIN32 - stringstream aCommand ; - aCommand << "addToKillList.py " << getpid() << " SALOME_Container" << ends ; + std::stringstream aCommand ; + aCommand << "addToKillList.py " << getpid() << " SALOME_Container" << std::ends ; system(aCommand.str().c_str()); #endif diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 03d906381..5988eb203 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -39,8 +39,6 @@ #define TIME_OUT_TO_LAUNCH_CONT 61 -using namespace std; - const char *SALOME_ContainerManager::_ContainerManagerNameInNS = "/ContainerManager"; @@ -84,7 +82,7 @@ SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb, PortableSer #ifdef WITHOPENMPI if( getenv("OMPI_URI_FILE") != NULL ){ system("killall ompi-server"); - string command; + std::string command; command = "ompi-server -r "; command += getenv("OMPI_URI_FILE"); int status=system(command.c_str()); @@ -141,9 +139,9 @@ void SALOME_ContainerManager::ShutdownContainers() bool isOK; isOK = _NS->Change_Directory("/Containers"); if( isOK ){ - vector vec = _NS->list_directory_recurs(); - list lstCont; - for(vector::iterator iter = vec.begin();iter!=vec.end();iter++) + std::vector vec = _NS->list_directory_recurs(); + std::list lstCont; + for(std::vector::iterator iter = vec.begin();iter!=vec.end();iter++) { SCRUTE((*iter)); CORBA::Object_var obj=_NS->Resolve((*iter).c_str()); @@ -159,10 +157,10 @@ void SALOME_ContainerManager::ShutdownContainers() } } MESSAGE("Container list: "); - for(list::iterator iter=lstCont.begin();iter!=lstCont.end();iter++){ + for(std::list::iterator iter=lstCont.begin();iter!=lstCont.end();iter++){ SCRUTE((*iter)); } - for(list::iterator iter=lstCont.begin();iter!=lstCont.end();iter++) + for(std::list::iterator iter=lstCont.begin();iter!=lstCont.end();iter++) { try { @@ -203,7 +201,7 @@ void SALOME_ContainerManager::ShutdownContainers() Engines::Container_ptr SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& params) { - string machFile; + std::string machFile; Engines::Container_ptr ret = Engines::Container::_nil(); // Step 0: Default mode is start @@ -247,7 +245,7 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param try { if(!cont->_non_existent()) - local_resources.push_back(string(possibleResources[i])); + local_resources.push_back(std::string(possibleResources[i])); } catch(CORBA::Exception&) {} } @@ -261,7 +259,7 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param } else for(unsigned int i=0; i < possibleResources->length(); i++) - local_resources.push_back(string(possibleResources[i])); + local_resources.push_back(std::string(possibleResources[i])); // Step 4: select the resource where to get/start the container std::string resource_selected; @@ -400,10 +398,10 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param //redirect stdout and stderr in a file #ifdef WNT - string logFilename=getenv("TEMP"); + std::string logFilename=getenv("TEMP"); logFilename += "\\"; #else - string logFilename="/tmp"; + std::string logFilename="/tmp"; char* val = getenv("SALOME_TMP_DIR"); if(val) { @@ -563,13 +561,13 @@ bool isPythonContainer(const char* ContainerName) */ //============================================================================= -string +std::string SALOME_ContainerManager::BuildCommandToLaunchRemoteContainer -(const string& resource_name, +(const std::string& resource_name, const Engines::ContainerParameters& params, const std::string& container_exe) { - string command; + std::string command; if (!_isAppliSalomeDefined) command = BuildTempFileToLaunchRemoteContainer(resource_name, params); else @@ -674,15 +672,15 @@ SALOME_ContainerManager::BuildCommandToLaunchRemoteContainer * builds the command to be launched. */ //============================================================================= -string +std::string SALOME_ContainerManager::BuildCommandToLaunchLocalContainer (const Engines::ContainerParameters& params, const std::string& machinesFile, const std::string& container_exe) { _TmpFileName = BuildTemporaryFileName(); - string command; + std::string command; int nbproc = 0; - ostringstream o; + std::ostringstream o; if (params.isMPI) { @@ -729,9 +727,9 @@ SALOME_ContainerManager::BuildCommandToLaunchLocalContainer if(wdir == "$TEMPDIR") { // a new temporary directory is requested - string dir = Kernel_Utils::GetTmpDir(); + std::string dir = Kernel_Utils::GetTmpDir(); #ifdef WIN32 - o << "cd /d " << dir << endl; + o << "cd /d " << dir << std::endl; #else o << "cd " << dir << ";"; #endif @@ -741,8 +739,8 @@ SALOME_ContainerManager::BuildCommandToLaunchLocalContainer { // a permanent directory is requested use it or create it #ifdef WIN32 - o << "mkdir " + wdir << endl; - o << "cd /D " + wdir << endl; + o << "mkdir " + wdir << std::endl; + o << "cd /D " + wdir << std::endl; #else o << "mkdir -p " << wdir << " && cd " << wdir + ";"; #endif @@ -759,7 +757,7 @@ SALOME_ContainerManager::BuildCommandToLaunchLocalContainer o << " -"; AddOmninamesParams(o); - ofstream command_file( _TmpFileName.c_str() ); + std::ofstream command_file( _TmpFileName.c_str() ); command_file << o.str(); command_file.close(); @@ -786,9 +784,9 @@ void SALOME_ContainerManager::RmTmpFile(std::string& tmpFileName) if ( lenght > 0) { #ifdef WIN32 - string command = "del /F "; + std::string command = "del /F "; #else - string command = "rm "; + std::string command = "rm "; #endif if ( lenght > 4 ) command += tmpFileName.substr(0, lenght - 3 ); @@ -797,7 +795,7 @@ void SALOME_ContainerManager::RmTmpFile(std::string& tmpFileName) command += '*'; system(command.c_str()); //if dir is empty - remove it - string tmp_dir = Kernel_Utils::GetDirByPath( tmpFileName ); + std::string tmp_dir = Kernel_Utils::GetDirByPath( tmpFileName ); if ( Kernel_Utils::IsEmptyDir( tmp_dir ) ) { #ifdef WIN32 @@ -816,7 +814,7 @@ void SALOME_ContainerManager::RmTmpFile(std::string& tmpFileName) */ //============================================================================= -void SALOME_ContainerManager::AddOmninamesParams(string& command) const +void SALOME_ContainerManager::AddOmninamesParams(std::string& command) const { CORBA::String_var iorstr = _NS->getIORaddr(); command += "ORBInitRef NameService="; @@ -829,7 +827,7 @@ void SALOME_ContainerManager::AddOmninamesParams(string& command) const */ //============================================================================= -void SALOME_ContainerManager::AddOmninamesParams(ofstream& fileStream) const +void SALOME_ContainerManager::AddOmninamesParams(std::ofstream& fileStream) const { CORBA::String_var iorstr = _NS->getIORaddr(); fileStream << "ORBInitRef NameService="; @@ -842,7 +840,7 @@ void SALOME_ContainerManager::AddOmninamesParams(ofstream& fileStream) const */ //============================================================================= -void SALOME_ContainerManager::AddOmninamesParams(ostringstream& oss) const +void SALOME_ContainerManager::AddOmninamesParams(std::ostringstream& oss) const { CORBA::String_var iorstr = _NS->getIORaddr(); oss << "ORBInitRef NameService="; @@ -855,10 +853,10 @@ void SALOME_ContainerManager::AddOmninamesParams(ostringstream& oss) const */ //============================================================================= -string SALOME_ContainerManager::BuildTemporaryFileName() const +std::string SALOME_ContainerManager::BuildTemporaryFileName() const { //build more complex file name to support multiple salome session - string aFileName = Kernel_Utils::GetTmpFileName(); + std::string aFileName = Kernel_Utils::GetTmpFileName(); #ifndef WIN32 aFileName += ".sh"; #else @@ -877,22 +875,22 @@ string SALOME_ContainerManager::BuildTemporaryFileName() const */ //============================================================================= -string +std::string SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer -(const string& resource_name, +(const std::string& resource_name, const Engines::ContainerParameters& params) throw(SALOME_Exception) { int status; _TmpFileName = BuildTemporaryFileName(); - ofstream tempOutputFile; - tempOutputFile.open(_TmpFileName.c_str(), ofstream::out ); + std::ofstream tempOutputFile; + tempOutputFile.open(_TmpFileName.c_str(), std::ofstream::out ); const ParserResourcesType& resInfo = _ResManager->GetImpl()->GetResourcesDescr(resource_name); - tempOutputFile << "#! /bin/sh" << endl; + tempOutputFile << "#! /bin/sh" << std::endl; // --- set env vars - tempOutputFile << "export SALOME_trace=local" << endl; // mkr : 27.11.2006 : PAL13967 - Distributed supervision graphs - Problem with "SALOME_trace" + tempOutputFile << "export SALOME_trace=local" << std::endl; // mkr : 27.11.2006 : PAL13967 - Distributed supervision graphs - Problem with "SALOME_trace" //tempOutputFile << "source " << resInfo.PreReqFilePath << endl; // ! env vars @@ -946,7 +944,7 @@ SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer tempOutputFile << _NS->ContainerName(params) << " -"; AddOmninamesParams(tempOutputFile); - tempOutputFile << " &" << endl; + tempOutputFile << " &" << std::endl; tempOutputFile.flush(); tempOutputFile.close(); #ifndef WIN32 @@ -955,12 +953,12 @@ SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer // --- Build command - string command; + std::string command; if (resInfo.Protocol == rsh) { command = "rsh "; - string commandRcp = "rcp "; + std::string commandRcp = "rcp "; commandRcp += _TmpFileName; commandRcp += " "; commandRcp += resInfo.HostName; @@ -972,7 +970,7 @@ SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer else if (resInfo.Protocol == ssh) { command = "ssh "; - string commandRcp = "scp "; + std::string commandRcp = "scp "; commandRcp += _TmpFileName; commandRcp += " "; commandRcp += resInfo.HostName; @@ -997,12 +995,12 @@ SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer } -string SALOME_ContainerManager::GetMPIZeroNode(const string machine, const string machinesFile) +std::string SALOME_ContainerManager::GetMPIZeroNode(const std::string machine, const std::string machinesFile) { int status; - string zeronode; - string command; - string tmpFile = BuildTemporaryFileName(); + std::string zeronode; + std::string command; + std::string tmpFile = BuildTemporaryFileName(); if( getenv("LIBBATCH_NODEFILE") == NULL ) { @@ -1054,7 +1052,7 @@ string SALOME_ContainerManager::GetMPIZeroNode(const string machine, const strin status = system(command.c_str()); if( status == 0 ){ - ifstream fp(tmpFile.c_str(),ios::in); + std::ifstream fp(tmpFile.c_str(),std::ios::in); fp >> zeronode; } @@ -1063,13 +1061,13 @@ string SALOME_ContainerManager::GetMPIZeroNode(const string machine, const strin return zeronode; } -string SALOME_ContainerManager::machinesFile(const int nbproc) +std::string SALOME_ContainerManager::machinesFile(const int nbproc) { - string tmp; - string nodesFile = getenv("LIBBATCH_NODEFILE"); - string machinesFile = Kernel_Utils::GetTmpFileName(); - ifstream fpi(nodesFile.c_str(),ios::in); - ofstream fpo(machinesFile.c_str(),ios::out); + std::string tmp; + std::string nodesFile = getenv("LIBBATCH_NODEFILE"); + std::string machinesFile = Kernel_Utils::GetTmpFileName(); + std::ifstream fpi(nodesFile.c_str(),std::ios::in); + std::ofstream fpo(machinesFile.c_str(),std::ios::out); _numInstanceMutex.lock(); @@ -1078,7 +1076,7 @@ string SALOME_ContainerManager::machinesFile(const int nbproc) for(int i=0;i> tmp ) - fpo << tmp << endl; + fpo << tmp << std::endl; else throw SALOME_Exception("You ask more processes than batch session have allocated!"); @@ -1332,7 +1330,7 @@ SALOME_ContainerManager::BuildCommandToLaunchPaCOProxyContainer(const Engines::C std::ifstream machine_file(machine_file_name.c_str()); std::getline(machine_file, hostname, ' '); size_t found = hostname.find('\n'); - if (found!=string::npos) + if (found!=std::string::npos) hostname.erase(found, 1); // Remove \n proxy_hostname = hostname; MESSAGE("[BuildCommandToLaunchPaCOProxyContainer] machine file name extracted is " << hostname); diff --git a/src/Container/SALOME_Container_SignalsHandler.cxx b/src/Container/SALOME_Container_SignalsHandler.cxx index 55b6697f9..c40024fdf 100644 --- a/src/Container/SALOME_Container_SignalsHandler.cxx +++ b/src/Container/SALOME_Container_SignalsHandler.cxx @@ -28,8 +28,6 @@ // CCRT porting // #include "CASCatch_SignalsHandler.h" // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC -using namespace std; - extern "C" void HandleServerSideSignals(CORBA::ORB_ptr theORB) { // CCRT porting diff --git a/src/Container/SALOME_FileRef_i.cxx b/src/Container/SALOME_FileRef_i.cxx index f4b670be7..932a36bfa 100644 --- a/src/Container/SALOME_FileRef_i.cxx +++ b/src/Container/SALOME_FileRef_i.cxx @@ -29,8 +29,6 @@ #include "Basics_Utils.hxx" #include -using namespace std; - //============================================================================= /*! * Default constructor, not for use @@ -129,8 +127,8 @@ CORBA::Boolean fileRef_i::addRef(const char* machine, const char* fileName) { MESSAGE("fileRef_i::addRef " << machine << " " << fileName); - string theMachine = machine; - string theFileName = fileName; + std::string theMachine = machine; + std::string theFileName = fileName; if (theFileName[0] != '/') { @@ -168,8 +166,8 @@ CORBA::Boolean fileRef_i::addRef(const char* machine, char* fileRef_i::getRef(const char* machine) { MESSAGE("fileRef_i::getRef "<< machine); - string theMachine = machine; - string theFileName = _copies[theMachine]; + std::string theMachine = machine; + std::string theFileName = _copies[theMachine]; if (_copies[theMachine].empty()) { MESSAGE("no copy of " << _machine << _origFileName << " available on " diff --git a/src/Container/TestSalome_file.cxx b/src/Container/TestSalome_file.cxx index 40e71642a..f8f9bd623 100644 --- a/src/Container/TestSalome_file.cxx +++ b/src/Container/TestSalome_file.cxx @@ -26,28 +26,26 @@ #include "HDFascii.hxx" #include -using namespace std; - void print_infos(Engines::file*); void print_state(Engines::SfState*); void print_infos(Engines::file * infos) { - cerr << "-------------------------------------------------------------------" << endl; - cerr << "file_name = " << infos->file_name << endl; - cerr << "path = " << infos->path << endl; - cerr << "type = " << infos->type << endl; - cerr << "source_file_name = " << infos->source_file_name << endl; - cerr << "status = " << infos->status << endl; + std::cerr << "-------------------------------------------------------------------" << std::endl; + std::cerr << "file_name = " << infos->file_name << std::endl; + std::cerr << "path = " << infos->path << std::endl; + std::cerr << "type = " << infos->type << std::endl; + std::cerr << "source_file_name = " << infos->source_file_name << std::endl; + std::cerr << "status = " << infos->status << std::endl; } void print_state(Engines::SfState * state) { - cerr << "-------------------------------------------------------------------" << endl; - cerr << "name = " << state->name << endl; - cerr << "hdf5_file_name = " << state->hdf5_file_name << endl; - cerr << "number_of_files = " << state->number_of_files << endl; - cerr << "files_ok = " << state->files_ok << endl; + std::cerr << "-------------------------------------------------------------------" << std::endl; + std::cerr << "name = " << state->name << std::endl; + std::cerr << "hdf5_file_name = " << state->hdf5_file_name << std::endl; + std::cerr << "number_of_files = " << state->number_of_files << std::endl; + std::cerr << "files_ok = " << state->files_ok << std::endl; } @@ -67,23 +65,23 @@ int main (int argc, char * argv[]) PortableServer::POAManager_var pman; CORBA::Object_var obj; - cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl; - cerr << "Test of setLocalFile()" << endl; + std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; + std::cerr << "Test of setLocalFile()" << std::endl; file.setLocalFile("/tmp/toto"); infos = file.getFileInfos("toto"); print_infos(infos); - cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl; - cerr << "Test of getFilesInfos()" << endl; + std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; + std::cerr << "Test of getFilesInfos()" << std::endl; all_infos = file.getFilesInfos(); for (int i = 0; i < all_infos->length(); i++) { print_infos(&((*all_infos)[i])); } - cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl; - cerr << "Test of getSalome_fileState()" << endl; + std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; + std::cerr << "Test of getSalome_fileState()" << std::endl; state = file.getSalome_fileState(); print_state(state); @@ -97,8 +95,8 @@ int main (int argc, char * argv[]) file2.setLocalFile("/tmp/toto_distributed_source"); Engines::Salome_file_ptr file2_ref = file2._this(); - cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl; - cerr << "Test of setDistributedFile()" << endl; + std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; + std::cerr << "Test of setDistributedFile()" << std::endl; file.setDistributedFile("/tmp/toto_distributed"); file.connectDistributedFile("toto_distributed", file2_ref); // file.setDistributedSourceFile("toto_distributed", "toto_distributed_source"); @@ -124,19 +122,19 @@ int main (int argc, char * argv[]) } catch (SALOME::SALOME_Exception & e) { - cerr << "Exception : " << e.details.text << endl; + std::cerr << "Exception : " << e.details.text << std::endl; } - cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl; - cerr << "Test of getFilesInfos()" << endl; + std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; + std::cerr << "Test of getFilesInfos()" << std::endl; all_infos = file.getFilesInfos(); for (int i = 0; i < all_infos->length(); i++) { print_infos(&((*all_infos)[i])); } - cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl; - cerr << "Test of getSalome_fileState()" << endl; + std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; + std::cerr << "Test of getSalome_fileState()" << std::endl; state = file.getSalome_fileState(); print_state(state); @@ -169,11 +167,11 @@ int main (int argc, char * argv[]) // Test of ConvertFromHDFToASCII // and ConvertFromASCIIToHDF - cerr << "Test of ConvertFromASCIIToHDF" << endl; + std::cerr << "Test of ConvertFromASCIIToHDF" << std::endl; HDFascii::ConvertFromASCIIToHDF("/tmp/toto"); // RETURN NULL ! - cerr << "Test of ConvertFromHDFToASCII" << endl; - cerr << HDFascii::ConvertFromHDFToASCII("test2.hdf", false) << endl; - cerr << HDFascii::ConvertFromHDFToASCII("test2.hdf", true) << endl; + std::cerr << "Test of ConvertFromHDFToASCII" << std::endl; + std::cerr << HDFascii::ConvertFromHDFToASCII("test2.hdf", false) << std::endl; + std::cerr << HDFascii::ConvertFromHDFToASCII("test2.hdf", true) << std::endl; - cerr << "End of tests" << endl; + std::cerr << "End of tests" << std::endl; } diff --git a/src/DF/DF_Application.cxx b/src/DF/DF_Application.cxx index 2178c2ef3..41df1a523 100644 --- a/src/DF/DF_Application.cxx +++ b/src/DF/DF_Application.cxx @@ -22,8 +22,6 @@ #include "DF_definitions.hxx" #include "DF_Application.hxx" -using namespace std; - //Constructor DF_Application::DF_Application() { @@ -37,7 +35,7 @@ DF_Application::~DF_Application() //Creates a new document with given type, returns a smart pointer to //newly created document. -DF_Document* DF_Application::NewDocument(const string& theDocumentType) +DF_Document* DF_Application::NewDocument(const std::string& theDocumentType) { DF_Document* aDoc = new DF_Document(theDocumentType); aDoc->_id = ++_currentID; @@ -68,10 +66,10 @@ DF_Document* DF_Application::GetDocument(int theDocumentID) } //Returns a list of IDs of all currently opened documents -vector DF_Application::GetDocumentIDs() +std::vector DF_Application::GetDocumentIDs() { - vector ids; - typedef map::const_iterator DI; + std::vector ids; + typedef std::map::const_iterator DI; for(DI p = _documents.begin(); p!=_documents.end(); p++) ids.push_back(p->first); return ids; @@ -86,7 +84,7 @@ int DF_Application::NbDocuments() //Restores a Document from the given file, returns a smart //pointer to opened document. -DF_Document* DF_Application::Open(const string& theFileName) +DF_Document* DF_Application::Open(const std::string& theFileName) { //Not implemented return NULL; @@ -94,7 +92,7 @@ DF_Document* DF_Application::Open(const string& theFileName) //Saves a Document in a given file with name theFileName -void DF_Application::SaveAs(const DF_Document* theDocument, const string& theFileName) +void DF_Application::SaveAs(const DF_Document* theDocument, const std::string& theFileName) { //Not implemented } diff --git a/src/DF/DF_Attribute.cxx b/src/DF/DF_Attribute.cxx index a3560c60c..21b2b34ca 100644 --- a/src/DF/DF_Attribute.cxx +++ b/src/DF/DF_Attribute.cxx @@ -23,8 +23,6 @@ #include "DF_Label.hxx" #include "DF_Attribute.hxx" -using namespace std; - //Class DF_Attribute is used to store some data defined by the DF_Attribute type //Constructor @@ -38,7 +36,7 @@ DF_Attribute::~DF_Attribute() //Remove an attribute from a map of the node's attributes to //avoid double deletion on the node destruction if(_node) { - map::iterator mi; + std::map::iterator mi; for(mi =_node->_attributes.begin(); mi != _node->_attributes.end(); mi++) { if(mi->second == this) { _node->_attributes.erase(mi); @@ -55,7 +53,7 @@ DF_Label DF_Attribute::Label() const } //Searches an Attribute with given ID located on the same Label as this Attribute. -DF_Attribute* DF_Attribute::FindAttribute(const string& theID) const +DF_Attribute* DF_Attribute::FindAttribute(const std::string& theID) const { if(!_node) return NULL; return Label().FindAttribute(theID); diff --git a/src/DF/DF_ChildIterator.cxx b/src/DF/DF_ChildIterator.cxx index a7b73c6f6..659fe0c0a 100644 --- a/src/DF/DF_ChildIterator.cxx +++ b/src/DF/DF_ChildIterator.cxx @@ -21,9 +21,6 @@ // #include "DF_ChildIterator.hxx" -using namespace std; - - //Constructor DF_ChildIterator::DF_ChildIterator(const DF_Label& theLabel, bool allLevels) :_root(NULL), _current(NULL) diff --git a/src/DF/DF_Container.cxx b/src/DF/DF_Container.cxx index d03d6e274..003ffe1aa 100644 --- a/src/DF/DF_Container.cxx +++ b/src/DF/DF_Container.cxx @@ -23,12 +23,10 @@ #include "DF_Label.hxx" #include "DF_Container.hxx" -using namespace std; - //Static method that returns an ID of the give type of attributes -const string& DF_Container::GetID() +const std::string& DF_Container::GetID() { - static string id = "DF_Container_srn"; + static std::string id = "DF_Container_srn"; return id; } @@ -63,13 +61,13 @@ DF_Container::~DF_Container() } //Sets an integer value of the attribute with given ID -void DF_Container::SetInt(const string& theID, int theValue) +void DF_Container::SetInt(const std::string& theID, int theValue) { _ints[theID] = theValue; } //Returns an integer value of the attribute with given ID -int DF_Container::GetInt(const string& theID) +int DF_Container::GetInt(const std::string& theID) { if(!HasIntID(theID)) return 0; @@ -77,68 +75,68 @@ int DF_Container::GetInt(const string& theID) } //Returns True if there is an integer with given ID -bool DF_Container::HasIntID(const string& theID) +bool DF_Container::HasIntID(const std::string& theID) { if(_ints.find(theID) != _ints.end()) return true; return false; } //Sets a double value of the attribute with given ID -void DF_Container::SetDouble(const string& theID, const double& theValue) +void DF_Container::SetDouble(const std::string& theID, const double& theValue) { _doubles[theID] = theValue; } //Returns a double value of the attribute with given ID -double DF_Container::GetDouble(const string& theID) +double DF_Container::GetDouble(const std::string& theID) { if(!HasDoubleID(theID)) return 0.0; return _doubles[theID]; } //Returns True if there is a double with given ID -bool DF_Container::HasDoubleID(const string& theID) +bool DF_Container::HasDoubleID(const std::string& theID) { if(_doubles.find(theID) != _doubles.end()) return true; return false; } //Sets a string value of the attribute with given ID -void DF_Container::SetString(const string& theID, const string& theValue) +void DF_Container::SetString(const std::string& theID, const std::string& theValue) { _strings[theID] = theValue; } //Returns a string value of the attribute with given ID -string DF_Container::GetString(const string& theID) +std::string DF_Container::GetString(const std::string& theID) { if(!HasStringID(theID)) return ""; return _strings[theID]; } //Returns True if there is a string with given ID -bool DF_Container::HasStringID(const string& theID) +bool DF_Container::HasStringID(const std::string& theID) { if(_strings.find(theID) != _strings.end()) return true; return false; } //Sets a boolean value of the attribute with given ID -void DF_Container::SetBool(const string& theID, bool theValue) +void DF_Container::SetBool(const std::string& theID, bool theValue) { _bools[theID] = theValue; } //Returns a boolean value of the attribute with given ID -bool DF_Container::GetBool(const string& theID) +bool DF_Container::GetBool(const std::string& theID) { if(!HasBoolID(theID)) return false; return _bools[theID]; } //Returns True if there is a boolean value with given ID -bool DF_Container::HasBoolID(const string& theID) +bool DF_Container::HasBoolID(const std::string& theID) { if(_bools.find(theID) != _bools.end()) return true; return false; @@ -154,7 +152,7 @@ void DF_Container::Clear() } //ID is a string that uniquely identify the given type of Attributes within the Application. -const string& DF_Container::ID() const +const std::string& DF_Container::ID() const { return GetID(); } @@ -167,19 +165,19 @@ void DF_Container::Restore(DF_Attribute* theAttribute) DF_Container* attr = dynamic_cast(theAttribute); if(!attr) return; - typedef map::const_iterator SI; + typedef std::map::const_iterator SI; for(SI p = attr->_ints.begin(); p != attr->_ints.end(); p++) _ints[p->first] = p->second; - typedef map::const_iterator SD; + typedef std::map::const_iterator SD; for(SD p = attr->_doubles.begin(); p != attr->_doubles.end(); p++) _doubles[p->first] = p->second; - typedef map::const_iterator SS; + typedef std::map::const_iterator SS; for(SS p = attr->_strings.begin(); p != attr->_strings.end(); p++) _strings[p->first] = p->second; - typedef map::const_iterator SB; + typedef std::map::const_iterator SB; for(SB p = attr->_bools.begin(); p != attr->_bools.end(); p++) _bools[p->first] = p->second; } @@ -198,20 +196,19 @@ void DF_Container::Paste(DF_Attribute* theIntoAttribute) attr->Clear(); - typedef map::const_iterator SI; + typedef std::map::const_iterator SI; for(SI p = _ints.begin(); p != _ints.end(); p++) attr->_ints[p->first] = p->second; - typedef map::const_iterator SD; + typedef std::map::const_iterator SD; for(SD p = _doubles.begin(); p != _doubles.end(); p++) attr->_doubles[p->first] = p->second; - typedef map::const_iterator SS; + typedef std::map::const_iterator SS; for(SS p = _strings.begin(); p != _strings.end(); p++) attr->_strings[p->first] = p->second; - typedef map::const_iterator SB; + typedef std::map::const_iterator SB; for(SB p = _bools.begin(); p != _bools.end(); p++) attr-> _bools[p->first] = p->second; } - diff --git a/src/DF/DF_Document.cxx b/src/DF/DF_Document.cxx index 68fe98559..39c8b2265 100644 --- a/src/DF/DF_Document.cxx +++ b/src/DF/DF_Document.cxx @@ -24,12 +24,10 @@ #include "DF_Label.hxx" #include "DF_ChildIterator.hxx" -using namespace std; - //Class DF_Document is container for user's data stored as a tree of Labels //with assigned Attributes -DF_Document::DF_Document(const string& theDocumentType) +DF_Document::DF_Document(const std::string& theDocumentType) { _id = -1; _type = theDocumentType; @@ -82,7 +80,7 @@ int DF_Document::GetDocumentID() const } //Returns a type of the Document -string DF_Document::GetDocumentType() +std::string DF_Document::GetDocumentType() { return _type; } @@ -92,7 +90,7 @@ void DF_Document::Clear() { if(_root.IsNull()) return; - vector vn; + std::vector vn; DF_ChildIterator CI(_root, true); for(; CI.More(); CI.Next()) { DF_LabelNode* node = CI.Value()._node; @@ -140,7 +138,7 @@ void DF_Document::Load(const std::string& theData) } //Converts a content of the Document into the std::string -string DF_Document::Save() +std::string DF_Document::Save() { //Not implemented return ""; diff --git a/src/DF/DF_Label.cxx b/src/DF/DF_Label.cxx index c26b891d1..5657c7838 100644 --- a/src/DF/DF_Label.cxx +++ b/src/DF/DF_Label.cxx @@ -27,8 +27,6 @@ #include -using namespace std; - //Class DF_Label defines a persistence reference in DF_Document that contains a tree of Labels. //This reference is named "entry" and is a sequence of tags divided by ":". The root entry is "0:". //For example "0:1:1" corresponds the following structure @@ -38,7 +36,7 @@ using namespace std; // | // |_ 1 -DF_Label DF_Label::Label(const DF_Label& theLabel, const string& theEntry, bool isCreated) +DF_Label DF_Label::Label(const DF_Label& theLabel, const std::string& theEntry, bool isCreated) { if(theLabel.IsNull()) return DF_Label(); @@ -48,7 +46,7 @@ DF_Label DF_Label::Label(const DF_Label& theLabel, const string& theEntry, bool char* cc = (char*)theEntry.c_str(); int n = 0; - vector tags; + std::vector tags; while (*cc != '\0') { while ( *cc >= '0' && *cc <= '9') { @@ -190,7 +188,7 @@ bool DF_Label::ForgetAllAttributes(bool clearChildren) const { if(!_node) return false; - vector va = GetAttributes(); + std::vector va = GetAttributes(); _node->_attributes.clear(); for(int i = 0, len = va.size(); i DF_Label::GetAttributes() const +std::vector DF_Label::GetAttributes() const { - vector attributes; + std::vector attributes; if(!_node) return attributes; - typedef map::const_iterator AI; - vector sorted; + typedef std::map::const_iterator AI; + std::vector sorted; for(AI p = _node->_attributes.begin(); p!=_node->_attributes.end(); p++) sorted.push_back(p->first); @@ -378,10 +376,10 @@ DF_Label DF_Label::NewChild() } //Returns a string entry of this Label -string DF_Label::Entry() const +std::string DF_Label::Entry() const { - string entry = ""; - vector vi; + std::string entry = ""; + std::vector vi; DF_LabelNode* father = this->_node; while(father) { vi.push_back(father->_tag); @@ -397,7 +395,7 @@ string DF_Label::Entry() const for(int i = len-1; i>=0; i--) { int tag = vi[i]; sprintf(buffer, "%d", tag); - entry+=string(buffer); + entry+=std::string(buffer); if(i) entry += ":"; } } @@ -421,23 +419,23 @@ void DF_Label::Nullify() void DF_Label::dump() { - if(!_node) cout << "DF_Label addr : " << this << " NULL " << endl; + if(!_node) std::cout << "DF_Label addr : " << this << " NULL " << std::endl; else { - cout << "DF_Label addr : " << this->_node << " entry : " << Entry() << endl; - if(_node->_father) cout << " Father : " << _node->_father << " entry : " << Father().Entry() << endl; - else cout << " Father : NULL " << endl; + std::cout << "DF_Label addr : " << this->_node << " entry : " << Entry() << std::endl; + if(_node->_father) std::cout << " Father : " << _node->_father << " entry : " << Father().Entry() << std::endl; + else std::cout << " Father : NULL " << std::endl; - if(_node->_firstChild) cout << " FirstChild : " << _node->_firstChild << " entry : " << DF_Label(_node->_firstChild).Entry() << endl; - else cout << " FirstChild : NULL " << endl; + if(_node->_firstChild) std::cout << " FirstChild : " << _node->_firstChild << " entry : " << DF_Label(_node->_firstChild).Entry() << std::endl; + else std::cout << " FirstChild : NULL " << std::endl; - if(_node->_lastChild) cout << " LastChild : " << _node->_lastChild << " entry : " << DF_Label(_node->_lastChild).Entry() << endl; - else cout << " LastChild : NULL " << endl; + if(_node->_lastChild) std::cout << " LastChild : " << _node->_lastChild << " entry : " << DF_Label(_node->_lastChild).Entry() << std::endl; + else std::cout << " LastChild : NULL " << std::endl; - if(_node->_previous) cout << " Previous : " << _node->_previous << " entry : " << DF_Label(_node->_previous).Entry() << endl; - else cout << " Previous : NULL " << endl; + if(_node->_previous) std::cout << " Previous : " << _node->_previous << " entry : " << DF_Label(_node->_previous).Entry() << std::endl; + else std::cout << " Previous : NULL " << std::endl; - if(_node->_next) cout << " Next : " << _node->_next << " entry : " << DF_Label(_node->_next).Entry() << endl; - else cout << " Next : NULL " << endl; + if(_node->_next) std::cout << " Next : " << _node->_next << " entry : " << DF_Label(_node->_next).Entry() << std::endl; + else std::cout << " Next : NULL " << std::endl; } } @@ -463,8 +461,8 @@ DF_LabelNode::DF_LabelNode() DF_LabelNode::~DF_LabelNode() { - vector va; - typedef map::const_iterator AI; + std::vector va; + typedef std::map::const_iterator AI; for(AI p = _attributes.begin(); p!=_attributes.end(); p++) va.push_back(p->second); @@ -480,8 +478,8 @@ void DF_LabelNode::Reset() _depth = 0; _tag = 0; - vector va; - typedef map::const_iterator AI; + std::vector va; + typedef std::map::const_iterator AI; for(AI p = _attributes.begin(); p!=_attributes.end(); p++) va.push_back(p->second); diff --git a/src/DF/testDF.cxx b/src/DF/testDF.cxx index 1e44603f3..bb69bb62a 100644 --- a/src/DF/testDF.cxx +++ b/src/DF/testDF.cxx @@ -47,11 +47,10 @@ #include #endif -using namespace std; -void printStr(const string& theValue) +void printStr(const std::string& theValue) { - cout << "printStr: " << theValue << endl; + std::cout << "printStr: " << theValue << std::endl; } void GetSystemDate(int& year, int& month, int& day, int& hours, int& minutes, int& seconds) @@ -85,25 +84,25 @@ void GetSystemDate(int& year, int& month, int& day, int& hours, int& minutes, in #endif } -string GetUserName() +std::string GetUserName() { #ifdef WIN32 char* pBuff = new char[UNLEN + 1]; DWORD dwSize = UNLEN + 1; - string retVal; + std::string retVal; GetUserName ( pBuff, &dwSize ); - string theTmpUserName(pBuff,(int)dwSize -1 ); + std::string theTmpUserName(pBuff,(int)dwSize -1 ); retVal = theTmpUserName; delete [] pBuff; return retVal; #else struct passwd *infos; infos = getpwuid(getuid()); - return string(infos->pw_name); + return std::string(infos->pw_name); #endif } -string GetNameFromPath(const string& thePath) { +std::string GetNameFromPath(const std::string& thePath) { if (thePath.empty()) return ""; int pos1 = thePath.rfind('/'); int pos2 = thePath.rfind('\\'); @@ -112,11 +111,11 @@ string GetNameFromPath(const string& thePath) { return thePath; } -string GetDirFromPath(const string& thePath) { +std::string GetDirFromPath(const std::string& thePath) { if (thePath.empty()) return ""; int pos = thePath.rfind('/'); - string path; + std::string path; if(pos > 0) { path = thePath.substr(0, pos+1); } @@ -142,7 +141,7 @@ string GetDirFromPath(const string& thePath) { } -bool Exists(const string thePath) +bool Exists(const std::string thePath) { #ifdef WIN32 if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { @@ -158,14 +157,14 @@ bool Exists(const string thePath) } -string divideString(const string& theValue, int nbChars) +std::string divideString(const std::string& theValue, int nbChars) { return theValue.substr(nbChars, theValue.size()); } -vector splitString(const string& theValue, char separator) +std::vector splitString(const std::string& theValue, char separator) { - vector vs; + std::vector vs; if(theValue[0] == separator && theValue.size() == 1) return vs; int pos = theValue.find(separator); if(pos < 0) { @@ -173,7 +172,7 @@ vector splitString(const string& theValue, char separator) return vs; } - string s = theValue; + std::string s = theValue; if(s[0] == separator) s = s.substr(1, s.size()); while((pos = s.find(separator)) >= 0) { vs.push_back(s.substr(0, pos)); @@ -187,7 +186,7 @@ vector splitString(const string& theValue, char separator) int main (int argc, char * argv[]) { - cout << "Test started " << endl; + std::cout << "Test started " << std::endl; DF_Application* appli = new DF_Application; /* @@ -202,23 +201,23 @@ int main (int argc, char * argv[]) DF_Attribute* attr = NULL; if(!(attr = child.FindAttribute(DF_Container::GetID()))) { - cout << "Attribute wasn't found" << endl; + std::cout << "Attribute wasn't found" << std::endl; } else { attr1 = dynamic_cast(attr); - cout << "Attribute was found " << " HasID " << attr1->HasIntID("eighteen") << " value = " << attr1->GetInt("eighteen")<< endl; + std::cout << "Attribute was found " << " HasID " << attr1->HasIntID("eighteen") << " value = " << attr1->GetInt("eighteen")<< std::endl; } DF_Container *attr2 = (DF_Container*)child.FindAttribute(DF_Container::GetID()); if(!attr2) cout << "Can't find the attribute" << endl; - cout << "Change find : " << attr2->GetInt("eighteen") << endl; + std::cout << "Change find : " << attr2->GetInt("eighteen") << std::endl; - cout << "Forgetting " << child.ForgetAttribute(DF_Container::GetID()) << endl; + std::cout << "Forgetting " << child.ForgetAttribute(DF_Container::GetID()) << std::endl; if(!child.FindAttribute(DF_Container::GetID())) { - cout << "Attribute wasn't found" << endl; + std::cout << "Attribute wasn't found" << std::endl; } @@ -228,8 +227,8 @@ int main (int argc, char * argv[]) child.NewChild();//0:1:4:2 - cout << "Is equal " << (child == child) << endl; - cout << "Is equal " << (child == root1) << endl; + std::cout << "Is equal " << (child == child) << std::endl; + std::cout << "Is equal " << (child == root1) << std::endl; child = root1.NewChild(); //0:1:5 @@ -240,24 +239,24 @@ int main (int argc, char * argv[]) DF_ChildIterator CI(root1.Father(), true); //root1.dump(); for(; CI.More(); CI.Next()) { - cout << CI.Value().Entry() << endl; + std::cout << CI.Value().Entry() << std::endl; //CI.Value().dump(); } DF_Label L = DF_Label::Label(child, "0:1:4:1"); - cout << "Found Label " << L.Entry() << endl; + std::cout << "Found Label " << L.Entry() << std::endl; std::string s("012-56"); int pos = s.find('-'); - cout << "Fisrt part : " << s.substr(0, pos) << endl; - cout << "Last part : " << s.substr(pos+1, s.size()) << endl; + std::cout << "Fisrt part : " << s.substr(0, pos) << std::endl; + std::cout << "Last part : " << s.substr(pos+1, s.size()) << std::endl; - vector vs = splitString("/dn20/salome/srn/salome2/", '/'); + std::vector vs = splitString("/dn20/salome/srn/salome2/", '/'); for(int i = 0; i -using namespace std; - int main(int argc, char* argv[]) { PortableServer::POA_var root_poa; diff --git a/src/DSC/DSC_User/Basic/basic_port_factory.cxx b/src/DSC/DSC_User/Basic/basic_port_factory.cxx index 9c147cf05..4dea816a8 100644 --- a/src/DSC/DSC_User/Basic/basic_port_factory.cxx +++ b/src/DSC/DSC_User/Basic/basic_port_factory.cxx @@ -26,7 +26,6 @@ #include "basic_port_factory.hxx" #include "Superv_Component_i.hxx" -using namespace std; basic_port_factory::basic_port_factory() { Superv_Component_i::register_factory("BASIC",this); @@ -35,7 +34,7 @@ basic_port_factory::basic_port_factory() { basic_port_factory::~basic_port_factory() {} provides_port * -basic_port_factory::create_data_servant(string type) { +basic_port_factory::create_data_servant(std::string type) { provides_port * rtn_port = NULL; if (type == "short") { rtn_port = new data_short_port_provides(); @@ -44,7 +43,7 @@ basic_port_factory::create_data_servant(string type) { } uses_port * -basic_port_factory::create_data_proxy(string type) { +basic_port_factory::create_data_proxy(std::string type) { uses_port * rtn_port = NULL; if (type == "short") rtn_port = new data_short_port_uses(); diff --git a/src/DSC/DSC_User/Basic/data_short_port_uses.cxx b/src/DSC/DSC_User/Basic/data_short_port_uses.cxx index 1127a0034..a5af282d6 100644 --- a/src/DSC/DSC_User/Basic/data_short_port_uses.cxx +++ b/src/DSC/DSC_User/Basic/data_short_port_uses.cxx @@ -25,7 +25,6 @@ // #include "data_short_port_uses.hxx" #include -using namespace std; data_short_port_uses::data_short_port_uses() { _my_ports = NULL; @@ -43,7 +42,7 @@ data_short_port_uses::put(CORBA::Short data) { // if (!CORBA::is_nil(_my_port)) // _my_port->put(data); if (!_my_ports) - cerr << "data_short_port_uses::put is NULL" << endl; + std::cerr << "data_short_port_uses::put is NULL" << std::endl; else { for(int i = 0; i < _my_ports->length(); i++) @@ -61,6 +60,6 @@ data_short_port_uses::uses_port_changed(Engines::DSC::uses_port * new_uses_port, if (_my_ports) delete _my_ports; - cerr << "data_short_port_uses::uses_port_changed" << endl; + std::cerr << "data_short_port_uses::uses_port_changed" << std::endl; _my_ports = new Engines::DSC::uses_port(*new_uses_port); } diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.cxx index 8b05780c4..8924b31c1 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.cxx @@ -31,8 +31,6 @@ #define PRG_MAIN #include "calciumP.h" -using namespace std; - namespace CalciumInterface { }; diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.cxx index 7513d2a21..58664252a 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.cxx @@ -27,14 +27,13 @@ #include "utilities.h" #include -using namespace std; -CORBA_DATE_CAL_SCHEM::CORBA_DATE_CAL_SCHEM() : map() { - map & - table = ( map & ) *this ; table[CalciumTypes::TI_SCHEM ] = Ports::Calcium_Ports::TI_SCHEM ; @@ -45,8 +44,8 @@ table[CalciumTypes::ALPHA_SCHEM ] = Ports::Calcium_Ports::ALPHA_SCHEM ; Ports::Calcium_Ports::DateCalSchem CORBA_DATE_CAL_SCHEM::operator[]( const CalciumTypes::DateCalSchem &c ) const { - map &table = (map &table = (std::map&)*this ; assert( table.find( (CalciumTypes::DateCalSchem)c ) != table.end() ) ; return table[ (CalciumTypes::DateCalSchem)c ] ; @@ -56,12 +55,12 @@ const CORBA_DATE_CAL_SCHEM corbaDateCalSchem ; -CORBA_DEPENDENCY_TYPE::CORBA_DEPENDENCY_TYPE() : map() { - map & - table = ( map & ) *this ; table[CalciumTypes::TIME_DEPENDENCY ] = Ports::Calcium_Ports::TIME_DEPENDENCY ; @@ -77,9 +76,9 @@ CORBA_DEPENDENCY_TYPE::CORBA_DEPENDENCY_TYPE() : map & - table = (map& ) *this ; MESSAGE("CORBA_DEPENDENCY_TYPE() : ::operator["< () { - map & - table = ( map & ) *this ; table[CalciumTypes::L0_SCHEM ] = Ports::Calcium_Ports::L0_SCHEM ; @@ -108,9 +107,9 @@ CORBA_INTERPOLATION_SCHEM::CORBA_INTERPOLATION_SCHEM() : map &table = - (map& ) *this ; assert( table.find( (CalciumTypes::InterpolationSchem)c ) != table.end() ) ; @@ -121,12 +120,12 @@ const CORBA_INTERPOLATION_SCHEM corbaInterpolationSchem ; -CORBA_EXTRAPOLATION_SCHEM::CORBA_EXTRAPOLATION_SCHEM() : map () { - map & - table = ( map & ) *this ; table[CalciumTypes::E0_SCHEM ] = Ports::Calcium_Ports::E0_SCHEM ; @@ -137,9 +136,9 @@ CORBA_EXTRAPOLATION_SCHEM::CORBA_EXTRAPOLATION_SCHEM() : map &table = - (map& ) *this ; assert( table.find( (CalciumTypes::ExtrapolationSchem)c ) != table.end() ) ; diff --git a/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.cxx b/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.cxx index 2db543e9f..32dc912dc 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.cxx @@ -27,14 +27,12 @@ #include "utilities.h" #include -using namespace std; - -DATE_CAL_SCHEM::DATE_CAL_SCHEM() : map() { - map & - table = ( map & ) *this ; table[Ports::Calcium_Ports::TI_SCHEM ] = CalciumTypes::TI_SCHEM ; @@ -45,8 +43,8 @@ table[Ports::Calcium_Ports::ALPHA_SCHEM ] = CalciumTypes::ALPHA_SCHEM ; CalciumTypes::DateCalSchem DATE_CAL_SCHEM::operator[]( const Ports::Calcium_Ports::DateCalSchem &c ) const { - map &table = (map &table = (std::map&)*this ; assert( table.find( (Ports::Calcium_Ports::DateCalSchem)c ) != table.end() ) ; return table[ (Ports::Calcium_Ports::DateCalSchem)c ] ; @@ -56,12 +54,12 @@ const DATE_CAL_SCHEM dateCalSchem ; -DEPENDENCY_TYPE::DEPENDENCY_TYPE() : map() { - map & - table = ( map & ) *this ; table[Ports::Calcium_Ports::TIME_DEPENDENCY ] = CalciumTypes::TIME_DEPENDENCY ; @@ -76,8 +74,8 @@ DEPENDENCY_TYPE::DEPENDENCY_TYPE() : map &table = (map &table = (std::map&)*this ; MESSAGE("DEPENDENCY_TYPE() : ::operator["< () { - map & - table = ( map & ) *this ; table[Ports::Calcium_Ports::L0_SCHEM ] = CalciumTypes::L0_SCHEM ; @@ -106,9 +104,9 @@ INTERPOLATION_SCHEM::INTERPOLATION_SCHEM() : map &table = - (map& ) *this ; assert( table.find( (Ports::Calcium_Ports::InterpolationSchem)c ) != table.end() ) ; @@ -119,12 +117,12 @@ const INTERPOLATION_SCHEM interpolationSchem ; -EXTRAPOLATION_SCHEM::EXTRAPOLATION_SCHEM() : map () { - map & - table = ( map & ) *this ; table[Ports::Calcium_Ports::E0_SCHEM ] = CalciumTypes::E0_SCHEM ; @@ -135,9 +133,9 @@ EXTRAPOLATION_SCHEM::EXTRAPOLATION_SCHEM() : map &table = - (map& ) *this ; assert( table.find( (Ports::Calcium_Ports::ExtrapolationSchem)c ) != table.end() ) ; diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.cxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.cxx index a7fc37f3c..b7fa2d482 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_port_factory.cxx @@ -29,7 +29,6 @@ #include "calcium_port_factory.hxx" #include "Superv_Component_i.hxx" -using namespace std; calcium_port_factory::calcium_port_factory() { Superv_Component_i::register_factory("CALCIUM",this); @@ -38,7 +37,7 @@ calcium_port_factory::calcium_port_factory() { calcium_port_factory::~calcium_port_factory() {} provides_port * -calcium_port_factory::create_data_servant(string type) { +calcium_port_factory::create_data_servant(std::string type) { provides_port * rtn_port = NULL; if ( type == "integer") @@ -62,7 +61,7 @@ calcium_port_factory::create_data_servant(string type) { } uses_port * -calcium_port_factory::create_data_proxy(string type) { +calcium_port_factory::create_data_proxy(std::string type) { uses_port * rtn_port = NULL; if ( type == "integer") diff --git a/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx b/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx index 18656bfff..de1977657 100644 --- a/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx +++ b/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx @@ -29,8 +29,6 @@ #include "palm_port_factory.hxx" #include "Superv_Component_i.hxx" -using namespace std; - palm_port_factory::palm_port_factory() { Superv_Component_i::register_factory("PALM",this); } @@ -38,7 +36,7 @@ palm_port_factory::palm_port_factory() { palm_port_factory::~palm_port_factory() {} provides_port * -palm_port_factory::create_data_servant(string type) { +palm_port_factory::create_data_servant(std::string type) { provides_port * rtn_port = NULL; if (type == "short") { rtn_port = new palm_data_short_port_provides(); @@ -50,7 +48,7 @@ palm_port_factory::create_data_servant(string type) { } uses_port * -palm_port_factory::create_data_proxy(string type) { +palm_port_factory::create_data_proxy(std::string type) { uses_port * rtn_port = NULL; return rtn_port; } diff --git a/src/GenericObj/SALOME_GenericObj_i.cc b/src/GenericObj/SALOME_GenericObj_i.cc index bee7e62cf..3c84123cb 100644 --- a/src/GenericObj/SALOME_GenericObj_i.cc +++ b/src/GenericObj/SALOME_GenericObj_i.cc @@ -34,7 +34,6 @@ static int MYDEBUG = 0; #endif using namespace SALOME; -using namespace std; GenericObj_i::GenericObj_i(PortableServer::POA_ptr thePOA): myRefCounter(1){ if(MYDEBUG) diff --git a/src/HDFPersist/HDFascii.cc b/src/HDFPersist/HDFascii.cc index e1894af6f..4f42b3c2c 100644 --- a/src/HDFPersist/HDFascii.cc +++ b/src/HDFPersist/HDFascii.cc @@ -45,10 +45,8 @@ #define dir_separator '/' #endif -using namespace std; - -void Move(const string& fName, const string& fNameDst); -bool Exists(const string thePath); +void Move(const std::string& fName, const std::string& fNameDst); +bool Exists(const std::string thePath); bool CreateAttributeFromASCII(HDFinternalObject *father, FILE* fp); bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp); bool CreateGroupFromASCII(HDFcontainerObject *father, FILE *fp); @@ -57,7 +55,7 @@ void SaveAttributeInASCIIfile(HDFattribute *hdf_attribute, FILE* fp, int ident); void SaveGroupInASCIIfile(HDFgroup *hdf_group, FILE* fp, int ident); void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident); -string GetTmpDir(); +std::string GetTmpDir(); char* makeName(char* name); char* restoreName(char* name); void write_float64(FILE* fp, hdf_float64* value); @@ -109,13 +107,13 @@ char* HDFascii::ConvertFromHDFToASCII(const char* thePath, bool isReplace, const char* theExtension) { - string aPath(thePath); + std::string aPath(thePath); if(!isReplace) { if(theExtension == NULL) aPath += ".asc"; else aPath += (char*)theExtension; } - string aFileName(aPath); + std::string aFileName(aPath); if(isReplace) aFileName=aPath+".ascii_tmp"; HDFfile *hdf_file = new HDFfile((char*)thePath); @@ -375,7 +373,7 @@ void SaveAttributeInASCIIfile(HDFattribute *hdf_attribute, FILE* fp, int ident) char* HDFascii::ConvertFromASCIIToHDF(const char* thePath, bool isReplace) { - string aTmpDir, aFullName; + std::string aTmpDir, aFullName; if(!isReplace) { // Get a temporary directory to store a file aTmpDir = GetTmpDir(); @@ -384,7 +382,7 @@ char* HDFascii::ConvertFromASCIIToHDF(const char* thePath, } else { aTmpDir = thePath; - aFullName = string(thePath)+".ascii_tmp"; + aFullName = std::string(thePath)+".ascii_tmp"; } FILE *fp = fopen(thePath, "r"); @@ -406,30 +404,30 @@ char* HDFascii::ConvertFromASCIIToHDF(const char* thePath, if(strcmp(id_of_begin, GROUP_ID) == 0) { if(!CreateGroupFromASCII(hdf_file, fp)) { - cout << "ConvertFromASCIIToHDF : Can not create group number " << i << endl; + std::cout << "ConvertFromASCIIToHDF : Can not create group number " << i << std::endl; return NULL; } } else if(strcmp(id_of_begin, DATASET_ID) == 0) { if(!CreateDatasetFromASCII(hdf_file, fp)) { - cout << "ConvertFromASCIIToHDF :Can not create dataset number " << i << endl; + std::cout << "ConvertFromASCIIToHDF :Can not create dataset number " << i << std::endl; return NULL; } } else if(strcmp(id_of_begin, ATTRIBUTE_ID) == 0) { if(!CreateAttributeFromASCII(hdf_file, fp)) { - cout << "ConvertFromASCIIToHDF :Can not create attribute number " << i << endl; + std::cout << "ConvertFromASCIIToHDF :Can not create attribute number " << i << std::endl; return NULL; } } else - cout << "ConvertFromASCIIToHDF : Unrecognized type " << id_of_begin << endl; + std::cout << "ConvertFromASCIIToHDF : Unrecognized type " << id_of_begin << std::endl; } char id_of_end[MAX_ID_SIZE]; fscanf(fp, "%s", id_of_end); if(strcmp(id_of_end, ASCIIHDF_ID_END) != 0) { - cout << "ConvertFromASCIIToHDF : Can not find the end ASCII token " << endl; + std::cout << "ConvertFromASCIIToHDF : Can not find the end ASCII token " << std::endl; return false; } @@ -475,24 +473,24 @@ bool CreateGroupFromASCII(HDFcontainerObject *father, FILE *fp) if(strcmp(id_of_begin, GROUP_ID) == 0) { if(!CreateGroupFromASCII(hdf_group, fp)) { - cout << "Can not create subgroup " << i << " for group " << name << endl; + std::cout << "Can not create subgroup " << i << " for group " << name << std::endl; return false; } } else if(strcmp(id_of_begin, DATASET_ID) == 0) { if(!CreateDatasetFromASCII(hdf_group, fp)) { - cout << "Can not create dataset " << i << " for group " << name << endl; + std::cout << "Can not create dataset " << i << " for group " << name << std::endl; return false; } } else if(strcmp(id_of_begin, ATTRIBUTE_ID) == 0) { if(!CreateAttributeFromASCII(hdf_group, fp)) { - cout << "Can not create attribute " << i << " for group " << name << endl; + std::cout << "Can not create attribute " << i << " for group " << name << std::endl; return false; } } else - cout << "CreateGroupFromASCII : Unrecognized type " << id_of_begin << endl; + std::cout << "CreateGroupFromASCII : Unrecognized type " << id_of_begin << std::endl; } hdf_group->CloseOnDisk(); @@ -501,7 +499,7 @@ bool CreateGroupFromASCII(HDFcontainerObject *father, FILE *fp) char id_of_end[MAX_ID_SIZE]; fscanf(fp, "%s\n", id_of_end); if(strcmp(id_of_end, GROUP_ID_END) != 0) { - cout << "CreateGroupFromASCII : Invalid end token : " << id_of_end << endl; + std::cout << "CreateGroupFromASCII : Invalid end token : " << id_of_end << std::endl; return false; } @@ -584,19 +582,19 @@ bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp) if(strcmp(token, ATTRIBUTE_ID) == 0) { if(!CreateAttributeFromASCII(hdf_dataset, fp)) { - cout << "Can not create attribute " << i << " for dataset " << name << endl; + std::cout << "Can not create attribute " << i << " for dataset " << name << std::endl; return false; } } else { - cout << "CreateGroupFromASCII : Unrecognized type " << token << endl; + std::cout << "CreateGroupFromASCII : Unrecognized type " << token << std::endl; return false; } } fscanf(fp, "%s\n", token); if(strcmp(token, DATASET_ID_END) != 0) { - cout << "CreateDatasetFromASCII : Invalid end token : " << token << endl; + std::cout << "CreateDatasetFromASCII : Invalid end token : " << token << std::endl; return false; } @@ -654,7 +652,7 @@ bool CreateAttributeFromASCII(HDFinternalObject *father, FILE* fp) char id_of_end[MAX_ID_SIZE]; fscanf(fp, "%s\n", id_of_end); if(strcmp(id_of_end, ATTRIBUTE_ID_END) != 0) { - cout << "CreateAttributeFromASCII : Invalid end token : " << id_of_end << endl; + std::cout << "CreateAttributeFromASCII : Invalid end token : " << id_of_end << std::endl; return false; } @@ -666,16 +664,16 @@ bool CreateAttributeFromASCII(HDFinternalObject *father, FILE* fp) // function : GetTempDir // purpose : Return a temp directory to store created files like "/tmp/sub_dir/" //============================================================================ -string GetTmpDir() +std::string GetTmpDir() { //Find a temporary directory to store a file - string aTmpDir; + std::string aTmpDir; char *Tmp_dir = getenv("SALOME_TMP_DIR"); if(Tmp_dir != NULL) { - aTmpDir = string(Tmp_dir); + aTmpDir = std::string(Tmp_dir); if(aTmpDir[aTmpDir.size()-1] != dir_separator) aTmpDir+=dir_separator; /*#ifdef WIN32 if(aTmpDir[aTmpDir.size()-1] != '\\') aTmpDir+='\\'; @@ -685,9 +683,9 @@ string GetTmpDir() } else { #ifdef WIN32 - aTmpDir = string("C:\\"); + aTmpDir = std::string("C:\\"); #else - aTmpDir = string("/tmp/"); + aTmpDir = std::string("/tmp/"); #endif } @@ -695,8 +693,8 @@ string GetTmpDir() int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory char buffer[127]; sprintf(buffer, "%d", aRND); - string aSubDir(buffer); - if(aSubDir.size() <= 1) aSubDir = string("123409876"); + std:: string aSubDir(buffer); + if(aSubDir.size() <= 1) aSubDir = std::string("123409876"); aTmpDir += aSubDir; //Get RND sub directory @@ -709,7 +707,7 @@ string GetTmpDir() #endif */ - string aDir = aTmpDir; + std::string aDir = aTmpDir; for(aRND = 0; Exists(aDir); aRND++) { sprintf(buffer, "%d", aRND); @@ -729,7 +727,7 @@ string GetTmpDir() char* makeName(char* name) { - string aName(name), aNewName; + std::string aName(name), aNewName; int i, length = aName.size(); char replace = (char)19; @@ -746,7 +744,7 @@ char* makeName(char* name) char* restoreName(char* name) { - string aName(name), aNewName; + std::string aName(name), aNewName; int i, length = aName.size(); char replace = (char)19; @@ -780,7 +778,7 @@ void read_float64(FILE* fp, hdf_float64* value) } } -bool Exists(const string thePath) +bool Exists(const std::string thePath) { #ifdef WIN32 if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { @@ -795,7 +793,7 @@ bool Exists(const string thePath) return true; } -void Move(const string& fName, const string& fNameDst) +void Move(const std::string& fName, const std::string& fNameDst) { #ifdef WIN32 MoveFileEx (fName.c_str(), fNameDst.c_str(),MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED); diff --git a/src/HDFPersist/HDFattribute.cc b/src/HDFPersist/HDFattribute.cc index 0126e8788..96ed6e3c6 100644 --- a/src/HDFPersist/HDFattribute.cc +++ b/src/HDFPersist/HDFattribute.cc @@ -30,7 +30,6 @@ extern "C" #include "HDFexception.hxx" #include "HDFattribute.hxx" #include "HDFinternalObject.hxx" -using namespace std; HDFattribute::HDFattribute(char *name,HDFinternalObject *father,hdf_type type, size_t size) : HDFobject(name) diff --git a/src/HDFPersist/HDFcontainerObject.cc b/src/HDFPersist/HDFcontainerObject.cc index faf2c6191..6ed01b955 100644 --- a/src/HDFPersist/HDFcontainerObject.cc +++ b/src/HDFPersist/HDFcontainerObject.cc @@ -29,7 +29,6 @@ extern "C" } #include "HDFcontainerObject.hxx" #include "HDFexception.hxx" -using namespace std; HDFcontainerObject::HDFcontainerObject(const char *name) : HDFinternalObject(name) diff --git a/src/HDFPersist/HDFconvert.cc b/src/HDFPersist/HDFconvert.cc index fca543919..76324c855 100644 --- a/src/HDFPersist/HDFconvert.cc +++ b/src/HDFPersist/HDFconvert.cc @@ -24,7 +24,6 @@ // Module : SALOME // #include "HDFconvert.hxx" -using namespace std; #ifdef WIN32 #include @@ -33,7 +32,7 @@ using namespace std; #define close _close #endif -int HDFConvert::FromAscii(const string& file, const HDFcontainerObject & hdf_container, const string& nomdataset) +int HDFConvert::FromAscii(const std::string& file, const HDFcontainerObject & hdf_container, const std::string& nomdataset) { HDFdataset * hdf_dataset; diff --git a/src/HDFPersist/HDFdataset.cc b/src/HDFPersist/HDFdataset.cc index 790e3d065..1fa78205b 100644 --- a/src/HDFPersist/HDFdataset.cc +++ b/src/HDFPersist/HDFdataset.cc @@ -33,7 +33,6 @@ extern "C" #include "HDFexception.hxx" #include -using namespace std; herr_t dataset_attr(hid_t loc_id, const char *attr_name, void *operator_data) { diff --git a/src/HDFPersist/HDFexplorer.cc b/src/HDFPersist/HDFexplorer.cc index 6aa72a26d..d50eb3c97 100644 --- a/src/HDFPersist/HDFexplorer.cc +++ b/src/HDFPersist/HDFexplorer.cc @@ -27,7 +27,6 @@ #include "HDFexception.hxx" #include "HDFinternalObject.hxx" #include "HDFexplorer.hxx" -using namespace std; HDFexplorer::HDFexplorer(HDFcontainerObject *container) { diff --git a/src/HDFPersist/HDFfile.cc b/src/HDFPersist/HDFfile.cc index 453098c26..e6fc04bb9 100644 --- a/src/HDFPersist/HDFfile.cc +++ b/src/HDFPersist/HDFfile.cc @@ -38,7 +38,6 @@ extern "C" #include #include "HDFfile.hxx" #include "HDFexception.hxx" -using namespace std; herr_t file_attr(hid_t loc_id, const char *attr_name, void *operator_data) { diff --git a/src/HDFPersist/HDFgroup.cc b/src/HDFPersist/HDFgroup.cc index 8081645c2..60afbf896 100644 --- a/src/HDFPersist/HDFgroup.cc +++ b/src/HDFPersist/HDFgroup.cc @@ -30,7 +30,6 @@ extern "C" } #include "HDFgroup.hxx" #include "HDFexception.hxx" -using namespace std; herr_t group_attr(hid_t loc_id, const char *attr_name, void *operator_data) { diff --git a/src/HDFPersist/HDFobject.cc b/src/HDFPersist/HDFobject.cc index ae7358784..8fb26bd2d 100644 --- a/src/HDFPersist/HDFobject.cc +++ b/src/HDFPersist/HDFobject.cc @@ -31,7 +31,6 @@ extern "C" #include #include -using namespace std; #ifdef WNT #define strdup _strdup diff --git a/src/HDFPersist/test3.cxx b/src/HDFPersist/test3.cxx index 9a3648e0f..8fa79723e 100644 --- a/src/HDFPersist/test3.cxx +++ b/src/HDFPersist/test3.cxx @@ -26,7 +26,6 @@ #include #include "HDFOI.hxx" #include -using namespace std; int main() diff --git a/src/HDFPersist/test4.cxx b/src/HDFPersist/test4.cxx index f7423e46b..81a12d200 100644 --- a/src/HDFPersist/test4.cxx +++ b/src/HDFPersist/test4.cxx @@ -26,7 +26,6 @@ #include #include "HDFOI.hxx" #include -using namespace std; int main() diff --git a/src/HDFPersist/test5.cxx b/src/HDFPersist/test5.cxx index 3f3d1c4e1..6287dc518 100644 --- a/src/HDFPersist/test5.cxx +++ b/src/HDFPersist/test5.cxx @@ -26,7 +26,6 @@ #include #include "HDFOI.hxx" #include -using namespace std; int main() diff --git a/src/HDFPersist/test6.cxx b/src/HDFPersist/test6.cxx index a9ce51a55..2a15f4a95 100644 --- a/src/HDFPersist/test6.cxx +++ b/src/HDFPersist/test6.cxx @@ -26,7 +26,6 @@ #include #include "HDFOI.hxx" #include -using namespace std; int main() { diff --git a/src/HDFPersist/test7.cxx b/src/HDFPersist/test7.cxx index fd1f9f5c5..7f33b0734 100644 --- a/src/HDFPersist/test7.cxx +++ b/src/HDFPersist/test7.cxx @@ -25,7 +25,7 @@ // #include "HDFIO.hxx" #include -using namespace std; + int main() { diff --git a/src/HDFPersist/test8.cxx b/src/HDFPersist/test8.cxx index 4eda080e1..5fb10d145 100644 --- a/src/HDFPersist/test8.cxx +++ b/src/HDFPersist/test8.cxx @@ -26,7 +26,6 @@ #include #include "HDFOI.hxx" #include -using namespace std; int main() diff --git a/src/HDFPersist/test9.cxx b/src/HDFPersist/test9.cxx index 8dd59436c..a87844584 100644 --- a/src/HDFPersist/test9.cxx +++ b/src/HDFPersist/test9.cxx @@ -26,7 +26,6 @@ #include #include "HDFOI.hxx" #include -using namespace std; int main() diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index 01b224ead..4a4e5f3a0 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -39,8 +39,6 @@ #include #include -using namespace std; - //============================================================================= /*! * Constructor @@ -66,7 +64,7 @@ Launcher_cpp::~Launcher_cpp() { LAUNCHER_MESSAGE("Launcher_cpp destructor"); #ifdef WITH_LIBBATCH - std::map < string, Batch::BatchManager_eClient * >::const_iterator it1; + std::map < std::string, Batch::BatchManager_eClient * >::const_iterator it1; for(it1=_batchmap.begin();it1!=_batchmap.end();it1++) delete it1->second; std::map::const_iterator it_job; @@ -307,7 +305,7 @@ Launcher_cpp::createJobWithFile(const std::string xmlExecuteFile, // Creating a new job Launcher::Job_Command * new_job = new Launcher::Job_Command(); - string cmdFile = Kernel_Utils::GetTmpFileName(); + std::string cmdFile = Kernel_Utils::GetTmpFileName(); #ifndef WIN32 cmdFile += ".sh"; #else @@ -480,7 +478,7 @@ Launcher_cpp::createJobWithFile( const std::string xmlExecuteFile, std::string c #endif ParserLauncherType -Launcher_cpp::ParseXmlFile(string xmlExecuteFile) +Launcher_cpp::ParseXmlFile(std::string xmlExecuteFile) { ParserLauncherType job_params; SALOME_Launcher_Handler * handler = new SALOME_Launcher_Handler(job_params); diff --git a/src/Launcher/SALOME_Launcher.cxx b/src/Launcher/SALOME_Launcher.cxx index 8cec91830..be06642bc 100644 --- a/src/Launcher/SALOME_Launcher.cxx +++ b/src/Launcher/SALOME_Launcher.cxx @@ -38,8 +38,6 @@ #include #include -using namespace std; - const char *SALOME_Launcher::_LauncherNameInNS = "/SalomeLauncher"; //============================================================================= @@ -277,7 +275,7 @@ SALOME_Launcher::testBatch(const Engines::ResourceParameters& params) throw SALOME_Exception("No resources have been found with your parameters"); const Engines::ResourceDefinition* p = _ResManager->GetResourceDefinition((*aMachineList)[0]); - string resource_name(p->name); + std::string resource_name(p->name); INFOS("Choose resource for test: " << resource_name); BatchTest t(*p); diff --git a/src/Launcher/SALOME_LauncherServer.cxx b/src/Launcher/SALOME_LauncherServer.cxx index 6ba6164ea..f325d6798 100644 --- a/src/Launcher/SALOME_LauncherServer.cxx +++ b/src/Launcher/SALOME_LauncherServer.cxx @@ -26,8 +26,6 @@ #include #include -using namespace std; - void AttachDebugger() { #ifndef WIN32 @@ -60,8 +58,8 @@ int main(int argc, char* argv[]) if(getenv ("DEBUGGER")) { // setsig(SIGSEGV,&Handler); - set_terminate(&terminateHandler); - set_unexpected(&unexpectedHandler); + std::set_terminate(&terminateHandler); + std::set_unexpected(&unexpectedHandler); } /* Init libxml * To avoid memory leak, need to call xmlInitParser in the main thread diff --git a/src/Launcher/SALOME_Launcher_Handler.cxx b/src/Launcher/SALOME_Launcher_Handler.cxx index 0a1040315..202143789 100755 --- a/src/Launcher/SALOME_Launcher_Handler.cxx +++ b/src/Launcher/SALOME_Launcher_Handler.cxx @@ -29,8 +29,6 @@ #include #include -using namespace std; - //============================================================================= /*! * Constructor @@ -105,7 +103,7 @@ void SALOME_Launcher_Handler::ProcessXmlDocument(xmlDocPtr theDoc) if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){ _machp.Clear(); xmlChar* name = xmlNodeGetContent(aCurNode2); - string clusterName = (const char*)name; + std::string clusterName = (const char*)name; xmlFree(name); if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){ diff --git a/src/Launcher/SALOME_Launcher_Parser.cxx b/src/Launcher/SALOME_Launcher_Parser.cxx index 0636debbc..867e896c0 100644 --- a/src/Launcher/SALOME_Launcher_Parser.cxx +++ b/src/Launcher/SALOME_Launcher_Parser.cxx @@ -25,8 +25,6 @@ #define NULL_VALUE 0 -using namespace std; - void MachineParameters::Clear() { EnvFile = ""; @@ -35,34 +33,34 @@ void MachineParameters::Clear() void MachineParameters::Print() const { - ostringstream oss; + std::ostringstream oss; oss << " EnvFile: " << EnvFile - << " WorkDirectory: " << WorkDirectory << endl; + << " WorkDirectory: " << WorkDirectory << std::endl; - cout << oss.str(); + std::cout << oss.str(); } void ParserLauncherType::Print() const { - ostringstream oss; - oss << endl << - "RefDirectory: " << RefDirectory << endl << - "NbOfProcesses: " << NbOfProcesses << endl << + std::ostringstream oss; + oss << std::endl << + "RefDirectory: " << RefDirectory << std::endl << + "NbOfProcesses: " << NbOfProcesses << std::endl << "InputFile: "; for(int i=0; i ::const_iterator it; + std::map < std::string, MachineParameters >::const_iterator it; for(it=MachinesList.begin();it!=MachinesList.end();it++){ - cout << " " << it->first; + std::cout << " " << it->first; it->second.Print(); } diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx index 441cc8943..e363b6934 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx @@ -30,8 +30,6 @@ #include "Basics_Utils.hxx" #include -using namespace std; - /*! \class SALOME_FileTransferCORBA \brief A class to manage file transfer in SALOME (CORBA context) @@ -72,9 +70,9 @@ SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(Engines::fileRef_ptr */ //============================================================================= -SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(string refMachine, - string origFileName, - string containerName) +SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(std::string refMachine, + std::string origFileName, + std::string containerName) { MESSAGE("SALOME_FileTransferCORBA::SALOME_FileTransferCORBA" << refMachine << " " << origFileName << " " << containerName); @@ -108,7 +106,7 @@ SALOME_FileTransferCORBA::~SALOME_FileTransferCORBA() */ //============================================================================= -string SALOME_FileTransferCORBA::getLocalFile(string localFile) +std::string SALOME_FileTransferCORBA::getLocalFile(std::string localFile) { MESSAGE("SALOME_FileTransferCORBA::getLocalFile " << localFile); @@ -152,8 +150,8 @@ string SALOME_FileTransferCORBA::getLocalFile(string localFile) container = _theFileRef->getContainer(); ASSERT(! CORBA::is_nil(container)); - string myMachine = Kernel_Utils::GetHostname(); - string localCopy = _theFileRef->getRef(myMachine.c_str()); + std::string myMachine = Kernel_Utils::GetHostname(); + std::string localCopy = _theFileRef->getRef(myMachine.c_str()); if (localCopy.empty()) // no existing copy available { diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index 65a743859..491f4ff3f 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -54,8 +54,6 @@ #include "SALOME_NamingService.hxx" #include "SALOME_FileTransferCORBA.hxx" -using namespace std; - IncompatibleComponent::IncompatibleComponent( void ): SALOME_Exception( "IncompatibleComponent" ) { @@ -296,7 +294,7 @@ SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName, // --- Check if containerName contains machine name (if yes: rg>0) char *stContainer=strdup(containerName); - string st2Container(stContainer); + std::string st2Container(stContainer); int rg=st2Container.find("/"); Engines::MachineParameters_var params=new Engines::MachineParameters; @@ -529,7 +527,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() } } - string hostname = Kernel_Utils::GetHostname(); + std::string hostname = Kernel_Utils::GetHostname(); // 1) ConnectionManager try @@ -665,15 +663,15 @@ void SALOME_LifeCycleCORBA::shutdownServers() void SALOME_LifeCycleCORBA::killOmniNames() { - string portNumber (::getenv ("NSPORT") ); + std::string portNumber (::getenv ("NSPORT") ); if ( !portNumber.empty() ) { #ifdef WNT #else - string cmd ; - cmd = string( "ps -eo pid,command | grep -v grep | grep -E \"omniNames.*") + std::string cmd ; + cmd = std::string( "ps -eo pid,command | grep -v grep | grep -E \"omniNames.*") + portNumber - + string("\" | awk '{cmd=sprintf(\"kill -9 %s\",$1); system(cmd)}'" ); + + std::string("\" | awk '{cmd=sprintf(\"kill -9 %s\",$1); system(cmd)}'" ); MESSAGE(cmd); try { system ( cmd.c_str() ); @@ -686,9 +684,9 @@ void SALOME_LifeCycleCORBA::killOmniNames() // NPAL 18309 (Kill Notifd) if ( !portNumber.empty() ) { - string cmd = ("from killSalomeWithPort import killNotifdAndClean; "); - cmd += string("killNotifdAndClean(") + portNumber + "); "; - cmd = string("python -c \"") + cmd +"\" >& /dev/null"; + std::string cmd = ("from killSalomeWithPort import killNotifdAndClean; "); + cmd += std::string("killNotifdAndClean(") + portNumber + "); "; + cmd = std::string("python -c \"") + cmd +"\" >& /dev/null"; MESSAGE(cmd); system( cmd.c_str() ); } @@ -840,7 +838,7 @@ SALOME_LifeCycleCORBA::Load_ParallelComponent(const Engines::ContainerParameters MESSAGE("Creating component instance"); // @PARALLEL@ permits to identify that the component requested // is a parallel component. - string name = string(componentName); + std::string name = std::string(componentName); Engines::Component_var myInstance = cont->create_component_instance(name.c_str(), studyId); if (CORBA::is_nil(myInstance)) INFOS("create_component_instance returns a NULL component !"); diff --git a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx index b7a6510e3..a29a31eba 100644 --- a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx +++ b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx @@ -31,7 +31,6 @@ #include #include -using namespace std; // --- uncomment to have some traces on standard error // (useful only when adding new tests...) @@ -67,15 +66,15 @@ LifeCycleCORBATest::setUp() // --- trace on file const char *theFileName = TRACEFILE; - string s = "file:"; + std::string s = "file:"; s += theFileName; //s="local"; //s="with_logger"; CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite - ofstream traceFile; - // traceFile.open(theFileName, ios::out | ios::trunc); - traceFile.open(theFileName, ios::out | ios::app); + std::ofstream traceFile; + // traceFile.open(theFileName, std::ios::out | std::ios::trunc); + traceFile.open(theFileName, std::ios::out | std::ios::app); CPPUNIT_ASSERT(traceFile); // file created empty, then closed traceFile.close(); @@ -127,7 +126,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_LaunchContainer() // --- get a local container, // load an engine, check that the CORBA object is not null - string containerName = "myContainer"; + std::string containerName = "myContainer"; Engines::Component_var mycompo = _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent"); CPPUNIT_ASSERT(!CORBA::is_nil(mycompo)); @@ -155,7 +154,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_SameInstance() // --- get a local container, // load an engine, check that the CORBA object is not null - string containerName = "myContainer"; + std::string containerName = "myContainer"; Engines::Component_var mycompo1 = _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent"); @@ -177,8 +176,8 @@ LifeCycleCORBATest::testFindOrLoad_Component_SameInstance() // --- check equality of instance names - string name1 = m1->instanceName(); - string name2 = m2->instanceName(); + std::string name1 = m1->instanceName(); + std::string name2 = m2->instanceName(); CPPUNIT_ASSERT_EQUAL(name1, name2); } @@ -198,7 +197,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_PythonInCppContainer() // --- get a local container, // load an engine, check that the CORBA object is not null - string containerName = "myContainer"; + std::string containerName = "myContainer"; Engines::Component_var mycompo1 = _LCC.FindOrLoad_Component(containerName.c_str(),"SALOME_TestComponentPy"); @@ -227,7 +226,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_PythonSameInstance() // --- get a local container (with a name based on local hostname), // load an engine, check that the CORBA object is not null - string containerName = "myContainer"; + std::string containerName = "myContainer"; Engines::Component_var mycompo1 = _LCC.FindOrLoad_Component(containerName.c_str(),"SALOME_TestComponentPy"); @@ -249,8 +248,8 @@ LifeCycleCORBATest::testFindOrLoad_Component_PythonSameInstance() // --- check equality of instance names - string name1 = m1->instanceName(); - string name2 = m2->instanceName(); + std::string name1 = m1->instanceName(); + std::string name2 = m2->instanceName(); CPPUNIT_ASSERT_EQUAL(name1, name2); } @@ -271,7 +270,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_UnknownInCatalog() // --- get a local container (with a name based on local hostname), // load an engine, check that the CORBA object is not null - string containerName = "myContainer"; + std::string containerName = "myContainer"; Engines::Component_var mycompo1 = _LCC.FindOrLoad_Component(containerName.c_str(),"MyNewComponent"); @@ -295,7 +294,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_LaunchContainerHostname() // --- get a local container (with a name based on local hostname), // load an engine, check that the CORBA object is not null - string containerName = Kernel_Utils::GetHostname(); + std::string containerName = Kernel_Utils::GetHostname(); containerName += "/theContainer"; DEVTRACE("containerName = " << containerName); Engines::Component_var mycompo = @@ -324,7 +323,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_SameContainer() // --- get a local container (with a name based on local hostname), // load an engine, check that the CORBA object is not null - string containerName = "aContainer"; + std::string containerName = "aContainer"; Engines::Component_var mycompo1 = _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent"); @@ -349,8 +348,8 @@ LifeCycleCORBATest::testFindOrLoad_Component_SameContainer() // --- check equality of instance names - string name1 = m1->instanceName(); - string name2 = m2->instanceName(); + std::string name1 = m1->instanceName(); + std::string name2 = m2->instanceName(); CPPUNIT_ASSERT_EQUAL(name1, name2); // --- check containers are the same servant (same container name+hostname) @@ -359,11 +358,11 @@ LifeCycleCORBATest::testFindOrLoad_Component_SameContainer() CPPUNIT_ASSERT(!CORBA::is_nil(c1)); Engines::Container_var c2 = m2->GetContainerRef(); CPPUNIT_ASSERT(!CORBA::is_nil(c1)); - string cname1 = c1->name(); - string cname2 = c2->name(); + std::string cname1 = c1->name(); + std::string cname2 = c2->name(); CPPUNIT_ASSERT_EQUAL(cname1, cname2); - string hostname1 = c1->getHostName(); - string hostname2 = c2->getHostName(); + std::string hostname1 = c1->getHostName(); + std::string hostname2 = c2->getHostName(); CPPUNIT_ASSERT_EQUAL(hostname1, hostname2); CORBA::Long pidc1 = c1->getPID(); CORBA::Long pidc2 = c2->getPID(); @@ -385,7 +384,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_UnknownMachine() // --- try to get a distant container on an unknown machine (not existing) // check that the CORBA object is null - string containerName = "aFarAwayComputer"; + std::string containerName = "aFarAwayComputer"; containerName += "/theContainer"; // CPPUNIT_ASSERT_THROW(Engines::Component_var mycompo = // _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");,SALOME::SALOME_Exception); @@ -397,12 +396,12 @@ LifeCycleCORBATest::testFindOrLoad_Component_UnknownMachine() catch(const SALOME::SALOME_Exception &ex) { CPPUNIT_ASSERT(true); -// string expectedMessage = "BAD PARAM"; +// std::string expectedMessage = "BAD PARAM"; // std::ostream os; // os << ex; -// string actualMessage = os.str(); +// std::string actualMessage = os.str(); // DEVTRACE("actual Exception Message = " << actualMessage); -// CPPUNIT_ASSERT(actualMessage.find(expectedMessage) != string::npos); +// CPPUNIT_ASSERT(actualMessage.find(expectedMessage) != std::string::npos); } } @@ -442,7 +441,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsLocalContainer() Engines::MachineParameters params; _LCC.preSet(params); - string hostname=Kernel_Utils::GetHostname(); + std::string hostname=Kernel_Utils::GetHostname(); params.hostname=hostname.c_str(); Engines::Component_var mycompo = _LCC.FindOrLoad_Component(params,"SalomeTestComponent"); @@ -458,7 +457,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsLocalContainer() CPPUNIT_ASSERT(!CORBA::is_nil(m1)); Engines::Container_var c1 = m1->GetContainerRef(); CPPUNIT_ASSERT(!CORBA::is_nil(c1)); - string hostname1 = c1->getHostName(); + std::string hostname1 = c1->getHostName(); CPPUNIT_ASSERT_EQUAL(hostname1, Kernel_Utils::GetHostname()); } @@ -476,7 +475,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsContainerName() Engines::MachineParameters params; _LCC.preSet(params); - string containerName = "myContainer"; + std::string containerName = "myContainer"; params.container_name = containerName.c_str(); Engines::Component_var mycompo = _LCC.FindOrLoad_Component(params,"SalomeTestComponent"); @@ -492,10 +491,10 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsContainerName() CPPUNIT_ASSERT(!CORBA::is_nil(m1)); Engines::Container_var c1 = m1->GetContainerRef(); CPPUNIT_ASSERT(!CORBA::is_nil(c1)); - string hostname1 = c1->getHostName(); + std::string hostname1 = c1->getHostName(); CPPUNIT_ASSERT_EQUAL(hostname1, Kernel_Utils::GetHostname()); - string cname1 = c1->name(); - CPPUNIT_ASSERT(cname1.find(containerName) != string::npos); + std::string cname1 = c1->name(); + CPPUNIT_ASSERT(cname1.find(containerName) != std::string::npos); } // ============================================================================ @@ -509,9 +508,9 @@ LifeCycleCORBATest::testFindOrLoad_Component_RemoteComputer() { SALOME_LifeCycleCORBA _LCC(&_NS); - string remoteHost = GetRemoteHost(); + std::string remoteHost = GetRemoteHost(); - string containerName = remoteHost; + std::string containerName = remoteHost; containerName += "/aContainer"; DEVTRACE("containerName = " << containerName); Engines::Component_var mycompo1 = @@ -530,7 +529,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_RemoteComputer() CPPUNIT_ASSERT(!CORBA::is_nil(m1)); Engines::Container_var c1 = m1->GetContainerRef(); CPPUNIT_ASSERT(!CORBA::is_nil(c1)); - string hostname1 = c1->getHostName(); + std::string hostname1 = c1->getHostName(); CPPUNIT_ASSERT_EQUAL(hostname1, remoteHost); } @@ -546,7 +545,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsRemoteComputer() { SALOME_LifeCycleCORBA _LCC(&_NS); - string remoteHost = GetRemoteHost(); + std::string remoteHost = GetRemoteHost(); Engines::MachineParameters params; _LCC.preSet(params); @@ -568,7 +567,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsRemoteComputer() CPPUNIT_ASSERT(!CORBA::is_nil(m1)); Engines::Container_var c1 = m1->GetContainerRef(); CPPUNIT_ASSERT(!CORBA::is_nil(c1)); - string hostname1 = c1->getHostName(); + std::string hostname1 = c1->getHostName(); CPPUNIT_ASSERT_EQUAL(hostname1, remoteHost); } @@ -584,7 +583,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsRemoteComputer2() { SALOME_LifeCycleCORBA _LCC(&_NS); - string remoteHost = GetRemoteHost(); + std::string remoteHost = GetRemoteHost(); Engines::MachineParameters params; _LCC.preSet(params); @@ -607,7 +606,7 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsRemoteComputer2() CPPUNIT_ASSERT(!CORBA::is_nil(m1)); Engines::Container_var c1 = m1->GetContainerRef(); CPPUNIT_ASSERT(!CORBA::is_nil(c1)); - string hostname1 = c1->getHostName(); + std::string hostname1 = c1->getHostName(); CPPUNIT_ASSERT_EQUAL(hostname1, remoteHost); } @@ -620,11 +619,11 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsRemoteComputer2() void LifeCycleCORBATest::testgetLocalFile_localComputer() { SALOME_LifeCycleCORBA _LCC(&_NS); - string origFileName = getenv("KERNEL_ROOT_DIR"); + std::string origFileName = getenv("KERNEL_ROOT_DIR"); origFileName += "/lib/salome/libSalomeLifeCycleCORBA.so.0.0.0"; SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(), origFileName); - string local = transfer.getLocalFile(); + std::string local = transfer.getLocalFile(); CPPUNIT_ASSERT(!local.empty()); CPPUNIT_ASSERT_EQUAL(local, origFileName); } @@ -638,13 +637,13 @@ void LifeCycleCORBATest::testgetLocalFile_localComputer() void LifeCycleCORBATest::testgetLocalFile_remoteComputer() { SALOME_LifeCycleCORBA _LCC(&_NS); - string origFileName = getenv("KERNEL_ROOT_DIR"); + std::string origFileName = getenv("KERNEL_ROOT_DIR"); origFileName += "/lib/salome/libSalomeContainer.so.0.0.0"; SALOME_FileTransferCORBA transfer( GetRemoteHost(), origFileName); - string local = transfer.getLocalFile(); + std::string local = transfer.getLocalFile(); CPPUNIT_ASSERT(!local.empty()); - string local2 = transfer.getLocalFile(); + std::string local2 = transfer.getLocalFile(); CPPUNIT_ASSERT(!local2.empty()); CPPUNIT_ASSERT_EQUAL(local, local2); } @@ -669,7 +668,7 @@ void LifeCycleCORBATest::testgetLocalFile_remoteComputer() */ // ============================================================================ -string LifeCycleCORBATest::GetRemoteHost() +std::string LifeCycleCORBATest::GetRemoteHost() { SALOME_LifeCycleCORBA _LCC(&_NS); @@ -687,13 +686,13 @@ string LifeCycleCORBATest::GetRemoteHost() Engines::ResourceList_var hostList = resourcesManager->GetFittingResources(params.resource_params); CPPUNIT_ASSERT(hostList->length() > 1); - string localHost = Kernel_Utils::GetHostname(); - string remoteHost; + std::string localHost = Kernel_Utils::GetHostname(); + std::string remoteHost; for (unsigned int i=0; i < hostList->length(); i++) { const char* aMachine = hostList[i]; Engines::ResourceDefinition_var resource_definition = resourcesManager->GetResourceDefinition(aMachine); - string machine(resource_definition->hostname.in()); + std::string machine(resource_definition->hostname.in()); if (machine != localHost) { remoteHost = machine; diff --git a/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx index b3807bde8..56f3a4f92 100644 --- a/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx @@ -38,8 +38,6 @@ #include "utilities.h" #include -using namespace std; - int main (int argc, char * argv[]) { @@ -62,7 +60,7 @@ int main (int argc, char * argv[]) // --- get a local container, // load an engine, and invoque methods on that engine - string containerName = "myServer"; + std::string containerName = "myServer"; MESSAGE("FindOrLoadComponent " + containerName + "/" + "SalomeTestComponent" ); Engines::Component_var mycompo = @@ -77,7 +75,7 @@ int main (int argc, char * argv[]) // --- get another container, // load an engine, and invoque methods on that engine - string containerName2 = "otherServer"; + std::string containerName2 = "otherServer"; Engines::Component_var mycompo2 = _LCC.FindOrLoad_Component(containerName2.c_str(),"SALOME_TestComponentPy"); @@ -86,7 +84,7 @@ int main (int argc, char * argv[]) m2 = Engines::TestComponent::_narrow(mycompo2); ASSERT(!CORBA::is_nil(m2)); SCRUTE(m2->instanceName()); - cout << m2->instanceName() << endl; + std::cout << m2->instanceName() << std::endl; MESSAGE("Coucou " << m2->Coucou(1L)); // --- get a third container, @@ -97,26 +95,26 @@ int main (int argc, char * argv[]) ASSERT(!CORBA::is_nil(mycompo3)); Engines::TestComponent_var m3 = Engines::TestComponent::_narrow(mycompo3); ASSERT(!CORBA::is_nil(m3)); - cout << m3->instanceName() << endl; + std::cout << m3->instanceName() << std::endl; // --- yet another container, with hostname, // load an engine, and invoque methods on that engine - string containerName4 = Kernel_Utils::GetHostname(); + std::string containerName4 = Kernel_Utils::GetHostname(); containerName4 += "/titiPy"; Engines::Component_var mycompo4 = _LCC.FindOrLoad_Component(containerName4.c_str(),"SALOME_TestComponentPy"); ASSERT(!CORBA::is_nil(mycompo4)); Engines::TestComponent_var m4 = Engines::TestComponent::_narrow(mycompo4); ASSERT(!CORBA::is_nil(m4)); - cout << m4->instanceName() << endl; + std::cout << m4->instanceName() << std::endl; // --- try a local file transfer - string origFileName = "/home/prascle/petitfichier"; + std::string origFileName = "/home/prascle/petitfichier"; SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(), origFileName); - string local = transfer.getLocalFile(); + std::string local = transfer.getLocalFile(); SCRUTE(local); // --- try a file transfer from another computer diff --git a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i index 22da974ba..666229b24 100644 --- a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i +++ b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i @@ -44,8 +44,6 @@ typedef int Py_ssize_t; #define PY_SSIZE_T_MIN INT_MIN #endif -using namespace std; - //--- from omniORBpy.h (not present on Debian Sarge packages) struct omniORBpyAPI { @@ -92,8 +90,6 @@ omniORBpyAPI* api; // ---------------------------------------------------------------------------- -using namespace std; - %typemap(out) Engines::Container_ptr, Engines::Component_ptr, Engines::fileRef_ptr, Engines::ContainerManager_ptr, Engines::ResourcesManager_ptr diff --git a/src/Logger/SALOME_Trace.cxx b/src/Logger/SALOME_Trace.cxx index 35039417c..3afbaf815 100644 --- a/src/Logger/SALOME_Trace.cxx +++ b/src/Logger/SALOME_Trace.cxx @@ -30,7 +30,6 @@ //#include #include #include -using namespace std; #ifdef WIN32 #include @@ -92,7 +91,7 @@ int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) { } if (CORBA::is_nil(inc)) { - cout<<"SALOME_Trace can not find NameService"< putMessage (LogMsg) ; } diff --git a/src/MPIContainer/MPIContainer_i.cxx b/src/MPIContainer/MPIContainer_i.cxx index a6e0d7125..5bcc6e0e0 100644 --- a/src/MPIContainer/MPIContainer_i.cxx +++ b/src/MPIContainer/MPIContainer_i.cxx @@ -38,7 +38,6 @@ #include // must be before Python.h ! #include #include "Container_init_python.hxx" -using namespace std; // L'appel au registry SALOME ne se fait que pour le process 0 Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, @@ -59,7 +58,7 @@ Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, _NS = new SALOME_NamingService(); _NS->init_orb( CORBA::ORB::_duplicate(_orb) ) ; - string hostname = Kernel_Utils::GetHostname(); + std::string hostname = Kernel_Utils::GetHostname(); _containerName = _NS->BuildContainerNameForNS(containerName,hostname.c_str()); SCRUTE(_containerName); _NS->Register(pCont, _containerName.c_str()); @@ -142,11 +141,11 @@ bool Engines_MPIContainer_i::load_component_Library(const char* componentName, C bool Engines_MPIContainer_i::Lload_component_Library(const char* componentName) { - string aCompName = componentName; + std::string aCompName = componentName; // --- try dlopen C++ component - string impl_name = string ("lib") + aCompName + string("Engine.so"); + std::string impl_name = string ("lib") + aCompName + string("Engine.so"); _numInstanceMutex.lock(); // lock to be alone // (see decInstanceCnt, finalize_removal)) @@ -253,7 +252,7 @@ Engines_MPIContainer_i::Lcreate_component_instance( const char* genericRegisterN Engines::Component_var iobject = Engines::Component::_nil() ; Engines::MPIObject_var pobj; - string aCompName = genericRegisterName; + std::string aCompName = genericRegisterName; if (_library_map[aCompName]) { // Python component if (_isSupervContainer) { INFOS("Supervision Container does not support Python Component Engines"); @@ -266,8 +265,8 @@ Engines_MPIContainer_i::Lcreate_component_instance( const char* genericRegisterN char aNumI[12]; sprintf( aNumI , "%d" , numInstance ) ; - string instanceName = aCompName + "_inst_" + aNumI ; - string component_registerName = + std::string instanceName = aCompName + "_inst_" + aNumI ; + std::string component_registerName = _containerName + "/" + instanceName; Py_ACQUIRE_NEW_THREAD; @@ -300,7 +299,7 @@ Engines_MPIContainer_i::Lcreate_component_instance( const char* genericRegisterN //--- try C++ - string impl_name = string ("lib") + genericRegisterName +string("Engine.so"); + std::string impl_name = std::string ("lib") + genericRegisterName +std::string("Engine.so"); if (_library_map.count(impl_name) != 0) // C++ component { void* handle = _library_map[impl_name]; @@ -322,8 +321,8 @@ Engines_MPIContainer_i::createMPIInstance(string genericRegisterName, Engines::MPIObject_var pobj; // --- find the factory - string aGenRegisterName = genericRegisterName; - string factory_name = aGenRegisterName + string("Engine_factory"); + std::string aGenRegisterName = genericRegisterName; + std::string factory_name = aGenRegisterName + std::string("Engine_factory"); typedef PortableServer::ObjectId * (*MPIFACTORY_FUNCTION) (int,int, @@ -358,8 +357,8 @@ Engines_MPIContainer_i::createMPIInstance(string genericRegisterName, char aNumI[12]; sprintf( aNumI , "%d" , numInstance ) ; - string instanceName = aGenRegisterName + "_inst_" + aNumI ; - string component_registerName = + std::string instanceName = aGenRegisterName + "_inst_" + aNumI ; + std::string component_registerName = _containerName + "/" + instanceName; // --- Instanciate required CORBA object @@ -450,12 +449,12 @@ Engines::Component_ptr Engines_MPIContainer_i::Lload_impl( char _aNumI[12]; sprintf(_aNumI,"%d",_numInstance) ; - string _impl_name = componentName; - string _nameToRegister = nameToRegister; - string instanceName = _nameToRegister + "_inst_" + _aNumI + cproc; + std::string _impl_name = componentName; + std::string _nameToRegister = nameToRegister; + std::string instanceName = _nameToRegister + "_inst_" + _aNumI + cproc; MESSAGE("[" << _numproc << "] instanceName=" << instanceName); - string absolute_impl_name(_impl_name); + std::string absolute_impl_name(_impl_name); MESSAGE("[" << _numproc << "] absolute_impl_name=" << absolute_impl_name); void * handle = dlopen(absolute_impl_name.c_str(), RTLD_LAZY); if(!handle){ @@ -464,7 +463,7 @@ Engines::Component_ptr Engines_MPIContainer_i::Lload_impl( return Engines::Component::_nil() ; } - string factory_name = _nameToRegister + string("Engine_factory"); + std::string factory_name = _nameToRegister + std::string("Engine_factory"); MESSAGE("[" << _numproc << "] factory_name=" << factory_name) ; dlerror(); @@ -504,7 +503,7 @@ Engines::Component_ptr Engines_MPIContainer_i::Lload_impl( if( _numproc == 0 ){ // utiliser + tard le registry ici : // register the engine under the name containerName.dir/nameToRegister.object - string component_registerName = _containerName + "/" + _nameToRegister; + std::string component_registerName = _containerName + "/" + _nameToRegister; _NS->Register(iobject, component_registerName.c_str()) ; } @@ -570,11 +569,11 @@ void Engines_MPIContainer_i::finalize_removal() _numInstanceMutex.lock(); // lock to be alone // (see decInstanceCnt, load_component_Library) - map::iterator ith; + std::map::iterator ith; for (ith = _toRemove_map.begin(); ith != _toRemove_map.end(); ith++) { void *handle = (*ith).second; - string impl_name= (*ith).first; + std::string impl_name= (*ith).first; if (handle) { SCRUTE(handle); diff --git a/src/MPIContainer/MPIObject_i.cxx b/src/MPIContainer/MPIObject_i.cxx index d7281e836..7d94fbbb5 100644 --- a/src/MPIContainer/MPIObject_i.cxx +++ b/src/MPIContainer/MPIObject_i.cxx @@ -26,7 +26,7 @@ #include "MPIObject_i.hxx" #include "utilities.h" #include "Utils_SALOME_Exception.hxx" -using namespace std; + #define TIMEOUT 5 MPIObject_i::MPIObject_i() @@ -70,7 +70,7 @@ void MPIObject_i::BCastIOR(CORBA::ORB_ptr orb, Engines::MPIObject_ptr pobj, bool int err, ip, n; char *ior; MPI_Status status; /* status de reception de message MPI */ - ostringstream msg; + std::ostringstream msg; if( _numproc == 0 ) { @@ -141,7 +141,7 @@ void MPIObject_i::remoteMPI2Connect(string service) int i; char port_name[MPI_MAX_PORT_NAME]; char port_name_clt[MPI_MAX_PORT_NAME]; - ostringstream msg; + std::ostringstream msg; if( service.size() == 0 ) { @@ -168,11 +168,11 @@ void MPIObject_i::remoteMPI2Connect(string service) { _srv[service] = true; _port_name[service] = port_name; - MESSAGE("[" << _numproc << "] service " << service << " available at " << port_name << endl); + MESSAGE("[" << _numproc << "] service " << service << " available at " << port_name << std::endl); } else if ( MPI_Lookup_name((char*)service.c_str(), MPI_INFO_NULL, port_name_clt) == MPI_SUCCESS ) { - MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << endl); + MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << std::endl); MPI_Close_port( port_name ); } else @@ -190,7 +190,7 @@ void MPIObject_i::remoteMPI2Connect(string service) sleep(1); if ( MPI_Lookup_name((char*)service.c_str(), MPI_INFO_NULL, port_name_clt) == MPI_SUCCESS ) { - MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << endl); + MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << std::endl); break; } i++; @@ -223,7 +223,7 @@ void MPIObject_i::remoteMPI2Connect(string service) void MPIObject_i::remoteMPI2Disconnect(std::string service) { - ostringstream msg; + std::ostringstream msg; if( service.size() == 0 ) { @@ -245,7 +245,7 @@ void MPIObject_i::remoteMPI2Disconnect(std::string service) strcpy(port_name,_port_name[service].c_str()); MPI_Unpublish_name((char*)service.c_str(), MPI_INFO_NULL, port_name); - MESSAGE("[" << _numproc << "] " << service << ": close port " << _port_name[service] << endl); + MESSAGE("[" << _numproc << "] " << service << ": close port " << _port_name[service] << std::endl); MPI_Close_port( port_name ); _port_name.erase(service); } diff --git a/src/MPIContainer/SALOME_MPIContainer.cxx b/src/MPIContainer/SALOME_MPIContainer.cxx index 99b74adce..551335090 100644 --- a/src/MPIContainer/SALOME_MPIContainer.cxx +++ b/src/MPIContainer/SALOME_MPIContainer.cxx @@ -25,7 +25,6 @@ #include "Utils_ORB_INIT.hxx" #include "Utils_SINGLETON.hxx" #include "utilities.h" -using namespace std; int main(int argc, char* argv[]) { diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx index 55d4e9a22..8d026d59d 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx @@ -32,8 +32,6 @@ UNEXPECT_CATCH(MC_NotFound, SALOME_ModuleCatalog::NotFound); #include "utilities.h" -using namespace std; - #ifdef _DEBUG_ static int MYDEBUG = 0; #else @@ -132,7 +130,7 @@ SALOME_ModuleCatalog_AcomponentImpl::GetInterface(const char* interfacename) if (!_find) { // The interface was not found, the exception should be thrown - string message = "The interface"; + std::string message = "The interface"; message += interfacename; message += " of the component "; message += _Component.name; @@ -190,7 +188,7 @@ SALOME_ModuleCatalog_AcomponentImpl::GetServiceList(const char* interfacename) if (!_find) { // The interface was not found, the exception should be thrown - string message = "The interface"; + std::string message = "The interface"; message += interfacename; message += " of the component "; message += _Component.name; @@ -257,7 +255,7 @@ SALOME_ModuleCatalog_AcomponentImpl::GetService(const char* interfacename, if (!_find) { // The interface was not found, the exception should be thrown - string message = "The service"; + std::string message = "The service"; message += servicename; message += " of the interface "; message += interfacename; @@ -313,7 +311,7 @@ SALOME_ModuleCatalog_AcomponentImpl::GetDefaultService(const char* interfacename if (!_find) { // The service was not found, the exception should be thrown - string message = "The default service of the interface "; + std::string message = "The default service of the interface "; message += interfacename; message += " of the component "; message += _Component.name; @@ -361,7 +359,7 @@ SALOME_ModuleCatalog_AcomponentImpl::GetPathPrefix(const char* machinename) if (!_find) { // The computer was not found, the exception should be thrown - string message = "The computer "; + std::string message = "The computer "; message += machinename; message += " was not found in the catalog associated to the component "; message += _Component.name; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx index 47813f8eb..5ff776588 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx @@ -30,14 +30,13 @@ #include "SALOME_ModuleCatalog.hh" #include #include "utilities.h" -using namespace std; void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C, - const string & InterfaceName, - const string & ServiceName); + const std::string & InterfaceName, + const std::string & ServiceName); void PrintInterface(SALOME_ModuleCatalog::Acomponent_ptr C, - const string & InterfaceName); + const std::string & InterfaceName); void PrintComponent(SALOME_ModuleCatalog::Acomponent_ptr C); @@ -120,7 +119,7 @@ int main(int argc,char **argv) } catch(SALOME_ModuleCatalog::NotFound &ex){ INFOS("SALOME_ModuleCatalog::NotFound") - cerr << ex.what << endl; + std::cerr << ex.what << std::endl; } catch(CORBA::SystemException&) { INFOS("Caught CORBA::SystemException.") @@ -167,7 +166,7 @@ void PrintComponent(SALOME_ModuleCatalog::Acomponent_ptr C) void PrintInterface(SALOME_ModuleCatalog::Acomponent_ptr C, - const string & InterfaceName) + const std::string & InterfaceName) { unsigned int i, n; @@ -184,8 +183,8 @@ void PrintInterface(SALOME_ModuleCatalog::Acomponent_ptr C, } void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C, - const string & InterfaceName, - const string & ServiceName) + const std::string & InterfaceName, + const std::string & ServiceName) { int i, n; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx index 172de3898..c54cf7bd3 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx @@ -32,7 +32,6 @@ #include "utilities.h" #include -using namespace std; #ifdef _DEBUG_ static int MYDEBUG = 0; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx index 40ba2302a..76fa42b68 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx @@ -30,8 +30,6 @@ #include #include "utilities.h" -using namespace std; - std::ostream & operator<< (std::ostream & f, const ParserParameter & P) { f << " name : " << P.name << std::endl; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx index 906f77543..b41964633 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx @@ -34,7 +34,6 @@ #ifdef CHECKTIME #include #endif -using namespace std; int main(int argc,char **argv) { diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index 6f8f9b34f..0a2ef4975 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -36,8 +36,6 @@ # include #endif -using namespace std; - #ifdef _DEBUG_ static int MYDEBUG = 0; #else @@ -48,23 +46,23 @@ static const char* SEPARATOR = "::"; static const char* OLD_SEPARATOR = ":"; -list splitStringToList(const string& theString, const string& theSeparator) +std::list splitStringToList(const std::string& theString, const std::string& theSeparator) { - list aList; + std::list aList; int sepLen = theSeparator.length(); int startPos = 0, sepPos = theString.find(theSeparator, startPos); while (1) { - string anItem ; - if(sepPos != string::npos) + std::string anItem ; + if(sepPos != std::string::npos) anItem = theString.substr(startPos, sepPos - startPos); else anItem = theString.substr(startPos); if (anItem.length() > 0) aList.push_back(anItem); - if(sepPos == string::npos) + if(sepPos == std::string::npos) break; startPos = sepPos + sepLen; sepPos = theString.find(theSeparator, startPos); @@ -130,13 +128,13 @@ SALOME_ModuleCatalogImpl::SALOME_ModuleCatalogImpl(int argc, char** argv, CORBA: // Affect the _general_module_list and _general_path_list members // with the common catalog - list dirList; + std::list dirList; #ifdef WIN32 dirList = splitStringToList(_general_path, SEPARATOR); #else //check for new format - bool isNew = (std::string( _general_path ).find(SEPARATOR) != string::npos); + bool isNew = (std::string( _general_path ).find(SEPARATOR) != std::string::npos); if ( isNew ) { //using new format dirList = splitStringToList(_general_path, SEPARATOR); @@ -146,11 +144,11 @@ SALOME_ModuleCatalogImpl::SALOME_ModuleCatalogImpl(int argc, char** argv, CORBA: } #endif - for (list::iterator iter = dirList.begin(); iter != dirList.end(); iter++) + for (std::list::iterator iter = dirList.begin(); iter != dirList.end(); iter++) { - string aPath = (*iter); + std::string aPath = (*iter); //remove inverted commas from filename - while (aPath.find('\"') != string::npos) + while (aPath.find('\"') != std::string::npos) aPath.erase(aPath.find('\"'), 1); _parse_xml_file(aPath.c_str(), @@ -626,7 +624,7 @@ void SALOME_ModuleCatalogImpl::ShutdownWithExit() } ParserComponent * -SALOME_ModuleCatalogImpl::findComponent(const string & name) +SALOME_ModuleCatalogImpl::findComponent(const std::string & name) { ParserComponent * C_parser = NULL; @@ -912,7 +910,7 @@ bool SALOME_ModuleCatalogImpl::_verify_path_prefix(ParserPathPrefixes & pathList) { bool _return_value = true; - vector _machine_list; + std::vector _machine_list; // Fill a list of all computers indicated in the path list for (unsigned int ind = 0; ind < pathList.size(); ind++) diff --git a/src/NOTIFICATION_SWIG/NOTIFICATION_Swig.cxx b/src/NOTIFICATION_SWIG/NOTIFICATION_Swig.cxx index 14b636801..c1d9805bd 100644 --- a/src/NOTIFICATION_SWIG/NOTIFICATION_Swig.cxx +++ b/src/NOTIFICATION_SWIG/NOTIFICATION_Swig.cxx @@ -25,7 +25,6 @@ // Module : SALOME // #include "NOTIFICATION_Swig.hxx" -using namespace std; // Swig notification supplier // -------------------------- diff --git a/src/NamingService/NamingService_WaitForServerReadiness.cxx b/src/NamingService/NamingService_WaitForServerReadiness.cxx index 857d772bb..099d16dd8 100644 --- a/src/NamingService/NamingService_WaitForServerReadiness.cxx +++ b/src/NamingService/NamingService_WaitForServerReadiness.cxx @@ -29,8 +29,6 @@ #include #include -using namespace std; - // ============================================================================ /*! * Wait until a server is registered in naming service. @@ -46,7 +44,7 @@ using namespace std; void NamingService_WaitForServerReadiness(SALOME_NamingService* NS, - string serverName) + std::string serverName) { long TIMESleep = 500000000; // 500 ms. int NumberOfTries = 40; // total wait = 20 s. diff --git a/src/NamingService/SALOME_NamingService.cxx b/src/NamingService/SALOME_NamingService.cxx index 03c2a43d4..788a13564 100644 --- a/src/NamingService/SALOME_NamingService.cxx +++ b/src/NamingService/SALOME_NamingService.cxx @@ -39,8 +39,6 @@ #define strdup _strdup #endif -using namespace std; - /*! \class SALOME_NamingService \brief A class to manage the SALOME naming service @@ -156,7 +154,7 @@ void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef, // to place the current_context to the correct node CosNaming::Name context_name; - vector splitPath; + std::vector splitPath; int dimension_resultat = _createContextNameDir(Path, context_name, splitPath, @@ -354,7 +352,7 @@ CORBA::Object_ptr SALOME_NamingService::Resolve(const char* Path) // to place the current_context to the correct node CosNaming::Name context_name; - vector splitPath; + std::vector splitPath; _createContextNameDir(Path, context_name, splitPath, @@ -429,13 +427,13 @@ CORBA::Object_ptr SALOME_NamingService::ResolveFirst(const char* Path) Utils_Locker lock (&_myMutex); // SCRUTE(Path); - string thePath = Path; - string basePath = ""; - string name = thePath; + std::string thePath = Path; + std::string basePath = ""; + std::string name = thePath; - string::size_type idx = thePath.rfind('/'); + std::string::size_type idx = thePath.rfind('/'); - if (idx != string::npos) // at least one '/' found + if (idx != std::string::npos) // at least one '/' found { basePath = thePath.substr(0, idx); name = thePath.substr(idx + 1); @@ -453,8 +451,8 @@ CORBA::Object_ptr SALOME_NamingService::ResolveFirst(const char* Path) if (isOk) { - vector listElem = list_directory(); - vector::iterator its = listElem.begin(); + std::vector listElem = list_directory(); + std::vector::iterator its = listElem.begin(); while (its != listElem.end()) { @@ -501,7 +499,7 @@ SALOME_NamingService::ResolveComponent(const char* hostname, Utils_Locker lock (&_myMutex); - string name = "/Containers/"; + std::string name = "/Containers/"; name += hostname; @@ -530,10 +528,10 @@ SALOME_NamingService::ResolveComponent(const char* hostname, else { SCRUTE(name); - string basename = name; + std::string basename = name; if (Change_Directory(basename.c_str())) { - vector contList = list_subdirs(); + std::vector contList = list_subdirs(); for (unsigned int ind = 0; ind < contList.size(); ind++) { @@ -575,9 +573,9 @@ SALOME_NamingService::ResolveComponent(const char* hostname, */ // ============================================================================ -string SALOME_NamingService::ContainerName(const char *containerName) +std::string SALOME_NamingService::ContainerName(const char *containerName) { - string ret; + std::string ret; if (strlen(containerName) == 0) ret = "FactoryServer"; @@ -602,7 +600,7 @@ string SALOME_NamingService::ContainerName(const char *containerName) */ // ============================================================================ -string +std::string SALOME_NamingService::ContainerName(const Engines::MachineParameters& params) { int nbproc; @@ -618,7 +616,7 @@ SALOME_NamingService::ContainerName(const Engines::MachineParameters& params) else nbproc = params.nb_node * params.nb_proc_per_node; - string ret = ContainerName(params.container_name); + std::string ret = ContainerName(params.container_name); if ( nbproc >= 1 ) { @@ -630,7 +628,7 @@ SALOME_NamingService::ContainerName(const Engines::MachineParameters& params) return ret; } -string +std::string SALOME_NamingService::ContainerName(const Engines::ContainerParameters& params) { int nbproc; @@ -646,7 +644,7 @@ SALOME_NamingService::ContainerName(const Engines::ContainerParameters& params) else nbproc = params.resource_params.nb_node * params.resource_params.nb_proc_per_node; - string ret = ContainerName(params.container_name); + std::string ret = ContainerName(params.container_name); if ( nbproc >= 1 ) { @@ -672,10 +670,10 @@ SALOME_NamingService::ContainerName(const Engines::ContainerParameters& params) */ // ============================================================================ -string SALOME_NamingService::BuildContainerNameForNS(const char *containerName, +std::string SALOME_NamingService::BuildContainerNameForNS(const char *containerName, const char *hostname) { - string ret = "/Containers/"; + std::string ret = "/Containers/"; ret += hostname; ret += "/"; ret += ContainerName(containerName); @@ -695,12 +693,12 @@ string SALOME_NamingService::BuildContainerNameForNS(const char *containerName, */ // ============================================================================ -string +std::string SALOME_NamingService:: BuildContainerNameForNS(const Engines::MachineParameters& params, const char *hostname) { - string ret = "/Containers/"; + std::string ret = "/Containers/"; ret += hostname; ret += "/"; ret += ContainerName(params); @@ -708,12 +706,12 @@ BuildContainerNameForNS(const Engines::MachineParameters& params, return ret; } -string +std::string SALOME_NamingService:: BuildContainerNameForNS(const Engines::ContainerParameters& params, const char *hostname) { - string ret = "/Containers/"; + std::string ret = "/Containers/"; ret += hostname; ret += "/"; ret += ContainerName(params); @@ -787,7 +785,7 @@ throw(ServiceUnreachable) Utils_Locker lock (&_myMutex); - string path(Path); + std::string path(Path); // --- if path empty, nothing to create, no context change @@ -831,7 +829,7 @@ throw(ServiceUnreachable) // MESSAGE("BEGIN OF Change_Directory " << Path); Utils_Locker lock (&_myMutex); - string path(Path); + std::string path(Path); // --- if path empty, nothing to do @@ -862,7 +860,7 @@ throw(ServiceUnreachable) if (path[path.length()-1] != '/') path += '/'; // SCRUTE(path); CosNaming::Name context_name; - vector splitPath; + std::vector splitPath; _createContextNameDir(path.c_str(), context_name, splitPath, @@ -935,7 +933,7 @@ throw(ServiceUnreachable) CosNaming::NamingContext_var ref_context = _current_context; - vector splitPath; + std::vector splitPath; splitPath.resize(0); int lengthPath = 0; bool notFound = true ; @@ -956,7 +954,7 @@ throw(ServiceUnreachable) throw ServiceUnreachable(); } - string path; + std::string path; lengthPath = splitPath.size(); for (int k = 0 ; k < lengthPath ;k++) { @@ -1044,11 +1042,11 @@ throw(ServiceUnreachable) */ // ============================================================================ -vector SALOME_NamingService::list_directory() +std::vector SALOME_NamingService::list_directory() throw(ServiceUnreachable) { // MESSAGE("list_directory"); - vector dirList ; + std::vector dirList ; dirList.resize(0); CosNaming::BindingList_var binding_list; @@ -1073,7 +1071,7 @@ throw(ServiceUnreachable) { // remove memory leak // dirList.push_back(CORBA::string_dup(bindingName[0].id)); - dirList.push_back(string(bindingName[0].id)); + dirList.push_back(std::string(bindingName[0].id)); } } @@ -1098,11 +1096,11 @@ throw(ServiceUnreachable) */ // ============================================================================ -vector SALOME_NamingService::list_subdirs() +std::vector SALOME_NamingService::list_subdirs() throw(ServiceUnreachable) { MESSAGE("list_subdirs"); - vector dirList ; + std::vector dirList ; dirList.resize(0); CosNaming::BindingList_var binding_list; @@ -1148,14 +1146,14 @@ throw(ServiceUnreachable) */ // ============================================================================ -vector SALOME_NamingService::list_directory_recurs() +std::vector SALOME_NamingService::list_directory_recurs() throw(ServiceUnreachable) { MESSAGE("list_directory_recurs"); Utils_Locker lock (&_myMutex); - vector dirList ; + std::vector dirList ; char* currentDir = Current_Directory(); @@ -1182,7 +1180,7 @@ throw(ServiceUnreachable) Utils_Locker lock (&_myMutex); - string path(Path); + std::string path(Path); // --- if path empty, nothing to do @@ -1202,7 +1200,7 @@ throw(ServiceUnreachable) // --- context of the directory containing the object CosNaming::Name context_name; - vector splitPath; + std::vector splitPath; int dimension_resultat = _createContextNameDir(path.c_str(), context_name, splitPath, @@ -1338,7 +1336,7 @@ throw(ServiceUnreachable) Utils_Locker lock (&_myMutex); - string path(Path); + std::string path(Path); // --- if path empty, nothing to do @@ -1360,7 +1358,7 @@ throw(ServiceUnreachable) // --- context of the directory CosNaming::Name context_name; - vector splitPath; + std::vector splitPath; int dimension_resultat = _createContextNameDir(path.c_str(), context_name, splitPath, @@ -1512,7 +1510,7 @@ throw(ServiceUnreachable) MESSAGE("begin of Destroy_FullDirectory " << Path); if( Change_Directory(Path) ) { - vector contList = list_directory(); + std::vector contList = list_directory(); for (unsigned int ind = 0; ind < contList.size(); ind++) Destroy_Name(contList[ind].c_str()); @@ -1573,26 +1571,26 @@ void SALOME_NamingService::_initialize_root_context() // ============================================================================ int -SALOME_NamingService::_createContextNameDir(string path, +SALOME_NamingService::_createContextNameDir(std::string path, CosNaming::Name& context_name, - vector& splitPath, + std::vector& splitPath, bool onlyDir) { if (path.empty()) return 0; - string::size_type begIdx, endIdx; - const string delims("/"); + std::string::size_type begIdx, endIdx; + const std::string delims("/"); splitPath.resize(0); bool endWithDelim = false; begIdx = path.find_first_not_of(delims); - while (begIdx != string::npos) + while (begIdx != std::string::npos) { endIdx = path.find_first_of(delims, begIdx); if (endIdx == path.length()-1) endWithDelim = true; - if (endIdx == string::npos) + if (endIdx == std::string::npos) endIdx = path.length(); int lsub = endIdx - begIdx; if (lsub >= 1) @@ -1719,7 +1717,7 @@ void SALOME_NamingService::_Find(const char* name, void SALOME_NamingService:: -_current_directory(vector& splitPath, +_current_directory(std::vector& splitPath, int& lengthResult, CosNaming::NamingContext_var contextToFind, bool& notFound) @@ -1810,9 +1808,9 @@ _current_directory(vector& splitPath, */ // ============================================================================ -void SALOME_NamingService::_list_directory_recurs(vector& myList, - string relativeSubDir, - string absCurDirectory) +void SALOME_NamingService::_list_directory_recurs(std::vector& myList, + std::string relativeSubDir, + std::string absCurDirectory) { CosNaming::BindingList_var binding_list; CosNaming::BindingIterator_var binding_iterator; @@ -1821,7 +1819,7 @@ void SALOME_NamingService::_list_directory_recurs(vector& myList, unsigned long nb = 0 ; // --- only for thethe use of BindingIterator // to access the bindings - string absDir; + std::string absDir; CosNaming::NamingContext_var ref_context = _current_context; @@ -1845,14 +1843,14 @@ void SALOME_NamingService::_list_directory_recurs(vector& myList, if (binding->binding_type == CosNaming::ncontext) { - string relativeSdir(bindingName[0].id); + std::string relativeSdir(bindingName[0].id); _list_directory_recurs(myList, relativeSdir, absDir); } else if (binding->binding_type == CosNaming::nobject) { - string objName(bindingName[0].id); - string elt = absDir + "/" + objName; + std::string objName(bindingName[0].id); + std::string elt = absDir + "/" + objName; SCRUTE(elt); myList.push_back(elt); } diff --git a/src/NamingService/ServiceUnreachable.cxx b/src/NamingService/ServiceUnreachable.cxx index 26e6e295e..ca549b3bf 100644 --- a/src/NamingService/ServiceUnreachable.cxx +++ b/src/NamingService/ServiceUnreachable.cxx @@ -24,7 +24,6 @@ // Module : SALOME // #include "ServiceUnreachable.hxx" -using namespace std; ServiceUnreachable::ServiceUnreachable( void ): SALOME_Exception( "ServiceUnreachable" ) { diff --git a/src/NamingService/Test/NamingServiceTest.cxx b/src/NamingService/Test/NamingServiceTest.cxx index 3b2782fc9..357b31410 100644 --- a/src/NamingService/Test/NamingServiceTest.cxx +++ b/src/NamingService/Test/NamingServiceTest.cxx @@ -29,7 +29,6 @@ #include #include -using namespace std; // --- uncomment to have some traces on standard error // (useful only when adding new tests...) @@ -114,15 +113,15 @@ NamingServiceTest::setUp() // --- trace on file const char *theFileName = TRACEFILE; - string s = "file:"; + std::string s = "file:"; s += theFileName; //s="local"; //s="with_logger"; CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite - ofstream traceFile; + std::ofstream traceFile; // traceFile.open(theFileName, ios::out | ios::trunc); - traceFile.open(theFileName, ios::out | ios::app); + traceFile.open(theFileName, std::ios::out | std::ios::app); CPPUNIT_ASSERT(traceFile); // file created empty, then closed traceFile.close(); @@ -416,7 +415,7 @@ NamingServiceTest::testResolveFirst() { NSTEST::echo_var anEchoRef = myFactory->createInstance(); ref[i] = anEchoRef->getId(); - string name = "/nstestfirst/echo_"; + std::string name = "/nstestfirst/echo_"; char anum[10]; sprintf(anum,"%d",ref[i]); name += anum; @@ -425,7 +424,7 @@ NamingServiceTest::testResolveFirst() for (int i=0; igetId() == ref[i]); } - string name = "/nstestfirst/echo"; + std::string name = "/nstestfirst/echo"; obj = _NS.ResolveFirst(name.c_str()); CPPUNIT_ASSERT(!CORBA::is_nil(obj)); NSTEST::echo_var anEchoRef = NSTEST::echo::_narrow(obj); @@ -468,7 +467,7 @@ NamingServiceTest::testResolveFirstRelative() { NSTEST::echo_var anEchoRef = myFactory->createInstance(); ref[i] = anEchoRef->getId(); - string name = "/nstestfirstrel/echo_"; + std::string name = "/nstestfirstrel/echo_"; char anum[10]; sprintf(anum,"%d",ref[i]); name += anum; @@ -478,7 +477,7 @@ NamingServiceTest::testResolveFirstRelative() for (int i=0; icreateInstance(); int val = anEchoRef->getId(); - string name = "echo_"; + std::string name = "echo_"; char anum[10]; sprintf(anum,"%d",val); name += anum; _NS.Register(anEchoRef,name.c_str()); - string dirname = "/aaa/bbb/ccc/ddd/eee/"; + std::string dirname = "/aaa/bbb/ccc/ddd/eee/"; dirname += name; obj = _NS.Resolve(dirname.c_str()); CPPUNIT_ASSERT(!CORBA::is_nil(obj)); @@ -1025,13 +1024,13 @@ NamingServiceTest::testChangeDirectory() void NamingServiceTest::testCurrentDirectory() { - string path = "/aaa/bbb/ccc/ddd/eee"; + std::string path = "/aaa/bbb/ccc/ddd/eee"; bool ret = _NS.Create_Directory(path.c_str()); CPPUNIT_ASSERT(ret); _NS.Change_Directory(path.c_str()); char* acurdir = _NS.Current_Directory(); - string curdir = acurdir; + std::string curdir = acurdir; free(acurdir); CPPUNIT_ASSERT(curdir == path); } @@ -1114,7 +1113,7 @@ NamingServiceTest::testDestroyName() NSTEST::aFactory_var myFactory = NSTEST::aFactory::_narrow(obj); CPPUNIT_ASSERT(!CORBA::is_nil(myFactory)); - string path = "/Containers/theHostName/theContainerName/theComponentName"; + std::string path = "/Containers/theHostName/theContainerName/theComponentName"; NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, path.c_str()); @@ -1141,7 +1140,7 @@ NamingServiceTest::testDestroyDirectory() NSTEST::aFactory_var myFactory = NSTEST::aFactory::_narrow(obj); CPPUNIT_ASSERT(!CORBA::is_nil(myFactory)); - string path = "/Containers/theHostName/theContainerName/theComponentName"; + std::string path = "/Containers/theHostName/theContainerName/theComponentName"; NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, path.c_str()); @@ -1163,16 +1162,16 @@ NamingServiceTest::testDestroyDirectory() */ // ============================================================================ -void NamingServiceTest::_destroyDirectoryRecurs(string path) +void NamingServiceTest::_destroyDirectoryRecurs(std::string path) { - string current = path; + std::string current = path; SCRUTE(path); if (_NS.Change_Directory(path.c_str())) { - vector subdirs = _NS.list_subdirs(); + std::vector subdirs = _NS.list_subdirs(); for (int i=0; i subdirs = _NS.list_subdirs(); + std::vector subdirs = _NS.list_subdirs(); CPPUNIT_ASSERT(subdirs.size() >0); _NS.list_directory_recurs(); - string path = "/Containers"; + std::string path = "/Containers"; _destroyDirectoryRecurs(path); CPPUNIT_ASSERT( ! _NS.Change_Directory("/Containers")); _NS.Change_Directory("/"); diff --git a/src/Notification/NOTIFICATION.cxx b/src/Notification/NOTIFICATION.cxx index d2f083a78..0e2f24b15 100644 --- a/src/Notification/NOTIFICATION.cxx +++ b/src/Notification/NOTIFICATION.cxx @@ -28,7 +28,6 @@ #include "Utils_ORB_INIT.hxx" #include "Utils_SINGLETON.hxx" -using namespace std; CosNA_EventChannel_ptr NOTIFICATION_channel() { ORB_INIT& init = *SINGLETON_::Instance(); ASSERT(SINGLETON_::IsAlreadyExisting()); diff --git a/src/Notification/NOTIFICATION_Consumer.cxx b/src/Notification/NOTIFICATION_Consumer.cxx index 0c60660f3..816d19bf3 100644 --- a/src/Notification/NOTIFICATION_Consumer.cxx +++ b/src/Notification/NOTIFICATION_Consumer.cxx @@ -25,7 +25,6 @@ // Module : SALOME // #include "NOTIFICATION.hxx" -using namespace std; NOTIFICATION_Consumer::NOTIFICATION_Consumer(): proxy_supplier(0), diff --git a/src/Notification/NOTIFICATION_Supplier.cxx b/src/Notification/NOTIFICATION_Supplier.cxx index ae094ff61..e334d5027 100644 --- a/src/Notification/NOTIFICATION_Supplier.cxx +++ b/src/Notification/NOTIFICATION_Supplier.cxx @@ -25,7 +25,6 @@ // Module : SALOME // #include "NOTIFICATION.hxx" -using namespace std; long NOTIFICATION_Supplier::_stamp = 0; diff --git a/src/ParallelContainer/SALOME_ParallelComponent_i.cxx b/src/ParallelContainer/SALOME_ParallelComponent_i.cxx index 87ab4c475..48399f703 100644 --- a/src/ParallelContainer/SALOME_ParallelComponent_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelComponent_i.cxx @@ -48,7 +48,6 @@ int SIGUSR11 = 1000; #include #include -using namespace std; extern bool _Sleeping ; static Engines_Parallel_Component_i * theEngines_Component ; @@ -260,7 +259,7 @@ Engines::FieldsDict* Engines_Parallel_Component_i::getProperties() { Engines::FieldsDict_var copie = new Engines::FieldsDict; copie->length(_fieldsDict.size()); - map::iterator it; + std::map::iterator it; CORBA::ULong i = 0; for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++, i++) { @@ -486,21 +485,21 @@ CORBA::Long Engines_Parallel_Component_i::CpuUsed_impl() { _ThreadCpuUsed = CpuUsed() ; cpu = _ThreadCpuUsed ; - // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl " - // << _serviceName << " " << cpu << endl ; + // std::cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl " + // << _serviceName << " " << cpu << std::endl ; } } else { cpu = _ThreadCpuUsed ; - // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl " - // << _serviceName << " " << cpu<< endl ; + // std::cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl " + // << _serviceName << " " << cpu<< std::endl ; } } else { - // cout<< pthread_self()<<"Engines_Parallel_Component_i::CpuUsed_impl _ThreadId " - // <<_ThreadId <<" "<<_serviceName<<" _StartUsed "<<_StartUsed<::iterator it; + std::map::iterator it; for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++) { std::string cle((*it).first); @@ -770,15 +769,15 @@ long Engines_Parallel_Component_i::CpuUsed() return 0 ; } cpu = usage.ru_utime.tv_sec - _StartUsed ; - // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed " << " " + // std::cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed " << " " // << _serviceName << usage.ru_utime.tv_sec << " - " << _StartUsed - // << " = " << cpu << endl ; + // << " = " << cpu << std::endl ; } else { - // cout << pthread_self() << "Engines_Parallel_Component_i::CpuUsed _ThreadId " + // std::cout << pthread_self() << "Engines_Parallel_Component_i::CpuUsed _ThreadId " // << _ThreadId << " " << _serviceName<< " _StartUsed " - // << _StartUsed << endl ; + // << _StartUsed << std::endl ; } #else // NOT implementet yet @@ -823,9 +822,9 @@ void Engines_Parallel_Component_i::sendMessage(const char *event_type, */ //============================================================================= -string Engines_Parallel_Component_i::GetDynLibraryName(const char *componentName) +std::string Engines_Parallel_Component_i::GetDynLibraryName(const char *componentName) { - string ret="lib"; + std::string ret="lib"; ret+=componentName; ret+="Engine.so"; return ret; diff --git a/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx b/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx index 4d3a2602e..3b3e1d693 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx @@ -50,17 +50,15 @@ #include "Container_init_python.hxx" -using namespace std; - #ifdef _DEBUG_ #include void handler(int t) { - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "SIGSEGV in :" << getpid() << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "SIGSEGV in :" << getpid() << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; while (1) {} } #endif @@ -150,13 +148,13 @@ int main(int argc, char* argv[]) SALOME_NamingService * ns = new SALOME_NamingService(orb); // Get the proxy - string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(), + std::string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(), proxy_hostname.c_str()); obj = ns->Resolve(proxyNameInNS.c_str()); char * proxy_ior = orb->object_to_string(obj); // Creating a node - string node_name = containerName + "Node"; + std::string node_name = containerName + "Node"; Engines_Parallel_Container_i * servant = new Engines_Parallel_Container_i(CORBA::ORB::_duplicate(orb), proxy_ior, myid, @@ -179,7 +177,7 @@ int main(int argc, char* argv[]) node_name = node_name + buffer; string _containerName = ns->BuildContainerNameForNS((char*) node_name.c_str(), hostname.c_str()); - cerr << "---------" << _containerName << "----------" << endl; + std::cerr << "---------" << _containerName << "----------" << std::endl; ns->Register(obj, _containerName.c_str()); pman->activate(); orb->run(); diff --git a/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx b/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx index bfe8e6474..487189dc9 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx @@ -53,17 +53,16 @@ #include "Container_init_python.hxx" -using namespace std; #ifdef _DEBUG_ #include void handler(int t) { - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "SIGSEGV in :" << getpid() << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "SIGSEGV in :" << getpid() << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; while (1) {} } #endif @@ -133,25 +132,25 @@ int main(int argc, char* argv[]) } #endif - cerr << "Level MPI_THREAD_SINGLE : " << MPI_THREAD_SINGLE << endl; - cerr << "Level MPI_THREAD_SERIALIZED : " << MPI_THREAD_SERIALIZED << endl; - cerr << "Level MPI_THREAD_FUNNELED : " << MPI_THREAD_FUNNELED << endl; - cerr << "Level MPI_THREAD_MULTIPLE : " << MPI_THREAD_MULTIPLE << endl; - cerr << "Level provided : " << provided << endl; + std::cerr << "Level MPI_THREAD_SINGLE : " << MPI_THREAD_SINGLE << std::endl; + std::cerr << "Level MPI_THREAD_SERIALIZED : " << MPI_THREAD_SERIALIZED << std::endl; + std::cerr << "Level MPI_THREAD_FUNNELED : " << MPI_THREAD_FUNNELED << std::endl; + std::cerr << "Level MPI_THREAD_MULTIPLE : " << MPI_THREAD_MULTIPLE << std::endl; + std::cerr << "Level provided : " << provided << std::endl; // Initialise the ORB. CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); KERNEL_PYTHON::init_python(argc,argv); // Code pour choisir le reseau infiniband ..... - /* string hostname_temp = GetHostname(); + /* std::string hostname_temp = GetHostname(); hostent * t = gethostbyname(hostname_temp.c_str()); - cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << t->h_addr << " " << hostname_temp << endl; - cerr << t->h_addr << endl; + std::cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << t->h_addr << " " << hostname_temp << std::endl; + std::cerr << t->h_addr << std::endl; in_addr * address=(in_addr * ) t->h_addr; - cerr << inet_ntoa(* address) << endl; - string ip = inet_ntoa(* address); - cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << endl; - string com = "giop:tcp:" + ip + ":"; + std::cerr << inet_ntoa(* address) << std::endl; + std::string ip = inet_ntoa(* address); + std::cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << std::endl; + std::string com = "giop:tcp:" + ip + ":"; const char* options[][2] = { { "endPoint", com.c_str() }, { 0, 0 } }; CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB4", options); */ @@ -177,13 +176,13 @@ int main(int argc, char* argv[]) SALOME_NamingService * ns = new SALOME_NamingService(CORBA::ORB::_duplicate(orb)); // On récupère le proxy - string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(), + std::string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(), proxy_hostname.c_str()); obj = ns->Resolve(proxyNameInNS.c_str()); char * proxy_ior = orb->object_to_string(obj); // Node creation - string node_name = containerName + "Node"; + std::string node_name = containerName + "Node"; Engines_Parallel_Container_i * servant = new Engines_Parallel_Container_i(CORBA::ORB::_duplicate(orb), proxy_ior, myid, @@ -200,7 +199,7 @@ int main(int argc, char* argv[]) obj = servant->_this(); // In the NamingService - string hostname = Kernel_Utils::GetHostname(); + std::string hostname = Kernel_Utils::GetHostname(); int myid; MPI_Comm_rank(MPI_COMM_WORLD, &myid); @@ -210,12 +209,12 @@ int main(int argc, char* argv[]) // We register nodes in two different parts // In the real machine name and in the proxy machine - string _containerName = ns->BuildContainerNameForNS(node_name.c_str(), + std::string _containerName = ns->BuildContainerNameForNS(node_name.c_str(), hostname.c_str()); - string _proxymachine_containerName = ns->BuildContainerNameForNS(node_name.c_str(), + std::string _proxymachine_containerName = ns->BuildContainerNameForNS(node_name.c_str(), proxy_hostname.c_str()); - cerr << "Register container node : " << _containerName << endl; - cerr << "Register container node : " << _proxymachine_containerName << endl; + std::cerr << "Register container node : " << _containerName << std::endl; + std::cerr << "Register container node : " << _proxymachine_containerName << std::endl; ns->Register(obj, _containerName.c_str()); ns->Register(obj, _proxymachine_containerName.c_str()); pman->activate(); diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx index 716fdeed9..ebbf948a0 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx @@ -53,14 +53,13 @@ #ifdef DEBUG_PARALLEL #include -using namespace std; void handler(int t) { - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "SIGSEGV in :" << getpid() << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "SIGSEGV in :" << getpid() << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; while (1) {} } #endif @@ -122,11 +121,11 @@ int main(int argc, char* argv[]) obj = proxy->_this(); // In the NamingService - string hostname = Kernel_Utils::GetHostname(); + std::string hostname = Kernel_Utils::GetHostname(); Engines::Container_var pCont = Engines::Container::_narrow(obj); string _containerName = ns->BuildContainerNameForNS(containerName.c_str(), hostname.c_str()); - cerr << "---------" << _containerName << "----------" << endl; + std::cerr << "---------" << _containerName << "----------" << std::endl; ns->Register(pCont, _containerName.c_str()); pman->activate(); orb->run(); diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx index 96558509e..b575f9285 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx @@ -54,7 +54,7 @@ #ifdef _DEBUG_ #include -using namespace std; + typedef void (*sighandler_t)(int); sighandler_t setsig(int sig, sighandler_t handler) @@ -101,11 +101,11 @@ void unexpectedHandler(void) } void handler(int t) { - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "SIGSEGV in :" << getpid() << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; - cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "SIGSEGV in :" << getpid() << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; + std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl; while (1) {} } #endif @@ -178,11 +178,11 @@ int main(int argc, char* argv[]) obj = proxy->_this(); // in the NamingService - string hostname = Kernel_Utils::GetHostname(); + std::string hostname = Kernel_Utils::GetHostname(); Engines::Container_var pCont = Engines::Container::_narrow(obj); - string _containerName = ns->BuildContainerNameForNS(containerName.c_str(), + std::string _containerName = ns->BuildContainerNameForNS(containerName.c_str(), hostname.c_str()); - cerr << "---------" << _containerName << "----------" << endl; + std::cerr << "---------" << _containerName << "----------" << std::endl; ns->Register(pCont, _containerName.c_str()); pman->activate(); orb->run(); diff --git a/src/ParallelContainer/SALOME_ParallelContainer_i.cxx b/src/ParallelContainer/SALOME_ParallelContainer_i.cxx index c22ff906d..6e72f2504 100644 --- a/src/ParallelContainer/SALOME_ParallelContainer_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainer_i.cxx @@ -50,7 +50,6 @@ int SIGUSR1 = 1000; #include #include "Container_init_python.hxx" -using namespace std; bool _Sleeping = false ; @@ -297,9 +296,9 @@ Engines_Parallel_Container_i::load_component_Library(const char* componentName, bool ret = false; std::string aCompName = componentName; #ifndef WIN32 - string impl_name = string ("lib") + aCompName + string("Engine.so"); + std::string impl_name = string ("lib") + aCompName + string("Engine.so"); #else - string impl_name = aCompName + string("Engine.dll"); + std::string impl_name = aCompName + string("Engine.dll"); #endif _numInstanceMutex.lock(); // lock to be alone @@ -425,9 +424,9 @@ Engines_Parallel_Container_i::create_component_instance_env(const char*genericRe std::string aCompName = genericRegisterName; #ifndef WIN32 - string impl_name = string ("lib") + aCompName +string("Engine.so"); + std::string impl_name = string ("lib") + aCompName +string("Engine.so"); #else - string impl_name = aCompName +string("Engine.dll"); + std::string impl_name = aCompName +string("Engine.dll"); #endif _numInstanceMutex.lock(); @@ -474,10 +473,10 @@ Engines::Component_ptr Engines_Parallel_Container_i::find_component_instance( co CORBA::Long studyId) { Engines::Component_var anEngine = Engines::Component::_nil(); - map::iterator itm =_listInstances_map.begin(); + std::map::iterator itm =_listInstances_map.begin(); while (itm != _listInstances_map.end()) { - string instance = (*itm).first; + std::string instance = (*itm).first; SCRUTE(instance); if (instance.find(registeredName) == 0) { @@ -530,7 +529,7 @@ Engines::Component_ptr Engines_Parallel_Container_i::load_impl( const char* gene void Engines_Parallel_Container_i::remove_impl(Engines::Component_ptr component_i) { ASSERT(!CORBA::is_nil(component_i)); - string instanceName = component_i->instanceName(); + std::string instanceName = component_i->instanceName(); _numInstanceMutex.lock() ; // lock to be alone (stl container write) // Test if the component is in this container std::map::iterator itm; @@ -560,11 +559,11 @@ void Engines_Parallel_Container_i::finalize_removal() MESSAGE("WARNING FINALIZE DOES CURRENTLY NOTHING !!!"); // (see decInstanceCnt, load_component_Library) - //map::iterator ith; + //std::map::iterator ith; //for (ith = _toRemove_map.begin(); ith != _toRemove_map.end(); ith++) //{ // void *handle = (*ith).second; - // string impl_name= (*ith).first; + // std::string impl_name= (*ith).first; // if (handle) // { // SCRUTE(handle); @@ -616,7 +615,7 @@ bool Engines_Parallel_Container_i::Kill_impl() Engines::fileRef_ptr Engines_Parallel_Container_i::createFileRef(const char* origFileName) { - string origName(origFileName); + std::string origName(origFileName); Engines::fileRef_var theFileRef = Engines::fileRef::_nil(); if (origName[0] != '/') @@ -712,14 +711,14 @@ Engines_Parallel_Container_i::createSalome_file(const char* origFileName) //============================================================================= Engines::Component_ptr -Engines_Parallel_Container_i::find_or_create_instance(string genericRegisterName) +Engines_Parallel_Container_i::find_or_create_instance(std::string genericRegisterName) { Engines::Component_var iobject = Engines::Component::_nil(); try { - string aGenRegisterName = genericRegisterName; + std::string aGenRegisterName = genericRegisterName; // --- find a registered instance in naming service, or create - string component_registerBase = _containerName + "/" + aGenRegisterName; + std::string component_registerBase = _containerName + "/" + aGenRegisterName; CORBA::Object_var obj = _NS->ResolveFirst(component_registerBase.c_str()); if (CORBA::is_nil( obj )) { @@ -770,7 +769,7 @@ Engines_Parallel_Container_i::find_or_create_instance(string genericRegisterName */ //============================================================================= Engines::Component_ptr -Engines_Parallel_Container_i::createPythonInstance(string genericRegisterName, int studyId) +Engines_Parallel_Container_i::createPythonInstance(std::string genericRegisterName, int studyId) { Engines::Component_var iobject = Engines::Component::_nil(); @@ -778,8 +777,8 @@ Engines_Parallel_Container_i::createPythonInstance(string genericRegisterName, i int numInstance = _numInstance; char aNumI[12]; sprintf( aNumI , "%d" , numInstance ) ; - string instanceName = genericRegisterName + "_inst_" + aNumI ; - string component_registerName = _containerName + "/" + instanceName; + std::string instanceName = genericRegisterName + "_inst_" + aNumI ; + std::string component_registerName = _containerName + "/" + instanceName; Py_ACQUIRE_NEW_THREAD; PyObject *mainmod = PyImport_AddModule("__main__"); @@ -832,7 +831,7 @@ Engines_Parallel_Container_i::createPythonInstance(string genericRegisterName, i */ //============================================================================= Engines::Component_ptr -Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName, +Engines_Parallel_Container_i::createCPPInstance(std::string genericRegisterName, void *handle, int studyId) { @@ -840,8 +839,8 @@ Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName, // --- find the factory - string aGenRegisterName = genericRegisterName; - string factory_name = aGenRegisterName + string("Engine_factory"); + std::string aGenRegisterName = genericRegisterName; + std::string factory_name = aGenRegisterName + string("Engine_factory"); typedef PortableServer::ObjectId * (*FACTORY_FUNCTION_2) (CORBA::ORB_ptr, @@ -873,8 +872,8 @@ Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName, int numInstance = _numInstance; char aNumI[12]; sprintf( aNumI , "%d" , numInstance ); - string instanceName = aGenRegisterName + "_inst_" + aNumI; - string component_registerName = + std::string instanceName = aGenRegisterName + "_inst_" + aNumI; + std::string component_registerName = _containerName + "/" + instanceName; // --- Instanciate required CORBA object @@ -977,8 +976,8 @@ Engines_Parallel_Container_i::create_paco_component_node_instance(const char* co { char aNumI2[12]; sprintf(aNumI2 , "%d" , getMyRank()) ; - string instanceName = aCompName + "_inst_" + aNumI + "_work_node_" + aNumI2; - string component_registerName = _containerName + "/" + instanceName; + std::string instanceName = aCompName + "_inst_" + aNumI + "_work_node_" + aNumI2; + std::string component_registerName = _containerName + "/" + instanceName; // --- Instanciate work node PortableServer::ObjectId *id ; //not owner, do not delete (nore use var) @@ -1018,11 +1017,11 @@ Engines_Parallel_Container_i::create_paco_component_node_instance(const char* co */ //============================================================================= -void Engines_Parallel_Container_i::decInstanceCnt(string genericRegisterName) +void Engines_Parallel_Container_i::decInstanceCnt(std::string genericRegisterName) { if(_cntInstances_map.count(genericRegisterName) !=0 ) { - string aGenRegisterName =genericRegisterName; + std::string aGenRegisterName =genericRegisterName; MESSAGE("Engines_Parallel_Container_i::decInstanceCnt " << aGenRegisterName); ASSERT(_cntInstances_map[aGenRegisterName] > 0); _numInstanceMutex.lock(); // lock to be alone @@ -1031,7 +1030,7 @@ void Engines_Parallel_Container_i::decInstanceCnt(string genericRegisterName) SCRUTE(_cntInstances_map[aGenRegisterName]); if (_cntInstances_map[aGenRegisterName] == 0) { - string impl_name = + std::string impl_name = Engines_Component_i::GetDynLibraryName(aGenRegisterName.c_str()); SCRUTE(impl_name); void* handle = _library_map[impl_name]; diff --git a/src/Registry/RegistryConnexion.cxx b/src/Registry/RegistryConnexion.cxx index d7686a97b..a201c7dac 100644 --- a/src/Registry/RegistryConnexion.cxx +++ b/src/Registry/RegistryConnexion.cxx @@ -38,8 +38,6 @@ extern "C" { # include } -using namespace std; - Registry::Components_var Connexion( int argc , char **argv , const char *ptrSessionName ) throw( CommException ) { diff --git a/src/Registry/RegistryService.cxx b/src/Registry/RegistryService.cxx index a3324c52d..6eaf46f9c 100644 --- a/src/Registry/RegistryService.cxx +++ b/src/Registry/RegistryService.cxx @@ -40,7 +40,6 @@ extern "C" #include #define getpid _getpid #endif -using namespace std; /* ------------------------------*/ /* Constructors and Destructors */ @@ -55,7 +54,7 @@ RegistryService::RegistryService( void ) : _SessionName(0), _Compteur(0) RegistryService::~RegistryService() { BEGIN_OF("RegistryService::~RegistryService()") ; - map::iterator im; + std::map::iterator im; for (im=_reg.begin();im!=_reg.end(); im++) { MESSAGE("Delete _reg item " << im->second->_name) ; @@ -160,7 +159,7 @@ Registry::AllInfos* RegistryService::history( void ) return RegistryService::makeseq(_fin) ; } -Registry::AllInfos* RegistryService::makeseq(map &mymap ) +Registry::AllInfos* RegistryService::makeseq(std::map &mymap ) { int i=0 ; @@ -169,7 +168,7 @@ Registry::AllInfos* RegistryService::makeseq(map &mymap ) const int RegLength = mymap.size(); all->length(RegLength); - map::iterator im; + std::map::iterator im; for (im=mymap.begin();im!=mymap.end(); im++) { diff --git a/src/Registry/SALOME_Registry_Server.cxx b/src/Registry/SALOME_Registry_Server.cxx index 23cc25d3c..91e485e40 100644 --- a/src/Registry/SALOME_Registry_Server.cxx +++ b/src/Registry/SALOME_Registry_Server.cxx @@ -46,7 +46,6 @@ extern "C" #ifdef CHECKTIME #include #endif -using namespace std; int main( int argc , char **argv ) { @@ -187,7 +186,7 @@ int main( int argc , char **argv ) catch( const CORBA::Exception & ) { } - string absoluteName = string("/") + registryName; + std::string absoluteName = std::string("/") + registryName; naming.Register( varComponents , absoluteName.c_str() ) ; MESSAGE("Wait client requests") ; try diff --git a/src/ResourcesManager/ResourcesManager.cxx b/src/ResourcesManager/ResourcesManager.cxx index ffba5fbd0..5beadabaa 100644 --- a/src/ResourcesManager/ResourcesManager.cxx +++ b/src/ResourcesManager/ResourcesManager.cxx @@ -39,8 +39,6 @@ #define MAX_SIZE_FOR_HOSTNAME 256; -using namespace std; - static LoadRateManagerFirst first; static LoadRateManagerCycl cycl; static LoadRateManagerAltCycl altcycl; @@ -55,7 +53,7 @@ ResourcesManager_cpp(const char *xmlFilePath) { _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; @@ -232,7 +230,7 @@ ResourcesManager_cpp::GetFittingResources(const resourceParams& params) throw(Re li.sort(); vec.clear(); - for (list::iterator iter2 = li.begin(); iter2 != li.end(); iter2++) + for (std::list::iterator iter2 = li.begin(); iter2 != li.end(); iter2++) vec.push_back((*iter2)._Name); } @@ -414,7 +412,7 @@ const MapOfParserResourcesType& ResourcesManager_cpp::GetList() const return _resourcesList; } -string ResourcesManager_cpp::Find(const std::string& policy, const std::vector& listOfResources) +std::string ResourcesManager_cpp::Find(const std::string& policy, const std::vector& listOfResources) { if(_resourceManagerMap.count(policy)==0) return _resourceManagerMap[""]->Find(listOfResources, _resourcesList); @@ -435,7 +433,7 @@ ResourcesManager_cpp::SelectOnlyResourcesWithOS(std::vector& resour // a computer list is given : take only resources with OS on those computers std::vector vec_tmp = resources; resources.clear(); - vector::iterator iter = vec_tmp.begin(); + std::vector::iterator iter = vec_tmp.begin(); for (; iter != vec_tmp.end(); iter++) { MapOfParserResourcesType::const_iterator it = _resourcesList.find(*iter); @@ -454,13 +452,13 @@ ResourcesManager_cpp::SelectOnlyResourcesWithOS(std::vector& resour //============================================================================= void ResourcesManager_cpp::KeepOnlyResourcesWithComponent(std::vector& resources, - const vector& componentList) + const std::vector& componentList) { std::vector::iterator iter = resources.begin(); for (; iter != resources.end(); iter++) { MapOfParserResourcesType::const_iterator it = _resourcesList.find(*iter); - const vector& mapOfComponentsOfCurrentHost = (*it).second.ComponentsList; + const std::vector& mapOfComponentsOfCurrentHost = (*it).second.ComponentsList; bool erasedHost = false; if( mapOfComponentsOfCurrentHost.size() > 0 ) @@ -468,7 +466,7 @@ ResourcesManager_cpp::KeepOnlyResourcesWithComponent(std::vector& r for(unsigned int i=0; i::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(), + std::vector::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(), mapOfComponentsOfCurrentHost.end(), compoi); if (itt == mapOfComponentsOfCurrentHost.end()) diff --git a/src/ResourcesManager/SALOME_LoadRateManager.cxx b/src/ResourcesManager/SALOME_LoadRateManager.cxx index c52550330..eb39e3b86 100644 --- a/src/ResourcesManager/SALOME_LoadRateManager.cxx +++ b/src/ResourcesManager/SALOME_LoadRateManager.cxx @@ -23,18 +23,16 @@ #include #include -using namespace std; - -string LoadRateManagerFirst::Find(const vector& hosts, +std::string LoadRateManagerFirst::Find(const std::vector& hosts, MapOfParserResourcesType& resList) { if (hosts.size() == 0) - return string(""); + return std::string(""); - return string(hosts[0]); + return std::string(hosts[0]); } -string LoadRateManagerCycl::Find(const vector& hosts, +std::string LoadRateManagerCycl::Find(const std::vector& hosts, MapOfParserResourcesType& resList) { static int imachine = 0; @@ -42,30 +40,30 @@ string LoadRateManagerCycl::Find(const vector& hosts, // if empty list return empty string if (hosts.size() == 0) - return string(""); + return std::string(""); else{ - ParserResourcesType resource = resList[string(hosts[imachine])]; + ParserResourcesType resource = resList[std::string(hosts[imachine])]; int nbproc = resource.DataForSort._nbOfProcPerNode * resource.DataForSort._nbOfNodes; if( nbproc <= 0) nbproc = 1; if( iproc < nbproc ){ iproc++; - return string(hosts[imachine]); + return std::string(hosts[imachine]); } else{ iproc = 1; imachine++; if(imachine >= (int)hosts.size()) imachine = 0; - return string(hosts[imachine]); + return std::string(hosts[imachine]); } } } -string LoadRateManagerAltCycl::Find(const vector& hosts, +std::string LoadRateManagerAltCycl::Find(const std::vector& hosts, MapOfParserResourcesType& resList) { if (hosts.size() == 0) - return string(""); + return std::string(""); std::string selected=hosts[0]; int uses=0; diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index f33f830a6..316c695d9 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -31,8 +31,6 @@ #include #include -using namespace std; - //============================================================================= /*! * Constructor @@ -130,7 +128,7 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) _resource.DataForSort._Name = Kernel_Utils::GetHostname(); } } - map::const_iterator iter = _resources_list.find(_resource.Name); + std::map::const_iterator iter = _resources_list.find(_resource.Name); if (iter != _resources_list.end()) RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !"); _resources_list[_resource.Name] = _resource; @@ -142,7 +140,7 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) _resource.Clear(); if(ProcessCluster(aCurNode, _resource)) { - map::const_iterator iter = _resources_list.find(_resource.Name); + std::map::const_iterator iter = _resources_list.find(_resource.Name); if (iter != _resources_list.end()) RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !"); _resources_list[_resource.Name] = _resource; @@ -152,7 +150,7 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) } #ifdef _DEBUG_ - for (map::const_iterator iter = _resources_list.begin(); + for (std::map::const_iterator iter = _resources_list.begin(); iter != _resources_list.end(); iter++) { diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx index 261860b59..d395a2360 100644 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx @@ -25,8 +25,6 @@ #define NULL_VALUE 0 -using namespace std; - unsigned int ResourceDataToSort::_nbOfProcWanted = NULL_VALUE; unsigned int ResourceDataToSort::_nbOfNodesWanted = NULL_VALUE; unsigned int ResourceDataToSort::_nbOfProcPerNodeWanted = NULL_VALUE; @@ -36,7 +34,7 @@ unsigned int ResourceDataToSort::_memInMBWanted = NULL_VALUE; ResourceDataToSort::ResourceDataToSort() {} -ResourceDataToSort::ResourceDataToSort(const string& name, +ResourceDataToSort::ResourceDataToSort(const std::string& name, unsigned int nbOfNodes, unsigned int nbOfProcPerNode, unsigned int CPUFreqMHz, @@ -123,39 +121,39 @@ unsigned int ResourceDataToSort::GetNumberOfPoints() const //! Method used for debug void ResourceDataToSort::Print() const { - cout << _nbOfNodes << endl; - cout << _nbOfProcPerNode << endl; - cout << _CPUFreqMHz << endl; - cout << _memInMB << endl; + std::cout << _nbOfNodes << std::endl; + std::cout << _nbOfProcPerNode << std::endl; + std::cout << _CPUFreqMHz << std::endl; + std::cout << _memInMB << std::endl; } void ParserResourcesType::Print() { - ostringstream oss; - oss << endl << - "Name : " << Name << endl << - "HostName : " << HostName << endl << - "NbOfNodes : " << DataForSort._nbOfNodes << endl << - "NbOfProcPerNode : " << DataForSort._nbOfProcPerNode << endl << - "CPUFreqMHz : " << DataForSort._CPUFreqMHz << endl << - "MemInMB : " << DataForSort._memInMB << endl << - "Protocol : " << Protocol << endl << - "ClusterInternalProtocol : " << ClusterInternalProtocol << endl << - "Mode : " << Mode << endl << - "Batch : " << Batch << endl << - "mpi : " << mpi << endl << - "UserName : " << UserName << endl << - "AppliPath : " << AppliPath << endl << - "OS : " << OS << endl << - "batchQueue : " << batchQueue << endl << - "userCommands : " << userCommands << endl << - "use : " << use << endl << - "NbOfProc : " << nbOfProc << endl << - "Modules : " << endl << - "Components : " << endl; + std::ostringstream oss; + oss << std::endl << + "Name : " << Name << std::endl << + "HostName : " << HostName << std::endl << + "NbOfNodes : " << DataForSort._nbOfNodes << std::endl << + "NbOfProcPerNode : " << DataForSort._nbOfProcPerNode << std::endl << + "CPUFreqMHz : " << DataForSort._CPUFreqMHz << std::endl << + "MemInMB : " << DataForSort._memInMB << std::endl << + "Protocol : " << Protocol << std::endl << + "ClusterInternalProtocol : " << ClusterInternalProtocol << std::endl << + "Mode : " << Mode << std::endl << + "Batch : " << Batch << std::endl << + "mpi : " << mpi << std::endl << + "UserName : " << UserName << std::endl << + "AppliPath : " << AppliPath << std::endl << + "OS : " << OS << std::endl << + "batchQueue : " << batchQueue << std::endl << + "userCommands : " << userCommands << std::endl << + "use : " << use << std::endl << + "NbOfProc : " << nbOfProc << std::endl << + "Modules : " << std::endl << + "Components : " << std::endl; for(unsigned int i=0;i::iterator it; @@ -163,9 +161,9 @@ void ParserResourcesType::Print() it != ClusterMembersList.end(); it++) { - oss << "Cluster member called : " << (*it).HostName << endl; + oss << "Cluster member called : " << (*it).HostName << std::endl; } - cout << oss.str() << endl; + std::cout << oss.str() << std::endl; } std::string diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 97e91ffd6..151368ff8 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -45,8 +45,6 @@ #define MAX_SIZE_FOR_HOSTNAME 256; -using namespace std; - const char *SALOME_ResourcesManager::_ResourcesManagerNameInNS = "/ResourcesManager"; //============================================================================= @@ -156,14 +154,14 @@ SALOME_ResourcesManager::GetFittingResources(const Engines::ResourceParameters& p.cpu_clock = params.cpu_clock; p.mem_mb = params.mem_mb; for(unsigned int i=0; i vec = _rm.GetFittingResources(p); + std::vector vec = _rm.GetFittingResources(p); // C++ -> CORBA ret->length(vec.size()); @@ -189,9 +187,9 @@ char * SALOME_ResourcesManager::FindFirst(const Engines::ResourceList& listOfResources) { // CORBA -> C++ - vector rl; + std::vector rl; for(unsigned int i=0; i C++ - vector rl; + std::vector rl; for(unsigned int i=0; i::iterator it = list_of_machines.begin(); while (machine_number != nb_procs) { // Adding a new node to the machine file - machine_file << *it << endl; + machine_file << *it << std::endl; // counting... it++; @@ -475,7 +473,7 @@ SALOME_ResourcesManager::getMachineFile(std::string resource_name, { // Creating machine file machine_file_name = tmpnam(NULL); - std::ofstream machine_file(machine_file_name.c_str(), ios_base::out); + std::ofstream machine_file(machine_file_name.c_str(), std::ios_base::out); // We add all cluster machines to the file std::list::iterator cluster_it = @@ -484,7 +482,7 @@ SALOME_ResourcesManager::getMachineFile(std::string resource_name, { unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes * (*cluster_it).DataForSort._nbOfProcPerNode; - machine_file << (*cluster_it).HostName << " cpu=" << number_of_proc << endl; + machine_file << (*cluster_it).HostName << " cpu=" << number_of_proc << std::endl; cluster_it++; } } @@ -492,7 +490,7 @@ SALOME_ResourcesManager::getMachineFile(std::string resource_name, { // Creating machine file machine_file_name = tmpnam(NULL); - std::ofstream machine_file(machine_file_name.c_str(), ios_base::out); + std::ofstream machine_file(machine_file_name.c_str(), std::ios_base::out); // We add all cluster machines to the file std::list::iterator cluster_it = @@ -501,7 +499,7 @@ SALOME_ResourcesManager::getMachineFile(std::string resource_name, { unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes * (*cluster_it).DataForSort._nbOfProcPerNode; - machine_file << (*cluster_it).HostName << " slots=" << number_of_proc << endl; + machine_file << (*cluster_it).HostName << " slots=" << number_of_proc << std::endl; cluster_it++; } } diff --git a/src/SALOMEDS/SALOMEDS.cxx b/src/SALOMEDS/SALOMEDS.cxx index 6da176aa7..2131fdc12 100644 --- a/src/SALOMEDS/SALOMEDS.cxx +++ b/src/SALOMEDS/SALOMEDS.cxx @@ -43,17 +43,15 @@ #include CORBA_SERVER_HEADER(SALOMEDS) #include -using namespace SALOMEDS; - // PAL8065: san -- Global recursive mutex for SALOMEDS methods -Utils_Mutex Locker::MutexDS; +Utils_Mutex SALOMEDS::Locker::MutexDS; // PAL8065: san -- Global SALOMEDS locker -Locker::Locker() +SALOMEDS::Locker::Locker() : Utils_Locker( &MutexDS ) {} -Locker::~Locker() +SALOMEDS::Locker::~Locker() {} void SALOMEDS::lock() @@ -63,7 +61,7 @@ void SALOMEDS::lock() void SALOMEDS::unlock() { - Locker::MutexDS.unlock(); + SALOMEDS::Locker::MutexDS.unlock(); } diff --git a/src/SALOMEDS/SALOMEDS_AttLong_i.cxx b/src/SALOMEDS/SALOMEDS_AttLong_i.cxx index 7aaeb5337..691698a62 100644 --- a/src/SALOMEDS/SALOMEDS_AttLong_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttLong_i.cxx @@ -29,7 +29,7 @@ #include "utilities.h" #include #include -using namespace std; + //============================================================================ /*! Function : Set diff --git a/src/SALOMEDS/SALOMEDS_AttReal_i.cxx b/src/SALOMEDS/SALOMEDS_AttReal_i.cxx index d0475f246..f4aea8fc5 100644 --- a/src/SALOMEDS/SALOMEDS_AttReal_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttReal_i.cxx @@ -30,7 +30,7 @@ #include #include #include -using namespace std; + //============================================================================ /*! Function : Set diff --git a/src/SALOMEDS/SALOMEDS_AttributeComment_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeComment_i.cxx index dee16e6fa..e34e40abe 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeComment_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeComment_i.cxx @@ -28,8 +28,6 @@ #include "SALOMEDS_SObject_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - char* SALOMEDS_AttributeComment_i::Value() { SALOMEDS::Locker lock; @@ -45,6 +43,6 @@ void SALOMEDS_AttributeComment_i::SetValue(const char* value) CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); - string aValue((char*)Str.in()); + std::string aValue((char*)Str.in()); dynamic_cast(_impl)->SetValue(aValue); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx index 137f752e9..cefaf976f 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeDrawable_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeDrawable_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - CORBA::Boolean SALOMEDS_AttributeDrawable_i::IsDrawable() { SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_AttributeExpandable_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeExpandable_i.cxx index 5b75422b9..606f57bd8 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeExpandable_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeExpandable_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeExpandable_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - CORBA::Boolean SALOMEDS_AttributeExpandable_i::IsExpandable() { SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx index 66465d3be..ea8a119d5 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeExternalFileDef_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - char* SALOMEDS_AttributeExternalFileDef_i::Value() { SALOMEDS::Locker lock; @@ -41,5 +39,5 @@ void SALOMEDS_AttributeExternalFileDef_i::SetValue(const char* value) SALOMEDS::Locker lock; CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); - dynamic_cast(_impl)->SetValue(string(Str)); + dynamic_cast(_impl)->SetValue(std::string(Str)); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx index e61dd0de2..bad5e92ff 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeFileType_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - char* SALOMEDS_AttributeFileType_i::Value() { SALOMEDS::Locker lock; @@ -41,6 +39,6 @@ void SALOMEDS_AttributeFileType_i::SetValue(const char* value) SALOMEDS::Locker lock; CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); - string aValue((char*)Str.in()); + std::string aValue((char*)Str.in()); dynamic_cast(_impl)->SetValue(aValue); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeFlags_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeFlags_i.cxx index 1240a0049..1810af11d 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFlags_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFlags_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeFlags_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - /* Class : SALOMEDS_AttributeFlags_i Description : This class is intended for storing different object attributes that diff --git a/src/SALOMEDS/SALOMEDS_AttributeGraphic_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeGraphic_i.cxx index 1b291989e..996277c4c 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeGraphic_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeGraphic_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeGraphic_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - /* Class : SALOMEDS_AttributeGraphic_i Description : This class is intended for storing information about diff --git a/src/SALOMEDS/SALOMEDS_AttributeIOR_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeIOR_i.cxx index 7d46207e3..43b4c8cd6 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeIOR_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeIOR_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeIOR_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - char* SALOMEDS_AttributeIOR_i::Value() { SALOMEDS::Locker lock; @@ -42,7 +40,7 @@ void SALOMEDS_AttributeIOR_i::SetValue(const char* value) SALOMEDS::Locker lock; CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); - string anExtStr((char *)Str.in()); + std::string anExtStr((char *)Str.in()); dynamic_cast(_impl)->SetValue(anExtStr); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeInteger_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeInteger_i.cxx index b3256a2ba..69c425a6f 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeInteger_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeInteger_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeInteger_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - CORBA::Long SALOMEDS_AttributeInteger_i::Value() { SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_AttributeLocalID_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeLocalID_i.cxx index c17da185c..b85e27aa5 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeLocalID_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeLocalID_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeLocalID_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - CORBA::Long SALOMEDS_AttributeLocalID_i::Value() { SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_AttributeName_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeName_i.cxx index b2bb0db6b..b4661acb1 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeName_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeName_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeName_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - char* SALOMEDS_AttributeName_i::Value() { SALOMEDS::Locker lock; @@ -40,5 +38,5 @@ void SALOMEDS_AttributeName_i::SetValue(const char* value) { SALOMEDS::Locker lock; CheckLocked(); - dynamic_cast(_impl)->SetValue(string(value)); + dynamic_cast(_impl)->SetValue(std::string(value)); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeOpened_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeOpened_i.cxx index bc1031fa0..5ddca2ab2 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeOpened_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeOpened_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeOpened_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - CORBA::Boolean SALOMEDS_AttributeOpened_i::IsOpened() { SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_AttributeParameter.cxx b/src/SALOMEDS/SALOMEDS_AttributeParameter.cxx index 8377bfb83..9c44a57ec 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeParameter.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeParameter.cxx @@ -28,8 +28,6 @@ #include -using namespace std; - //======================================================================= /*! * Function : Constructor @@ -65,7 +63,7 @@ SALOMEDS_AttributeParameter::~SALOMEDS_AttributeParameter() * Purpose : Associates a integer value with the ID */ //======================================================================= -void SALOMEDS_AttributeParameter::SetInt(const string& theID, const int theValue) +void SALOMEDS_AttributeParameter::SetInt(const std::string& theID, const int theValue) { CheckLocked(); @@ -83,7 +81,7 @@ void SALOMEDS_AttributeParameter::SetInt(const string& theID, const int theValue * Purpose : Returns a int value associated with the given ID */ //======================================================================= -int SALOMEDS_AttributeParameter::GetInt(const string& theID) +int SALOMEDS_AttributeParameter::GetInt(const std::string& theID) { int aValue; if(_isLocal) { @@ -101,7 +99,7 @@ int SALOMEDS_AttributeParameter::GetInt(const string& theID) * Purpose : Associates a double value with the ID */ //======================================================================= -void SALOMEDS_AttributeParameter::SetReal(const string& theID, const double& theValue) +void SALOMEDS_AttributeParameter::SetReal(const std::string& theID, const double& theValue) { CheckLocked(); @@ -119,7 +117,7 @@ void SALOMEDS_AttributeParameter::SetReal(const string& theID, const double& the * Purpose : Returns a double value associated with the given ID */ //======================================================================= -double SALOMEDS_AttributeParameter::GetReal(const string& theID) +double SALOMEDS_AttributeParameter::GetReal(const std::string& theID) { double aValue; if(_isLocal) { @@ -137,7 +135,7 @@ double SALOMEDS_AttributeParameter::GetReal(const string& theID) * Purpose : Associates a string with the ID */ //======================================================================= -void SALOMEDS_AttributeParameter::SetString(const string& theID, const string& theValue) +void SALOMEDS_AttributeParameter::SetString(const std::string& theID, const std::string& theValue) { CheckLocked(); @@ -155,9 +153,9 @@ void SALOMEDS_AttributeParameter::SetString(const string& theID, const string& t * Purpose : Returns a string associated with the given ID */ //======================================================================= -string SALOMEDS_AttributeParameter::GetString(const string& theID) +std::string SALOMEDS_AttributeParameter::GetString(const std::string& theID) { - string aValue; + std::string aValue; if(_isLocal) { SALOMEDS::Locker lock; aValue = dynamic_cast(_local_impl)->GetString(theID); @@ -173,7 +171,7 @@ string SALOMEDS_AttributeParameter::GetString(const string& theID) * Purpose : Associates a bool value with the ID */ //======================================================================= -void SALOMEDS_AttributeParameter::SetBool(const string& theID, const bool& theValue) +void SALOMEDS_AttributeParameter::SetBool(const std::string& theID, const bool& theValue) { CheckLocked(); @@ -191,7 +189,7 @@ void SALOMEDS_AttributeParameter::SetBool(const string& theID, const bool& theVa * Purpose : Returns a bool value associated with the ID */ //======================================================================= -bool SALOMEDS_AttributeParameter::GetBool(const string& theID) +bool SALOMEDS_AttributeParameter::GetBool(const std::string& theID) { if(_isLocal) { SALOMEDS::Locker lock; @@ -207,7 +205,7 @@ bool SALOMEDS_AttributeParameter::GetBool(const string& theID) * Purpose : Associates an array of double values with the given ID */ //======================================================================= -void SALOMEDS_AttributeParameter::SetRealArray(const string& theID, const vector& theArray) +void SALOMEDS_AttributeParameter::SetRealArray(const std::string& theID, const std::vector& theArray) { CheckLocked(); @@ -232,9 +230,9 @@ void SALOMEDS_AttributeParameter::SetRealArray(const string& theID, const vector * Purpose : Returns an array of double values associated with the ID */ //======================================================================= -vector SALOMEDS_AttributeParameter::GetRealArray(const string& theID) +std::vector SALOMEDS_AttributeParameter::GetRealArray(const std::string& theID) { - vector v; + std::vector v; if(_isLocal) { SALOMEDS::Locker lock; return dynamic_cast(_local_impl)->GetRealArray(theID); @@ -256,7 +254,7 @@ vector SALOMEDS_AttributeParameter::GetRealArray(const string& theID) * Purpose : Associates an array of int values with the given ID */ //======================================================================= -void SALOMEDS_AttributeParameter::SetIntArray(const string& theID, const vector& theArray) +void SALOMEDS_AttributeParameter::SetIntArray(const std::string& theID, const std::vector& theArray) { CheckLocked(); @@ -281,9 +279,9 @@ void SALOMEDS_AttributeParameter::SetIntArray(const string& theID, const vector< * Purpose : Returns an array of int values associated with the ID */ //======================================================================= -vector SALOMEDS_AttributeParameter::GetIntArray(const string& theID) +std::vector SALOMEDS_AttributeParameter::GetIntArray(const std::string& theID) { - vector v; + std::vector v; if(_isLocal) { SALOMEDS::Locker lock; return dynamic_cast(_local_impl)->GetIntArray(theID); @@ -305,7 +303,7 @@ vector SALOMEDS_AttributeParameter::GetIntArray(const string& theID) * Purpose : Associates an array of string values with the given ID */ //======================================================================= -void SALOMEDS_AttributeParameter::SetStrArray(const string& theID, const vector& theArray) +void SALOMEDS_AttributeParameter::SetStrArray(const std::string& theID, const std::vector& theArray) { CheckLocked(); @@ -330,9 +328,9 @@ void SALOMEDS_AttributeParameter::SetStrArray(const string& theID, const vector< * Purpose : Returns an array of string values associated with the ID */ //======================================================================= -vector SALOMEDS_AttributeParameter::GetStrArray(const string& theID) +std::vector SALOMEDS_AttributeParameter::GetStrArray(const std::string& theID) { - vector v; + std::vector v; if(_isLocal) { SALOMEDS::Locker lock; return dynamic_cast(_local_impl)->GetStrArray(theID); @@ -342,7 +340,7 @@ vector SALOMEDS_AttributeParameter::GetStrArray(const string& theID) int length = aSeq->length(); if(length) { v.resize(length); - for(int i = 0; i < length; i++) v[i] = string(aSeq[i].in()); + for(int i = 0; i < length; i++) v[i] = std::string(aSeq[i].in()); } } return v; @@ -356,7 +354,7 @@ vector SALOMEDS_AttributeParameter::GetStrArray(const string& theID) * a value in the attribute */ //======================================================================= -bool SALOMEDS_AttributeParameter::IsSet(const string& theID, const int theType) +bool SALOMEDS_AttributeParameter::IsSet(const std::string& theID, const int theType) { if(_isLocal) { SALOMEDS::Locker lock; @@ -372,7 +370,7 @@ bool SALOMEDS_AttributeParameter::IsSet(const string& theID, const int theType) * Purpose : Removes a parameter with given ID */ //======================================================================= -bool SALOMEDS_AttributeParameter::RemoveID(const string& theID, const int theType) +bool SALOMEDS_AttributeParameter::RemoveID(const std::string& theID, const int theType) { CheckLocked(); @@ -462,9 +460,9 @@ void SALOMEDS_AttributeParameter::Clear() * Purpose : Returns an array of all ID's of the given type */ //======================================================================= -vector SALOMEDS_AttributeParameter::GetIDs(const int theType) +std::vector SALOMEDS_AttributeParameter::GetIDs(const int theType) { - vector v; + std::vector v; if(_isLocal) { SALOMEDS::Locker lock; SALOMEDSImpl_AttributeParameter* AP_impl = dynamic_cast(_local_impl); @@ -476,7 +474,7 @@ vector SALOMEDS_AttributeParameter::GetIDs(const int theType) int length = CorbaSeq->length(); if(length) { v.resize(length); - for(int i = 0; i -using namespace std; - #include "Utils_ExceptHandlers.hxx" UNEXPECT_CATCH(AP_InvalidIdentifier, SALOMEDS::AttributeParameter::InvalidIdentifier); @@ -154,7 +152,7 @@ void SALOMEDS_AttributeParameter_i::SetRealArray(const char* theID, const SALOME { SALOMEDS::Locker lock; CheckLocked(); - vector v; + std::vector v; int length = theArray.length(); if(length) { v.resize(length); @@ -175,7 +173,7 @@ SALOMEDS::DoubleSeq* SALOMEDS_AttributeParameter_i::GetRealArray(const char* the SALOMEDS::Locker lock; Unexpect aCatch (AP_InvalidIdentifier); SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq; - vector v = dynamic_cast(_impl)->GetRealArray(theID); + std::vector v = dynamic_cast(_impl)->GetRealArray(theID); int length = v.size(); if(length) { aSeq->length(length); @@ -194,7 +192,7 @@ void SALOMEDS_AttributeParameter_i::SetIntArray(const char* theID, const SALOMED { SALOMEDS::Locker lock; CheckLocked(); - vector v; + std::vector v; int length = theArray.length(); if(length) { v.resize(length); @@ -215,7 +213,7 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeParameter_i::GetIntArray(const char* theID) SALOMEDS::Locker lock; Unexpect aCatch (AP_InvalidIdentifier); SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq; - vector v = dynamic_cast(_impl)->GetIntArray(theID); + std::vector v = dynamic_cast(_impl)->GetIntArray(theID); int length = v.size(); if(length) { aSeq->length(length); @@ -234,11 +232,11 @@ void SALOMEDS_AttributeParameter_i::SetStrArray(const char* theID, const SALOMED { SALOMEDS::Locker lock; CheckLocked(); - vector v; + std::vector v; int length = theArray.length(); if(length) { v.resize(length); - for(int i = 0; i(_impl)->SetStrArray(theID, v); } @@ -255,7 +253,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeParameter_i::GetStrArray(const char* theI SALOMEDS::Locker lock; Unexpect aCatch (AP_InvalidIdentifier); SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq; - vector v = dynamic_cast(_impl)->GetStrArray(theID); + std::vector v = dynamic_cast(_impl)->GetStrArray(theID); int length = v.size(); if(length) { aSeq->length(length); @@ -352,7 +350,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeParameter_i::GetIDs(CORBA::Long theType) { SALOMEDS::Locker lock; SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq; - vector A = dynamic_cast(_impl)->GetIDs((Parameter_Types)theType); + std::vector A = dynamic_cast(_impl)->GetIDs((Parameter_Types)theType); if(A.size()) { int length = A.size(); diff --git a/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.cxx b/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.cxx index 7cc694596..d2f1c1664 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributePersistentRef_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - char* SALOMEDS_AttributePersistentRef_i::Value() { SALOMEDS::Locker lock; @@ -41,5 +39,5 @@ void SALOMEDS_AttributePersistentRef_i::SetValue(const char* value) SALOMEDS::Locker lock; CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); - dynamic_cast(_impl)->SetValue(string(Str)); + dynamic_cast(_impl)->SetValue(std::string(Str)); } diff --git a/src/SALOMEDS/SALOMEDS_AttributePixMap_i.cxx b/src/SALOMEDS/SALOMEDS_AttributePixMap_i.cxx index 2e3c4cdba..f17fb8174 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePixMap_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributePixMap_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributePixMap_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - CORBA::Boolean SALOMEDS_AttributePixMap_i::HasPixMap() { SALOMEDS::Locker lock; @@ -47,5 +45,5 @@ void SALOMEDS_AttributePixMap_i::SetPixMap(const char* value) SALOMEDS::Locker lock; CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); - dynamic_cast(_impl)->SetPixMap(string(Str)); + dynamic_cast(_impl)->SetPixMap(std::string(Str)); } diff --git a/src/SALOMEDS/SALOMEDS_AttributePythonObject_i.cxx b/src/SALOMEDS/SALOMEDS_AttributePythonObject_i.cxx index 5645d1c3c..c1a6ce808 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePythonObject_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributePythonObject_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributePythonObject_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - void SALOMEDS_AttributePythonObject_i::SetObject(const char* theSequence, CORBA::Boolean IsScript) { SALOMEDS::Locker lock; @@ -39,7 +37,7 @@ void SALOMEDS_AttributePythonObject_i::SetObject(const char* theSequence, CORBA: char* SALOMEDS_AttributePythonObject_i::GetObject() { SALOMEDS::Locker lock; - string aSeq(dynamic_cast(_impl)->GetObject()); + std::string aSeq(dynamic_cast(_impl)->GetObject()); CORBA::String_var aStr = CORBA::string_dup(aSeq.c_str()); return aStr._retn(); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeReal_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeReal_i.cxx index f033a682c..30489be16 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeReal_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeReal_i.cxx @@ -28,8 +28,6 @@ #include "SALOMEDS.hxx" #include -using namespace std; - CORBA::Double SALOMEDS_AttributeReal_i::Value() { SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_AttributeSelectable_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeSelectable_i.cxx index 949b40205..d0b8c39e5 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeSelectable_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeSelectable_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeSelectable_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - CORBA::Boolean SALOMEDS_AttributeSelectable_i::IsSelectable() { SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx index 5db32c6dd..84534dd1d 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx @@ -28,14 +28,11 @@ #include -using namespace std; - - void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& other) { SALOMEDS::Locker lock; CheckLocked(); - vector aSeq; + std::vector aSeq; for(int i = 0, len = other.length(); i(_impl)->Assign(aSeq); } @@ -44,7 +41,7 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeSequenceOfInteger_i::CorbaSequence() { SALOMEDS::Locker lock; SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq; - const vector& CasCadeSeq = dynamic_cast(_impl)->Array(); + const std::vector& CasCadeSeq = dynamic_cast(_impl)->Array(); int len = CasCadeSeq.size(); CorbaSeq->length(len); for (int i = 0; i < len; i++) { diff --git a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx index e028c1022..48800763d 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx @@ -27,13 +27,11 @@ #include "SALOMEDS.hxx" #include -using namespace std; - void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other) { SALOMEDS::Locker lock; CheckLocked(); - vector CasCadeSeq; + std::vector CasCadeSeq; for (int i = 0; i < other.length(); i++) { CasCadeSeq.push_back(other[i]); } @@ -44,7 +42,7 @@ SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence() { SALOMEDS::Locker lock; SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq; - const vector& CasCadeSeq = dynamic_cast(_impl)->Array(); + const std::vector& CasCadeSeq = dynamic_cast(_impl)->Array(); int len = CasCadeSeq.size(); CorbaSeq->length(len); for (int i = 0; i < len; i++) { diff --git a/src/SALOMEDS/SALOMEDS_AttributeString_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeString_i.cxx index 3adec8caf..a849dc78e 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeString_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeString_i.cxx @@ -28,8 +28,6 @@ #include "SALOMEDS_SObject_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - char* SALOMEDS_AttributeString_i::Value() { SALOMEDS::Locker lock; @@ -44,5 +42,5 @@ void SALOMEDS_AttributeString_i::SetValue(const char* value) SALOMEDS::Locker lock; CheckLocked(); - dynamic_cast(_impl)->SetValue(string(value)); + dynamic_cast(_impl)->SetValue(std::string(value)); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx index c4aaf86f6..6cbdbd1d1 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeStudyProperties.hxx" #include "SALOMEDS.hxx" -using namespace std; - SALOMEDS_AttributeStudyProperties::SALOMEDS_AttributeStudyProperties (SALOMEDSImpl_AttributeStudyProperties* theAttr) :SALOMEDS_GenericAttribute(theAttr) @@ -79,7 +77,7 @@ void SALOMEDS_AttributeStudyProperties::SetCreationDate dynamic_cast(_local_impl); int aTmp; if (anImpl->GetCreationDate(aTmp, aTmp, aTmp, aTmp, aTmp)) return; - string S; + std::string S; anImpl->SetModification(S, theMinute, theHour, theDay, theMonth, theYear); } else { ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->SetCreationDate(theMinute, @@ -235,8 +233,8 @@ void SALOMEDS_AttributeStudyProperties::GetModificationsList(std::vector aNames; - vector aMinutes, aHours, aDays, aMonths, aYears; + std::vector aNames; + std::vector aMinutes, aHours, aDays, aMonths, aYears; SALOMEDSImpl_AttributeStudyProperties* anImpl = dynamic_cast(_local_impl); anImpl->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears); aLength = aNames.size(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx index 47c67d1b4..42c1f17b9 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx @@ -25,7 +25,6 @@ // #include "SALOMEDS_AttributeStudyProperties_i.hxx" #include "SALOMEDS.hxx" -using namespace std; #define CREATION_MODE_NOTDEFINED 0 #define CREATION_MODE_SCRATCH 1 @@ -41,7 +40,7 @@ void SALOMEDS_AttributeStudyProperties_i::SetUserName(const char* theName) char* SALOMEDS_AttributeStudyProperties_i::GetUserName() { SALOMEDS::Locker lock; - string S = dynamic_cast(_impl)->GetCreatorName(); + std::string S = dynamic_cast(_impl)->GetCreatorName(); CORBA::String_var c_s = CORBA::string_dup(S.c_str()); return c_s._retn(); } @@ -57,7 +56,7 @@ void SALOMEDS_AttributeStudyProperties_i::SetCreationDate(CORBA::Long theMinute, SALOMEDSImpl_AttributeStudyProperties* aProp = dynamic_cast(_impl); int aTmp; if (aProp->GetCreationDate(aTmp, aTmp, aTmp, aTmp, aTmp)) return; - string S; + std::string S; aProp->SetModification(S, theMinute, theHour, theDay, theMonth, theYear); } @@ -159,8 +158,8 @@ void SALOMEDS_AttributeStudyProperties_i::GetModificationsList(SALOMEDS::StringS CORBA::Boolean theWithCreator) { SALOMEDS::Locker lock; - vector aNames; - vector aMinutes, aHours, aDays, aMonths, aYears; + std::vector aNames; + std::vector aMinutes, aHours, aDays, aMonths, aYears; SALOMEDSImpl_AttributeStudyProperties* aProp = dynamic_cast(_impl); aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears); int aLength = aNames.size(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx index fc3c3e261..bb105a335 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeTableOfReal.hxx" #include "SALOMEDS.hxx" -using namespace std; - SALOMEDS_AttributeTableOfReal::SALOMEDS_AttributeTableOfReal (SALOMEDSImpl_AttributeTableOfReal* theAttr) :SALOMEDS_GenericAttribute(theAttr) @@ -238,7 +236,7 @@ std::vector SALOMEDS_AttributeTableOfReal::GetRowUnits() else { SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowUnits(); aLength = aSeq->length(); - for (i = 0; i < aLength; i++) aVector.push_back(string(aSeq[i].in())); + for (i = 0; i < aLength; i++) aVector.push_back(std::string(aSeq[i].in())); } return aVector; } diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx index af7218536..efd38f27d 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx @@ -28,8 +28,6 @@ #include -using namespace std; - SALOMEDS_AttributeTableOfString::SALOMEDS_AttributeTableOfString (SALOMEDSImpl_AttributeTableOfString* theAttr) :SALOMEDS_GenericAttribute(theAttr) diff --git a/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx b/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx index 26089eb3f..bbeccf2d2 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx @@ -29,8 +29,6 @@ #include "SALOMEDSImpl_SObject.hxx" #include "SALOMEDS_SObject.hxx" -using namespace std; - SALOMEDS_AttributeTarget::SALOMEDS_AttributeTarget(SALOMEDSImpl_AttributeTarget* theAttr) :SALOMEDS_GenericAttribute(theAttr) {} @@ -61,7 +59,7 @@ std::vector<_PTR(SObject)> SALOMEDS_AttributeTarget::Get() if (_isLocal) { SALOMEDS::Locker lock; - vector aSeq = dynamic_cast(_local_impl)->Get(); + std::vector aSeq = dynamic_cast(_local_impl)->Get(); aLength = aSeq.size(); for (i = 0; i < aLength; i++) { aSO = new SALOMEDS_SObject(aSeq[i]); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx index f8edb8a8b..18aa25bd9 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx @@ -31,8 +31,6 @@ #include -using namespace std; - void SALOMEDS_AttributeTarget_i::Add(SALOMEDS::SObject_ptr anObject) { SALOMEDS::Locker lock; @@ -43,7 +41,7 @@ void SALOMEDS_AttributeTarget_i::Add(SALOMEDS::SObject_ptr anObject) SALOMEDS::Study::ListOfSObject* SALOMEDS_AttributeTarget_i::Get() { SALOMEDS::Locker lock; - vector aSeq = dynamic_cast(_impl)->Get(); + std::vector aSeq = dynamic_cast(_impl)->Get(); SALOMEDS::Study::ListOfSObject_var aSList = new SALOMEDS::Study::ListOfSObject; int aLength = aSeq.size(), i; if (aLength == 0) return aSList._retn(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx b/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx index 76edbef91..1704f85ef 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx @@ -28,8 +28,6 @@ #include -using namespace std; - SALOMEDS_AttributeTextColor::SALOMEDS_AttributeTextColor(SALOMEDSImpl_AttributeTextColor* theAttr) :SALOMEDS_GenericAttribute(theAttr) {} @@ -47,7 +45,7 @@ STextColor SALOMEDS_AttributeTextColor::TextColor() STextColor aColor; if (_isLocal) { SALOMEDS::Locker lock; - vector aSeq = dynamic_cast(_local_impl)->TextColor(); + std::vector aSeq = dynamic_cast(_local_impl)->TextColor(); aColor.R = aSeq[0]; aColor.G = aSeq[1]; aColor.B = aSeq[2]; @@ -66,7 +64,7 @@ void SALOMEDS_AttributeTextColor::SetTextColor(STextColor value) if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; - vector aSeq; + std::vector aSeq; aSeq.push_back( value.R ); aSeq.push_back( value.G ); aSeq.push_back( value.B ); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.cxx index 8e8b8a2bc..bfe2faae6 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.cxx @@ -27,13 +27,11 @@ #include "SALOMEDS.hxx" #include -using namespace std; - SALOMEDS::Color SALOMEDS_AttributeTextColor_i::TextColor() { SALOMEDS::Locker lock; SALOMEDS::Color TextColor; - vector anArray = dynamic_cast(_impl)->TextColor(); + std::vector anArray = dynamic_cast(_impl)->TextColor(); if (anArray.size()!=3) { TextColor.R = 0; TextColor.G = 0; @@ -51,7 +49,7 @@ void SALOMEDS_AttributeTextColor_i::SetTextColor(const SALOMEDS::Color& value) { SALOMEDS::Locker lock; CheckLocked(); - vector anArray; + std::vector anArray; anArray.push_back(value.R); anArray.push_back(value.G); anArray.push_back(value.B); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx index a6192565f..fc0f11677 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx @@ -28,8 +28,6 @@ #include -using namespace std; - SALOMEDS_AttributeTextHighlightColor::SALOMEDS_AttributeTextHighlightColor (SALOMEDSImpl_AttributeTextHighlightColor* theAttr) :SALOMEDS_GenericAttribute(theAttr) @@ -49,7 +47,7 @@ STextColor SALOMEDS_AttributeTextHighlightColor::TextHighlightColor() STextColor aColor; if (_isLocal) { SALOMEDS::Locker lock; - vector aSeq = dynamic_cast(_local_impl)->TextHighlightColor(); + std::vector aSeq = dynamic_cast(_local_impl)->TextHighlightColor(); aColor.R = aSeq[0]; aColor.G = aSeq[1]; aColor.B = aSeq[2]; @@ -69,7 +67,7 @@ void SALOMEDS_AttributeTextHighlightColor::SetTextHighlightColor(STextColor valu if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; - vector aSeq; + std::vector aSeq; aSeq.push_back(value.R); aSeq.push_back(value.G); aSeq.push_back(value.B); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.cxx index 5facef965..70b74b93c 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.cxx @@ -27,13 +27,11 @@ #include "SALOMEDS.hxx" #include -using namespace std; - SALOMEDS::Color SALOMEDS_AttributeTextHighlightColor_i::TextHighlightColor() { SALOMEDS::Locker lock; SALOMEDS::Color TextHighlightColor; - vector anArray = dynamic_cast(_impl)->TextHighlightColor(); + std::vector anArray = dynamic_cast(_impl)->TextHighlightColor(); if (anArray.size()!=3) { TextHighlightColor.R = 0; TextHighlightColor.G = 0; @@ -51,7 +49,7 @@ void SALOMEDS_AttributeTextHighlightColor_i::SetTextHighlightColor(const SALOMED { SALOMEDS::Locker lock; CheckLocked(); - vector anArray; + std::vector anArray; anArray.push_back(value.R); anArray.push_back(value.G); anArray.push_back(value.B); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx index 5a3c20885..a800550a3 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx @@ -32,8 +32,6 @@ #include "SALOMEDSImpl_AttributeTreeNode.hxx" #include "SALOMEDS_AttributeTreeNode.hxx" -using namespace std; - SALOMEDS_AttributeTreeNode::SALOMEDS_AttributeTreeNode(SALOMEDSImpl_AttributeTreeNode* theAttr) :SALOMEDS_GenericAttribute(theAttr) {} @@ -253,7 +251,7 @@ void SALOMEDS_AttributeTreeNode::SetTreeID(const std::string& value) std::string SALOMEDS_AttributeTreeNode::GetTreeID() { - string aGUID; + std::string aGUID; if (_isLocal) { SALOMEDS::Locker lock; SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast(_local_impl); @@ -430,7 +428,7 @@ bool SALOMEDS_AttributeTreeNode::IsChild(const _PTR(AttributeTreeNode)& value) std::string SALOMEDS_AttributeTreeNode::Label() { - string aLabel; + std::string aLabel; if (_isLocal) { SALOMEDS::Locker lock; aLabel = _local_impl->Label().Entry(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx index 7c17764b6..6cecec36c 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx @@ -27,8 +27,6 @@ #include "utilities.h" #include "SALOMEDS.hxx" -using namespace std; - static SALOMEDSImpl_AttributeTreeNode* GetNode(SALOMEDS::AttributeTreeNode_ptr value, SALOMEDSImpl_AttributeTreeNode* aNode) { diff --git a/src/SALOMEDS/SALOMEDS_AttributeUserID_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeUserID_i.cxx index 3a9f25f90..0a69be841 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeUserID_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeUserID_i.cxx @@ -26,8 +26,6 @@ #include "SALOMEDS_AttributeUserID_i.hxx" #include "SALOMEDS.hxx" -using namespace std; - char* SALOMEDS_AttributeUserID_i::Value() { SALOMEDS::Locker lock; @@ -40,6 +38,6 @@ void SALOMEDS_AttributeUserID_i::SetValue(const char* value) SALOMEDS::Locker lock; CheckLocked(); CORBA::String_var Str = CORBA::string_dup(value); - dynamic_cast(_impl)->SetValue(string(Str)); + dynamic_cast(_impl)->SetValue(std::string(Str)); } diff --git a/src/SALOMEDS/SALOMEDS_BasicAttributeFactory.cxx b/src/SALOMEDS/SALOMEDS_BasicAttributeFactory.cxx index cfca4db2d..ea12d1d2c 100644 --- a/src/SALOMEDS/SALOMEDS_BasicAttributeFactory.cxx +++ b/src/SALOMEDS/SALOMEDS_BasicAttributeFactory.cxx @@ -27,7 +27,7 @@ // #include "SALOMEDS_BasicAttributeFactory.hxx" #include "utilities.h" -using namespace std; + //============================================================================ /*! Function : Create diff --git a/src/SALOMEDS/SALOMEDS_BasicAttribute_i.cxx b/src/SALOMEDS/SALOMEDS_BasicAttribute_i.cxx index ba425bb2e..d9fb6f644 100644 --- a/src/SALOMEDS/SALOMEDS_BasicAttribute_i.cxx +++ b/src/SALOMEDS/SALOMEDS_BasicAttribute_i.cxx @@ -26,7 +26,6 @@ // $Header$ // #include "SALOMEDS_BasicAttribute_i.hxx" -using namespace std; //============================================================================ /*! Function : SetLabel diff --git a/src/SALOMEDS/SALOMEDS_ChildIterator.cxx b/src/SALOMEDS/SALOMEDS_ChildIterator.cxx index 1f11e67d6..6bb5daf5f 100644 --- a/src/SALOMEDS/SALOMEDS_ChildIterator.cxx +++ b/src/SALOMEDS/SALOMEDS_ChildIterator.cxx @@ -27,8 +27,6 @@ #include "SALOMEDS_SObject.hxx" #include "SALOMEDS.hxx" -using namespace std; - SALOMEDS_ChildIterator::SALOMEDS_ChildIterator(const SALOMEDSImpl_ChildIterator& theIterator) { SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx b/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx index 4375ea04d..f052cb370 100644 --- a/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx +++ b/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx @@ -30,8 +30,6 @@ #include "SALOMEDSImpl_Study.hxx" #include "utilities.h" -using namespace std; - //============================================================================ /*! Function : constructor * Purpose : diff --git a/src/SALOMEDS/SALOMEDS_Client.cxx b/src/SALOMEDS/SALOMEDS_Client.cxx index 79d01a83f..3f98299d6 100644 --- a/src/SALOMEDS/SALOMEDS_Client.cxx +++ b/src/SALOMEDS/SALOMEDS_Client.cxx @@ -32,8 +32,6 @@ #include "utilities.h" #include "HDFOI.hxx" -using namespace std; - //============================================================================ /*! Function : * Purpose : diff --git a/src/SALOMEDS/SALOMEDS_Driver_i.cxx b/src/SALOMEDS/SALOMEDS_Driver_i.cxx index 9d482fd5d..74ce18db0 100644 --- a/src/SALOMEDS/SALOMEDS_Driver_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Driver_i.cxx @@ -28,14 +28,12 @@ #include "SALOMEDS.hxx" #include -using namespace std; - SALOMEDS_Driver_i::~SALOMEDS_Driver_i() { } SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::Save(const SALOMEDSImpl_SComponent& theComponent, - const string& theURL, + const std::string& theURL, long& theStreamLength, bool isMultiFile) { @@ -52,7 +50,7 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::Save(const SALOMEDSImpl_SComponent& the } SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::SaveASCII(const SALOMEDSImpl_SComponent& theComponent, - const string& theURL, + const std::string& theURL, long& theStreamLength, bool isMultiFile) { @@ -71,7 +69,7 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::SaveASCII(const SALOMEDSImpl_SComponent bool SALOMEDS_Driver_i::Load(const SALOMEDSImpl_SComponent& theComponent, const unsigned char* theStream, const long theStreamLength, - const string& theURL, + const std::string& theURL, bool isMultiFile) { SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb); @@ -94,7 +92,7 @@ bool SALOMEDS_Driver_i::Load(const SALOMEDSImpl_SComponent& theComponent, bool SALOMEDS_Driver_i::LoadASCII(const SALOMEDSImpl_SComponent& theComponent, const unsigned char* theStream, const long theStreamLength, - const string& theURL, + const std::string& theURL, bool isMultiFile) { SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb); @@ -125,8 +123,8 @@ void SALOMEDS_Driver_i::Close(const SALOMEDSImpl_SComponent& theComponent) -string SALOMEDS_Driver_i::IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject, - const string& IORString, +std::string SALOMEDS_Driver_i::IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject, + const std::string& IORString, bool isMultiFile, bool isASCII) { @@ -137,12 +135,12 @@ string SALOMEDS_Driver_i::IORToLocalPersistentID(const SALOMEDSImpl_SObject& the CORBA::String_var pers_string =_driver->IORToLocalPersistentID(so.in(), ior.in(), isMultiFile, isASCII); SALOMEDS::lock(); - return string(pers_string); + return std::string(pers_string); } -string SALOMEDS_Driver_i::LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theObject, - const string& aLocalPersistentID, +std::string SALOMEDS_Driver_i::LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theObject, + const std::string& aLocalPersistentID, bool isMultiFile, bool isASCII) { @@ -151,7 +149,7 @@ string SALOMEDS_Driver_i::LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& the SALOMEDS::unlock(); CORBA::String_var IOR = _driver->LocalPersistentIDToIOR(so.in(), pers_string.in(), isMultiFile, isASCII); SALOMEDS::lock(); - return string(IOR); + return std::string(IOR); } bool SALOMEDS_Driver_i::CanCopy(const SALOMEDSImpl_SObject& theObject) @@ -184,7 +182,7 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::CopyFrom(const SALOMEDSImpl_SObject& th return aTMPFile; } -bool SALOMEDS_Driver_i::CanPaste(const string& theComponentName, int theObjectID) +bool SALOMEDS_Driver_i::CanPaste(const std::string& theComponentName, int theObjectID) { SALOMEDS::unlock(); bool canPaste = _driver->CanPaste(theComponentName.c_str(), theObjectID); @@ -192,7 +190,7 @@ bool SALOMEDS_Driver_i::CanPaste(const string& theComponentName, int theObjectID return canPaste; } -string SALOMEDS_Driver_i::PasteInto(const unsigned char* theStream, +std::string SALOMEDS_Driver_i::PasteInto(const unsigned char* theStream, const long theStreamLength, int theObjectID, const SALOMEDSImpl_SObject& theObject) @@ -210,7 +208,7 @@ string SALOMEDS_Driver_i::PasteInto(const unsigned char* theStream, SALOMEDS::SObject_var ret_so = _driver->PasteInto(aStream.in(), theObjectID, so.in()); SALOMEDS::lock(); - return string(ret_so->GetID()); + return std::string(ret_so->GetID()); } SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::DumpPython(SALOMEDSImpl_Study* theStudy, @@ -237,11 +235,11 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::DumpPython(SALOMEDSImpl_Study* theStudy // SALOMEDS_DriverFactory //############################################################################################################### -SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByType(const string& theComponentType) +SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByType(const std::string& theComponentType) { CORBA::Object_var obj; - string aFactoryType; + std::string aFactoryType; if (theComponentType == "SUPERV") aFactoryType = "SuperVisionContainer"; else aFactoryType = "FactoryServer"; @@ -261,7 +259,7 @@ SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByType(const string& the return NULL; } -SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByIOR(const string& theIOR) +SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByIOR(const std::string& theIOR) { CORBA::Object_var obj; obj = _orb->string_to_object(theIOR.c_str()); diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx b/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx index a5a64b49b..8382f7b84 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx @@ -40,8 +40,6 @@ #include #endif -using namespace std; - SALOMEDS_GenericAttribute::SALOMEDS_GenericAttribute(SALOMEDSImpl_GenericAttribute* theGA) { _isLocal = true; diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx index 29767e091..cc5fd4eb8 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx @@ -40,8 +40,6 @@ #include #endif -using namespace std; - UNEXPECT_CATCH(GALockProtection, SALOMEDS::GenericAttribute::LockProtection); SALOMEDS_GenericAttribute_i::SALOMEDS_GenericAttribute_i(DF_Attribute* theImpl, CORBA::ORB_ptr theOrb) @@ -83,7 +81,7 @@ char* SALOMEDS_GenericAttribute_i::Type() { SALOMEDS::Locker lock; if (_impl) { - string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(_impl); + std::string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(_impl); return CORBA::string_dup(type.c_str()); } @@ -94,7 +92,7 @@ char* SALOMEDS_GenericAttribute_i::GetClassType() { SALOMEDS::Locker lock; if (_impl) { - string class_type = SALOMEDSImpl_GenericAttribute::Impl_GetClassType(_impl); + std::string class_type = SALOMEDSImpl_GenericAttribute::Impl_GetClassType(_impl); return CORBA::string_dup(class_type.c_str()); } @@ -108,7 +106,7 @@ SALOMEDS::GenericAttribute_ptr SALOMEDS_GenericAttribute_i::CreateAttribute { SALOMEDS::Locker lock; - string aClassType = dynamic_cast(theAttr)->GetClassType(); + std::string aClassType = dynamic_cast(theAttr)->GetClassType(); char* aTypeOfAttribute = (char*)aClassType.c_str(); SALOMEDS::GenericAttribute_var anAttribute; SALOMEDS_GenericAttribute_i* attr_servant = NULL; diff --git a/src/SALOMEDS/SALOMEDS_IParameters.cxx b/src/SALOMEDS/SALOMEDS_IParameters.cxx index 8e54d30bf..3455543a6 100644 --- a/src/SALOMEDS/SALOMEDS_IParameters.cxx +++ b/src/SALOMEDS/SALOMEDS_IParameters.cxx @@ -22,8 +22,6 @@ #include "SALOMEDS_IParameters.hxx" #include -using namespace std; - #define PT_INTEGER 0 #define PT_REAL 1 #define PT_BOOLEAN 2 @@ -53,10 +51,10 @@ SALOMEDS_IParameters::~SALOMEDS_IParameters() _compNames.clear(); } -int SALOMEDS_IParameters::append(const string& listName, const string& value) +int SALOMEDS_IParameters::append(const std::string& listName, const std::string& value) { if(!_ap) return -1; - vector v; + std::vector v; if(!_ap->IsSet(listName, PT_STRARRAY)) { if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) _ap->SetStrArray(_AP_LISTS_LIST_, v); if(listName != _AP_ENTRIES_LIST_ && @@ -71,43 +69,43 @@ int SALOMEDS_IParameters::append(const string& listName, const string& value) return (v.size()-1); } -int SALOMEDS_IParameters::nbValues(const string& listName) +int SALOMEDS_IParameters::nbValues(const std::string& listName) { if(!_ap) return -1; if(!_ap->IsSet(listName, PT_STRARRAY)) return 0; - vector v = _ap->GetStrArray(listName); + std::vector v = _ap->GetStrArray(listName); return v.size(); } -vector SALOMEDS_IParameters::getValues(const string& listName) +std::vector SALOMEDS_IParameters::getValues(const std::string& listName) { - vector v; + std::vector v; if(!_ap) return v; if(!_ap->IsSet(listName, PT_STRARRAY)) return v; return _ap->GetStrArray(listName); } -string SALOMEDS_IParameters::getValue(const string& listName, int index) +std::string SALOMEDS_IParameters::getValue(const std::string& listName, int index) { if(!_ap) return ""; if(!_ap->IsSet(listName, PT_STRARRAY)) return ""; - vector v = _ap->GetStrArray(listName); + std::vector v = _ap->GetStrArray(listName); if(index >= v.size()) return ""; return v[index]; } -vector SALOMEDS_IParameters::getLists() +std::vector SALOMEDS_IParameters::getLists() { - vector v; + std::vector v; if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) return v; return _ap->GetStrArray(_AP_LISTS_LIST_); } -void SALOMEDS_IParameters::setParameter(const string& entry, const string& parameterName, const string& value) +void SALOMEDS_IParameters::setParameter(const std::string& entry, const std::string& parameterName, const std::string& value) { if(!_ap) return; - vector v; + std::vector v; if(!_ap->IsSet(entry, PT_STRARRAY)) { append(_AP_ENTRIES_LIST_, entry); //Add the entry to the internal list of entries _ap->SetStrArray(entry, v); @@ -119,11 +117,11 @@ void SALOMEDS_IParameters::setParameter(const string& entry, const string& param } -string SALOMEDS_IParameters::getParameter(const string& entry, const string& parameterName) +std::string SALOMEDS_IParameters::getParameter(const std::string& entry, const std::string& parameterName) { if(!_ap) return ""; if(!_ap->IsSet(entry, PT_STRARRAY)) return ""; - vector v = _ap->GetStrArray(entry); + std::vector v = _ap->GetStrArray(entry); int length = v.size(); for(int i = 0; i SALOMEDS_IParameters::getAllParameterNames(const string& entry) +std::vector SALOMEDS_IParameters::getAllParameterNames(const std::string& entry) { - vector v, names; + std::vector v, names; if(!_ap) return v; if(!_ap->IsSet(entry, PT_STRARRAY)) return v; v = _ap->GetStrArray(entry); @@ -145,9 +143,9 @@ vector SALOMEDS_IParameters::getAllParameterNames(const string& entry) return names; } -vector SALOMEDS_IParameters::getAllParameterValues(const string& entry) +std::vector SALOMEDS_IParameters::getAllParameterValues(const std::string& entry) { - vector v, values; + std::vector v, values; if(!_ap) return v; if(!_ap->IsSet(entry, PT_STRARRAY)) return v; v = _ap->GetStrArray(entry); @@ -158,22 +156,22 @@ vector SALOMEDS_IParameters::getAllParameterValues(const string& entry) return values; } -int SALOMEDS_IParameters::getNbParameters(const string& entry) +int SALOMEDS_IParameters::getNbParameters(const std::string& entry) { if(!_ap) return -1; if(!_ap->IsSet(entry, PT_STRARRAY)) return -1; return _ap->GetStrArray(entry).size()/2; } -vector SALOMEDS_IParameters::getEntries() +std::vector SALOMEDS_IParameters::getEntries() { - vector v; + std::vector v; if(!_ap) return v; if(!_ap->IsSet(_AP_ENTRIES_LIST_, PT_STRARRAY)) return v; return _ap->GetStrArray(_AP_ENTRIES_LIST_); } -void SALOMEDS_IParameters::setProperty(const string& name, const std::string& value) +void SALOMEDS_IParameters::setProperty(const std::string& name, const std::string& value) { if(!_ap) return; if(!_ap->IsSet(name, PT_STRING)) { @@ -182,26 +180,26 @@ void SALOMEDS_IParameters::setProperty(const string& name, const std::string& va _ap->SetString(name, value); } -string SALOMEDS_IParameters::getProperty(const string& name) +std::string SALOMEDS_IParameters::getProperty(const std::string& name) { if(!_ap) return ""; if(!_ap->IsSet(name, PT_STRING)) return ""; return _ap->GetString(name); } -vector SALOMEDS_IParameters::getProperties() +std::vector SALOMEDS_IParameters::getProperties() { - vector v; + std::vector v; if(!_ap) return v; if(!_ap->IsSet(_AP_PROPERTIES_LIST_, PT_STRARRAY)) return v; return _ap->GetStrArray(_AP_PROPERTIES_LIST_); } -vector SALOMEDS_IParameters::parseValue(const string& value, const char separator, bool fromEnd) +std::vector SALOMEDS_IParameters::parseValue(const std::string& value, const char separator, bool fromEnd) { - string val(value); - vector v; + std::string val(value); + std::vector v; int pos; if(fromEnd) pos = val.rfind(separator); else pos = val.find(separator); @@ -211,7 +209,7 @@ vector SALOMEDS_IParameters::parseValue(const string& value, const char return v; } - string part1, part2; + std::string part1, part2; part1 = val.substr(0, pos); part2 = val.substr(pos+1, val.size()); v.push_back(part1); @@ -219,21 +217,21 @@ vector SALOMEDS_IParameters::parseValue(const string& value, const char return v; } -string SALOMEDS_IParameters::encodeEntry(const string& entry, const string& compName) +std::string SALOMEDS_IParameters::encodeEntry(const std::string& entry, const std::string& compName) { - string tail(entry, 6, entry.length()-1); - string newEntry(compName); + std::string tail(entry, 6, entry.length()-1); + std::string newEntry(compName); newEntry+=("_"+tail); return newEntry; } -string SALOMEDS_IParameters::decodeEntry(const string& entry) +std::string SALOMEDS_IParameters::decodeEntry(const std::string& entry) { if(!_study) return entry; int pos = entry.rfind("_"); if(pos < 0 || pos >= entry.length()) return entry; - string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1); + std::string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1); if(_compNames.find(compName) == _compNames.end()) { _PTR(SObject) so = _study->FindComponent(compName); @@ -243,15 +241,15 @@ string SALOMEDS_IParameters::decodeEntry(const string& entry) } else compID = _compNames[compName]; - string newEntry(compID); + std::string newEntry(compID); newEntry += (":"+tail); return newEntry; } -void SALOMEDS_IParameters::setDumpPython(_PTR(Study) study, const string& theID) +void SALOMEDS_IParameters::setDumpPython(_PTR(Study) study, const std::string& theID) { - string anID; + std::string anID; if(theID == "") anID = getDefaultVisualComponent(); else anID = theID; @@ -259,9 +257,9 @@ void SALOMEDS_IParameters::setDumpPython(_PTR(Study) study, const string& theID) ap->SetBool(_AP_DUMP_PYTHON_, !isDumpPython(study, theID)); } -bool SALOMEDS_IParameters::isDumpPython(_PTR(Study) study, const string& theID) +bool SALOMEDS_IParameters::isDumpPython(_PTR(Study) study, const std::string& theID) { - string anID; + std::string anID; if(theID == "") anID = getDefaultVisualComponent(); else anID = theID; @@ -271,7 +269,7 @@ bool SALOMEDS_IParameters::isDumpPython(_PTR(Study) study, const string& theID) return (bool)ap->GetBool(_AP_DUMP_PYTHON_); } -string SALOMEDS_IParameters::getDefaultVisualComponent() +std::string SALOMEDS_IParameters::getDefaultVisualComponent() { return "Interface Applicative"; } diff --git a/src/SALOMEDS/SALOMEDS_SComponent.cxx b/src/SALOMEDS/SALOMEDS_SComponent.cxx index e79f15eed..702281a08 100644 --- a/src/SALOMEDS/SALOMEDS_SComponent.cxx +++ b/src/SALOMEDS/SALOMEDS_SComponent.cxx @@ -30,8 +30,6 @@ #include -using namespace std; - SALOMEDS_SComponent::SALOMEDS_SComponent(SALOMEDS::SComponent_ptr theSComponent) :SALOMEDS_SObject(theSComponent) {} diff --git a/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx b/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx index 1d70da008..4e036677d 100644 --- a/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx @@ -27,8 +27,6 @@ #include "SALOMEDS.hxx" #include "SALOMEDSImpl_SComponent.hxx" -using namespace std; - //============================================================================ /*! Function : constructor * diff --git a/src/SALOMEDS/SALOMEDS_SComponent_i.cxx b/src/SALOMEDS/SALOMEDS_SComponent_i.cxx index 48d71ed7d..004a5d5ab 100644 --- a/src/SALOMEDS/SALOMEDS_SComponent_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SComponent_i.cxx @@ -28,8 +28,6 @@ #include "utilities.h" #include -using namespace std; - SALOMEDS::SComponent_ptr SALOMEDS_SComponent_i::New(const SALOMEDSImpl_SComponent& theImpl, CORBA::ORB_ptr theORB) { SALOMEDS_SComponent_i* sco_servant = new SALOMEDS_SComponent_i(theImpl, theORB); @@ -62,7 +60,7 @@ SALOMEDS_SComponent_i::~SALOMEDS_SComponent_i() char* SALOMEDS_SComponent_i::ComponentDataType() { SALOMEDS::Locker lock; - string aType = dynamic_cast(_impl)->ComponentDataType(); + std::string aType = dynamic_cast(_impl)->ComponentDataType(); return CORBA::string_dup(aType.c_str()); } @@ -75,7 +73,7 @@ char* SALOMEDS_SComponent_i::ComponentDataType() CORBA::Boolean SALOMEDS_SComponent_i::ComponentIOR(CORBA::String_out IOR) { SALOMEDS::Locker lock; - string ior; + std::string ior; if(!dynamic_cast(_impl)->ComponentIOR(ior)) { IOR = CORBA::string_dup(""); return false; diff --git a/src/SALOMEDS/SALOMEDS_SObject.cxx b/src/SALOMEDS/SALOMEDS_SObject.cxx index 28df2a5c6..76cb8ea3f 100644 --- a/src/SALOMEDS/SALOMEDS_SObject.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject.cxx @@ -53,9 +53,6 @@ #endif - -using namespace std; - SALOMEDS_SObject::SALOMEDS_SObject(SALOMEDS::SObject_ptr theSObject) { #ifdef WIN32 @@ -224,15 +221,15 @@ void SALOMEDS_SObject::Name(const std::string& theName) else _corba_impl->Name(theName.c_str()); } -vector<_PTR(GenericAttribute)> SALOMEDS_SObject::GetAllAttributes() +std::vector<_PTR(GenericAttribute)> SALOMEDS_SObject::GetAllAttributes() { - vector<_PTR(GenericAttribute)> aVector; + std::vector<_PTR(GenericAttribute)> aVector; int aLength = 0; SALOMEDSClient_GenericAttribute* anAttr; if (_isLocal) { SALOMEDS::Locker lock; - vector aSeq = _local_impl->GetAllAttributes(); + std::vector aSeq = _local_impl->GetAllAttributes(); aLength = aSeq.size(); for (int i = 0; i < aLength; i++) { anAttr = SALOMEDS_GenericAttribute::CreateAttribute(dynamic_cast(aSeq[i])); diff --git a/src/SALOMEDS/SALOMEDS_SObject_i.cxx b/src/SALOMEDS/SALOMEDS_SObject_i.cxx index 9f355a397..392bf4d29 100644 --- a/src/SALOMEDS/SALOMEDS_SObject_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject_i.cxx @@ -44,8 +44,6 @@ #include #endif -using namespace std; - SALOMEDS::SObject_ptr SALOMEDS_SObject_i::New(const SALOMEDSImpl_SObject& theImpl, CORBA::ORB_ptr theORB) { SALOMEDS_SObject_i* so_servant = new SALOMEDS_SObject_i(theImpl, theORB); @@ -135,7 +133,7 @@ SALOMEDS::Study_ptr SALOMEDS_SObject_i::GetStudy() return SALOMEDS::Study::_nil(); } - string IOR = aStudy->GetTransientReference(); + std::string IOR = aStudy->GetTransientReference(); CORBA::Object_var obj = _orb->string_to_object(IOR.c_str()); SALOMEDS::Study_var Study = SALOMEDS::Study::_narrow(obj) ; ASSERT(!CORBA::is_nil(Study)); @@ -169,7 +167,7 @@ CORBA::Boolean SALOMEDS_SObject_i::FindAttribute (SALOMEDS::GenericAttribute_out SALOMEDS::ListOfAttributes* SALOMEDS_SObject_i::GetAllAttributes() { SALOMEDS::Locker lock; - vector aSeq = _impl->GetAllAttributes(); + std::vector aSeq = _impl->GetAllAttributes(); SALOMEDS::ListOfAttributes_var SeqOfAttr = new SALOMEDS::ListOfAttributes; int length = aSeq.size(); @@ -239,7 +237,7 @@ char* SALOMEDS_SObject_i::Name() void SALOMEDS_SObject_i::Name(const char* name) { SALOMEDS::Locker lock; - string aName((char*)name); + std::string aName((char*)name); _impl->Name(aName); } @@ -275,7 +273,7 @@ CORBA::Object_ptr SALOMEDS_SObject_i::GetObject() SALOMEDS::Locker lock; CORBA::Object_ptr obj = CORBA::Object::_nil(); try { - string IOR = _impl->GetIOR(); + std::string IOR = _impl->GetIOR(); char* c_ior = CORBA::string_dup(IOR.c_str()); obj = _orb->string_to_object(c_ior); CORBA::string_free(c_ior); diff --git a/src/SALOMEDS/SALOMEDS_Server.cxx b/src/SALOMEDS/SALOMEDS_Server.cxx index e27fd0d14..fbdf9e037 100644 --- a/src/SALOMEDS/SALOMEDS_Server.cxx +++ b/src/SALOMEDS/SALOMEDS_Server.cxx @@ -37,7 +37,6 @@ #ifdef CHECKTIME #include #endif -using namespace std; // extern "C" // { // for ccmalloc memory debug diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index eeb4c5d33..b2b4ede3a 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -62,8 +62,6 @@ #include #endif -using namespace std; - SALOMEDS_Study::SALOMEDS_Study(SALOMEDSImpl_Study* theStudy) { _isLocal = true; @@ -201,7 +199,7 @@ std::vector<_PTR(SObject)> SALOMEDS_Study::FindObjectByName(const std::string& a if (_isLocal) { SALOMEDS::Locker lock; - vector aSeq = _local_impl->FindObjectByName(anObjectName, aComponentName); + std::vector aSeq = _local_impl->FindObjectByName(anObjectName, aComponentName); aLength = aSeq.size(); for (i = 0; i< aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i]))); @@ -545,7 +543,7 @@ std::vector<_PTR(SObject)> SALOMEDS_Study::FindDependances(const _PTR(SObject)& if (_isLocal) { SALOMEDS::Locker lock; - vector aSeq = _local_impl->FindDependances(*(aSO->GetLocalImpl())); + std::vector aSeq = _local_impl->FindDependances(*(aSO->GetLocalImpl())); if (aSeq.size()) { aLength = aSeq.size(); for (i = 0; i < aLength; i++) @@ -630,7 +628,7 @@ void SALOMEDS_Study::EnableUseCaseAutoFilling(bool isEnabled) else _corba_impl->EnableUseCaseAutoFilling(isEnabled); } -bool SALOMEDS_Study::DumpStudy(const string& thePath, const string& theBaseName, bool isPublished) +bool SALOMEDS_Study::DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished) { //SRN: Pure CORBA DumpStudy as it does more cleaning than the local one if(CORBA::is_nil(_corba_impl)) GetStudy(); //If CORBA implementation is null then retrieve it @@ -638,7 +636,7 @@ bool SALOMEDS_Study::DumpStudy(const string& thePath, const string& theBaseName, return ret; } -void SALOMEDS_Study::SetStudyLock(const string& theLockerID) +void SALOMEDS_Study::SetStudyLock(const std::string& theLockerID) { if (_isLocal) { SALOMEDS::Locker lock; @@ -658,13 +656,13 @@ bool SALOMEDS_Study::IsStudyLocked() return isLocked; } -void SALOMEDS_Study::UnLockStudy(const string& theLockerID) +void SALOMEDS_Study::UnLockStudy(const std::string& theLockerID) { if(_isLocal) _local_impl->UnLockStudy(theLockerID.c_str()); else _corba_impl->UnLockStudy((char*)theLockerID.c_str()); } -vector SALOMEDS_Study::GetLockerID() +std::vector SALOMEDS_Study::GetLockerID() { std::vector aVector; int aLength, i; @@ -681,7 +679,7 @@ vector SALOMEDS_Study::GetLockerID() } -void SALOMEDS_Study::SetReal(const string& theVarName, const double theValue) +void SALOMEDS_Study::SetReal(const std::string& theVarName, const double theValue) { if (_isLocal) { SALOMEDS::Locker lock; @@ -693,7 +691,7 @@ void SALOMEDS_Study::SetReal(const string& theVarName, const double theValue) _corba_impl->SetReal((char*)theVarName.c_str(),theValue); } -void SALOMEDS_Study::SetInteger(const string& theVarName, const int theValue) +void SALOMEDS_Study::SetInteger(const std::string& theVarName, const int theValue) { if (_isLocal) { SALOMEDS::Locker lock; @@ -705,7 +703,7 @@ void SALOMEDS_Study::SetInteger(const string& theVarName, const int theValue) _corba_impl->SetInteger((char*)theVarName.c_str(),theValue); } -void SALOMEDS_Study::SetBoolean(const string& theVarName, const bool theValue) +void SALOMEDS_Study::SetBoolean(const std::string& theVarName, const bool theValue) { if (_isLocal) { SALOMEDS::Locker lock; @@ -717,7 +715,7 @@ void SALOMEDS_Study::SetBoolean(const string& theVarName, const bool theValue) _corba_impl->SetBoolean((char*)theVarName.c_str(),theValue); } -void SALOMEDS_Study::SetString(const string& theVarName, const string& theValue) +void SALOMEDS_Study::SetString(const std::string& theVarName, const std::string& theValue) { if (_isLocal) { SALOMEDS::Locker lock; @@ -729,7 +727,7 @@ void SALOMEDS_Study::SetString(const string& theVarName, const string& theValue) _corba_impl->SetString((char*)theVarName.c_str(),(char*)theValue.c_str()); } -void SALOMEDS_Study::SetStringAsDouble(const string& theVarName, const double theValue) +void SALOMEDS_Study::SetStringAsDouble(const std::string& theVarName, const double theValue) { if (_isLocal) { SALOMEDS::Locker lock; @@ -741,7 +739,7 @@ void SALOMEDS_Study::SetStringAsDouble(const string& theVarName, const double th _corba_impl->SetStringAsDouble((char*)theVarName.c_str(),theValue); } -double SALOMEDS_Study::GetReal(const string& theVarName) +double SALOMEDS_Study::GetReal(const std::string& theVarName) { double aResult; if (_isLocal) { @@ -753,7 +751,7 @@ double SALOMEDS_Study::GetReal(const string& theVarName) return aResult; } -int SALOMEDS_Study::GetInteger(const string& theVarName) +int SALOMEDS_Study::GetInteger(const std::string& theVarName) { int aResult; if (_isLocal) { @@ -765,7 +763,7 @@ int SALOMEDS_Study::GetInteger(const string& theVarName) return aResult; } -bool SALOMEDS_Study::GetBoolean(const string& theVarName) +bool SALOMEDS_Study::GetBoolean(const std::string& theVarName) { bool aResult; if (_isLocal) { @@ -777,7 +775,7 @@ bool SALOMEDS_Study::GetBoolean(const string& theVarName) return aResult; } -std::string SALOMEDS_Study::GetString(const string& theVarName) +std::string SALOMEDS_Study::GetString(const std::string& theVarName) { std::string aResult; if (_isLocal) { @@ -789,7 +787,7 @@ std::string SALOMEDS_Study::GetString(const string& theVarName) return aResult; } -bool SALOMEDS_Study::IsReal(const string& theVarName) +bool SALOMEDS_Study::IsReal(const std::string& theVarName) { bool aResult; if (_isLocal) { @@ -802,7 +800,7 @@ bool SALOMEDS_Study::IsReal(const string& theVarName) return aResult; } -bool SALOMEDS_Study::IsInteger(const string& theVarName) +bool SALOMEDS_Study::IsInteger(const std::string& theVarName) { bool aResult; if (_isLocal) { @@ -815,7 +813,7 @@ bool SALOMEDS_Study::IsInteger(const string& theVarName) return aResult; } -bool SALOMEDS_Study::IsBoolean(const string& theVarName) +bool SALOMEDS_Study::IsBoolean(const std::string& theVarName) { bool aResult; if (_isLocal) { @@ -828,7 +826,7 @@ bool SALOMEDS_Study::IsBoolean(const string& theVarName) return aResult; } -bool SALOMEDS_Study::IsString(const string& theVarName) +bool SALOMEDS_Study::IsString(const std::string& theVarName) { bool aResult; if (_isLocal) { @@ -841,7 +839,7 @@ bool SALOMEDS_Study::IsString(const string& theVarName) return aResult; } -bool SALOMEDS_Study::IsVariable(const string& theVarName) +bool SALOMEDS_Study::IsVariable(const std::string& theVarName) { bool aResult; if (_isLocal) { @@ -853,9 +851,9 @@ bool SALOMEDS_Study::IsVariable(const string& theVarName) return aResult; } -vector SALOMEDS_Study::GetVariableNames() +std::vector SALOMEDS_Study::GetVariableNames() { - vector aVector; + std::vector aVector; if (_isLocal) { SALOMEDS::Locker lock; aVector = _local_impl->GetVariableNames(); @@ -864,12 +862,12 @@ vector SALOMEDS_Study::GetVariableNames() SALOMEDS::ListOfStrings_var aSeq = _corba_impl->GetVariableNames(); int aLength = aSeq->length(); for (int i = 0; i < aLength; i++) - aVector.push_back( string(aSeq[i].in()) ); + aVector.push_back( std::string(aSeq[i].in()) ); } return aVector; } -bool SALOMEDS_Study::RemoveVariable(const string& theVarName) +bool SALOMEDS_Study::RemoveVariable(const std::string& theVarName) { bool aResult; if (_isLocal) { @@ -881,7 +879,7 @@ bool SALOMEDS_Study::RemoveVariable(const string& theVarName) return aResult; } -bool SALOMEDS_Study::RenameVariable(const string& theVarName, const string& theNewVarName) +bool SALOMEDS_Study::RenameVariable(const std::string& theVarName, const std::string& theNewVarName) { bool aResult; if (_isLocal) { @@ -893,7 +891,7 @@ bool SALOMEDS_Study::RenameVariable(const string& theVarName, const string& theN return aResult; } -bool SALOMEDS_Study::IsVariableUsed(const string& theVarName) +bool SALOMEDS_Study::IsVariableUsed(const std::string& theVarName) { bool aResult; if (_isLocal) { @@ -905,9 +903,9 @@ bool SALOMEDS_Study::IsVariableUsed(const string& theVarName) return aResult; } -vector< vector > SALOMEDS_Study::ParseVariables(const string& theVars) +std::vector< std::vector > SALOMEDS_Study::ParseVariables(const std::string& theVars) { - vector< vector > aResult; + std::vector< std::vector > aResult; if (_isLocal) { SALOMEDS::Locker lock; aResult = _local_impl->ParseVariables(theVars); @@ -915,10 +913,10 @@ vector< vector > SALOMEDS_Study::ParseVariables(const string& theVars) else { SALOMEDS::ListOfListOfStrings_var aSeq = _corba_impl->ParseVariables(theVars.c_str()); for (int i = 0, n = aSeq->length(); i < n; i++) { - vector aVector; + std::vector aVector; SALOMEDS::ListOfStrings aSection = aSeq[i]; for (int j = 0, m = aSection.length(); j < m; j++) { - aVector.push_back( string(aSection[j].in()) ); + aVector.push_back( std::string(aSection[j].in()) ); } aResult.push_back( aVector ); } @@ -970,7 +968,7 @@ SALOMEDS::Study_ptr SALOMEDS_Study::GetStudy() } -_PTR(AttributeParameter) SALOMEDS_Study::GetCommonParameters(const string& theID, int theSavePoint) +_PTR(AttributeParameter) SALOMEDS_Study::GetCommonParameters(const std::string& theID, int theSavePoint) { SALOMEDSClient_AttributeParameter* AP = NULL; if(theSavePoint >= 0) { @@ -985,8 +983,8 @@ _PTR(AttributeParameter) SALOMEDS_Study::GetCommonParameters(const string& theID return _PTR(AttributeParameter)(AP); } -_PTR(AttributeParameter) SALOMEDS_Study::GetModuleParameters(const string& theID, - const string& theModuleName, int theSavePoint) +_PTR(AttributeParameter) SALOMEDS_Study::GetModuleParameters(const std::string& theID, + const std::string& theModuleName, int theSavePoint) { SALOMEDSClient_AttributeParameter* AP = NULL; if(theSavePoint > 0) { diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx b/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx index 0ce032547..e953f9fb7 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx @@ -49,8 +49,6 @@ #include "Utils_ORB_INIT.hxx" #include "Utils_SINGLETON.hxx" -using namespace std; - SALOMEDS_StudyBuilder::SALOMEDS_StudyBuilder(SALOMEDSImpl_StudyBuilder* theBuilder) { _isLocal = true; diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx index 3609befb9..2c3c87dad 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx @@ -43,8 +43,6 @@ #include #include -using namespace std; - UNEXPECT_CATCH(SBSalomeException, SALOME::SALOME_Exception); UNEXPECT_CATCH(SBLockProtection, SALOMEDS::StudyBuilder::LockProtection); @@ -78,7 +76,7 @@ SALOMEDS::SComponent_ptr SALOMEDS_StudyBuilder_i::NewComponent(const char* DataT SALOMEDS::Locker lock; CheckLocked(); //char* aDataType = CORBA::string_dup(DataType); - SALOMEDSImpl_SComponent aSCO = _impl->NewComponent(string(DataType)); + SALOMEDSImpl_SComponent aSCO = _impl->NewComponent(std::string(DataType)); //CORBA::free_string(aDataType); if(aSCO.IsNull()) return SALOMEDS::SComponent::_nil(); @@ -231,7 +229,7 @@ SALOMEDS::GenericAttribute_ptr SALOMEDS_StudyBuilder_i::FindOrCreateAttribute(SA SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.inout()); DF_Attribute* anAttr; try { - anAttr = _impl->FindOrCreateAttribute(aSO, string(aTypeOfAttribute)); + anAttr = _impl->FindOrCreateAttribute(aSO, std::string(aTypeOfAttribute)); } catch (...) { throw SALOMEDS::StudyBuilder::LockProtection(); @@ -261,7 +259,7 @@ CORBA::Boolean SALOMEDS_StudyBuilder_i::FindAttribute(SALOMEDS::SObject_ptr anOb SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in()); DF_Attribute* anAttr; - if(!_impl->FindAttribute(aSO, anAttr, string(aTypeOfAttribute))) return false; + if(!_impl->FindAttribute(aSO, anAttr, std::string(aTypeOfAttribute))) return false; anAttribute = SALOMEDS_GenericAttribute_i::CreateAttribute(anAttr, _orb); return true; @@ -281,7 +279,7 @@ void SALOMEDS_StudyBuilder_i::RemoveAttribute(SALOMEDS::SObject_ptr anObject, ASSERT(!CORBA::is_nil(anObject)); CORBA::String_var anID = anObject->GetID(); SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in()); - _impl->RemoveAttribute(aSO, string(aTypeOfAttribute)); + _impl->RemoveAttribute(aSO, std::string(aTypeOfAttribute)); } //============================================================================ @@ -331,8 +329,8 @@ void SALOMEDS_StudyBuilder_i::AddDirectory(const char* thePath) SALOMEDS::Locker lock; CheckLocked(); if(thePath == NULL || strlen(thePath) == 0) throw SALOMEDS::Study::StudyInvalidDirectory(); - if(!_impl->AddDirectory(string(thePath))) { - string anErrorCode = _impl->GetErrorCode(); + if(!_impl->AddDirectory(std::string(thePath))) { + std::string anErrorCode = _impl->GetErrorCode(); if(anErrorCode == "StudyNameAlreadyUsed") throw SALOMEDS::Study::StudyNameAlreadyUsed(); if(anErrorCode == "StudyInvalidDirectory") throw SALOMEDS::Study::StudyInvalidDirectory(); if(anErrorCode == "StudyInvalidComponent") throw SALOMEDS::Study::StudyInvalidComponent(); @@ -352,7 +350,7 @@ void SALOMEDS_StudyBuilder_i::SetGUID(SALOMEDS::SObject_ptr anObject, const char ASSERT(!CORBA::is_nil(anObject)); CORBA::String_var anID=anObject->GetID(); SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in()); - _impl->SetGUID(aSO, string(theGUID)); + _impl->SetGUID(aSO, std::string(theGUID)); } //============================================================================ @@ -366,7 +364,7 @@ bool SALOMEDS_StudyBuilder_i::IsGUID(SALOMEDS::SObject_ptr anObject, const char* ASSERT(!CORBA::is_nil(anObject)); CORBA::String_var anID=anObject->GetID(); SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in()); - return _impl->IsGUID(aSO, string(theGUID)); + return _impl->IsGUID(aSO, std::string(theGUID)); } @@ -533,7 +531,7 @@ void SALOMEDS_StudyBuilder_i::SetName(SALOMEDS::SObject_ptr theSO, const char* t CORBA::String_var anID=theSO->GetID(); SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in()); - _impl->SetName(aSO, string(theValue)); + _impl->SetName(aSO, std::string(theValue)); } //============================================================================ @@ -550,7 +548,7 @@ void SALOMEDS_StudyBuilder_i::SetComment(SALOMEDS::SObject_ptr theSO, const char CORBA::String_var anID=theSO->GetID(); SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in()); - _impl->SetComment(aSO, string(theValue)); + _impl->SetComment(aSO, std::string(theValue)); } //============================================================================ @@ -567,5 +565,5 @@ void SALOMEDS_StudyBuilder_i::SetIOR(SALOMEDS::SObject_ptr theSO, const char* th CORBA::String_var anID=theSO->GetID(); SALOMEDSImpl_SObject aSO = _impl->GetOwner()->GetSObject(anID.in()); - _impl->SetIOR(aSO, string(theValue)); + _impl->SetIOR(aSO, std::string(theValue)); } diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.cxx b/src/SALOMEDS/SALOMEDS_StudyManager.cxx index 76ab7d253..6135a221d 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.cxx @@ -45,8 +45,6 @@ #include #endif -using namespace std; - SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_ptr orb); SALOMEDS_StudyManager::SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManager) @@ -169,7 +167,7 @@ std::vector SALOMEDS_StudyManager::GetOpenStudies() if (_isLocal) { SALOMEDS::Locker lock; - vector aSeq = _local_impl->GetOpenStudies(); + std::vector aSeq = _local_impl->GetOpenStudies(); aLength = aSeq.size(); for(i = 0; i < aLength; i++) aVector.push_back(aSeq[i]->Name()); @@ -315,7 +313,7 @@ SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_p SALOMEDSImpl_SComponent aSCO = theObject.GetFatherComponent(); if(!aSCO.IsNull()) { - string IOREngine = aSCO.GetIOR(); + std::string IOREngine = aSCO.GetIOR(); if(!IOREngine.empty()) { CORBA::Object_var obj = orb->string_to_object(IOREngine.c_str()); SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ; diff --git a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx index efb6564ad..03b1780d5 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx @@ -52,8 +52,6 @@ #include #endif -using namespace std; - UNEXPECT_CATCH(SalomeException,SALOME::SALOME_Exception); UNEXPECT_CATCH(LockProtection, SALOMEDS::StudyBuilder::LockProtection); @@ -156,7 +154,7 @@ SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::Open(const char* aUrl) Unexpect aCatch(SalomeException); MESSAGE("Begin of SALOMEDS_StudyManager_i::Open"); - SALOMEDSImpl_Study* aStudyImpl = _impl->Open(string(aUrl)); + SALOMEDSImpl_Study* aStudyImpl = _impl->Open(std::string(aUrl)); if ( !aStudyImpl ) THROW_SALOME_CORBA_EXCEPTION("Impossible to Open study from file", SALOME::BAD_PARAM) @@ -262,7 +260,7 @@ CORBA::Boolean SALOMEDS_StudyManager_i::SaveAs(const char* aUrl, SALOMEDS::Study } SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId()); - return _impl->SaveAs(string(aUrl), aStudyImpl, _factory, theMultiFile); + return _impl->SaveAs(std::string(aUrl), aStudyImpl, _factory, theMultiFile); } CORBA::Boolean SALOMEDS_StudyManager_i::SaveAsASCII(const char* aUrl, SALOMEDS::Study_ptr aStudy, CORBA::Boolean theMultiFile) @@ -275,7 +273,7 @@ CORBA::Boolean SALOMEDS_StudyManager_i::SaveAsASCII(const char* aUrl, SALOMEDS:: } SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId()); - return _impl->SaveAsASCII(string(aUrl), aStudyImpl, _factory, theMultiFile); + return _impl->SaveAsASCII(std::string(aUrl), aStudyImpl, _factory, theMultiFile); } //============================================================================ @@ -287,7 +285,7 @@ SALOMEDS::ListOfOpenStudies* SALOMEDS_StudyManager_i::GetOpenStudies() { SALOMEDS::Locker lock; - vector anOpened = _impl->GetOpenStudies(); + std::vector anOpened = _impl->GetOpenStudies(); int aLength = anOpened.size(); SALOMEDS::ListOfOpenStudies_var _list_open_studies = new SALOMEDS::ListOfOpenStudies; @@ -317,7 +315,7 @@ SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::GetStudyByName(const char* aStudyNa { SALOMEDS::Locker lock; - SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByName(string(aStudyName)); + SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByName(std::string(aStudyName)); if (!aStudyImpl) { @@ -449,7 +447,7 @@ SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_p SALOMEDSImpl_SComponent aSCO = theObject.GetFatherComponent(); if(!aSCO.IsNull()) { - string IOREngine = aSCO.GetIOR(); + std::string IOREngine = aSCO.GetIOR(); if(!IOREngine.empty()) { CORBA::Object_var obj = orb->string_to_object(IOREngine.c_str()); SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ; diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index bf3f7660a..eaf987afc 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -54,8 +54,6 @@ #include #endif -using namespace std; - std::map SALOMEDS_Study_i::_mapOfStudies; //============================================================================ @@ -131,7 +129,7 @@ SALOMEDS::SComponent_ptr SALOMEDS_Study_i::FindComponent (const char* aComponent { SALOMEDS::Locker lock; - SALOMEDSImpl_SComponent aCompImpl = _impl->FindComponent(string(aComponentName)); + SALOMEDSImpl_SComponent aCompImpl = _impl->FindComponent(std::string(aComponentName)); if(aCompImpl.IsNull()) return SALOMEDS::SComponent::_nil(); SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (aCompImpl, _orb); @@ -147,7 +145,7 @@ SALOMEDS::SComponent_ptr SALOMEDS_Study_i::FindComponentID(const char* aComponen { SALOMEDS::Locker lock; - SALOMEDSImpl_SComponent aCompImpl = _impl->FindComponentID(string((char*)aComponentID)); + SALOMEDSImpl_SComponent aCompImpl = _impl->FindComponentID(std::string((char*)aComponentID)); if(aCompImpl.IsNull()) return SALOMEDS::SComponent::_nil(); SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (aCompImpl, _orb); @@ -163,7 +161,7 @@ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObject(const char* anObjectName) { SALOMEDS::Locker lock; - SALOMEDSImpl_SObject aSO = _impl->FindObject(string((char*)anObjectName)); + SALOMEDSImpl_SObject aSO = _impl->FindObject(std::string((char*)anObjectName)); if(aSO.IsNull()) return SALOMEDS::SObject::_nil(); if(aSO.IsComponent()) { @@ -186,7 +184,7 @@ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectID(const char* anObjectID) { SALOMEDS::Locker lock; - SALOMEDSImpl_SObject aSO = _impl->FindObjectID(string((char*)anObjectID)); + SALOMEDSImpl_SObject aSO = _impl->FindObjectID(std::string((char*)anObjectID)); if(aSO.IsNull()) return SALOMEDS::SObject::_nil(); SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb); return so._retn(); @@ -221,8 +219,8 @@ SALOMEDS::Study::ListOfSObject* SALOMEDS_Study_i::FindObjectByName( const char* { SALOMEDS::Locker lock; - vector aSeq = _impl->FindObjectByName(string((char*)anObjectName), - string((char*)aComponentName)); + std::vector aSeq = _impl->FindObjectByName(std::string((char*)anObjectName), + std::string((char*)aComponentName)); int aLength = aSeq.size(); SALOMEDS::Study::ListOfSObject_var listSO = new SALOMEDS::Study::ListOfSObject ; listSO->length(aLength); @@ -242,7 +240,7 @@ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectIOR(const char* anObjectIOR) { SALOMEDS::Locker lock; - SALOMEDSImpl_SObject aSO = _impl->FindObjectIOR(string((char*)anObjectIOR)); + SALOMEDSImpl_SObject aSO = _impl->FindObjectIOR(std::string((char*)anObjectIOR)); if(aSO.IsNull()) return SALOMEDS::SObject::_nil(); SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb); @@ -258,7 +256,7 @@ SALOMEDS::SObject_ptr SALOMEDS_Study_i::FindObjectByPath(const char* thePath) { SALOMEDS::Locker lock; - SALOMEDSImpl_SObject aSO = _impl->FindObjectByPath(string((char*)thePath)); + SALOMEDSImpl_SObject aSO = _impl->FindObjectByPath(std::string((char*)thePath)); if(aSO.IsNull()) return SALOMEDS::SObject::_nil(); SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aSO, _orb); @@ -274,7 +272,7 @@ char* SALOMEDS_Study_i::GetObjectPath(CORBA::Object_ptr theObject) { SALOMEDS::Locker lock; - string aPath(""); + std::string aPath(""); if(CORBA::is_nil(theObject)) return CORBA::string_dup(aPath.c_str()); SALOMEDSImpl_SObject aSO; SALOMEDS::SObject_var aSObj = SALOMEDS::SObject::_narrow(theObject); @@ -302,7 +300,7 @@ void SALOMEDS_Study_i::SetContext(const char* thePath) { SALOMEDS::Locker lock; - _impl->SetContext(string((char*)thePath)); + _impl->SetContext(std::string((char*)thePath)); if(_impl->IsError() && _impl->GetErrorCode() == "InvalidContext") throw SALOMEDS::Study::StudyInvalidContext(); } @@ -334,7 +332,7 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetObjectNames(const char* theContext if (strlen(theContext) == 0 && !_impl->HasCurrentContext()) throw SALOMEDS::Study::StudyInvalidContext(); - vector aSeq = _impl->GetObjectNames(string((char*)theContext)); + std::vector aSeq = _impl->GetObjectNames(std::string((char*)theContext)); if (_impl->GetErrorCode() == "InvalidContext") throw SALOMEDS::Study::StudyInvalidContext(); @@ -361,7 +359,7 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetDirectoryNames(const char* theCont if (strlen(theContext) == 0 && !_impl->HasCurrentContext()) throw SALOMEDS::Study::StudyInvalidContext(); - vector aSeq = _impl->GetDirectoryNames(string((char*)theContext)); + std::vector aSeq = _impl->GetDirectoryNames(std::string((char*)theContext)); if (_impl->GetErrorCode() == "InvalidContext") throw SALOMEDS::Study::StudyInvalidContext(); @@ -388,7 +386,7 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetFileNames(const char* theContext) if (strlen(theContext) == 0 && !_impl->HasCurrentContext()) throw SALOMEDS::Study::StudyInvalidContext(); - vector aSeq = _impl->GetFileNames(string((char*)theContext)); + std::vector aSeq = _impl->GetFileNames(std::string((char*)theContext)); if (_impl->GetErrorCode() == "InvalidContext") throw SALOMEDS::Study::StudyInvalidContext(); @@ -413,7 +411,7 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetComponentNames(const char* theCont SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings; - vector aSeq = _impl->GetComponentNames(string((char*)theContext)); + std::vector aSeq = _impl->GetComponentNames(std::string((char*)theContext)); int aLength = aSeq.size(); aResult->length(aLength); @@ -488,7 +486,7 @@ char* SALOMEDS_Study_i::Name() void SALOMEDS_Study_i::Name(const char* name) { SALOMEDS::Locker lock; - _impl->Name(string((char*)name)); + _impl->Name(std::string((char*)name)); } //============================================================================ @@ -555,7 +553,7 @@ char* SALOMEDS_Study_i::URL() void SALOMEDS_Study_i::URL(const char* url) { SALOMEDS::Locker lock; - _impl->URL(string((char*)url)); + _impl->URL(std::string((char*)url)); } @@ -574,7 +572,7 @@ void SALOMEDS_Study_i::StudyId(CORBA::Short id) void SALOMEDS_Study_i::UpdateIORLabelMap(const char* anIOR,const char* anEntry) { SALOMEDS::Locker lock; - _impl->UpdateIORLabelMap(string((char*)anIOR), string((char*)anEntry)); + _impl->UpdateIORLabelMap(std::string((char*)anIOR), std::string((char*)anEntry)); } SALOMEDS::Study_ptr SALOMEDS_Study_i::GetStudy(const DF_Label& theLabel, CORBA::ORB_ptr orb) @@ -645,7 +643,7 @@ SALOMEDS::ListOfDates* SALOMEDS_Study_i::GetModificationsDate() { SALOMEDS::Locker lock; - vector aSeq = _impl->GetModificationsDate(); + std::vector aSeq = _impl->GetModificationsDate(); int aLength = aSeq.size(); SALOMEDS::ListOfDates_var aDates = new SALOMEDS::ListOfDates; aDates->length(aLength); @@ -750,7 +748,7 @@ void SALOMEDS_Study_i::RemovePostponed(CORBA::Long /*theUndoLimit*/) { SALOMEDS::Locker lock; - vector anIORs = _impl->GetIORs(); + std::vector anIORs = _impl->GetIORs(); int i, aSize = (int)anIORs.size(); for(i = 0; i < aSize; i++) { @@ -791,7 +789,7 @@ CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath, { SALOMEDS::Locker lock; - string aPath((char*)thePath), aBaseName((char*)theBaseName); + std::string aPath((char*)thePath), aBaseName((char*)theBaseName); SALOMEDS_DriverFactory_i* factory = new SALOMEDS_DriverFactory_i(_orb); CORBA::Boolean ret = _impl->DumpStudy(aPath, aBaseName, isPublished, factory); delete factory; @@ -872,7 +870,7 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetLockerID() SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings; - vector aSeq = _impl->GetLockerID(); + std::vector aSeq = _impl->GetLockerID(); int aLength = aSeq.size(); aResult->length(aLength); @@ -888,7 +886,7 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetLockerID() //============================================================================ void SALOMEDS_Study_i::SetReal(const char* theVarName, CORBA::Double theValue) { - _impl->SetVariable(string(theVarName), + _impl->SetVariable(std::string(theVarName), theValue, SALOMEDSImpl_GenericVariable::REAL_VAR); } @@ -900,7 +898,7 @@ void SALOMEDS_Study_i::SetReal(const char* theVarName, CORBA::Double theValue) //============================================================================ void SALOMEDS_Study_i::SetInteger(const char* theVarName, CORBA::Long theValue) { - _impl->SetVariable(string(theVarName), + _impl->SetVariable(std::string(theVarName), theValue, SALOMEDSImpl_GenericVariable::INTEGER_VAR); } @@ -912,7 +910,7 @@ void SALOMEDS_Study_i::SetInteger(const char* theVarName, CORBA::Long theValue) //============================================================================ void SALOMEDS_Study_i::SetBoolean(const char* theVarName, CORBA::Boolean theValue) { - _impl->SetVariable(string(theVarName), + _impl->SetVariable(std::string(theVarName), theValue, SALOMEDSImpl_GenericVariable::BOOLEAN_VAR); } @@ -924,7 +922,7 @@ void SALOMEDS_Study_i::SetBoolean(const char* theVarName, CORBA::Boolean theValu //============================================================================ void SALOMEDS_Study_i::SetString(const char* theVarName, const char* theValue) { - _impl->SetStringVariable(string(theVarName), + _impl->SetStringVariable(std::string(theVarName), theValue, SALOMEDSImpl_GenericVariable::STRING_VAR); } @@ -936,7 +934,7 @@ void SALOMEDS_Study_i::SetString(const char* theVarName, const char* theValue) //============================================================================ void SALOMEDS_Study_i::SetStringAsDouble(const char* theVarName, CORBA::Double theValue) { - _impl->SetStringVariableAsDouble(string(theVarName), + _impl->SetStringVariableAsDouble(std::string(theVarName), theValue, SALOMEDSImpl_GenericVariable::STRING_VAR); } @@ -948,7 +946,7 @@ void SALOMEDS_Study_i::SetStringAsDouble(const char* theVarName, CORBA::Double t //============================================================================ CORBA::Double SALOMEDS_Study_i::GetReal(const char* theVarName) { - return _impl->GetVariableValue(string(theVarName)); + return _impl->GetVariableValue(std::string(theVarName)); } //============================================================================ @@ -958,7 +956,7 @@ CORBA::Double SALOMEDS_Study_i::GetReal(const char* theVarName) //============================================================================ CORBA::Long SALOMEDS_Study_i::GetInteger(const char* theVarName) { - return (int)_impl->GetVariableValue(string(theVarName)); + return (int)_impl->GetVariableValue(std::string(theVarName)); } //============================================================================ @@ -968,7 +966,7 @@ CORBA::Long SALOMEDS_Study_i::GetInteger(const char* theVarName) //============================================================================ CORBA::Boolean SALOMEDS_Study_i::GetBoolean(const char* theVarName) { - return (bool)_impl->GetVariableValue(string(theVarName)); + return (bool)_impl->GetVariableValue(std::string(theVarName)); } //============================================================================ @@ -978,7 +976,7 @@ CORBA::Boolean SALOMEDS_Study_i::GetBoolean(const char* theVarName) //============================================================================ char* SALOMEDS_Study_i::GetString(const char* theVarName) { - return CORBA::string_dup(_impl->GetStringVariableValue(string(theVarName)).c_str()); + return CORBA::string_dup(_impl->GetStringVariableValue(std::string(theVarName)).c_str()); } //============================================================================ @@ -988,7 +986,7 @@ char* SALOMEDS_Study_i::GetString(const char* theVarName) //============================================================================ CORBA::Boolean SALOMEDS_Study_i::IsReal(const char* theVarName) { - return _impl->IsTypeOf(string(theVarName), + return _impl->IsTypeOf(std::string(theVarName), SALOMEDSImpl_GenericVariable::REAL_VAR); } @@ -999,7 +997,7 @@ CORBA::Boolean SALOMEDS_Study_i::IsReal(const char* theVarName) //============================================================================ CORBA::Boolean SALOMEDS_Study_i::IsInteger(const char* theVarName) { - return _impl->IsTypeOf(string(theVarName), + return _impl->IsTypeOf(std::string(theVarName), SALOMEDSImpl_GenericVariable::INTEGER_VAR); } @@ -1010,7 +1008,7 @@ CORBA::Boolean SALOMEDS_Study_i::IsInteger(const char* theVarName) //============================================================================ CORBA::Boolean SALOMEDS_Study_i::IsBoolean(const char* theVarName) { - return _impl->IsTypeOf(string(theVarName), + return _impl->IsTypeOf(std::string(theVarName), SALOMEDSImpl_GenericVariable::BOOLEAN_VAR); } @@ -1021,7 +1019,7 @@ CORBA::Boolean SALOMEDS_Study_i::IsBoolean(const char* theVarName) //============================================================================ CORBA::Boolean SALOMEDS_Study_i::IsString(const char* theVarName) { - return _impl->IsTypeOf(string(theVarName), + return _impl->IsTypeOf(std::string(theVarName), SALOMEDSImpl_GenericVariable::STRING_VAR); } @@ -1032,7 +1030,7 @@ CORBA::Boolean SALOMEDS_Study_i::IsString(const char* theVarName) //============================================================================ CORBA::Boolean SALOMEDS_Study_i::IsVariable(const char* theVarName) { - return _impl->IsVariable(string(theVarName)); + return _impl->IsVariable(std::string(theVarName)); } //============================================================================ @@ -1042,7 +1040,7 @@ CORBA::Boolean SALOMEDS_Study_i::IsVariable(const char* theVarName) //============================================================================ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetVariableNames() { - vector aVarNames = _impl->GetVariableNames(); + std::vector aVarNames = _impl->GetVariableNames(); SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings; int aLen = aVarNames.size(); @@ -1061,7 +1059,7 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetVariableNames() //============================================================================ CORBA::Boolean SALOMEDS_Study_i::RemoveVariable(const char* theVarName) { - return _impl->RemoveVariable(string(theVarName)); + return _impl->RemoveVariable(std::string(theVarName)); } //============================================================================ @@ -1071,7 +1069,7 @@ CORBA::Boolean SALOMEDS_Study_i::RemoveVariable(const char* theVarName) //============================================================================ CORBA::Boolean SALOMEDS_Study_i::RenameVariable(const char* theVarName, const char* theNewVarName) { - return _impl->RenameVariable(string(theVarName), string(theNewVarName)); + return _impl->RenameVariable(std::string(theVarName), std::string(theNewVarName)); } //============================================================================ @@ -1081,7 +1079,7 @@ CORBA::Boolean SALOMEDS_Study_i::RenameVariable(const char* theVarName, const ch //============================================================================ CORBA::Boolean SALOMEDS_Study_i::IsVariableUsed(const char* theVarName) { - return _impl->IsVariableUsed(string(theVarName)); + return _impl->IsVariableUsed(std::string(theVarName)); } @@ -1092,7 +1090,7 @@ CORBA::Boolean SALOMEDS_Study_i::IsVariableUsed(const char* theVarName) //============================================================================ SALOMEDS::ListOfListOfStrings* SALOMEDS_Study_i::ParseVariables(const char* theVarName) { - vector< vector > aSections = _impl->ParseVariables(string(theVarName)); + std::vector< std::vector > aSections = _impl->ParseVariables(std::string(theVarName)); SALOMEDS::ListOfListOfStrings_var aResult = new SALOMEDS::ListOfListOfStrings; @@ -1100,7 +1098,7 @@ SALOMEDS::ListOfListOfStrings* SALOMEDS_Study_i::ParseVariables(const char* theV aResult->length(aSectionsLen); for (int aSectionInd = 0; aSectionInd < aSectionsLen; aSectionInd++) { - vector aVarNames = aSections[aSectionInd]; + std::vector aVarNames = aSections[aSectionInd]; SALOMEDS::ListOfStrings_var aList = new SALOMEDS::ListOfStrings; @@ -1125,7 +1123,7 @@ char* SALOMEDS_Study_i::GetDefaultScript(const char* theModuleName, const char* { SALOMEDS::Locker lock; - string script = SALOMEDSImpl_IParameters::getDefaultScript(_impl, theModuleName, theShift); + std::string script = SALOMEDSImpl_IParameters::getDefaultScript(_impl, theModuleName, theShift); return CORBA::string_dup(script.c_str()); } diff --git a/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx b/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx index 3131077e0..b582f8033 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx @@ -34,8 +34,6 @@ #include -using namespace std; - SALOMEDS_UseCaseBuilder::SALOMEDS_UseCaseBuilder(SALOMEDSImpl_UseCaseBuilder* theBuilder) { _isLocal = true; diff --git a/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.cxx b/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.cxx index ecc1152a9..94b9d0976 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.cxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.cxx @@ -30,8 +30,6 @@ #include "utilities.h" -using namespace std; - //============================================================================ /*! Function : constructor * Purpose : diff --git a/src/SALOMEDS/SALOMEDS_UseCaseIterator.cxx b/src/SALOMEDS/SALOMEDS_UseCaseIterator.cxx index 0b3c9b7a8..73aa974c3 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseIterator.cxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseIterator.cxx @@ -28,8 +28,6 @@ #include "SALOMEDS.hxx" #include "SALOMEDS_SObject.hxx" -using namespace std; - SALOMEDS_UseCaseIterator::SALOMEDS_UseCaseIterator(const SALOMEDSImpl_UseCaseIterator& theIterator) { _isLocal = true; diff --git a/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx b/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx index bff53cc8b..51eddf222 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx @@ -30,8 +30,6 @@ #include "SALOMEDSImpl_SObject.hxx" #include "utilities.h" -using namespace std; - //============================================================================ /*! Function : constructor * Purpose : diff --git a/src/SALOMEDS/Test/SALOMEDSTest.cxx b/src/SALOMEDS/Test/SALOMEDSTest.cxx index 4351c6bfa..b053211fe 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest.cxx @@ -41,7 +41,6 @@ #include "SALOMEDS_SObject.hxx" -using namespace std; // ============================================================================ /*! @@ -73,7 +72,7 @@ void SALOMEDSTest::setUp() void SALOMEDSTest::tearDown() { _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) ); - vector v = sm->GetOpenStudies(); + std::vector v = sm->GetOpenStudies(); for(int i = 0; iGetStudyByName(v[i]); if(study) diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeComment.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeComment.cxx index 0b8e558f7..b5c2eb80e 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeComment.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeComment.cxx @@ -52,7 +52,7 @@ void SALOMEDSTest::testAttributeComment() CPPUNIT_ASSERT(_attr); //Check method Value - string value = _attr->Value(); + std::string value = _attr->Value(); CPPUNIT_ASSERT(value.empty()); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeExternalFileDef.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeExternalFileDef.cxx index e7be6de13..b75e387f8 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeExternalFileDef.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeExternalFileDef.cxx @@ -52,7 +52,7 @@ void SALOMEDSTest::testAttributeExternalFileDef() CPPUNIT_ASSERT(_attr); //Check method Value - string value = _attr->Value(); + std::string value = _attr->Value(); CPPUNIT_ASSERT(value.empty()); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeFileType.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeFileType.cxx index 9f28dd5c1..b419de43e 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeFileType.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeFileType.cxx @@ -52,7 +52,7 @@ void SALOMEDSTest::testAttributeFileType() CPPUNIT_ASSERT(_attr); //Check method Value - string value = _attr->Value(); + std::string value = _attr->Value(); CPPUNIT_ASSERT(value.empty()); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeIOR.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeIOR.cxx index 694597f5d..795c8c629 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeIOR.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeIOR.cxx @@ -52,11 +52,11 @@ void SALOMEDSTest::testAttributeIOR() CPPUNIT_ASSERT(_attr); //Check method Value - string value = _attr->Value(); + std::string value = _attr->Value(); CPPUNIT_ASSERT(value.empty()); - string ior = _orb->object_to_string(_sm); + std::string ior = _orb->object_to_string(_sm); //Check method SetValue _attr->SetValue(ior); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeName.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeName.cxx index 851b5bafb..5b8618142 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeName.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeName.cxx @@ -52,7 +52,7 @@ void SALOMEDSTest::testAttributeName() CPPUNIT_ASSERT(_attr); //Check method Value - string value = _attr->Value(); + std::string value = _attr->Value(); CPPUNIT_ASSERT(value.empty()); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeParameter.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeParameter.cxx index d56310482..ff06800fb 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeParameter.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeParameter.cxx @@ -94,7 +94,7 @@ void SALOMEDSTest::testAttributeParameter() CPPUNIT_ASSERT(_attr->IsSet("BoolValue", PT_BOOLEAN)); CPPUNIT_ASSERT(!_attr->GetBool("BoolValue")); - vector intArray; + std::vector intArray; intArray.push_back(0); intArray.push_back(1); @@ -104,7 +104,7 @@ void SALOMEDSTest::testAttributeParameter() CPPUNIT_ASSERT(_attr->GetIntArray("IntArray")[0] == 0); CPPUNIT_ASSERT(_attr->GetIntArray("IntArray")[1] == 1); - vector realArray; + std::vector realArray; realArray.push_back(0.0); realArray.push_back(1.1); @@ -114,7 +114,7 @@ void SALOMEDSTest::testAttributeParameter() CPPUNIT_ASSERT(_attr->GetRealArray("RealArray")[0] == 0.0); CPPUNIT_ASSERT(_attr->GetRealArray("RealArray")[1] == 1.1); - vector strArray; + std::vector strArray; strArray.push_back("hello"); strArray.push_back("world"); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributePersistentRef.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributePersistentRef.cxx index 335f63445..c265a951c 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributePersistentRef.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributePersistentRef.cxx @@ -52,7 +52,7 @@ void SALOMEDSTest::testAttributePersistentRef() CPPUNIT_ASSERT(_attr); //Check method Value - string value = _attr->Value(); + std::string value = _attr->Value(); CPPUNIT_ASSERT(value.empty()); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributePixMap.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributePixMap.cxx index 7f9dec3e3..0b4d47eb5 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributePixMap.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributePixMap.cxx @@ -55,7 +55,7 @@ void SALOMEDSTest::testAttributePixMap() CPPUNIT_ASSERT(!_attr->HasPixMap()); //Check method SetPixMap - string pixmap = "something"; + std::string pixmap = "something"; _attr->SetPixMap(pixmap); CPPUNIT_ASSERT(_attr->HasPixMap()); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributePythonObject.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributePythonObject.cxx index 592a58100..e5a26af0a 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributePythonObject.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributePythonObject.cxx @@ -54,7 +54,7 @@ void SALOMEDSTest::testAttributePythonObject() //Check method IsScript CPPUNIT_ASSERT(!_attr->IsScript()); - string pyobj = "some object!"; + std::string pyobj = "some object!"; //Check method SetObject _attr->SetObject(pyobj, true); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx index 22eac7421..67a8dcbae 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx @@ -79,7 +79,7 @@ void SALOMEDSTest::testAttributeSequenceOfInteger() CPPUNIT_ASSERT(_attr->Value(3) == 3); //Check method CorbaSequence - vector v = _attr->CorbaSequence(); + std::vector v = _attr->CorbaSequence(); CPPUNIT_ASSERT(v.size() == 3); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfReal.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfReal.cxx index fe68a5260..07d1638ba 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfReal.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfReal.cxx @@ -78,7 +78,7 @@ void SALOMEDSTest::testAttributeSequenceOfReal() CPPUNIT_ASSERT(_attr->Value(3) == 3.3); //Check method CorbaSequence - vector v = _attr->CorbaSequence(); + std::vector v = _attr->CorbaSequence(); CPPUNIT_ASSERT(v.size() == 3); v.push_back(5.5); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeStudyProperties.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeStudyProperties.cxx index 9ca2a20d4..d3c72f061 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeStudyProperties.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeStudyProperties.cxx @@ -67,7 +67,7 @@ void SALOMEDSTest::testAttributeStudyProperties() CPPUNIT_ASSERT(_attr->GetUserName() == "srn"); //Check method SetCreationMode - string value = "from scratch"; + std::string value = "from scratch"; _attr->SetCreationMode(value); //Check method GetCreationMode @@ -96,8 +96,8 @@ void SALOMEDSTest::testAttributeStudyProperties() _attr->SetModification("srn2", 6, 7, 8, 9, 10); //Check method GetModificationsList - vector vs; - vector vi[5]; + std::vector vs; + std::vector vi[5]; _attr->GetModificationsList(vs, vi[0], vi[1], vi[2], vi[3], vi[4], false); CPPUNIT_ASSERT(vs[0] == "srn2" && vi[0][0] == 6 && vi[1][0] == 7 && vi[2][0] == 8 && vi[3][0] == 9 && vi[4][0] == 10); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfInteger.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfInteger.cxx index c8dd9749a..858230b53 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfInteger.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfInteger.cxx @@ -84,14 +84,14 @@ void SALOMEDSTest::testAttributeTableOfInteger() CPPUNIT_ASSERT(_attr->GetValue(1, 1) == 23); //Check method GetRowSetIndices - vector rs = _attr->GetRowSetIndices(1); + std::vector rs = _attr->GetRowSetIndices(1); CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1); _attr->PutValue(32, 2,2); CPPUNIT_ASSERT(_attr->HasValue(2, 2)); - vector rowTitles; + std::vector rowTitles; rowTitles.push_back("title1"); rowTitles.push_back("title2"); @@ -102,11 +102,11 @@ void SALOMEDSTest::testAttributeTableOfInteger() _attr->SetRowTitle(1, "new_title"); //Check method GetRowTitles - vector rt = _attr->GetRowTitles(); + std::vector rt = _attr->GetRowTitles(); CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2"); - vector colTitles; + std::vector colTitles; colTitles.push_back("title1"); colTitles.push_back("title2"); @@ -117,11 +117,11 @@ void SALOMEDSTest::testAttributeTableOfInteger() _attr->SetColumnTitle(1, "new_title"); //Check method GetColumnTitles - vector ct = _attr->GetColumnTitles(); + std::vector ct = _attr->GetColumnTitles(); CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2"); - vector rowUnits; + std::vector rowUnits; rowUnits.push_back("unit1"); rowUnits.push_back("unit2"); @@ -132,7 +132,7 @@ void SALOMEDSTest::testAttributeTableOfInteger() _attr->SetRowUnit(1, "new_unit"); //Check method GetRowUnits - vector ru = _attr->GetRowUnits(); + std::vector ru = _attr->GetRowUnits(); CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2"); @@ -140,7 +140,7 @@ void SALOMEDSTest::testAttributeTableOfInteger() CPPUNIT_ASSERT(_attr->GetNbColumns() == 2); //Check method AddRow - vector data; + std::vector data; data.push_back(11); data.push_back(22); @@ -149,7 +149,7 @@ void SALOMEDSTest::testAttributeTableOfInteger() CPPUNIT_ASSERT(_attr->GetNbRows() == 3); //Check method GetRow - vector data2 = _attr->GetRow(3); + std::vector data2 = _attr->GetRow(3); CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == 11 && data2[1] == 22); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfReal.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfReal.cxx index 7da99c8ba..77973c571 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfReal.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfReal.cxx @@ -84,14 +84,14 @@ void SALOMEDSTest::testAttributeTableOfReal() CPPUNIT_ASSERT(_attr->GetValue(1, 1) == 23.23); //Check method GetRowSetIndices - vector rs = _attr->GetRowSetIndices(1); + std::vector rs = _attr->GetRowSetIndices(1); CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1); _attr->PutValue(32.32, 2,2); CPPUNIT_ASSERT(_attr->HasValue(2, 2)); - vector rowTitles; + std::vector rowTitles; rowTitles.push_back("title1"); rowTitles.push_back("title2"); @@ -102,11 +102,11 @@ void SALOMEDSTest::testAttributeTableOfReal() _attr->SetRowTitle(1, "new_title"); //Check method GetRowTitles - vector rt = _attr->GetRowTitles(); + std::vector rt = _attr->GetRowTitles(); CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2"); - vector colTitles; + std::vector colTitles; colTitles.push_back("title1"); colTitles.push_back("title2"); @@ -117,11 +117,11 @@ void SALOMEDSTest::testAttributeTableOfReal() _attr->SetColumnTitle(1, "new_title"); //Check method GetColumnTitles - vector ct = _attr->GetColumnTitles(); + std::vector ct = _attr->GetColumnTitles(); CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2"); - vector rowUnits; + std::vector rowUnits; rowUnits.push_back("unit1"); rowUnits.push_back("unit2"); @@ -132,7 +132,7 @@ void SALOMEDSTest::testAttributeTableOfReal() _attr->SetRowUnit(1, "new_unit"); //Check method GetRowUnits - vector ru = _attr->GetRowUnits(); + std::vector ru = _attr->GetRowUnits(); CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2"); @@ -140,7 +140,7 @@ void SALOMEDSTest::testAttributeTableOfReal() CPPUNIT_ASSERT(_attr->GetNbColumns() == 2); //Check method AddRow - vector data; + std::vector data; data.push_back(11.11); data.push_back(22.22); @@ -149,7 +149,7 @@ void SALOMEDSTest::testAttributeTableOfReal() CPPUNIT_ASSERT(_attr->GetNbRows() == 3); //Check method GetRow - vector data2 = _attr->GetRow(3); + std::vector data2 = _attr->GetRow(3); CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == 11.11 && data2[1] == 22.22); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfString.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfString.cxx index 72951d7d4..2b56ea753 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfString.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfString.cxx @@ -84,14 +84,14 @@ void SALOMEDSTest::testAttributeTableOfString() CPPUNIT_ASSERT(_attr->GetValue(1, 1) == "23"); //Check method GetRowSetIndices - vector rs = _attr->GetRowSetIndices(1); + std::vector rs = _attr->GetRowSetIndices(1); CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1); _attr->PutValue("32", 2,2); CPPUNIT_ASSERT(_attr->HasValue(2, 2)); - vector rowTitles; + std::vector rowTitles; rowTitles.push_back("title1"); rowTitles.push_back("title2"); @@ -102,12 +102,12 @@ void SALOMEDSTest::testAttributeTableOfString() _attr->SetRowTitle(1, "new_title"); //Check method GetRowTitles - vector rt = _attr->GetRowTitles(); + std::vector rt = _attr->GetRowTitles(); CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2"); - vector colTitles; + std::vector colTitles; colTitles.push_back("title1"); colTitles.push_back("title2"); @@ -118,11 +118,11 @@ void SALOMEDSTest::testAttributeTableOfString() _attr->SetColumnTitle(1, "new_title"); //Check method GetColumnTitles - vector ct = _attr->GetColumnTitles(); + std::vector ct = _attr->GetColumnTitles(); CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2"); - vector rowUnits; + std::vector rowUnits; rowUnits.push_back("unit1"); rowUnits.push_back("unit2"); @@ -133,7 +133,7 @@ void SALOMEDSTest::testAttributeTableOfString() _attr->SetRowUnit(1, "new_unit"); //Check method GetRowUnits - vector ru = _attr->GetRowUnits(); + std::vector ru = _attr->GetRowUnits(); CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2"); @@ -141,7 +141,7 @@ void SALOMEDSTest::testAttributeTableOfString() CPPUNIT_ASSERT(_attr->GetNbColumns() == 2); //Check method AddRow - vector data; + std::vector data; data.push_back("11"); data.push_back("22"); @@ -150,7 +150,7 @@ void SALOMEDSTest::testAttributeTableOfString() CPPUNIT_ASSERT(_attr->GetNbRows() == 3); //Check method GetRow - vector data2 = _attr->GetRow(3); + std::vector data2 = _attr->GetRow(3); CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == "11" && data2[1] == "22"); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTarget.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTarget.cxx index 72ae366a0..c4f3e241f 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTarget.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTarget.cxx @@ -66,7 +66,7 @@ void SALOMEDSTest::testAttributeTarget() _attr->Add(so2); //Check method Get - vector< _PTR(SObject) > v = _attr->Get(); + std::vector< _PTR(SObject) > v = _attr->Get(); CPPUNIT_ASSERT(v.size() == 2); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTreeNode.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTreeNode.cxx index 00b8f6f96..3bc8f1d2c 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTreeNode.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTreeNode.cxx @@ -52,7 +52,7 @@ void SALOMEDSTest::testAttributeTreeNode() //Check the attribute creation CPPUNIT_ASSERT(_attr); - string TreeNodeID = "0e1c36e6-379b-4d90-ab3b-17a14310e648"; + std::string TreeNodeID = "0e1c36e6-379b-4d90-ab3b-17a14310e648"; _PTR(SObject) so1 = study->CreateObjectID("0:1:2"); @@ -180,12 +180,12 @@ void SALOMEDSTest::testAttributeTreeNode() CPPUNIT_ASSERT(_attr2->GetTreeID() == TreeNodeID); #else - cout << endl << "THE TEST IS NOT COMPLETE !!!" << endl; + std::cout << std::endl << "THE TEST IS NOT COMPLETE !!!" << std::endl; #endif //Try to create the attribute with given TreeID - string value = "0e1c36e6-1111-4d90-ab3b-18a14310e648"; + std::string value = "0e1c36e6-1111-4d90-ab3b-18a14310e648"; _PTR(AttributeTreeNode) _attr_guid = studyBuilder->FindOrCreateAttribute(so, "AttributeTreeNodeGUID"+value); CPPUNIT_ASSERT(_attr_guid && _attr_guid->GetTreeID() == value); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeUserID.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeUserID.cxx index cb8a5dcdb..41dca0625 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeUserID.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeUserID.cxx @@ -51,7 +51,7 @@ void SALOMEDSTest::testAttributeUserID() //Check the attribute creation CPPUNIT_ASSERT(_attr); - string value = "0e1c36e6-379b-4d90-ab3b-17a14310e648"; + std::string value = "0e1c36e6-379b-4d90-ab3b-17a14310e648"; //Check method SetValue _attr->SetValue(value); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_SComponent.cxx b/src/SALOMEDS/Test/SALOMEDSTest_SComponent.cxx index cafd14b31..151da0620 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_SComponent.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_SComponent.cxx @@ -53,10 +53,10 @@ void SALOMEDSTest::testSComponent() //Check method ComponentIOR - string ior = _orb->object_to_string(_sm); + std::string ior = _orb->object_to_string(_sm); _attr->SetValue(ior); - string new_ior; + std::string new_ior; CPPUNIT_ASSERT(sco->ComponentIOR(new_ior)); CPPUNIT_ASSERT(new_ior == ior); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_SComponentIterator.cxx b/src/SALOMEDS/Test/SALOMEDSTest_SComponentIterator.cxx index 349270f21..62a142a2b 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_SComponentIterator.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_SComponentIterator.cxx @@ -44,7 +44,7 @@ void SALOMEDSTest::testSComponentIterator() studyBuilder->NewComponent("Test1"); studyBuilder->NewComponent("Test2"); - vector v; + std::vector v; v.push_back("Test1"); v.push_back("Test2"); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx b/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx index 1145f3e22..d3f2618ad 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx @@ -70,7 +70,7 @@ void SALOMEDSTest::testSObject() _PTR(AttributeName) _attrName = studyBuilder->FindOrCreateAttribute(so, "AttributeName"); _PTR(AttributeComment) _attrComment = studyBuilder->FindOrCreateAttribute(so, "AttributeComment"); - string ior = _orb->object_to_string(_sm); + std::string ior = _orb->object_to_string(_sm); _attrIOR->SetValue(ior); _attrName->SetValue("SO name"); _attrComment->SetValue("SO comment"); @@ -99,7 +99,7 @@ void SALOMEDSTest::testSObject() CPPUNIT_ASSERT(so->Name() == "test"); //Check method GetAllAttributes - vector< _PTR(GenericAttribute) > v = so->GetAllAttributes(); + std::vector< _PTR(GenericAttribute) > v = so->GetAllAttributes(); CPPUNIT_ASSERT(v.size() == 5); //+AttributeTarget +AttributeTreeNode diff --git a/src/SALOMEDS/Test/SALOMEDSTest_Study.cxx b/src/SALOMEDS/Test/SALOMEDSTest_Study.cxx index 47da3bd7d..a569ed5a0 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_Study.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_Study.cxx @@ -101,7 +101,7 @@ void SALOMEDSTest::testStudy() CPPUNIT_ASSERT(!study->FindComponent("")); //Check method GetComponentNames - vector components = study->GetComponentNames(""); //The context doesn't matter + std::vector components = study->GetComponentNames(""); //The context doesn't matter CPPUNIT_ASSERT(components.size() == 1 && components[0] == "sco1"); //Check method FindComponentID @@ -121,7 +121,7 @@ void SALOMEDSTest::testStudy() _PTR(AttributeIOR) ior_attr_so1 = studyBuilder->FindOrCreateAttribute(so1, "AttributeIOR"); CPPUNIT_ASSERT(ior_attr_so1); - string ior = _orb->object_to_string(_sm); + std::string ior = _orb->object_to_string(_sm); ior_attr_so1->SetValue(ior); _PTR(SObject) so2 = studyBuilder->NewObject(so1); @@ -145,7 +145,7 @@ void SALOMEDSTest::testStudy() CPPUNIT_ASSERT(!study->FindObjectID("")); //Check method FindObjectByName - vector< _PTR(SObject) > v = study->FindObjectByName("so1", sco1->ComponentDataType()); + std::vector< _PTR(SObject) > v = study->FindObjectByName("so1", sco1->ComponentDataType()); CPPUNIT_ASSERT(v.size()==1 && v[0]->GetID() == so1->GetID()); //Try to find SObject with empty name and empty component type @@ -163,7 +163,7 @@ void SALOMEDSTest::testStudy() CPPUNIT_ASSERT(!study->FindObjectIOR("")); //Check method GetObjectPath - string path = study->GetObjectPath(so2); + std::string path = study->GetObjectPath(so2); //Try to get path of NULL SObject _PTR(SObject) emptySO; @@ -186,7 +186,7 @@ void SALOMEDSTest::testStudy() study->SetContext("/"); //Root //Check method GetObjectNames - vector vs = study->GetObjectNames("/sco1"); + std::vector vs = study->GetObjectNames("/sco1"); CPPUNIT_ASSERT(vs.size() == 2); //Check method GetDirectoryNames @@ -220,7 +220,7 @@ void SALOMEDSTest::testStudy() //Check method FindDependances studyBuilder->Addreference(so2, so1); studyBuilder->Addreference(sco1, so1); - vector< _PTR(SObject) > vso = study->FindDependances(so1); + std::vector< _PTR(SObject) > vso = study->FindDependances(so1); CPPUNIT_ASSERT(vso.size() == 2 && vso[0]->GetID() == so2->GetID() && vso[1]->GetID() == sco1->GetID()); //Check method GetProperties @@ -251,7 +251,7 @@ void SALOMEDSTest::testStudy() //Check method GetLastModificationDate sp->SetModification("srn", 1, 2, 3, 4, 5); sp->SetModification("srn", 6, 7, 8, 9, 10); - string date = study->GetLastModificationDate(); + std::string date = study->GetLastModificationDate(); CPPUNIT_ASSERT(date == "08/09/0010 07:06"); @@ -314,22 +314,22 @@ void SALOMEDSTest::testStudy() //Check method EnableUseCaseAutoFilling study->EnableUseCaseAutoFilling(false); _PTR(SObject) uso1 = study->NewBuilder()->NewObject(sco1); - vector< _PTR(GenericAttribute) > va1 = uso1->GetAllAttributes(); + std::vector< _PTR(GenericAttribute) > va1 = uso1->GetAllAttributes(); CPPUNIT_ASSERT(va1.size() == 0); study->EnableUseCaseAutoFilling(true); _PTR(SObject) uso2 = study->NewBuilder()->NewObject(sco1); - vector< _PTR(GenericAttribute) > va2 = uso2->GetAllAttributes(); + std::vector< _PTR(GenericAttribute) > va2 = uso2->GetAllAttributes(); CPPUNIT_ASSERT(va2.size() == 1); // +AttributeTreeNode //Check method DumpStudy study->DumpStudy(".", "SRN", false); - fstream f("SRN.py"); + std::fstream f("SRN.py"); char buffer[128]; buffer[81] = (char)0; f.getline(buffer, 80); - string line(buffer); + std::string line(buffer); f.close(); system("rm -f SRN.py"); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx b/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx index 240a9343a..95e6154fb 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx @@ -47,9 +47,9 @@ void SALOMEDSTest::testStudyBuilder() CPPUNIT_ASSERT(sco1 && sco1->ComponentDataType() == "Test"); //Check method DefineComponentInstance - string ior = _orb->object_to_string(_sm); + std::string ior = _orb->object_to_string(_sm); studyBuilder->DefineComponentInstance(sco1, ior); - string newior; + std::string newior; sco1->ComponentIOR(newior); CPPUNIT_ASSERT(newior == ior); @@ -68,12 +68,12 @@ void SALOMEDSTest::testStudyBuilder() //Check method NewObject _PTR(SObject) so1 = studyBuilder->NewObject(sco3); CPPUNIT_ASSERT(so1); - string id1 = so1->GetID(); + std::string id1 = so1->GetID(); //Check method NewObjectToTag _PTR(SObject) so2 = studyBuilder->NewObjectToTag(so1, 2); CPPUNIT_ASSERT(so2 && so2->Tag() == 2); - string id2 = so2->GetID(); + std::string id2 = so2->GetID(); //Check method FindOrCreateAttribute _PTR(SObject) so3 = studyBuilder->NewObject(sco3); @@ -129,7 +129,7 @@ void SALOMEDSTest::testStudyBuilder() CPPUNIT_ASSERT(!so2->ReferencedObject(refSO)); //Check method SetGUID and IsGUID - string value = "0e1c36e6-379b-4d90-ab3b-17a14310e648"; + std::string value = "0e1c36e6-379b-4d90-ab3b-17a14310e648"; studyBuilder->SetGUID(so1, value); CPPUNIT_ASSERT(studyBuilder->IsGUID(so1, value)); diff --git a/src/SALOMEDS/Test/SALOMEDSTest_StudyManager.cxx b/src/SALOMEDS/Test/SALOMEDSTest_StudyManager.cxx index 0b9216ba5..957f17607 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_StudyManager.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_StudyManager.cxx @@ -57,7 +57,7 @@ void SALOMEDSTest::testStudyManager() CPPUNIT_ASSERT(study4->Name() == study2->Name()); //Check method GetOpenStudies - vector v = sm->GetOpenStudies(); + std::vector v = sm->GetOpenStudies(); CPPUNIT_ASSERT(v.size() == 2); //Check method Close @@ -92,7 +92,7 @@ void SALOMEDSTest::testStudyManager() //Check method SaveAs sm->SaveAs("srn_UnitTest_Save.hdf", study1, false); - string url = study1->URL(); + std::string url = study1->URL(); sm->Close(study1); //Check method Open @@ -108,7 +108,7 @@ void SALOMEDSTest::testStudyManager() CPPUNIT_ASSERT(sco3); // Add a new SObject with AttributeName that contains "Saved study" string _PTR(SObject) so3 = sb3->NewObject(sco3); - string soID = so3->GetID(); + std::string soID = so3->GetID(); _PTR(AttributeName) na3 = sb3->FindOrCreateAttribute(so3, "AttributeName"); CPPUNIT_ASSERT(na3); diff --git a/src/SALOMEDS/Test/TestSALOMEDS.cxx b/src/SALOMEDS/Test/TestSALOMEDS.cxx index f861bf780..ab0d8d9eb 100644 --- a/src/SALOMEDS/Test/TestSALOMEDS.cxx +++ b/src/SALOMEDS/Test/TestSALOMEDS.cxx @@ -52,7 +52,6 @@ CPPUNIT_TEST_SUITE_REGISTRATION( SALOMEDSTest_Embedded ); #include "NamingService_WaitForServerReadiness.hxx" #include "SALOMEDS_StudyManager_i.hxx" -using namespace std; // ============================================================================ /*! @@ -75,10 +74,10 @@ int main(int argc, char* argv[]) int size; gethostname(hostname, size); char* chr_port = getenv("SALOMEDS_UNITTESTS_PORT"); - string port; + std::string port; if(chr_port) port = chr_port; if(port.empty()) port = "2810"; - string cfg_file = string(getenv("HOME"))+"/.omniORB_"+string(hostname)+"_"+port+".cfg"; + std::string cfg_file = std::string(getenv("HOME"))+"/.omniORB_"+std::string(hostname)+"_"+port+".cfg"; setenv("OMNIORB_CONFIG", cfg_file.c_str(), 1); ORB_INIT &init = *SINGLETON_::Instance() ; @@ -87,7 +86,7 @@ int main(int argc, char* argv[]) sleep(15); - string host; // = Kernel_Utils::GetHostname(); + std::string host; // = Kernel_Utils::GetHostname(); char* wait_Superv = getenv("SALOMEDS_UNITTESTS_WAIT_SUPERVISOR"); if(wait_Superv) host = Kernel_Utils::GetHostname(); @@ -95,7 +94,7 @@ int main(int argc, char* argv[]) if(host.empty()) NamingService_WaitForServerReadiness(&NS, "/myStudyManager"); else { - string serverName = "/Containers/"+host+"/SuperVisionContainer"; + std::string serverName = "/Containers/"+host+"/SuperVisionContainer"; NamingService_WaitForServerReadiness(&NS, serverName); } @@ -106,7 +105,7 @@ int main(int argc, char* argv[]) } //Set up the environement for Embedded case - string kernel_root = getenv("KERNEL_ROOT_DIR"); + std::string kernel_root = getenv("KERNEL_ROOT_DIR"); CPPUNIT_ASSERT(!kernel_root.empty()); kernel_root+="/share/salome/resources/kernel"; diff --git a/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx b/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx index e6bb5367a..e1f0426c5 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx +++ b/src/SALOMEDSClient/SALOMEDSClient_ClientFactory.cxx @@ -65,8 +65,6 @@ static CONVERT_SOBJECT_FUNCTION aConvertSObject = NULL; static CONVERT_STUDY_FUNCTION aConvertStudy = NULL; static CONVERT_BUILDER_FUNCTION aConvertBuilder = NULL; -using namespace std; - _PTR(SObject) ClientFactory::SObject(SALOMEDS::SObject_ptr theSObject) { SALOMEDSClient_SObject* so = NULL; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx index 2c7be685c..80c5643cf 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx @@ -25,20 +25,18 @@ // #include "SALOMEDSImpl_AttributeComment.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : //======================================================================= -const string& SALOMEDSImpl_AttributeComment::GetID () +const std::string& SALOMEDSImpl_AttributeComment::GetID () { - static string CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9"); + static std::string CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9"); return CommentID; } SALOMEDSImpl_AttributeComment* SALOMEDSImpl_AttributeComment::Set (const DF_Label& L, - const string& Val) + const std::string& Val) { SALOMEDSImpl_AttributeComment* A = NULL; if (!(A=(SALOMEDSImpl_AttributeComment*)L.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) { @@ -55,7 +53,7 @@ SALOMEDSImpl_AttributeComment* SALOMEDSImpl_AttributeComment::Set (const DF_Labe //function : SetValue //purpose : //======================================================================= -void SALOMEDSImpl_AttributeComment::SetValue (const string& S) +void SALOMEDSImpl_AttributeComment::SetValue (const std::string& S) { CheckLocked(); @@ -73,7 +71,7 @@ void SALOMEDSImpl_AttributeComment::SetValue (const string& S) //function : ID //purpose : //======================================================================= -const string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); } +const std::string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); } //======================================================================= //function : NewEmpty diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx index ddc1556aa..ca6d0a53c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeDrawable.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx index 809e308d6..59e390866 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeExpandable.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx index 8f7be2124..e913c111a 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeExternalFileDef.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx index a51012378..b2cbecd0b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeFileType.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.cxx index aca376d5f..4918dc8f5 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.cxx @@ -25,9 +25,6 @@ // #include "SALOMEDSImpl_AttributeFlags.hxx" -using namespace std; - - /* Class : SALOMEDSImpl_AttributeFlags Description : This class is intended for storing different object attributes that diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.cxx index f3ca6d7f9..5c565c3fc 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.cxx @@ -26,8 +26,6 @@ #include "SALOMEDSImpl_AttributeGraphic.hxx" #include "DF_Attribute.hxx" -using namespace std; - /* Class : SALOMEDSImpl_AttributeGraphic Description : This class is intended for storing information about @@ -115,7 +113,7 @@ DF_Attribute* SALOMEDSImpl_AttributeGraphic::NewEmpty () const //function : SetVisibility //purpose : Set visibility of object in all views //======================================================================= -void SALOMEDSImpl_AttributeGraphic::SetVisibility( const map& theMap ) +void SALOMEDSImpl_AttributeGraphic::SetVisibility( const std::map& theMap ) { myVisibility = theMap; } @@ -124,7 +122,7 @@ void SALOMEDSImpl_AttributeGraphic::SetVisibility( const map& theMap ) //function : SetVisibility //purpose : Get visibility of object in all views //======================================================================= -const map& SALOMEDSImpl_AttributeGraphic::GetVisibility() +const std::map& SALOMEDSImpl_AttributeGraphic::GetVisibility() { return myVisibility; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx index 1c049a87f..82648ddcb 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx @@ -26,8 +26,6 @@ #include "SALOMEDSImpl_AttributeIOR.hxx" #include "SALOMEDSImpl_Study.hxx" -using namespace std; - //to disable automatic genericobj management comment the following line #define WITHGENERICOBJ diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx index e772c4bd7..877b6f47a 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeInteger.cxx @@ -26,7 +26,6 @@ #include "SALOMEDSImpl_AttributeInteger.hxx" #include -using namespace std; //======================================================================= //function : GetID @@ -111,18 +110,18 @@ void SALOMEDSImpl_AttributeInteger::Paste (DF_Attribute* Into) //function : Save //purpose : //======================================================================= -string SALOMEDSImpl_AttributeInteger::Save() +std::string SALOMEDSImpl_AttributeInteger::Save() { char buffer[128]; sprintf(buffer, "%d", myValue); - return string(buffer); + return std::string(buffer); } //======================================================================= //function : Load //purpose : //======================================================================= -void SALOMEDSImpl_AttributeInteger::Load(const string& theValue) +void SALOMEDSImpl_AttributeInteger::Load(const std::string& theValue) { myValue = atoi(theValue.c_str()); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx index e3ccfd140..5ddf7377c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeLocalID.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : @@ -127,18 +125,18 @@ void SALOMEDSImpl_AttributeLocalID::Paste (DF_Attribute* into) //function : Save //purpose : //======================================================================= -string SALOMEDSImpl_AttributeLocalID::Save() +std::string SALOMEDSImpl_AttributeLocalID::Save() { char buffer[128]; sprintf(buffer, "%d", myValue); - return string(buffer); + return std::string(buffer); } //======================================================================= //function : Load //purpose : //======================================================================= -void SALOMEDSImpl_AttributeLocalID::Load(const string& theValue) +void SALOMEDSImpl_AttributeLocalID::Load(const std::string& theValue) { myValue = atoi(theValue.c_str()); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx index 12488a8e0..1e3c622c2 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeName.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx index 83c13f06b..e33f8c7e6 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeOpened.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx index d5dfd926c..6d797d28a 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx @@ -30,13 +30,10 @@ #include #include -using namespace std; - - // Purpose: Each character in the string is replaced by 3 characters: '%' and hex number // of the character (2 characters) -string convertString(const string& S) +std::string convertString(const std::string& S) { int length = S.size(); const char *s = S.c_str(); @@ -50,14 +47,14 @@ string convertString(const string& S) buffer[pos+2] = c[1]; } - string RS(buffer); + std::string RS(buffer); delete c; delete buffer; return RS; } //Restors a string converted by the function convertString -string restoreString(const string& S) +std::string restoreString(const std::string& S) { int length = S.size(); char *c = new char[3], *buffer = new char[length/3+1]; @@ -71,7 +68,7 @@ string restoreString(const string& S) buffer[pos] = (char)val; } - string RS(buffer); + std::string RS(buffer); delete c; delete buffer; return RS; @@ -112,7 +109,7 @@ SALOMEDSImpl_AttributeParameter* SALOMEDSImpl_AttributeParameter::Set (const DF_ * Purpose : Associates a integer value with the ID */ //======================================================================= -void SALOMEDSImpl_AttributeParameter::SetInt(const string& theID, const int& theValue) +void SALOMEDSImpl_AttributeParameter::SetInt(const std::string& theID, const int& theValue) { CheckLocked(); @@ -131,7 +128,7 @@ void SALOMEDSImpl_AttributeParameter::SetInt(const string& theID, const int& the * Purpose : Returns a int value associated with the given ID */ //======================================================================= -int SALOMEDSImpl_AttributeParameter::GetInt(const string& theID) +int SALOMEDSImpl_AttributeParameter::GetInt(const std::string& theID) { if(!IsSet(theID, PT_INTEGER)) throw DFexception("Invalid ID"); return _ints[theID]; @@ -143,7 +140,7 @@ int SALOMEDSImpl_AttributeParameter::GetInt(const string& theID) * Purpose : Associates a double value with the ID */ //======================================================================= -void SALOMEDSImpl_AttributeParameter::SetReal(const string& theID, const double& theValue) +void SALOMEDSImpl_AttributeParameter::SetReal(const std::string& theID, const double& theValue) { CheckLocked(); @@ -162,7 +159,7 @@ void SALOMEDSImpl_AttributeParameter::SetReal(const string& theID, const double& * Purpose : Returns a double value associated with the given ID */ //======================================================================= -double SALOMEDSImpl_AttributeParameter::GetReal(const string& theID) +double SALOMEDSImpl_AttributeParameter::GetReal(const std::string& theID) { if(!IsSet(theID, PT_REAL)) throw DFexception("Invalid ID"); return _reals[theID]; @@ -174,7 +171,7 @@ double SALOMEDSImpl_AttributeParameter::GetReal(const string& theID) * Purpose : Associates a string with the ID */ //======================================================================= -void SALOMEDSImpl_AttributeParameter::SetString(const string& theID, const string& theValue) +void SALOMEDSImpl_AttributeParameter::SetString(const std::string& theID, const std::string& theValue) { CheckLocked(); @@ -193,7 +190,7 @@ void SALOMEDSImpl_AttributeParameter::SetString(const string& theID, const strin * Purpose : Returns a string associated with the given ID */ //======================================================================= -string SALOMEDSImpl_AttributeParameter::GetString(const string& theID) +std::string SALOMEDSImpl_AttributeParameter::GetString(const std::string& theID) { if(!IsSet(theID, PT_STRING)) throw DFexception("Invalid ID"); return _strings[theID]; @@ -205,7 +202,7 @@ string SALOMEDSImpl_AttributeParameter::GetString(const string& theID) * Purpose : Associates a bool value with the ID */ //======================================================================= -void SALOMEDSImpl_AttributeParameter::SetBool(const string& theID, const bool& theValue) +void SALOMEDSImpl_AttributeParameter::SetBool(const std::string& theID, const bool& theValue) { CheckLocked(); @@ -224,7 +221,7 @@ void SALOMEDSImpl_AttributeParameter::SetBool(const string& theID, const bool& t * Purpose : Returns a bool value associated with the ID */ //======================================================================= -bool SALOMEDSImpl_AttributeParameter::GetBool(const string& theID) +bool SALOMEDSImpl_AttributeParameter::GetBool(const std::string& theID) { if(!IsSet(theID, PT_BOOLEAN)) throw DFexception("Invalid ID"); return _bools[theID]; @@ -236,7 +233,7 @@ bool SALOMEDSImpl_AttributeParameter::GetBool(const string& theID) * Purpose : Associates an array of double values with the given ID */ //======================================================================= -void SALOMEDSImpl_AttributeParameter::SetRealArray(const string& theID, const vector& theArray) +void SALOMEDSImpl_AttributeParameter::SetRealArray(const std::string& theID, const std::vector& theArray) { CheckLocked(); @@ -255,7 +252,7 @@ void SALOMEDSImpl_AttributeParameter::SetRealArray(const string& theID, const ve * Purpose : Returns double values associated with the ID */ //======================================================================= -vector SALOMEDSImpl_AttributeParameter::GetRealArray(const string& theID) +std::vector SALOMEDSImpl_AttributeParameter::GetRealArray(const std::string& theID) { if(!IsSet(theID, PT_REALARRAY)) throw DFexception("Invalid ID"); return _realarrays[theID]; @@ -268,7 +265,7 @@ vector SALOMEDSImpl_AttributeParameter::GetRealArray(const string& theID * Purpose : Associates an array of int values with the given ID */ //======================================================================= -void SALOMEDSImpl_AttributeParameter::SetIntArray(const string& theID, const vector& theArray) +void SALOMEDSImpl_AttributeParameter::SetIntArray(const std::string& theID, const std::vector& theArray) { CheckLocked(); @@ -287,7 +284,7 @@ void SALOMEDSImpl_AttributeParameter::SetIntArray(const string& theID, const vec * Purpose : Returns int values associated with the ID */ //======================================================================= -vector SALOMEDSImpl_AttributeParameter::GetIntArray(const string& theID) +std::vector SALOMEDSImpl_AttributeParameter::GetIntArray(const std::string& theID) { if(!IsSet(theID, PT_INTARRAY)) throw DFexception("Invalid ID"); return _intarrays[theID]; @@ -300,7 +297,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIntArray(const string& theID) * Purpose : Associates an array of string values with the given ID */ //======================================================================= -void SALOMEDSImpl_AttributeParameter::SetStrArray(const string& theID, const vector& theArray) +void SALOMEDSImpl_AttributeParameter::SetStrArray(const std::string& theID, const std::vector& theArray) { CheckLocked(); @@ -319,7 +316,7 @@ void SALOMEDSImpl_AttributeParameter::SetStrArray(const string& theID, const vec * Purpose : Returns string values associated with the ID */ //======================================================================= -vector SALOMEDSImpl_AttributeParameter::GetStrArray(const string& theID) +std::vector SALOMEDSImpl_AttributeParameter::GetStrArray(const std::string& theID) { if(!IsSet(theID, PT_STRARRAY)) throw DFexception("Invalid ID"); return _strarrays[theID]; @@ -333,7 +330,7 @@ vector SALOMEDSImpl_AttributeParameter::GetStrArray(const string& theID) * a value in the attribute */ //======================================================================= -bool SALOMEDSImpl_AttributeParameter::IsSet(const string& theID, const Parameter_Types theType) +bool SALOMEDSImpl_AttributeParameter::IsSet(const std::string& theID, const Parameter_Types theType) { switch(theType) { case PT_INTEGER: { @@ -376,7 +373,7 @@ bool SALOMEDSImpl_AttributeParameter::IsSet(const string& theID, const Parameter * Purpose : Removes a parameter with given ID */ //======================================================================= -bool SALOMEDSImpl_AttributeParameter::RemoveID(const string& theID, const Parameter_Types theType) +bool SALOMEDSImpl_AttributeParameter::RemoveID(const std::string& theID, const Parameter_Types theType) { Backup(); SetModifyFlag(); @@ -494,17 +491,17 @@ void SALOMEDSImpl_AttributeParameter::Clear() * Purpose : Returns an array of all ID's of the given type */ //======================================================================= -vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType) +std::vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType) { - vector anArray; + std::vector anArray; int i = 0; switch(theType) { case PT_INTEGER: { if(_ints.size()) { anArray.resize(_ints.size()); - for(map::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++) + for(std::map::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++) anArray[i] = p->first; } break; @@ -512,7 +509,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the case PT_REAL: { if(_reals.size()) { anArray.resize(_reals.size()); - for(map::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++) + for(std::map::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++) anArray[i] = p->first; } break; @@ -520,7 +517,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the case PT_BOOLEAN: { if(_bools.size()) { anArray.resize(_bools.size()); - for(map::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++) + for(std::map::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++) anArray[i] = p->first; } break; @@ -528,7 +525,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the case PT_STRING: { if(_strings.size()) { anArray.resize(_strings.size()); - for(map::const_iterator p = _strings.begin(); p!= _strings.end(); p++) + for(std::map::const_iterator p = _strings.begin(); p!= _strings.end(); p++) anArray[i] = p->first; } break; @@ -536,7 +533,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the case PT_REALARRAY: { if(_realarrays.size()) { anArray.resize(_realarrays.size()); - for(map< string, vector >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++) + for(std::map< std::string, std::vector >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++) anArray[i] = p->first; } break; @@ -544,7 +541,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the case PT_INTARRAY: { if(_intarrays.size()) { anArray.resize(_intarrays.size()); - for(map< string, vector >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++) + for(std::map< std::string, std::vector >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++) anArray[i] = p->first; } break; @@ -552,7 +549,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the case PT_STRARRAY: { if(_strarrays.size()) { anArray.resize(_strarrays.size()); - for(map< string, vector >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++) + for(std::map< std::string, std::vector >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++) anArray[i] = p->first; } break; @@ -594,19 +591,19 @@ void SALOMEDSImpl_AttributeParameter::Restore(DF_Attribute* with) _intarrays.clear(); _strarrays.clear(); - for(map::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++) + for(std::map::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++) if(p->first.size()) _ints[p->first] = p->second; - for(map::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++) + for(std::map::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++) if(p->first.size()) _reals[p->first] = p->second; - for(map::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++) + for(std::map::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++) if(p->first.size()) _bools[p->first] = p->second; - for(map::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++) + for(std::map::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++) if(p->first.size()) _strings[p->first] = p->second; - for(map< string,vector >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++) + for(std::map< std::string,std::vector >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++) if(p->first.size()) _realarrays[p->first] = p->second; - for(map< string,vector >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++) + for(std::map< std::string,std::vector >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++) if(p->first.size()) _intarrays[p->first] = p->second; - for(map< string,vector >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++) + for(std::map< std::string,std::vector >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++) if(p->first.size()) _strarrays[p->first] = p->second; } @@ -627,36 +624,36 @@ void SALOMEDSImpl_AttributeParameter::Paste (DF_Attribute* into) * Purpose : Saves a content of the attribute as a string */ //======================================================================= -string SALOMEDSImpl_AttributeParameter::Save() +std::string SALOMEDSImpl_AttributeParameter::Save() { - ostringstream buffer; + std::ostringstream buffer; char *tmpBuffer = new char[255]; buffer << _ints.size() << " "; - for(map::const_iterator p = _ints.begin(); p != _ints.end(); p++) { + for(std::map::const_iterator p = _ints.begin(); p != _ints.end(); p++) { buffer << convertString(p->first) << " " << p->second << " "; } buffer << _reals.size() << " "; - for(map::const_iterator p =_reals.begin(); p != _reals.end(); p++) { + for(std::map::const_iterator p =_reals.begin(); p != _reals.end(); p++) { sprintf(tmpBuffer, "%.64e", p->second); buffer << convertString(p->first) << " " << tmpBuffer << " "; } buffer << _bools.size() << " "; - for(map::const_iterator p = _bools.begin(); p != _bools.end(); p++) { + for(std::map::const_iterator p = _bools.begin(); p != _bools.end(); p++) { buffer << convertString(p->first) << " " << p->second << " "; } buffer << _strings.size() << " "; - for(map::const_iterator p = _strings.begin(); p != _strings.end(); p++) { + for(std::map::const_iterator p = _strings.begin(); p != _strings.end(); p++) { buffer << convertString(p->first) << " " << convertString(p->second) << " "; } buffer << _realarrays.size() << " "; - for(map< string,vector >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) { - vector v(p->second); + for(std::map< std::string,std::vector >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) { + std::vector v(p->second); sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size()); buffer << tmpBuffer; for(int i = 0; i >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) { - vector v(p->second); + for(std::map< std::string,std::vector >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) { + std::vector v(p->second); sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size()); buffer << tmpBuffer; for(int i = 0; i >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) { - vector v(p->second); + for(std::map< std::string,std::vector >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) { + std::vector v(p->second); sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size()); buffer << tmpBuffer; for(int i = 0; i> size; for(int i = 1; i<=size; i++) { @@ -743,7 +740,7 @@ void SALOMEDSImpl_AttributeParameter::Load(const string& theValue) buffer >> size; for(int i = 1; i<=size; i++) { buffer >> id >> val; - vector v; + std::vector v; v.resize(val); for(int j = 0; j> val2; @@ -755,7 +752,7 @@ void SALOMEDSImpl_AttributeParameter::Load(const string& theValue) buffer >> size; for(int i = 1; i<=size; i++) { buffer >> id >> val; - vector v; + std::vector v; v.resize(val); for(int j = 0; j> ival; @@ -767,7 +764,7 @@ void SALOMEDSImpl_AttributeParameter::Load(const string& theValue) buffer >> size; for(int i = 1; i<=size; i++) { buffer >> id >> val; - vector v; + std::vector v; v.resize(val); for(int j = 0; j> s; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx index 288f82e54..742587bd4 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributePersistentRef.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx index 2c6e82cf9..355537115 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributePixMap.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx index 36af91a00..aca9611de 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributePythonObject.hxx" -using namespace std; - const std::string& SALOMEDSImpl_AttributePythonObject::GetID() { static std::string SALOMEDSImpl_AttributePythonObjectID ("128371A3-8F52-11d6-A8A3-0001021E8C7F"); @@ -49,7 +47,7 @@ SALOMEDSImpl_AttributePythonObject::SALOMEDSImpl_AttributePythonObject() myIsScript = false; } -void SALOMEDSImpl_AttributePythonObject::SetObject(const string& theSequence, +void SALOMEDSImpl_AttributePythonObject::SetObject(const std::string& theSequence, const bool theScript) { CheckLocked(); @@ -60,7 +58,7 @@ void SALOMEDSImpl_AttributePythonObject::SetObject(const string& theSequence, SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } -string SALOMEDSImpl_AttributePythonObject::GetObject() const +std::string SALOMEDSImpl_AttributePythonObject::GetObject() const { return mySequence; } @@ -98,16 +96,16 @@ void SALOMEDSImpl_AttributePythonObject::Paste(DF_Attribute* into) } -string SALOMEDSImpl_AttributePythonObject::Save() +std::string SALOMEDSImpl_AttributePythonObject::Save() { - string aString = GetObject(); - string aResult = IsScript()?"s":"n"; + std::string aString = GetObject(); + std::string aResult = IsScript()?"s":"n"; aResult += aString; return aResult; } -void SALOMEDSImpl_AttributePythonObject::Load(const string& value) +void SALOMEDSImpl_AttributePythonObject::Load(const std::string& value) { char* aString = (char*)value.c_str(); SetObject(aString + 1, aString[0]=='s'); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx index 1b37bb039..b6efceff6 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReal.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeReal.hxx" -using namespace std; - #include @@ -108,18 +106,18 @@ void SALOMEDSImpl_AttributeReal::Paste (DF_Attribute* into) //function : Save //purpose : //======================================================================= -string SALOMEDSImpl_AttributeReal::Save() +std::string SALOMEDSImpl_AttributeReal::Save() { char buffer[255]; sprintf(buffer, "%.64e", myValue); - return string(buffer); + return std::string(buffer); } //======================================================================= //function : Load //purpose : //======================================================================= -void SALOMEDSImpl_AttributeReal::Load(const string& theValue) +void SALOMEDSImpl_AttributeReal::Load(const std::string& theValue) { myValue = atof(theValue.c_str()); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx index 45ad9a695..d0ccef7df 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeReference.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : @@ -73,12 +71,12 @@ void SALOMEDSImpl_AttributeReference::Set(const DF_Label& Origin) const std::string& SALOMEDSImpl_AttributeReference::ID () const { return GetID(); } -string SALOMEDSImpl_AttributeReference::Save() +std::string SALOMEDSImpl_AttributeReference::Save() { return myLabel.Entry(); } -void SALOMEDSImpl_AttributeReference::Load(const string& value) +void SALOMEDSImpl_AttributeReference::Load(const std::string& value) { myLabel = DF_Label::Label(Label(), value, true); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx index 3d4015792..34a594b39 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeSelectable.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx index c90a5196a..faeeaf333 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx @@ -26,8 +26,6 @@ #include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx" #include -using namespace std; - //======================================================================= //function : GetID //purpose : @@ -106,7 +104,7 @@ void SALOMEDSImpl_AttributeSequenceOfInteger::Paste (DF_Attribute* into) dynamic_cast(into)->Assign(myValue); } -void SALOMEDSImpl_AttributeSequenceOfInteger::Assign(const vector& other) +void SALOMEDSImpl_AttributeSequenceOfInteger::Assign(const std::vector& other) { CheckLocked(); Backup(); @@ -144,7 +142,7 @@ void SALOMEDSImpl_AttributeSequenceOfInteger::Remove(const int Index) if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range"); - typedef vector::iterator VI; + typedef std::vector::iterator VI; int i = 1; for(VI p = myValue.begin(); p!=myValue.end(); p++, i++) { if(i == Index) { @@ -169,7 +167,7 @@ int SALOMEDSImpl_AttributeSequenceOfInteger::Value(const int Index) -string SALOMEDSImpl_AttributeSequenceOfInteger::Save() +std::string SALOMEDSImpl_AttributeSequenceOfInteger::Save() { int aLength = Length(); char* aResult = new char[aLength * 25]; @@ -179,13 +177,13 @@ string SALOMEDSImpl_AttributeSequenceOfInteger::Save() sprintf(aResult + aPosition , "%d ", Value(i)); aPosition += strlen(aResult + aPosition); } - string ret(aResult); + std::string ret(aResult); delete aResult; return ret; } -void SALOMEDSImpl_AttributeSequenceOfInteger::Load(const string& value) +void SALOMEDSImpl_AttributeSequenceOfInteger::Load(const std::string& value) { char* aCopy = (char*)value.c_str(); char* adr = strtok(aCopy, " "); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx index 286fc044b..d8079e0e7 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx @@ -26,8 +26,6 @@ #include "SALOMEDSImpl_AttributeSequenceOfReal.hxx" #include -using namespace std; - //======================================================================= //function : GetID //purpose : @@ -109,7 +107,7 @@ void SALOMEDSImpl_AttributeSequenceOfReal::Paste (DF_Attribute* into) dynamic_cast(into)->Assign(myValue); } -void SALOMEDSImpl_AttributeSequenceOfReal::Assign(const vector& other) +void SALOMEDSImpl_AttributeSequenceOfReal::Assign(const std::vector& other) { CheckLocked(); Backup(); @@ -146,7 +144,7 @@ void SALOMEDSImpl_AttributeSequenceOfReal::Remove(const int Index) if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range"); - typedef vector::iterator VI; + typedef std::vector::iterator VI; int i = 1; for(VI p = myValue.begin(); p!=myValue.end(); p++, i++) { if(i == Index) { @@ -170,7 +168,7 @@ double SALOMEDSImpl_AttributeSequenceOfReal::Value(const int Index) } -string SALOMEDSImpl_AttributeSequenceOfReal::Save() +std::string SALOMEDSImpl_AttributeSequenceOfReal::Save() { int aLength = Length(); char* aResult = new char[aLength * 127]; @@ -180,13 +178,13 @@ string SALOMEDSImpl_AttributeSequenceOfReal::Save() sprintf(aResult + aPosition , "%.64e ", Value(i)); aPosition += strlen(aResult + aPosition); } - string ret(aResult); + std::string ret(aResult); delete aResult; return ret; } -void SALOMEDSImpl_AttributeSequenceOfReal::Load(const string& value) +void SALOMEDSImpl_AttributeSequenceOfReal::Load(const std::string& value) { char* aCopy = (char*)value.c_str(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.cxx index e3110c40c..6586f3a70 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeString.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx index ad5f1cfa2..b10f6dc2d 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx @@ -26,9 +26,6 @@ #include "SALOMEDSImpl_AttributeStudyProperties.hxx" #include -using namespace std; - - const std::string& SALOMEDSImpl_AttributeStudyProperties::GetID() { static std::string SALOMEDSImpl_AttributeStudyPropertiesID ("128371A2-8F52-11d6-A8A3-0001021E8C7F"); @@ -87,12 +84,12 @@ void SALOMEDSImpl_AttributeStudyProperties::SetModification(const std::string& t } void SALOMEDSImpl_AttributeStudyProperties::GetModifications - (vector& theUserNames, - vector& theMinutes, - vector& theHours, - vector& theDays, - vector& theMonths, - vector& theYears) const + (std::vector& theUserNames, + std::vector& theMinutes, + std::vector& theHours, + std::vector& theDays, + std::vector& theMonths, + std::vector& theYears) const { theUserNames = myUserName; theMinutes = myMinute; @@ -194,8 +191,8 @@ void SALOMEDSImpl_AttributeStudyProperties::Restore(DF_Attribute* with) dynamic_cast(with); Init(); - vector aNames; - vector aMinutes, aHours, aDays, aMonths, aYears; + std::vector aNames; + std::vector aMinutes, aHours, aDays, aMonths, aYears; aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears); for (int i = 0, len = aNames.size(); i < len; i++) { myUserName.push_back(aNames[i]); @@ -234,10 +231,10 @@ void SALOMEDSImpl_AttributeStudyProperties::Paste(DF_Attribute* into) } -string SALOMEDSImpl_AttributeStudyProperties::Save() +std::string SALOMEDSImpl_AttributeStudyProperties::Save() { - vector aNames; - vector aMinutes, aHours, aDays, aMonths, aYears; + std::vector aNames; + std::vector aMinutes, aHours, aDays, aMonths, aYears; GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears); int aLength, anIndex; @@ -264,13 +261,13 @@ string SALOMEDSImpl_AttributeStudyProperties::Save() aProperty[a++] = 1; } aProperty[a] = 0; - string prop(aProperty); + std::string prop(aProperty); delete aProperty; return prop; } -void SALOMEDSImpl_AttributeStudyProperties::Load(const string& value) +void SALOMEDSImpl_AttributeStudyProperties::Load(const std::string& value) { char* aCopy = (char*)value.c_str(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx index 972cebd65..accd0f58c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx @@ -27,9 +27,6 @@ #include "SALOMEDSImpl_AttributeReference.hxx" #include "SALOMEDSImpl_Study.hxx" -using namespace std; - - //======================================================================= //function : GetID //purpose : @@ -99,9 +96,9 @@ void SALOMEDSImpl_AttributeTarget::Add(const SALOMEDSImpl_SObject& theSO) //function : Get //purpose : //======================================================================= -vector SALOMEDSImpl_AttributeTarget::Get() +std::vector SALOMEDSImpl_AttributeTarget::Get() { - vector aSeq; + std::vector aSeq; for(int i = 0, len = myVariables.size(); iLabel())); @@ -118,7 +115,7 @@ void SALOMEDSImpl_AttributeTarget::Remove(const SALOMEDSImpl_SObject& theSO) Backup(); DF_Label aRefLabel = theSO.GetLabel(); - vector va; + std::vector va; for(int i = 0, len = myVariables.size(); iLabel(); if(myVariables[i]->Label() == aRefLabel) continue; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx index e3a3b7539..20005e808 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeTextColor.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : @@ -73,7 +71,7 @@ void SALOMEDSImpl_AttributeTextColor::SetTextColor(const double& R, const double //function : TextColor //purpose : //======================================================================= -vector SALOMEDSImpl_AttributeTextColor::TextColor() +std::vector SALOMEDSImpl_AttributeTextColor::TextColor() { return myValue; } @@ -82,7 +80,7 @@ vector SALOMEDSImpl_AttributeTextColor::TextColor() //function : ChangeArray //purpose : //======================================================================= -void SALOMEDSImpl_AttributeTextColor::ChangeArray(const vector& newArray) +void SALOMEDSImpl_AttributeTextColor::ChangeArray(const std::vector& newArray) { Backup(); @@ -133,18 +131,18 @@ void SALOMEDSImpl_AttributeTextColor::Paste (DF_Attribute* into) -string SALOMEDSImpl_AttributeTextColor::Save() +std::string SALOMEDSImpl_AttributeTextColor::Save() { char *Val = new char[75]; sprintf(Val, "%f %f %f", (float)myValue[0], (float)myValue[1], (float)myValue[2]); - string ret(Val); + std::string ret(Val); delete Val; return ret; } -void SALOMEDSImpl_AttributeTextColor::Load(const string& value) +void SALOMEDSImpl_AttributeTextColor::Load(const std::string& value) { float r, g, b; sscanf(value.c_str(), "%f %f %f", &r, &g, &b); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx index 37309ad5b..0526b1077 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx @@ -25,8 +25,6 @@ // #include "SALOMEDSImpl_AttributeTextHighlightColor.hxx" -using namespace std; - //======================================================================= //function : GetID //purpose : @@ -83,7 +81,7 @@ void SALOMEDSImpl_AttributeTextHighlightColor::SetTextHighlightColor(const doubl //function : TextHighlightColor //purpose : //======================================================================= -vector SALOMEDSImpl_AttributeTextHighlightColor::TextHighlightColor() +std::vector SALOMEDSImpl_AttributeTextHighlightColor::TextHighlightColor() { return myValue; } @@ -92,7 +90,7 @@ vector SALOMEDSImpl_AttributeTextHighlightColor::TextHighlightColor() //function : ChangeArray //purpose : //======================================================================= -void SALOMEDSImpl_AttributeTextHighlightColor::ChangeArray(const vector& newArray) +void SALOMEDSImpl_AttributeTextHighlightColor::ChangeArray(const std::vector& newArray) { Backup(); @@ -133,18 +131,18 @@ void SALOMEDSImpl_AttributeTextHighlightColor::Paste (DF_Attribute* into) dynamic_cast(into)->ChangeArray (myValue); } -string SALOMEDSImpl_AttributeTextHighlightColor::Save() +std::string SALOMEDSImpl_AttributeTextHighlightColor::Save() { char *Val = new char[75]; sprintf(Val, "%f %f %f", (float)myValue[0], (float)myValue[1], (float)myValue[2]); - string ret(Val); + std::string ret(Val); delete Val; return ret; } -void SALOMEDSImpl_AttributeTextHighlightColor::Load(const string& value) +void SALOMEDSImpl_AttributeTextHighlightColor::Load(const std::string& value) { float r, g, b; sscanf(value.c_str(), "%f %f %f", &r, &g, &b); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx index 91c4560c5..cdde99f26 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx @@ -26,8 +26,6 @@ #include "SALOMEDSImpl_AttributeTreeNode.hxx" #include -using namespace std; - const std::string& SALOMEDSImpl_AttributeTreeNode::GetDefaultTreeID() { static std::string TreeNodeID ("0E1C36E6-379B-4d90-AC37-17A14310E648"); @@ -438,19 +436,19 @@ DF_Attribute* SALOMEDSImpl_AttributeTreeNode::NewEmpty() const return T; } -string SALOMEDSImpl_AttributeTreeNode::Type() +std::string SALOMEDSImpl_AttributeTreeNode::Type() { char* aNodeName = new char[127]; sprintf(aNodeName, "AttributeTreeNodeGUID%s", ID().c_str()); - string ret(aNodeName); + std::string ret(aNodeName); delete [] aNodeName; return ret; } -string SALOMEDSImpl_AttributeTreeNode::Save() +std::string SALOMEDSImpl_AttributeTreeNode::Save() { - string aFather, aPrevious, aNext, aFirst; + std::string aFather, aPrevious, aNext, aFirst; if (HasFather()) aFather = GetFather()->Label().Entry(); else aFather = "!"; if (HasPrevious()) aPrevious = GetPrevious()->Label().Entry(); else aPrevious = "!"; @@ -461,12 +459,12 @@ string SALOMEDSImpl_AttributeTreeNode::Save() aLength += aFather.size() + aPrevious.size() + aNext.size() + aFirst.size(); char* aResult = new char[aLength]; sprintf(aResult, "%s %s %s %s", aFather.c_str(), aPrevious.c_str(), aNext.c_str(), aFirst.c_str()); - string ret(aResult); + std::string ret(aResult); delete [] aResult; return ret; } -void SALOMEDSImpl_AttributeTreeNode::Load(const string& value) +void SALOMEDSImpl_AttributeTreeNode::Load(const std::string& value) { char* aCopy = (char*)value.c_str(); char* adr = strtok(aCopy, " "); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.cxx index 96cdbbc4f..a771b2fcf 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeUserID.cxx @@ -26,8 +26,6 @@ #include "SALOMEDSImpl_AttributeUserID.hxx" #include "Basics_Utils.hxx" -using namespace std; - std::string SALOMEDSImpl_AttributeUserID::DefaultID() { return Kernel_Utils::GetGUID(Kernel_Utils::DefUserID); @@ -98,13 +96,13 @@ void SALOMEDSImpl_AttributeUserID::Paste (DF_Attribute* into) A->SetValue( myID ); } -string SALOMEDSImpl_AttributeUserID::Type() +std::string SALOMEDSImpl_AttributeUserID::Type() { char* aUAttrName = new char[127]; sprintf(aUAttrName, "AttributeUserID_%s",ID().c_str()); - string ret(aUAttrName); + std::string ret(aUAttrName); delete aUAttrName; return ret; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx index b1148f59c..021ff426a 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx @@ -27,9 +27,7 @@ #include "SALOMEDSImpl_Study.hxx" #include "SALOMEDSImpl_StudyBuilder.hxx" -using namespace std; - -string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr) +std::string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr) { SALOMEDSImpl_GenericAttribute* ga = dynamic_cast(theAttr); if (ga) @@ -38,7 +36,7 @@ string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr) return ""; } -string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr) +std::string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr) { SALOMEDSImpl_GenericAttribute* ga = dynamic_cast(theAttr); if (ga) @@ -53,7 +51,7 @@ void SALOMEDSImpl_GenericAttribute::Impl_CheckLocked(DF_Attribute* theAttr) ga->CheckLocked(); } -string SALOMEDSImpl_GenericAttribute::Type() +std::string SALOMEDSImpl_GenericAttribute::Type() { return _type; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx index 7de967c2c..8972d72ec 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx @@ -28,8 +28,6 @@ #include -using namespace std; - //============================================================================ /*! Function : SALOMEDSImpl_GenericVariable * Purpose : @@ -37,7 +35,7 @@ using namespace std; //============================================================================ SALOMEDSImpl_GenericVariable:: SALOMEDSImpl_GenericVariable(SALOMEDSImpl_GenericVariable::VariableTypes theType, - const string& theName): + const std::string& theName): _type(theType), _name(theName) {} @@ -65,7 +63,7 @@ SALOMEDSImpl_GenericVariable::VariableTypes SALOMEDSImpl_GenericVariable::Type() * Purpose : */ //============================================================================ -string SALOMEDSImpl_GenericVariable::Name() const +std::string SALOMEDSImpl_GenericVariable::Name() const { return _name; } @@ -103,7 +101,7 @@ bool SALOMEDSImpl_GenericVariable::setName(const std::string& theName) * Purpose : */ //============================================================================ -SALOMEDSImpl_GenericVariable::VariableTypes SALOMEDSImpl_GenericVariable::String2VariableType(const string& theStrType) +SALOMEDSImpl_GenericVariable::VariableTypes SALOMEDSImpl_GenericVariable::String2VariableType(const std::string& theStrType) { return(SALOMEDSImpl_GenericVariable::VariableTypes)atoi((char*)theStrType.c_str()); } @@ -113,9 +111,9 @@ SALOMEDSImpl_GenericVariable::VariableTypes SALOMEDSImpl_GenericVariable::String * Purpose : */ //============================================================================ -string SALOMEDSImpl_GenericVariable::Save() const +std::string SALOMEDSImpl_GenericVariable::Save() const { - return string(); + return std::string(); } @@ -124,18 +122,18 @@ string SALOMEDSImpl_GenericVariable::Save() const * Purpose : */ //============================================================================ -string SALOMEDSImpl_GenericVariable::SaveToScript() const +std::string SALOMEDSImpl_GenericVariable::SaveToScript() const { - return string(); + return std::string(); } //============================================================================ /*! Function : SaveType * Purpose : */ //============================================================================ -string SALOMEDSImpl_GenericVariable::SaveType() const +std::string SALOMEDSImpl_GenericVariable::SaveType() const { - return string(); + return std::string(); } //============================================================================ @@ -143,6 +141,6 @@ string SALOMEDSImpl_GenericVariable::SaveType() const * Purpose : */ //============================================================================ -void SALOMEDSImpl_GenericVariable::Load(const string& theStrValue) +void SALOMEDSImpl_GenericVariable::Load(const std::string& theStrValue) { } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx index 0fa42cd69..a127c4cf8 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx @@ -25,8 +25,6 @@ #include "SALOMEDSImpl_SObject.hxx" #include "SALOMEDSImpl_ChildIterator.hxx" -using namespace std; - #define _AP_LISTS_LIST_ "AP_LISTS_LIST" #define _AP_ENTRIES_LIST_ "AP_ENTRIES_LIST" #define _AP_PROPERTIES_LIST_ "AP_PROPERTIES_LIST" @@ -48,10 +46,10 @@ SALOMEDSImpl_IParameters::~SALOMEDSImpl_IParameters() _compNames.clear(); } -int SALOMEDSImpl_IParameters::append(const string& listName, const string& value) +int SALOMEDSImpl_IParameters::append(const std::string& listName, const std::string& value) { if(!_ap) return -1; - vector v; + std::vector v; if(!_ap->IsSet(listName, PT_STRARRAY)) { if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) _ap->SetStrArray(_AP_LISTS_LIST_, v); if(listName != _AP_ENTRIES_LIST_ && @@ -66,43 +64,43 @@ int SALOMEDSImpl_IParameters::append(const string& listName, const string& value return (v.size()-1); } -int SALOMEDSImpl_IParameters::nbValues(const string& listName) +int SALOMEDSImpl_IParameters::nbValues(const std::string& listName) { if(!_ap) return -1; if(!_ap->IsSet(listName, PT_STRARRAY)) return 0; - vector v = _ap->GetStrArray(listName); + std::vector v = _ap->GetStrArray(listName); return v.size(); } -vector SALOMEDSImpl_IParameters::getValues(const string& listName) +std::vector SALOMEDSImpl_IParameters::getValues(const std::string& listName) { - vector v; + std::vector v; if(!_ap) return v; if(!_ap->IsSet(listName, PT_STRARRAY)) return v; return _ap->GetStrArray(listName); } -string SALOMEDSImpl_IParameters::getValue(const string& listName, int index) +std::string SALOMEDSImpl_IParameters::getValue(const std::string& listName, int index) { if(!_ap) return ""; if(!_ap->IsSet(listName, PT_STRARRAY)) return ""; - vector v = _ap->GetStrArray(listName); + std::vector v = _ap->GetStrArray(listName); if(index >= v.size()) return ""; return v[index]; } -vector SALOMEDSImpl_IParameters::getLists() +std::vector SALOMEDSImpl_IParameters::getLists() { - vector v; + std::vector v; if(!_ap->IsSet(_AP_LISTS_LIST_, PT_STRARRAY)) return v; return _ap->GetStrArray(_AP_LISTS_LIST_); } -void SALOMEDSImpl_IParameters::setParameter(const string& entry, const string& parameterName, const string& value) +void SALOMEDSImpl_IParameters::setParameter(const std::string& entry, const std::string& parameterName, const std::string& value) { if(!_ap) return; - vector v; + std::vector v; if(!_ap->IsSet(entry, PT_STRARRAY)) { append(_AP_ENTRIES_LIST_, entry); //Add the entry to the internal list of entries _ap->SetStrArray(entry, v); @@ -114,11 +112,11 @@ void SALOMEDSImpl_IParameters::setParameter(const string& entry, const string& p } -string SALOMEDSImpl_IParameters::getParameter(const string& entry, const string& parameterName) +std::string SALOMEDSImpl_IParameters::getParameter(const std::string& entry, const std::string& parameterName) { if(!_ap) return ""; if(!_ap->IsSet(entry, PT_STRARRAY)) return ""; - vector v = _ap->GetStrArray(entry); + std::vector v = _ap->GetStrArray(entry); int length = v.size(); for(int i = 0; i SALOMEDSImpl_IParameters::getAllParameterNames(const string& entry) +std::vector SALOMEDSImpl_IParameters::getAllParameterNames(const std::string& entry) { - vector v, names; + std::vector v, names; if(!_ap) return v; if(!_ap->IsSet(entry, PT_STRARRAY)) return v; v = _ap->GetStrArray(entry); @@ -140,9 +138,9 @@ vector SALOMEDSImpl_IParameters::getAllParameterNames(const string& entr return names; } -vector SALOMEDSImpl_IParameters::getAllParameterValues(const string& entry) +std::vector SALOMEDSImpl_IParameters::getAllParameterValues(const std::string& entry) { - vector v, values; + std::vector v, values; if(!_ap) return v; if(!_ap->IsSet(entry, PT_STRARRAY)) return v; v = _ap->GetStrArray(entry); @@ -153,22 +151,22 @@ vector SALOMEDSImpl_IParameters::getAllParameterValues(const string& ent return values; } -int SALOMEDSImpl_IParameters::getNbParameters(const string& entry) +int SALOMEDSImpl_IParameters::getNbParameters(const std::string& entry) { if(!_ap) return -1; if(!_ap->IsSet(entry, PT_STRARRAY)) return -1; return _ap->GetStrArray(entry).size()/2; } -vector SALOMEDSImpl_IParameters::getEntries() +std::vector SALOMEDSImpl_IParameters::getEntries() { - vector v; + std::vector v; if(!_ap) return v; if(!_ap->IsSet(_AP_ENTRIES_LIST_, PT_STRARRAY)) return v; return _ap->GetStrArray(_AP_ENTRIES_LIST_); } -void SALOMEDSImpl_IParameters::setProperty(const string& name, const std::string& value) +void SALOMEDSImpl_IParameters::setProperty(const std::string& name, const std::string& value) { if(!_ap) return; if(!_ap->IsSet(name, PT_STRING)) { @@ -177,28 +175,28 @@ void SALOMEDSImpl_IParameters::setProperty(const string& name, const std::string _ap->SetString(name, value); } -string SALOMEDSImpl_IParameters::getProperty(const string& name) +std::string SALOMEDSImpl_IParameters::getProperty(const std::string& name) { if(!_ap) return ""; if(!_ap->IsSet(name, PT_STRING)) return ""; return _ap->GetString(name); } -vector SALOMEDSImpl_IParameters::getProperties() +std::vector SALOMEDSImpl_IParameters::getProperties() { - vector v; + std::vector v; if(!_ap) return v; if(!_ap->IsSet(_AP_PROPERTIES_LIST_, PT_STRARRAY)) return v; return _ap->GetStrArray(_AP_PROPERTIES_LIST_); } -string SALOMEDSImpl_IParameters::decodeEntry(const string& entry) +std::string SALOMEDSImpl_IParameters::decodeEntry(const std::string& entry) { if(!_study) return entry; int pos = entry.rfind("_"); if(pos < 0 || pos >= entry.size()) return entry; - string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1); + std::string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1); if(_compNames.find(compName) == _compNames.end()) { SALOMEDSImpl_SObject so = _study->FindComponent(compName); @@ -208,16 +206,16 @@ string SALOMEDSImpl_IParameters::decodeEntry(const string& entry) } else compID = _compNames[compName]; - string newEntry(compID); + std::string newEntry(compID); newEntry += (":"+tail); return newEntry; } -bool SALOMEDSImpl_IParameters::isDumpPython(SALOMEDSImpl_Study* study, const string& theID) +bool SALOMEDSImpl_IParameters::isDumpPython(SALOMEDSImpl_Study* study, const std::string& theID) { - string anID; + std::string anID; if(theID == "") anID = getDefaultVisualComponent(); else anID = theID; @@ -228,9 +226,9 @@ bool SALOMEDSImpl_IParameters::isDumpPython(SALOMEDSImpl_Study* study, const str } -int SALOMEDSImpl_IParameters::getLastSavePoint(SALOMEDSImpl_Study* study, const string& theID) +int SALOMEDSImpl_IParameters::getLastSavePoint(SALOMEDSImpl_Study* study, const std::string& theID) { - string anID; + std::string anID; if(theID == "") anID = getDefaultVisualComponent(); else anID = theID; @@ -253,26 +251,26 @@ int SALOMEDSImpl_IParameters::getLastSavePoint(SALOMEDSImpl_Study* study, const -string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, int savePoint, const std::string& theID) +std::string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, int savePoint, const std::string& theID) { - string anID; + std::string anID; if(theID == "") anID = getDefaultVisualComponent(); else anID = theID; SALOMEDSImpl_AttributeParameter* ap = study->GetCommonParameters((char*)anID.c_str(), savePoint); SALOMEDSImpl_IParameters ip(ap); - string dump(""); + std::string dump(""); dump += "import iparameters\n"; dump += "ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters(\""+anID+"\", 1))\n\n"; - vector v = ip.getProperties(); + std::vector v = ip.getProperties(); if(v.size() > 0) { dump += "#Set up visual properties:\n"; for(int i = 0; i 0) { dump += "#Set up lists:\n"; for(int i = 0; i lst = ip.getValues(v[i]); + std::vector lst = ip.getValues(v[i]); dump += "# fill list "+v[i]+"\n"; for(int j = 0; j < lst.size(); j++) { if (lst[j].find('\"') == -1) @@ -295,16 +293,16 @@ string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, int s return dump; } -string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study, - const string& moduleName, - const string& shift, - const string& theID) +std::string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study, + const std::string& moduleName, + const std::string& shift, + const std::string& theID) { - string anID; + std::string anID; if(theID == "") anID = getDefaultVisualComponent(); else anID = theID; - string dump(""); + std::string dump(""); int savePoint = SALOMEDSImpl_IParameters::getLastSavePoint(study, anID); if(savePoint < 0) return dump; @@ -318,11 +316,11 @@ string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study, dump += shift +"import iparameters\n"; dump += shift + "ipar = iparameters.IParameters(theStudy.GetModuleParameters(\""+anID+"\", \""+moduleName+"\", 1))\n\n"; - vector v = ip.getProperties(); + std::vector v = ip.getProperties(); if(v.size() > 0) { dump += shift +"#Set up visual properties:\n"; for(int i = 0; i 0) { dump += shift +"#Set up lists:\n"; for(int i = 0; i lst = ip.getValues(v[i]); + std::vector lst = ip.getValues(v[i]); dump += shift +"# fill list "+v[i]+"\n"; for(int j = 0; j < lst.size(); j++) dump += shift +"ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n"; @@ -342,11 +340,11 @@ string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study, if(v.size() > 0) { dump += shift + "#Set up entries:\n"; for(int i = 0; i names = ip.getAllParameterNames(v[i]); - vector values = ip.getAllParameterValues(v[i]); - string decodedEntry = ip.decodeEntry(v[i]); + std::vector names = ip.getAllParameterNames(v[i]); + std::vector values = ip.getAllParameterValues(v[i]); + std::string decodedEntry = ip.decodeEntry(v[i]); SALOMEDSImpl_SObject so = study->FindObjectID(decodedEntry); - string so_name(""); + std::string so_name(""); if(so) so_name = so.GetName(); dump += shift + "# set up entry " + v[i] +" ("+so_name+")" + " parameters" + "\n"; for(int j = 0; j < names.size() && j < values.size(); j++) @@ -358,7 +356,7 @@ string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study, } -string SALOMEDSImpl_IParameters::getDefaultVisualComponent() +std::string SALOMEDSImpl_IParameters::getDefaultVisualComponent() { return "Interface Applicative"; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx index 5c5d096ba..d6de8f600 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx @@ -27,8 +27,6 @@ #include "SALOMEDSImpl_AttributeComment.hxx" #include "SALOMEDSImpl_AttributeIOR.hxx" -using namespace std; - //============================================================================ /*! Function : Empty constructor * Purpose : @@ -76,9 +74,9 @@ SALOMEDSImpl_SComponent::~SALOMEDSImpl_SComponent() * Purpose : */ //============================================================================ -string SALOMEDSImpl_SComponent::ComponentDataType() +std::string SALOMEDSImpl_SComponent::ComponentDataType() { - string res = ""; + std::string res = ""; SALOMEDSImpl_AttributeComment* type; if ( (type = (SALOMEDSImpl_AttributeComment*)_lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID())) ) { res = type->Value(); @@ -93,7 +91,7 @@ string SALOMEDSImpl_SComponent::ComponentDataType() * Purpose : */ //============================================================================ -bool SALOMEDSImpl_SComponent::ComponentIOR(string& IOR) +bool SALOMEDSImpl_SComponent::ComponentIOR(std::string& IOR) { SALOMEDSImpl_AttributeIOR* ior; if (!(ior = (SALOMEDSImpl_AttributeIOR*)_lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID())) ) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.cxx index c175e766b..82c9a3b59 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.cxx @@ -26,8 +26,6 @@ #include "SALOMEDSImpl_SComponentIterator.hxx" #include "SALOMEDSImpl_Study.hxx" -using namespace std; - //============================================================================ /*! Function : constructor * diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx index 4ec2311a3..fa96fe61b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx @@ -29,8 +29,6 @@ #include "SALOMEDSImpl_SComponent.hxx" #include "SALOMEDSImpl_Study.hxx" -using namespace std; - #include #include @@ -85,7 +83,7 @@ SALOMEDSImpl_SObject::~SALOMEDSImpl_SObject() * Purpose : */ //============================================================================ -string SALOMEDSImpl_SObject::GetID() const +std::string SALOMEDSImpl_SObject::GetID() const { return _lab.Entry(); } @@ -135,7 +133,7 @@ SALOMEDSImpl_Study* SALOMEDSImpl_SObject::GetStudy() const */ //============================================================================ bool SALOMEDSImpl_SObject::FindAttribute(DF_Attribute*& theAttribute, - const string& theTypeOfAttribute) const + const std::string& theTypeOfAttribute) const { if(_lab.IsNull()) return false; std::string aGUID = GetGUID(theTypeOfAttribute); @@ -150,12 +148,12 @@ bool SALOMEDSImpl_SObject::FindAttribute(DF_Attribute*& theAttribute, * Purpose : Returns list of all attributes for this sobject */ //============================================================================ -vector SALOMEDSImpl_SObject::GetAllAttributes() const +std::vector SALOMEDSImpl_SObject::GetAllAttributes() const { - vector va1, va = _lab.GetAttributes(); + std::vector va1, va = _lab.GetAttributes(); for(int i = 0, len = va.size(); i(va[i]); - if(ga && ga->Type() != string("AttributeReference")) + if(ga && ga->Type() != std::string("AttributeReference")) va1.push_back(va[i]); } @@ -199,9 +197,9 @@ bool SALOMEDSImpl_SObject::FindSubObject(int theTag, SALOMEDSImpl_SObject& theOb * Purpose : */ //============================================================================ -string SALOMEDSImpl_SObject::GetName() const +std::string SALOMEDSImpl_SObject::GetName() const { - string aStr = ""; + std::string aStr = ""; SALOMEDSImpl_AttributeName* aName; if ((aName=(SALOMEDSImpl_AttributeName*)_lab.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) { aStr =aName->Value(); @@ -214,9 +212,9 @@ string SALOMEDSImpl_SObject::GetName() const * Purpose : */ //============================================================================ -string SALOMEDSImpl_SObject::GetComment() const +std::string SALOMEDSImpl_SObject::GetComment() const { - string aStr = ""; + std::string aStr = ""; SALOMEDSImpl_AttributeComment* aComment; if ((aComment=(SALOMEDSImpl_AttributeComment*)_lab.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) { aStr = aComment->Value(); @@ -229,9 +227,9 @@ string SALOMEDSImpl_SObject::GetComment() const * Purpose : */ //============================================================================ -string SALOMEDSImpl_SObject::GetIOR() const +std::string SALOMEDSImpl_SObject::GetIOR() const { - string aStr = ""; + std::string aStr = ""; SALOMEDSImpl_AttributeIOR* anIOR; if ((anIOR=(SALOMEDSImpl_AttributeIOR*)_lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) { aStr = dynamic_cast(anIOR)->Value(); @@ -240,7 +238,7 @@ string SALOMEDSImpl_SObject::GetIOR() const } -std::string SALOMEDSImpl_SObject::GetGUID(const string& theType) +std::string SALOMEDSImpl_SObject::GetGUID(const std::string& theType) { __AttributeTypeToGUIDForSObject diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx index 73803b063..14a9f08d2 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx @@ -27,8 +27,6 @@ #include #include -using namespace std; - //============================================================================ /*! Function : SALOMEDSImpl_ScalarVariable * Purpose : @@ -36,7 +34,7 @@ using namespace std; //============================================================================ SALOMEDSImpl_ScalarVariable:: SALOMEDSImpl_ScalarVariable(SALOMEDSImpl_GenericVariable::VariableTypes type, - const string& theName): + const std::string& theName): SALOMEDSImpl_GenericVariable(type,theName) {} @@ -67,7 +65,7 @@ bool SALOMEDSImpl_ScalarVariable::setValue(const double theValue) * Purpose : */ //============================================================================ -bool SALOMEDSImpl_ScalarVariable::setStringValue(const string& theValue) +bool SALOMEDSImpl_ScalarVariable::setStringValue(const std::string& theValue) { if(myStrValue == theValue) @@ -92,7 +90,7 @@ double SALOMEDSImpl_ScalarVariable::getValue() const * Purpose : */ //============================================================================ -string SALOMEDSImpl_ScalarVariable::getStringValue() const +std::string SALOMEDSImpl_ScalarVariable::getStringValue() const { return myStrValue; } @@ -102,7 +100,7 @@ string SALOMEDSImpl_ScalarVariable::getStringValue() const * Purpose : */ //============================================================================ -string SALOMEDSImpl_ScalarVariable::Save() const{ +std::string SALOMEDSImpl_ScalarVariable::Save() const{ char buffer[255]; switch(Type()) { @@ -124,7 +122,7 @@ string SALOMEDSImpl_ScalarVariable::Save() const{ } default:break; } - return string(buffer); + return std::string(buffer); } //============================================================================ @@ -132,7 +130,7 @@ string SALOMEDSImpl_ScalarVariable::Save() const{ * Purpose : */ //============================================================================ -string SALOMEDSImpl_ScalarVariable::SaveToScript() const +std::string SALOMEDSImpl_ScalarVariable::SaveToScript() const { char buffer[255]; switch(Type()) @@ -162,7 +160,7 @@ string SALOMEDSImpl_ScalarVariable::SaveToScript() const } default:break; } - return string(buffer); + return std::string(buffer); } //============================================================================ @@ -170,10 +168,10 @@ string SALOMEDSImpl_ScalarVariable::SaveToScript() const * Purpose : */ //============================================================================ -string SALOMEDSImpl_ScalarVariable::SaveType() const{ +std::string SALOMEDSImpl_ScalarVariable::SaveType() const{ char buffer[255]; sprintf(buffer, "%d", (int)Type()); - return string(buffer); + return std::string(buffer); } //============================================================================ @@ -181,7 +179,7 @@ string SALOMEDSImpl_ScalarVariable::SaveType() const{ * Purpose : */ //============================================================================ -void SALOMEDSImpl_ScalarVariable::Load(const string& theStrValue) +void SALOMEDSImpl_ScalarVariable::Load(const std::string& theStrValue) { double aValue = atof(theStrValue.c_str()); setValue(aValue); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index d09c10e25..c9eea82cd 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -38,8 +38,6 @@ #include #include -using namespace std; - #define USE_CASE_LABEL_TAG 2 #define DIRECTORYID 16661 #define FILELOCALID 26662 @@ -73,7 +71,7 @@ SALOMEDSImpl_StudyBuilder::~SALOMEDSImpl_StudyBuilder() * Purpose : Create a new component (Scomponent) */ //============================================================================ -SALOMEDSImpl_SComponent SALOMEDSImpl_StudyBuilder::NewComponent(const string& DataType) +SALOMEDSImpl_SComponent SALOMEDSImpl_StudyBuilder::NewComponent(const std::string& DataType) { _errorCode = ""; CheckLocked(); @@ -104,7 +102,7 @@ SALOMEDSImpl_SComponent SALOMEDSImpl_StudyBuilder::NewComponent(const string& Da */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::DefineComponentInstance(const SALOMEDSImpl_SComponent& aComponent, - const string& IOR) + const std::string& IOR) { _errorCode = ""; @@ -284,7 +282,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, if (aLocked) _study->GetProperties()->SetLocked(false); std::string Res(Att->Value()); - string aHDFPath(Res); + std::string aHDFPath(Res); SALOMEDSImpl_AttributeComment* type = NULL; std::string DataType; @@ -306,7 +304,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, DefineComponentInstance (anSCO, aDriver->GetIOR()); - string aHDFUrl; + std::string aHDFUrl; bool isASCII = false; if (HDFascii::isASCII(aHDFPath.c_str())) { isASCII = true; @@ -322,7 +320,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, char aMultifileState[2]; char ASCIIfileState[2]; try { - string scoid = anSCO.GetID(); + std::string scoid = anSCO.GetID(); hdf_file->OpenOnDisk(HDF_RDONLY); HDFgroup *hdf_group = new HDFgroup("DATACOMPONENT",hdf_file); hdf_group->OpenOnDisk(); @@ -352,7 +350,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, ascii_hdf_dataset->OpenOnDisk(); ascii_hdf_dataset->ReadFromDisk(ASCIIfileState); - string aDir = SALOMEDSImpl_Tool::GetDirFromPath(Res); + std::string aDir = SALOMEDSImpl_Tool::GetDirFromPath(Res); bool aResult = (ASCIIfileState[0]=='A')? aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'): @@ -382,7 +380,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, delete hdf_file; if (isASCII) { - vector aFilesToRemove; + std::vector aFilesToRemove; aFilesToRemove.push_back("hdf_from_ascii.hdf"); SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true); @@ -392,7 +390,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, delete hdf_file; if (isASCII) { - vector aFilesToRemove; + std::vector aFilesToRemove; aFilesToRemove.push_back(aHDFUrl); SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true); } @@ -436,7 +434,7 @@ bool SALOMEDSImpl_StudyBuilder::Load(const SALOMEDSImpl_SObject& sco) */ //============================================================================ DF_Attribute* SALOMEDSImpl_StudyBuilder::FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject, - const string& aTypeOfAttribute) + const std::string& aTypeOfAttribute) { _errorCode = ""; if(!anObject) { @@ -459,7 +457,7 @@ DF_Attribute* SALOMEDSImpl_StudyBuilder::FindOrCreateAttribute(const SALOMEDSImp //Add checks for TreeNode and UserID attributes if (strncmp(aTypeOfAttribute.c_str(), "AttributeTreeNode",17) == 0 ) { - string aTreeNodeGUID; + std::string aTreeNodeGUID; if (strcmp(aTypeOfAttribute.c_str(), "AttributeTreeNode") == 0) { aTreeNodeGUID = SALOMEDSImpl_AttributeTreeNode::GetDefaultTreeID(); } else { @@ -500,7 +498,7 @@ DF_Attribute* SALOMEDSImpl_StudyBuilder::FindOrCreateAttribute(const SALOMEDSImp bool SALOMEDSImpl_StudyBuilder::FindAttribute(const SALOMEDSImpl_SObject& anObject, DF_Attribute*& anAttribute, - const string& aTypeOfAttribute) + const std::string& aTypeOfAttribute) { _errorCode = ""; if(!anObject) { @@ -523,7 +521,7 @@ bool SALOMEDSImpl_StudyBuilder::FindAttribute(const SALOMEDSImpl_SObject& anObje //============================================================================ bool SALOMEDSImpl_StudyBuilder::RemoveAttribute(const SALOMEDSImpl_SObject& anObject, - const string& aTypeOfAttribute) + const std::string& aTypeOfAttribute) { _errorCode = ""; CheckLocked(); @@ -533,7 +531,7 @@ bool SALOMEDSImpl_StudyBuilder::RemoveAttribute(const SALOMEDSImpl_SObject& anOb } DF_Label Lab = anObject.GetLabel(); - if (aTypeOfAttribute == string("AttributeIOR")) { // Remove from IORLabel map + if (aTypeOfAttribute == std::string("AttributeIOR")) { // Remove from IORLabel map SALOMEDSImpl_AttributeIOR* anAttr = NULL; if ((anAttr=(SALOMEDSImpl_AttributeIOR*)Lab.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) { _study->DeleteIORLabelMapItem(anAttr->Value()); @@ -610,7 +608,7 @@ bool SALOMEDSImpl_StudyBuilder::RemoveReference(const SALOMEDSImpl_SObject& me) * Purpose : adds a new directory with a path = thePath */ //============================================================================ -bool SALOMEDSImpl_StudyBuilder::AddDirectory(const string& thePath) +bool SALOMEDSImpl_StudyBuilder::AddDirectory(const std::string& thePath) { _errorCode = ""; CheckLocked(); @@ -619,7 +617,7 @@ bool SALOMEDSImpl_StudyBuilder::AddDirectory(const string& thePath) return false; } - string aPath(thePath), aContext(""), aFatherPath; + std::string aPath(thePath), aContext(""), aFatherPath; DF_Label aLabel; SALOMEDSImpl_SObject anObject; @@ -638,7 +636,7 @@ bool SALOMEDSImpl_StudyBuilder::AddDirectory(const string& thePath) aPath = _study->GetContext() + aPath; } - vector vs = SALOMEDSImpl_Tool::splitString(aPath, '/'); + std::vector vs = SALOMEDSImpl_Tool::splitString(aPath, '/'); if(vs.size() == 1) aFatherPath = "/"; else { @@ -681,7 +679,7 @@ bool SALOMEDSImpl_StudyBuilder::AddDirectory(const string& thePath) */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::SetGUID(const SALOMEDSImpl_SObject& anObject, - const string& theGUID) + const std::string& theGUID) { _errorCode = ""; CheckLocked(); @@ -704,7 +702,7 @@ bool SALOMEDSImpl_StudyBuilder::SetGUID(const SALOMEDSImpl_SObject& anObject, */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::IsGUID(const SALOMEDSImpl_SObject& anObject, - const string& theGUID) + const std::string& theGUID) { _errorCode = ""; if(!anObject) { @@ -914,7 +912,7 @@ void SALOMEDSImpl_StudyBuilder::CheckLocked() */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::SetName(const SALOMEDSImpl_SObject& theSO, - const string& theValue) + const std::string& theValue) { _errorCode = ""; CheckLocked(); @@ -935,7 +933,7 @@ bool SALOMEDSImpl_StudyBuilder::SetName(const SALOMEDSImpl_SObject& theSO, */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::SetComment(const SALOMEDSImpl_SObject& theSO, - const string& theValue) + const std::string& theValue) { _errorCode = ""; CheckLocked(); @@ -956,7 +954,7 @@ bool SALOMEDSImpl_StudyBuilder::SetComment(const SALOMEDSImpl_SObject& theSO, */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::SetIOR(const SALOMEDSImpl_SObject& theSO, - const string& theValue) + const std::string& theValue) { _errorCode = ""; CheckLocked(); @@ -991,9 +989,9 @@ static void Translate_persistentID_to_IOR(DF_Label& Lab, SALOMEDSImpl_Driver* dr if ((anID=(SALOMEDSImpl_AttributeLocalID*)current.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID()))) if (anID->Value() == FILELOCALID) continue; //SRN: This attribute store a file name, skip it - string persist_ref = Att->Value(); + std::string persist_ref = Att->Value(); SALOMEDSImpl_SObject so = SALOMEDSImpl_Study::SObject(current); - string ior_string = driver->LocalPersistentIDToIOR(so, + std::string ior_string = driver->LocalPersistentIDToIOR(so, persist_ref, isMultiFile, isASCII); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx index cfeca4916..e8165d966 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -49,8 +49,6 @@ # undef GetUserName #endif -using namespace std; - #define USE_CASE_LABEL_ID "0:2" static void SaveAttributes(const SALOMEDSImpl_SObject& SO, HDFgroup *hdf_group_sobject); @@ -91,7 +89,7 @@ SALOMEDSImpl_StudyManager::~SALOMEDSImpl_StudyManager() * Purpose : Create a New Study of name study_name */ //==================================================T========================== -SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::NewStudy(const string& study_name) +SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::NewStudy(const std::string& study_name) { _errorCode = ""; @@ -119,7 +117,7 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::NewStudy(const string& study_name * Purpose : Open a Study from it's persistent reference */ //============================================================================ -SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const string& aUrl) +SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const std::string& aUrl) { _errorCode = ""; @@ -129,7 +127,7 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const string& aUrl) HDFgroup *hdf_notebook_vars = 0; char* aC_HDFUrl; - string aHDFUrl; + std::string aHDFUrl; bool isASCII = false; if (HDFascii::isASCII(aUrl.c_str())) { isASCII = true; @@ -154,7 +152,7 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const string& aUrl) eStr = new char[strlen(aUrl.c_str())+17]; sprintf(eStr,"Can't open file %s",aUrl.c_str()); delete [] eStr; - _errorCode = string(eStr); + _errorCode = std::string(eStr); return NULL; } @@ -186,7 +184,7 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const string& aUrl) { char *eStr = new char [strlen(aUrl.c_str())+17]; sprintf(eStr,"Can't open file %s", aUrl.c_str()); - _errorCode = string(eStr); + _errorCode = std::string(eStr); return NULL; } @@ -201,7 +199,7 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const string& aUrl) hdf_group_study_structure = new HDFgroup("STUDY_STRUCTURE",hdf_file); if (isASCII) { - vector aFilesToRemove; + std::vector aFilesToRemove; aFilesToRemove.push_back("hdf_from_ascii.hdf"); SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true); } @@ -246,7 +244,7 @@ bool SALOMEDSImpl_StudyManager::Save(SALOMEDSImpl_Study* aStudy, { _errorCode = ""; - string url = aStudy->URL(); + std::string url = aStudy->URL(); if (url.empty()) { _errorCode = "No path specified to save the study. Nothing done"; return false; @@ -264,7 +262,7 @@ bool SALOMEDSImpl_StudyManager::SaveASCII(SALOMEDSImpl_Study* aStudy, { _errorCode = ""; - string url = aStudy->URL(); + std::string url = aStudy->URL(); if (url.empty()) { _errorCode = "No path specified to save the study. Nothing done"; return false; @@ -281,7 +279,7 @@ bool SALOMEDSImpl_StudyManager::SaveASCII(SALOMEDSImpl_Study* aStudy, * Purpose : Save a study to the persistent reference aUrl */ //============================================================================ -bool SALOMEDSImpl_StudyManager::SaveAs(const string& aUrl, +bool SALOMEDSImpl_StudyManager::SaveAs(const std::string& aUrl, SALOMEDSImpl_Study* aStudy, SALOMEDSImpl_DriverFactory* aFactory, bool theMultiFile) @@ -290,7 +288,7 @@ bool SALOMEDSImpl_StudyManager::SaveAs(const string& aUrl, return Impl_SaveAs(aUrl,aStudy, aFactory, theMultiFile, false); } -bool SALOMEDSImpl_StudyManager::SaveAsASCII(const string& aUrl, +bool SALOMEDSImpl_StudyManager::SaveAsASCII(const std::string& aUrl, SALOMEDSImpl_Study* aStudy, SALOMEDSImpl_DriverFactory* aFactory, bool theMultiFile) @@ -304,10 +302,10 @@ bool SALOMEDSImpl_StudyManager::SaveAsASCII(const string& aUrl, * Purpose : Get name list of open studies in the session */ //============================================================================ -vector SALOMEDSImpl_StudyManager::GetOpenStudies() +std::vector SALOMEDSImpl_StudyManager::GetOpenStudies() { _errorCode = ""; - vector aList; + std::vector aList; int nbDocs = _appli->NbDocuments(); @@ -317,7 +315,7 @@ vector SALOMEDSImpl_StudyManager::GetOpenStudies() } else { SALOMEDSImpl_Study* aStudy; - vector ids = _appli->GetDocumentIDs(); + std::vector ids = _appli->GetDocumentIDs(); for (int i = 0, len = ids.size(); iGetDocument(ids[i]); if(D == _clipboard) continue; @@ -336,7 +334,7 @@ vector SALOMEDSImpl_StudyManager::GetOpenStudies() */ //============================================================================ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::GetStudyByName - (const string& aStudyName) + (const std::string& aStudyName) { _errorCode = ""; int nbDocs = _appli->NbDocuments(); @@ -346,13 +344,13 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::GetStudyByName return NULL; } else { - vector studies = GetOpenStudies(); + std::vector studies = GetOpenStudies(); for (int i = 0, len = studies.size(); iName() == aStudyName) return studies[i]; } } - _errorCode = string("Found no study with the name ") + aStudyName; + _errorCode = std::string("Found no study with the name ") + aStudyName; return NULL; } @@ -371,7 +369,7 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::GetStudyByID(int aStudyID) return NULL; } else { - vector studies = GetOpenStudies(); + std::vector studies = GetOpenStudies(); for (int i = 0, len = studies.size(); iStudyId() == aStudyID) return studies[i]; } @@ -407,8 +405,8 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveProperties(SALOMEDSImpl_Study* aStudy, if (aLocked) aProp->SetLocked(true); - vector aNames; - vector aMinutes, aHours, aDays, aMonths, aYears; + std::vector aNames; + std::vector aMinutes, aHours, aDays, aMonths, aYears; aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears); @@ -455,7 +453,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveProperties(SALOMEDSImpl_Study* aStudy, * Purpose : save the study in HDF file */ //============================================================================ -bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, +bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const std::string& aStudyUrl, SALOMEDSImpl_Study* aStudy, SALOMEDSImpl_DriverFactory* aFactory, bool theMultiFile, @@ -480,7 +478,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, HDFdataset *hdf_dataset =0; hdf_size size[1]; hdf_int32 name_len = 0; - string component_name; + std::string component_name; if(!aStudy) { _errorCode = "Study is null"; @@ -488,13 +486,13 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, } //Create a temporary url to which the study is saved - string aUrl = SALOMEDSImpl_Tool::GetTmpDir() + SALOMEDSImpl_Tool::GetNameFromPath(aStudyUrl); + std::string aUrl = SALOMEDSImpl_Tool::GetTmpDir() + SALOMEDSImpl_Tool::GetNameFromPath(aStudyUrl); int aLocked = aStudy->GetProperties()->IsLocked(); if (aLocked) aStudy->GetProperties()->SetLocked(false); SALOMEDSImpl_StudyBuilder* SB= aStudy->NewBuilder(); - map aMapTypeDriver; + std::map aMapTypeDriver; try { @@ -504,10 +502,10 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, { SALOMEDSImpl_SComponent sco = itcomponent1.Value(); // if there is an associated Engine call its method for saving - string IOREngine; + std::string IOREngine; try { if (!sco.ComponentIOR(IOREngine)) { - string aCompType = sco.GetComment(); + std::string aCompType = sco.GetComment(); if (!aCompType.empty()) { SALOMEDSImpl_Driver* aDriver = aFactory->GetDriverByType(aCompType); @@ -527,7 +525,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, } } - string anOldName = aStudy->Name(); + std::string anOldName = aStudy->Name(); aStudy->URL(aStudyUrl); // To change for Save @@ -547,12 +545,12 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, { SALOMEDSImpl_SComponent sco = itcomponent.Value(); - string scoid = sco.GetID(); + std::string scoid = sco.GetID(); hdf_sco_group = new HDFgroup((char*)scoid.c_str(), hdf_group_datacomponent); hdf_sco_group->CreateOnDisk(); - string componentDataType = sco.ComponentDataType(); - string IOREngine; + std::string componentDataType = sco.ComponentDataType(); + std::string IOREngine; if (sco.ComponentIOR(IOREngine)) { SALOMEDSImpl_Driver* Engine = NULL; @@ -625,7 +623,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, for (; itcomp.More(); itcomp.Next()) { SALOMEDSImpl_SComponent SC = itcomp.Value(); - string scid = SC.GetID(); + std::string scid = SC.GetID(); hdf_sco_group2 = new HDFgroup((char*)scid.c_str(), hdf_group_study_structure); hdf_sco_group2->CreateOnDisk(); SaveAttributes(SC, hdf_sco_group2); @@ -662,9 +660,9 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, hdf_notebook_vars = new HDFgroup("NOTEBOOK_VARIABLES",hdf_file); hdf_notebook_vars->CreateOnDisk(); - string varValue; - string varType; - string varIndex; + std::string varValue; + std::string varType; + std::string varIndex; for(int i=0 ;i < aStudy->myNoteBookVars.size(); i++ ){ // For each variable create HDF group @@ -683,7 +681,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, char buffer[256]; sprintf(buffer,"%d",i); - varIndex= string(buffer); + varIndex= std::string(buffer); name_len = (hdf_int32) varIndex.length(); size[0] = name_len +1 ; hdf_dataset = new HDFdataset("VARIABLE_INDEX",hdf_notebook_var,HDF_STRING,size,1); @@ -712,7 +710,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, //----------------------------------------------------------------------- //6 - Write the Study Properties //----------------------------------------------------------------------- - string study_name = aStudy->Name(); + std::string study_name = aStudy->Name(); name_len = (hdf_int32) study_name.size(); size[0] = name_len +1 ; hdf_dataset = new HDFdataset("STUDY_NAME",hdf_group_study_structure,HDF_STRING,size,1); @@ -752,9 +750,9 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, // The easiest way to get a list of file in the temporary directory - string aCmd, aTmpFileDir = SALOMEDSImpl_Tool::GetTmpDir(); - string aTmpFile = aTmpFileDir +"files"; - string aStudyTmpDir = SALOMEDSImpl_Tool::GetDirFromPath(aUrl); + std::string aCmd, aTmpFileDir = SALOMEDSImpl_Tool::GetTmpDir(); + std::string aTmpFile = aTmpFileDir +"files"; + std::string aStudyTmpDir = SALOMEDSImpl_Tool::GetDirFromPath(aUrl); #ifdef WIN32 aCmd = "dir /B \"" + aStudyTmpDir +"\" > " + aTmpFile; @@ -772,9 +770,9 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, size_t aLen = strlen(buffer); if(buffer[aLen-1] == '\n') buffer[aLen-1] = char(0); #ifdef WIN32 - aCmd = "move /Y \"" + aStudyTmpDir + string(buffer) + "\" \"" + SALOMEDSImpl_Tool::GetDirFromPath(aStudyUrl) +"\""; + aCmd = "move /Y \"" + aStudyTmpDir + std::string(buffer) + "\" \"" + SALOMEDSImpl_Tool::GetDirFromPath(aStudyUrl) +"\""; #else - aCmd = "mv -f \"" + aStudyTmpDir + string(buffer) + "\" \"" + SALOMEDSImpl_Tool::GetDirFromPath(aStudyUrl)+"\""; + aCmd = "mv -f \"" + aStudyTmpDir + std::string(buffer) + "\" \"" + SALOMEDSImpl_Tool::GetDirFromPath(aStudyUrl)+"\""; #endif system(aCmd.c_str()); } @@ -820,7 +818,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveObject(const SALOMEDSImpl_SObject& SC, { // mpv: don't save empty labels - vector attr = itchild.Value().GetAttributes(); + std::vector attr = itchild.Value().GetAttributes(); if (attr.size() == 0) { //No attributes on the label DF_ChildIterator subchild(itchild.Value()); if (!subchild.More()) { @@ -829,7 +827,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveObject(const SALOMEDSImpl_SObject& SC, subchild.Init(itchild.Value(), true); bool anEmpty = true; for (; subchild.More() && anEmpty; subchild.Next()) { - vector attr2 = subchild.Value().GetAttributes(); + std::vector attr2 = subchild.Value().GetAttributes(); if (attr2.size()) { anEmpty = false; //There are attributes on the child label break; @@ -840,7 +838,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveObject(const SALOMEDSImpl_SObject& SC, SALOMEDSImpl_SObject SO = SALOMEDSImpl_Study::SObject(itchild.Value()); - string scoid = SO.GetID(); + std::string scoid = SO.GetID(); hdf_group_sobject = new HDFgroup(scoid.c_str(), hdf_group_datatype); hdf_group_sobject->CreateOnDisk(); SaveAttributes(SO, hdf_group_sobject); @@ -857,7 +855,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveObject(const SALOMEDSImpl_SObject& SC, * Purpose : */ //============================================================================ -string SALOMEDSImpl_StudyManager::Impl_SubstituteSlash(const string& aUrl) +std::string SALOMEDSImpl_StudyManager::Impl_SubstituteSlash(const std::string& aUrl) { _errorCode = ""; @@ -890,7 +888,7 @@ bool SALOMEDSImpl_StudyManager::CanCopy(const SALOMEDSImpl_SObject& theObject, SALOMEDSImpl_SComponent aComponent = theObject.GetFatherComponent(); if (!aComponent) return false; if (aComponent.GetLabel() == theObject.GetLabel()) return false; - string IOREngine; + std::string IOREngine; if (!aComponent.ComponentIOR(IOREngine)) return false; if (theEngine == NULL) return false; return theEngine->CanCopy(theObject); @@ -919,16 +917,16 @@ bool SALOMEDSImpl_StudyManager::CopyLabel(SALOMEDSImpl_Study* theSourceStudy, aAuxTargetLabel = aAuxTargetLabel.FindChild(aSourceLabel.Tag()); } // iterate attributes - vector attrList = theSource.GetAttributes(); + std::vector attrList = theSource.GetAttributes(); for(int i = 0, len = attrList.size(); i(anAttr)->Get(); - string anEntry = aReferenced.Entry(); + std::string anEntry = aReferenced.Entry(); // store the value of name attribute of referenced label SALOMEDSImpl_AttributeName* aNameAttribute; if ((aNameAttribute=(SALOMEDSImpl_AttributeName*)aReferenced.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) { @@ -939,13 +937,13 @@ bool SALOMEDSImpl_StudyManager::CopyLabel(SALOMEDSImpl_Study* theSourceStudy, continue; } - if (type == string("AttributeIOR")) { // IOR => ID and TMPFile of Engine - string anEntry = theSource.Entry(); + if (type == std::string("AttributeIOR")) { // IOR => ID and TMPFile of Engine + std::string anEntry = theSource.Entry(); SALOMEDSImpl_SObject aSO = theSourceStudy->FindObjectID(anEntry); int anObjID; long aLen; SALOMEDSImpl_TMPFile* aStream = theEngine->CopyFrom(aSO, anObjID, aLen); - string aResStr(""); + std::string aResStr(""); for(a = 0; a < aLen; a++) { aResStr += (char)(aStream->Get(a)); } @@ -1046,7 +1044,7 @@ bool SALOMEDSImpl_StudyManager::CanPaste(const SALOMEDSImpl_SObject& theObject, return false; } - string IOREngine; + std::string IOREngine; if (!aComponent.ComponentIOR(IOREngine)) { _errorCode = "component has no IOR"; return false; @@ -1087,7 +1085,7 @@ DF_Label SALOMEDSImpl_StudyManager::PasteLabel(SALOMEDSImpl_Study* theDestinatio if ((aNameAttribute=(SALOMEDSImpl_AttributeName*)aAuxSourceLabel.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) { SALOMEDSImpl_AttributeInteger* anObjID = (SALOMEDSImpl_AttributeInteger*)aAuxSourceLabel.FindAttribute(SALOMEDSImpl_AttributeInteger::GetID()); SALOMEDSImpl_AttributeComment* aComponentName = (SALOMEDSImpl_AttributeComment*)theSource.Root().FindAttribute(SALOMEDSImpl_AttributeComment::GetID()); - string aCompName = aComponentName->Value(); + std::string aCompName = aComponentName->Value(); if (theEngine->CanPaste(aCompName, anObjID->Value())) { std::string aTMPStr = aNameAttribute->Value(); @@ -1100,11 +1098,11 @@ DF_Label SALOMEDSImpl_StudyManager::PasteLabel(SALOMEDSImpl_Study* theDestinatio } } - string anEntry = aTargetLabel.Entry(); + std::string anEntry = aTargetLabel.Entry(); SALOMEDSImpl_SObject aPastedSO = theDestinationStudy->FindObjectID(anEntry); if (isFirstElement) { - string aDestEntry = theEngine->PasteInto(aStream, + std::string aDestEntry = theEngine->PasteInto(aStream, aLen, anObjID->Value(), aPastedSO.GetFatherComponent()); @@ -1117,7 +1115,7 @@ DF_Label SALOMEDSImpl_StudyManager::PasteLabel(SALOMEDSImpl_Study* theDestinatio } // iterate attributes - vector attrList = theSource.GetAttributes(); + std::vector attrList = theSource.GetAttributes(); for(int i = 0, len = attrList.size(); iID())) { @@ -1132,7 +1130,7 @@ DF_Label SALOMEDSImpl_StudyManager::PasteLabel(SALOMEDSImpl_Study* theDestinatio SALOMEDSImpl_AttributeComment* aCommentAttribute = NULL; if ((aCommentAttribute=(SALOMEDSImpl_AttributeComment*)aAuxSourceLabel.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) { char * anEntry = new char[aCommentAttribute->Value().size() + 1]; - strcpy(anEntry, string(aCommentAttribute->Value()).c_str()); + strcpy(anEntry, std::string(aCommentAttribute->Value()).c_str()); char* aNameStart = strchr(anEntry, ' '); if (aNameStart) { *aNameStart = '\0'; @@ -1224,14 +1222,14 @@ SALOMEDSImpl_SObject SALOMEDSImpl_StudyManager::Paste(const SALOMEDSImpl_SObject static void SaveAttributes(const SALOMEDSImpl_SObject& aSO, HDFgroup *hdf_group_sobject) { hdf_size size[1]; - vector attrList = aSO.GetLabel().GetAttributes(); + std::vector attrList = aSO.GetLabel().GetAttributes(); DF_Attribute* anAttr = NULL; for(int i = 0, len = attrList.size(); iSave(); + std::string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(anAttr); + if(type == std::string("AttributeIOR")) continue; //IOR attribute is not saved + std::string aSaveStr =anAttr->Save(); //cout << "Saving: " << aSO.GetID() << " type: "<< type<<"|" << endl; size[0] = (hdf_int32) strlen(aSaveStr.c_str()) + 1; HDFdataset *hdf_dataset = new HDFdataset((char*)type.c_str(), hdf_group_sobject, HDF_STRING,size, 1); @@ -1322,7 +1320,7 @@ static void Translate_IOR_to_persistentID (const SALOMEDSImpl_SObject& so, bool isASCII) { DF_ChildIterator itchild(so.GetLabel()); - string ior_string, persistent_string, curid; + std::string ior_string, persistent_string, curid; for (; itchild.More(); itchild.Next()) { SALOMEDSImpl_SObject current = SALOMEDSImpl_Study::SObject(itchild.Value()); @@ -1356,7 +1354,7 @@ void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup) //Get Nb of variables int aNbVars = theGroup->nInternalObjects(); - map aVarsMap; + std::map aVarsMap; for( int iVar=0;iVar < aNbVars;iVar++ ) { theGroup->InternalObjectIndentify(iVar,aVarName); @@ -1401,19 +1399,19 @@ void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup) new_group = 0; //will be deleted by hdf_sco_group destructor SALOMEDSImpl_GenericVariable::VariableTypes aVarType = - SALOMEDSImpl_GenericVariable::String2VariableType(string(currentVarType)); + SALOMEDSImpl_GenericVariable::String2VariableType(std::string(currentVarType)); delete [] currentVarType; //Create variable and add it in the study SALOMEDSImpl_GenericVariable* aVariable = - new SALOMEDSImpl_ScalarVariable(aVarType,string(aVarName)); - aVariable->Load(string(currentVarValue)); - aVarsMap.insert(make_pair(order,aVariable)); + new SALOMEDSImpl_ScalarVariable(aVarType,std::string(aVarName)); + aVariable->Load(std::string(currentVarValue)); + aVarsMap.insert(std::make_pair(order,aVariable)); delete [] currentVarValue; - } + } } - map::const_iterator it= aVarsMap.begin(); + std::map::const_iterator it= aVarsMap.begin(); for(;it!=aVarsMap.end();it++) theStudy->AddVariable((*it).second); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx index 974eb69b7..327ee5dab 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx @@ -46,11 +46,8 @@ #include #endif -using namespace std; - - -bool Exists(const string thePath) +bool Exists(const std::string thePath) { #ifdef WIN32 if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { @@ -72,15 +69,15 @@ bool Exists(const string thePath) // function : GetTempDir // purpose : Return a temp directory to store created files like "/tmp/sub_dir/" //============================================================================ -string SALOMEDSImpl_Tool::GetTmpDir() +std::string SALOMEDSImpl_Tool::GetTmpDir() { //Find a temporary directory to store a file - string aTmpDir; + std::string aTmpDir; char *Tmp_dir = getenv("SALOME_TMP_DIR"); if(Tmp_dir != NULL) { - aTmpDir = string(Tmp_dir); + aTmpDir = std::string(Tmp_dir); #ifdef WIN32 if(aTmpDir[aTmpDir.size()-1] != '\\') aTmpDir+='\\'; #else @@ -89,9 +86,9 @@ string SALOMEDSImpl_Tool::GetTmpDir() } else { #ifdef WIN32 - aTmpDir = string("C:\\"); + aTmpDir = std::string("C:\\"); #else - aTmpDir = string("/tmp/"); + aTmpDir = std::string("/tmp/"); #endif } @@ -99,12 +96,12 @@ string SALOMEDSImpl_Tool::GetTmpDir() int aRND = 999 + (int)(100000.0*rand()/(RAND_MAX+1.0)); //Get a random number to present a name of a sub directory char buffer[127]; sprintf(buffer, "%d", aRND); - string aSubDir(buffer); - if(aSubDir.size() <= 1) aSubDir = string("123409876"); + std::string aSubDir(buffer); + if(aSubDir.size() <= 1) aSubDir = std::string("123409876"); aTmpDir += aSubDir; //Get RND sub directory - string aDir = aTmpDir; + std::string aDir = aTmpDir; if(Exists(aDir)) { for(aRND = 0; Exists(aDir); aRND++) { @@ -133,15 +130,15 @@ string SALOMEDSImpl_Tool::GetTmpDir() // function : RemoveTemporaryFiles // purpose : Removes files listed in theFileList //============================================================================ -void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const string& theDirectory, - const vector& theFiles, +void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const std::string& theDirectory, + const std::vector& theFiles, const bool IsDirDeleted) { - string aDirName = theDirectory; + std::string aDirName = theDirectory; int i, aLength = theFiles.size(); for(i=1; i<=aLength; i++) { - string aFile(aDirName); + std::string aFile(aDirName); aFile += theFiles[i-1]; if(!Exists(aFile)) continue; @@ -168,7 +165,7 @@ void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const string& theDirectory, // function : GetNameFromPath // purpose : Returns the name by the path //============================================================================ -string SALOMEDSImpl_Tool::GetNameFromPath(const string& thePath) { +std::string SALOMEDSImpl_Tool::GetNameFromPath(const std::string& thePath) { if (thePath.empty()) return ""; int pos = thePath.rfind('/'); if(pos > 0) return thePath.substr(pos+1, thePath.size()); @@ -183,14 +180,14 @@ string SALOMEDSImpl_Tool::GetNameFromPath(const string& thePath) { // function : GetDirFromPath // purpose : Returns the dir by the path //============================================================================ -string SALOMEDSImpl_Tool::GetDirFromPath(const string& thePath) { +std::string SALOMEDSImpl_Tool::GetDirFromPath(const std::string& thePath) { #ifdef WIN32 - string separator = "\\"; + std::string separator = "\\"; #else - string separator = "/"; + std::string separator = "/"; #endif - string path; + std::string path; if (!thePath.empty()) { int pos = thePath.rfind('/'); if (pos < 0) pos = thePath.rfind('\\'); @@ -199,7 +196,7 @@ string SALOMEDSImpl_Tool::GetDirFromPath(const string& thePath) { if (pos > 0) path = thePath.substr(0, pos+1); else - path = string(".") + separator; + path = std::string(".") + separator; #ifdef WIN32 //Check if the only disk letter is given as path if (path.size() == 2 && path[1] == ':') path += separator; @@ -217,9 +214,9 @@ string SALOMEDSImpl_Tool::GetDirFromPath(const string& thePath) { // purpose : The functions returns a list of substring of initial string // divided by given separator //============================================================================ -vector SALOMEDSImpl_Tool::splitString(const string& theValue, char separator) +std::vector SALOMEDSImpl_Tool::splitString(const std::string& theValue, char separator) { - vector vs; + std::vector vs; if(theValue[0] == separator && theValue.size() == 1) return vs; int pos = theValue.find(separator); if(pos < 0) { @@ -227,7 +224,7 @@ vector SALOMEDSImpl_Tool::splitString(const string& theValue, char separ return vs; } - string s = theValue; + std::string s = theValue; if(s[0] == separator) s = s.substr(1, s.size()); while((pos = s.find(separator)) >= 0) { vs.push_back(s.substr(0, pos)); @@ -243,17 +240,17 @@ vector SALOMEDSImpl_Tool::splitString(const string& theValue, char separ // purpose : The functions returns a list of substring of initial string // divided by given separator include empty strings //============================================================================ -vector SALOMEDSImpl_Tool::splitStringWithEmpty(const string& theValue, char sep) +std::vector SALOMEDSImpl_Tool::splitStringWithEmpty(const std::string& theValue, char sep) { - vector aResult; - if(theValue[0] == sep ) aResult.push_back(string()); + std::vector aResult; + if(theValue[0] == sep ) aResult.push_back(std::string()); int pos = theValue.find(sep); if(pos < 0 ) { aResult.push_back(theValue); return aResult; } - string s = theValue; + std::string s = theValue; if(s[0] == sep) s = s.substr(1, s.size()); while((pos = s.find(sep)) >= 0) { aResult.push_back(s.substr(0, pos)); @@ -261,7 +258,7 @@ vector SALOMEDSImpl_Tool::splitStringWithEmpty(const string& theValue, c } if(!s.empty() && s[0] != sep) aResult.push_back(s); - if(theValue[theValue.size()-1] == sep) aResult.push_back(string()); + if(theValue[theValue.size()-1] == sep) aResult.push_back(std::string()); return aResult; } @@ -271,11 +268,11 @@ vector SALOMEDSImpl_Tool::splitStringWithEmpty(const string& theValue, c // purpose : The functions returns a list of lists of substrings of initial string // divided by two given separators include empty strings //============================================================================ -vector< vector > SALOMEDSImpl_Tool::splitStringWithEmpty(const string& theValue, char sep1, char sep2) +std::vector< std::vector > SALOMEDSImpl_Tool::splitStringWithEmpty(const std::string& theValue, char sep1, char sep2) { - vector< vector > aResult; + std::vector< std::vector > aResult; if(theValue.size() > 0) { - vector aSections = splitStringWithEmpty( theValue, sep1 ); + std::vector aSections = splitStringWithEmpty( theValue, sep1 ); for( int i = 0, n = aSections.size(); i < n; i++ ) aResult.push_back( splitStringWithEmpty( aSections[i], sep2 ) ); } @@ -318,21 +315,21 @@ void SALOMEDSImpl_Tool::GetSystemDate(int& year, int& month, int& day, int& hour #ifdef WIN32 # undef GetUserName #endif -string SALOMEDSImpl_Tool::GetUserName() +std::string SALOMEDSImpl_Tool::GetUserName() { #ifdef WIN32 char* pBuff = new char[UNLEN + 1]; DWORD dwSize = UNLEN + 1; - string retVal; + std::string retVal; ::GetUserNameA( pBuff, &dwSize ); - string theTmpUserName(pBuff,(int)dwSize -1 ); + std::string theTmpUserName(pBuff,(int)dwSize -1 ); retVal = theTmpUserName; delete [] pBuff; return retVal; #else struct passwd *infos; infos = getpwuid(getuid()); - return string(infos->pw_name); + return std::string(infos->pw_name); #endif } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx index 566846962..e284991e5 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx @@ -31,8 +31,6 @@ #include "DF_ChildIterator.hxx" -using namespace std; - #define USE_CASE_LABEL_TAG 2 #define USE_CASE_GUID "AA43BB12-D9CD-11d6-945D-0050DA506788" @@ -120,7 +118,7 @@ bool SALOMEDSImpl_UseCaseBuilder::Remove(const SALOMEDSImpl_SObject& theObject) aNode->Remove(); - vector aList; + std::vector aList; aList.push_back(aNode); SALOMEDSImpl_AttributeReference* aRef = NULL; @@ -272,7 +270,7 @@ bool SALOMEDSImpl_UseCaseBuilder::HasChildren(const SALOMEDSImpl_SObject& theObj * Purpose : */ //============================================================================ -bool SALOMEDSImpl_UseCaseBuilder::SetName(const string& theName) { +bool SALOMEDSImpl_UseCaseBuilder::SetName(const std::string& theName) { if(!_root) return false; SALOMEDSImpl_AttributeName* aNameAttrib = NULL; @@ -312,9 +310,9 @@ SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::GetCurrentObject() * Purpose : */ //============================================================================ -string SALOMEDSImpl_UseCaseBuilder::GetName() +std::string SALOMEDSImpl_UseCaseBuilder::GetName() { - string aString; + std::string aString; if(!_root) return aString; SALOMEDSImpl_AttributeName* aName = NULL; @@ -341,9 +339,9 @@ bool SALOMEDSImpl_UseCaseBuilder::IsUseCase(const SALOMEDSImpl_SObject& theObjec * Purpose : */ //============================================================================ -SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::AddUseCase(const string& theName) +SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::AddUseCase(const std::string& theName) { - string aBasicGUID(USE_CASE_GUID); + std::string aBasicGUID(USE_CASE_GUID); //Create a use cases structure if it not exists @@ -397,7 +395,7 @@ SALOMEDSImpl_UseCaseBuilder::GetUseCaseIterator(const SALOMEDSImpl_SObject& theO } -SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::GetSObject(const string& theEntry) +SALOMEDSImpl_SObject SALOMEDSImpl_UseCaseBuilder::GetSObject(const std::string& theEntry) { DF_Label L = DF_Label::Label(_root->Label(), theEntry); return SALOMEDSImpl_Study::SObject(L); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx index 1ce3207e0..ed66e7eb6 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx @@ -27,8 +27,6 @@ #include "SALOMEDSImpl_SObject.hxx" #include "SALOMEDSImpl_Study.hxx" -using namespace std; - //============================================================================ /*! Function : empty constructor * Purpose : @@ -46,7 +44,7 @@ SALOMEDSImpl_UseCaseIterator::SALOMEDSImpl_UseCaseIterator() */ //============================================================================ SALOMEDSImpl_UseCaseIterator::SALOMEDSImpl_UseCaseIterator(const DF_Label& theLabel, - const string& theGUID, + const std::string& theGUID, const bool allLevels) :_guid(theGUID), _levels(allLevels) { diff --git a/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx b/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx index 4092158dd..e6dfb97b1 100644 --- a/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx +++ b/src/SALOMEDSImpl/Test/SALOMEDSImplTest.cxx @@ -34,7 +34,6 @@ #include "SALOMEDSImpl_StudyBuilder.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" -using namespace std; // ============================================================================ /*! @@ -90,7 +89,7 @@ void SALOMEDSImplTest::testAttributeParameter() CPPUNIT_ASSERT(_ap->IsSet("BoolValue", PT_BOOLEAN)); CPPUNIT_ASSERT(!_ap->GetBool("BoolValue")); - vector intArray; + std::vector intArray; intArray.push_back(0); intArray.push_back(1); @@ -99,7 +98,7 @@ void SALOMEDSImplTest::testAttributeParameter() CPPUNIT_ASSERT(_ap->GetIntArray("IntArray")[0] == 0); CPPUNIT_ASSERT(_ap->GetIntArray("IntArray")[1] == 1); - vector realArray; + std::vector realArray; realArray.push_back(0.0); realArray.push_back(1.1); @@ -108,7 +107,7 @@ void SALOMEDSImplTest::testAttributeParameter() CPPUNIT_ASSERT(_ap->GetRealArray("RealArray")[0] == 0.0); CPPUNIT_ASSERT(_ap->GetRealArray("RealArray")[1] == 1.1); - vector strArray; + std::vector strArray; strArray.push_back("hello"); strArray.push_back("world"); diff --git a/src/SALOMEDSImpl/testDS.cxx b/src/SALOMEDSImpl/testDS.cxx index 1328442a6..b2c6a28f1 100644 --- a/src/SALOMEDSImpl/testDS.cxx +++ b/src/SALOMEDSImpl/testDS.cxx @@ -44,44 +44,42 @@ //#include "SALOMEDSImpl_.hxx" -using namespace std; - int main (int argc, char * argv[]) { - cout << "Test started " << endl; + std::cout << "Test started " << std::endl; SALOMEDSImpl_StudyManager* aSM = new SALOMEDSImpl_StudyManager(); - cout << "Manager is created " << endl; + std::cout << "Manager is created " << std::endl; SALOMEDSImpl_Study* aStudy = aSM->NewStudy("SRN"); - cout << "Study with id = " << aStudy->StudyId() << " is created " << endl; + std::cout << "Study with id = " << aStudy->StudyId() << " is created " << std::endl; - cout << "Check the study lock, locking" << endl; + std::cout << "Check the study lock, locking" << std::endl; aStudy->SetStudyLock("SRN"); - cout << "Is study locked = " << aStudy->IsStudyLocked() << endl; - vector ids = aStudy->GetLockerID(); + std::cout << "Is study locked = " << aStudy->IsStudyLocked() << std::endl; + std::vector ids = aStudy->GetLockerID(); for(int i = 0; iUnLockStudy("SRN"); - cout << "Is study locked = " << aStudy->IsStudyLocked() << endl; + std::cout << "Is study locked = " << aStudy->IsStudyLocked() << std::endl; SALOMEDSImpl_StudyBuilder* aBuilder = aStudy->NewBuilder(); - cout << "StudyBuilder is created " << endl; + std::cout << "StudyBuilder is created " << std::endl; SALOMEDSImpl_SComponent aSC = aBuilder->NewComponent("TEST"); - cout << "New component with type " << aSC.ComponentDataType() << " is created " << endl; + std::cout << "New component with type " << aSC.ComponentDataType() << " is created " << std::endl; SALOMEDSImpl_SObject aSO = aBuilder->NewObject(aSC); - cout << "New SObject with ID = " << aSO.GetID() << " is created" << endl; - cout << "An entry of newly created SO is " << aSO.GetLabel().Entry() << endl; + std::cout << "New SObject with ID = " << aSO.GetID() << " is created" << std::endl; + std::cout << "An entry of newly created SO is " << aSO.GetLabel().Entry() << std::endl; SALOMEDSImpl_AttributeIOR* aIORA = SALOMEDSImpl_AttributeIOR::Set(aSO.GetLabel(), "ior1234"); - cout << "New AttributeIOR is created, it contains " << dynamic_cast(aIORA)->Value() << endl; - cout << "Attribute has type: " << aIORA->Type() << " and value: " << aIORA->Save() << endl; - cout << "Just another way to create an attribute: official one :) " << endl; - cout << "Is SO null : " << aSO.IsNull()<< endl; + std::cout << "New AttributeIOR is created, it contains " << dynamic_cast(aIORA)->Value() << std::endl; + std::cout << "Attribute has type: " << aIORA->Type() << " and value: " << aIORA->Save() << std::endl; + std::cout << "Just another way to create an attribute: official one :) " << std::endl; + std::cout << "Is SO null : " << aSO.IsNull()<< std::endl; DF_Attribute* aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeName"); SALOMEDSImpl_AttributeName* aRN = dynamic_cast(aTDFAttr); aRN->SetValue("name_attribute"); - cout << " The type = " << aRN->Type() << endl; - cout << "Attribute has type: " << aRN->Type() << " and value: " << aRN->Save() << endl; - cout << "Check GetObjectPath: " << aStudy->GetObjectPath(aSO) << endl; + std::cout << " The type = " << aRN->Type() << std::endl; + std::cout << "Attribute has type: " << aRN->Type() << " and value: " << aRN->Save() << std::endl; + std::cout << "Check GetObjectPath: " << aStudy->GetObjectPath(aSO) << std::endl; SALOMEDSImpl_SObject aSubSO = aBuilder->NewObject(aSO); aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "AttributeIOR"); @@ -90,141 +88,141 @@ int main (int argc, char * argv[]) aBuilder->Addreference(aSubSO, aSO); SALOMEDSImpl_SObject aRefObject; aSubSO.ReferencedObject(aRefObject); - cout << "Check reference : ReferencedObject is " << aRefObject.GetID() << endl; - cout << "Check : Remove object: " << endl; + std::cout << "Check reference : ReferencedObject is " << aRefObject.GetID() << std::endl; + std::cout << "Check : Remove object: " << std::endl; aBuilder->RemoveObject(aSubSO); - cout << "Remove: done" << endl; + std::cout << "Remove: done" << std::endl; - cout << "Try invalid attribute creation" << endl; + std::cout << "Try invalid attribute creation" << std::endl; aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "invalid type"); - cout << "Address of created attribute : " << aTDFAttr << endl; + std::cout << "Address of created attribute : " << aTDFAttr << std::endl; - cout << "Check AttributeUserID" << endl; + std::cout << "Check AttributeUserID" << std::endl; aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "AttributeUserID"); if(aTDFAttr) { - cout << "Attribute UserID was created succesfully : id = " << dynamic_cast(aTDFAttr)->Value() << endl; + std::cout << "Attribute UserID was created succesfully : id = " << dynamic_cast(aTDFAttr)->Value() << std::endl; } - else cout << "Can't create AttributeUserID" << endl; + else std::cout << "Can't create AttributeUserID" << std::endl; - string id = "0e1c36e6-379b-4d90-ab3b-17a14310e648"; + std::string id = "0e1c36e6-379b-4d90-ab3b-17a14310e648"; dynamic_cast(aTDFAttr)->SetValue(id); - cout << "SetValue id = " << dynamic_cast(aTDFAttr)->Value() << endl; + std::cout << "SetValue id = " << dynamic_cast(aTDFAttr)->Value() << std::endl; - string id2 = "0e1c36e6-379b-4d90-ab3b-18a14310e648"; + std::string id2 = "0e1c36e6-379b-4d90-ab3b-18a14310e648"; aTDFAttr = aBuilder->FindOrCreateAttribute(aSubSO, "AttributeUserID"+id2); if(aTDFAttr) { - cout << "Attribute UserID was created succesfully : id = " << dynamic_cast(aTDFAttr)->Value() << endl; + std::cout << "Attribute UserID was created succesfully : id = " << dynamic_cast(aTDFAttr)->Value() << std::endl; } - else cout << "Can't create AttributeUserID" << endl; + else std::cout << "Can't create AttributeUserID" << std::endl; - cout << "Check AttributeTreeNode " << endl; + std::cout << "Check AttributeTreeNode " << std::endl; aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeTreeNode"); - cout << dynamic_cast(aTDFAttr)->Type() << endl; - cout << "Check AttributeTreeNode : done " << endl; + std::cout << dynamic_cast(aTDFAttr)->Type() << std::endl; + std::cout << "Check AttributeTreeNode : done " << std::endl; aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeParameter"); - cout << dynamic_cast(aTDFAttr)->Type() << endl; + std::cout << dynamic_cast(aTDFAttr)->Type() << std::endl; - cout << "Check the attributes on SObject" << endl; - vector aSeq = aSO.GetAllAttributes(); + std::cout << "Check the attributes on SObject" << std::endl; + std::vector aSeq = aSO.GetAllAttributes(); for(int i = 0; i < aSeq.size(); i++) - cout << "Found: " << dynamic_cast(aSeq[i])->Type() << endl; + std::cout << "Found: " << dynamic_cast(aSeq[i])->Type() << std::endl; - cout << "Check UseCase" << endl; + std::cout << "Check UseCase" << std::endl; SALOMEDSImpl_UseCaseBuilder* ucb = aStudy->GetUseCaseBuilder(); ucb->AddUseCase("use_case1"); ucb->AddUseCase("use_case2"); SALOMEDSImpl_UseCaseIterator ucitr = ucb->GetUseCaseIterator(SALOMEDSImpl_SObject()); ucitr.Init(false); - cout << "More? : " << ucitr.More() << endl; + std::cout << "More? : " << ucitr.More() << std::endl; - cout << "Check AttributeParameter " << endl; + std::cout << "Check AttributeParameter " << std::endl; SALOMEDSImpl_AttributeParameter* AP = dynamic_cast(aTDFAttr); - cout << "AttributeParameter with type : " << AP->Type() << endl; + std::cout << "AttributeParameter with type : " << AP->Type() << std::endl; AP->SetInt("1", 123); - cout << "IsSet for int: " << AP->IsSet("1", PT_INTEGER) << " value : " << AP->GetInt("1") << endl; + std::cout << "IsSet for int: " << AP->IsSet("1", PT_INTEGER) << " value : " << AP->GetInt("1") << std::endl; //for(int i = 2; i < 5; i++) AP->SetInt(i, i*i); AP->SetReal("1", 123.123); - cout << "IsSet for real: " << AP->IsSet("1", PT_REAL) << " value : " << AP->GetReal("1") << endl; + std::cout << "IsSet for real: " << AP->IsSet("1", PT_REAL) << " value : " << AP->GetReal("1") << std::endl; //for(int i = 2; i < 5; i++) AP->SetReal(i, 0.1); AP->SetString("1", "value is 123.123!"); - cout << "IsSet for string: " << AP->IsSet("1", PT_STRING) << " value : " << AP->GetString("1") << endl; + std::cout << "IsSet for string: " << AP->IsSet("1", PT_STRING) << " value : " << AP->GetString("1") << std::endl; /* for(int i = 2; i < 5; i++) { - string s((double)(1.0/i)); - cout << "Setting for " << i << " value : " << s << endl; + std::string s((double)(1.0/i)); + std::cout << "Setting for " << i << " value : " << s << std::endl; AP->SetString(i, s); } */ AP->SetBool("1", true); - cout << "IsSet for bool: " << AP->IsSet("1", PT_BOOLEAN) << " value : " << AP->GetBool("1") << endl; + std::cout << "IsSet for bool: " << AP->IsSet("1", PT_BOOLEAN) << " value : " << AP->GetBool("1") << std::endl; //for(int i = 2; i < 5; i++) AP->SetBool(i, 0); - vector v; + std::vector v; v.push_back(111.111); v.push_back(222.22222); v.push_back(333.3333333); AP->SetRealArray("1", v); - cout << "IsSet for array: " << AP->IsSet("1", PT_REALARRAY); - vector v2 = AP->GetRealArray("1"); - cout.precision(10); - cout << " values : "; - for(int i = 0; iIsSet("1", PT_REALARRAY); + std::vector v2 = AP->GetRealArray("1"); + std::cout.precision(10); + std::cout << " values : "; + for(int i = 0; iSetRealArray("2", v); - vector vi; + std::vector vi; vi.push_back(1); vi.push_back(2); AP->SetIntArray("2", vi); - vector vs; + std::vector vs; vs.push_back("hello, "); vs.push_back("world!"); AP->SetStrArray("3", vs); - string as = AP->Save(); - cout << "AS = " << as << endl; + std::string as = AP->Save(); + std::cout << "AS = " << as << std::endl; AP->Load(as); - cout << "Restored string with id = 1 is: " << AP->GetString("1") << endl; - cout << "Restored int with id = 2 is: " << AP->GetInt("1") << endl; - cout << "Restored real with id = 3 is: " << AP->GetReal("1") << endl; - cout << "Restored bool with id = 1 is: " << AP->GetBool("1") << endl; + std::cout << "Restored string with id = 1 is: " << AP->GetString("1") << std::endl; + std::cout << "Restored int with id = 2 is: " << AP->GetInt("1") << std::endl; + std::cout << "Restored real with id = 3 is: " << AP->GetReal("1") << std::endl; + std::cout << "Restored bool with id = 1 is: " << AP->GetBool("1") << std::endl; v2 = AP->GetRealArray("2"); - cout << "Restored real array with id = 2 is: "; - for(int i = 0; iGetIntArray("2"); - cout << "Restored int array with id = 2 is: "; - for(int i = 0; iGetStrArray("3"); - cout << "Restored string array with id = 2 is: "; - for(int i = 0; iRemoveID("1", PT_INTEGER); - cout << "IsSet with id = 1, type = PT_INTEGER : " << AP->IsSet("1", PT_INTEGER) << endl; - cout << "Check RemoveID is done" << endl; + std::cout << "IsSet with id = 1, type = PT_INTEGER : " << AP->IsSet("1", PT_INTEGER) << std::endl; + std::cout << "Check RemoveID is done" << std::endl; - cout << "Check AttributeParameter : done" << endl; + std::cout << "Check AttributeParameter : done" << std::endl; SALOMEDSImpl_SComponent tst = aBuilder->NewComponent("TEST2"); @@ -237,13 +235,13 @@ int main (int argc, char * argv[]) SALOMEDSImpl_ChildIterator ci=aStudy->NewChildIterator(tst); for(ci.InitEx(true); ci.More(); ci.Next()) - cout << "######## " << ci.Value().GetID() << endl; + std::cout << "######## " << ci.Value().GetID() << std::endl; DF_ChildIterator dci(tst.GetLabel(), true); for(; dci.More(); dci.Next()) - cout << "###### DF: " << dci.Value().Entry() << endl; + std::cout << "###### DF: " << dci.Value().Entry() << std::endl; - cout << "Test finished " << endl; + std::cout << "Test finished " << std::endl; return 0; } diff --git a/src/SALOMELocalTrace/BaseTraceCollector.cxx b/src/SALOMELocalTrace/BaseTraceCollector.cxx index ec44a684c..e3610307e 100644 --- a/src/SALOMELocalTrace/BaseTraceCollector.cxx +++ b/src/SALOMELocalTrace/BaseTraceCollector.cxx @@ -32,8 +32,6 @@ #include "BaseTraceCollector.hxx" #include "LocalTraceBufferPool.hxx" -using namespace std; - // Class attributes initialisation, for class method BaseTraceCollector::run BaseTraceCollector* BaseTraceCollector::_singleton = 0; diff --git a/src/SALOMELocalTrace/FileTraceCollector.cxx b/src/SALOMELocalTrace/FileTraceCollector.cxx index 6255da956..4cba95aa9 100644 --- a/src/SALOMELocalTrace/FileTraceCollector.cxx +++ b/src/SALOMELocalTrace/FileTraceCollector.cxx @@ -29,8 +29,6 @@ #include #include -using namespace std; - //#define _DEVDEBUG_ #include "FileTraceCollector.hxx" @@ -100,13 +98,13 @@ void* FileTraceCollector::run(void *bid) // --- opens a file with append mode // so, several processes can share the same file - ofstream traceFile; + std::ofstream traceFile; const char *theFileName = _fileName.c_str(); DEVTRACE("try to open trace file "<< theFileName); - traceFile.open(theFileName, ios::out | ios::app); + traceFile.open(theFileName, std::ios::out | std::ios::app); if (!traceFile) { - cerr << "impossible to open trace file "<< theFileName << endl; + std::cerr << "impossible to open trace file "<< theFileName << std::endl; exit (1); } @@ -133,15 +131,15 @@ void* FileTraceCollector::run(void *bid) << " : " << myTrace.trace; #endif traceFile.close(); - cout << flush ; + std::cout << std::flush ; #ifndef WIN32 - cerr << "INTERRUPTION from thread " << myTrace.threadId + std::cerr << "INTERRUPTION from thread " << myTrace.threadId << " : " << myTrace.trace; #else - cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId) + std::cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId) << " : " << myTrace.trace; #endif - cerr << flush ; + std::cerr << std::flush ; exit(1); } else @@ -180,7 +178,7 @@ FileTraceCollector:: ~FileTraceCollector() if (_threadId) { int ret = pthread_join(*_threadId, NULL); - if (ret) cerr << "error close FileTraceCollector : "<< ret << endl; + if (ret) std::cerr << "error close FileTraceCollector : "<< ret << std::endl; else DEVTRACE("FileTraceCollector destruction OK"); delete _threadId; _threadId = 0; diff --git a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx index e5ca216d7..de38132c9 100644 --- a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx +++ b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx @@ -43,8 +43,6 @@ #include "FileTraceCollector.hxx" #include "utilities.h" -using namespace std; - // In case of truncated message, end of trace contains "...\n\0" #define TRUNCATED_MESSAGE "...\n" @@ -113,12 +111,12 @@ LocalTraceBufferPool* LocalTraceBufferPool::instance() { #ifndef WIN32 void* handle; - string impl_name = string ("lib") + traceKind - + string("TraceCollector.so"); + std::string impl_name = std::string ("lib") + traceKind + + std::string("TraceCollector.so"); handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ; #else HINSTANCE handle; - string impl_name = string ("lib") + traceKind + string(".dll"); + std::string impl_name = std::string ("lib") + traceKind + std::string(".dll"); handle = LoadLibrary( impl_name.c_str() ); #endif if ( handle ) @@ -133,9 +131,9 @@ LocalTraceBufferPool* LocalTraceBufferPool::instance() #endif if ( !TraceCollectorFactory ) { - cerr << "Can't resolve symbol: SingletonInstance" < #include -using namespace std; - #include "LocalTraceCollector.hxx" // ============================================================================ @@ -100,27 +98,27 @@ void* LocalTraceCollector::run(void *bid) myTraceBuffer->retrieve(myTrace); if (myTrace.traceType == ABORT_MESS) { - cout << flush ; + std::cout << std::flush ; #ifndef WIN32 - cerr << "INTERRUPTION from thread " << myTrace.threadId + std::cerr << "INTERRUPTION from thread " << myTrace.threadId << " : " << myTrace.trace; #else - cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId) + std::cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId) << " : " << myTrace.trace; #endif - cerr << flush ; + std::cerr << std::flush ; exit(1); } else { - cout << flush ; + std::cout << std::flush ; #ifndef WIN32 - cerr << "th. " << myTrace.threadId << " " << myTrace.trace; + std::cerr << "th. " << myTrace.threadId << " " << myTrace.trace; #else - cerr << "th. " << (void*)(&myTrace.threadId) + std::cerr << "th. " << (void*)(&myTrace.threadId) << " " << myTrace.trace; #endif - cerr << flush ; + std::cerr << std::flush ; } } pthread_exit(NULL); @@ -146,7 +144,7 @@ LocalTraceCollector:: ~LocalTraceCollector() if (_threadId) { int ret = pthread_join(*_threadId, NULL); - if (ret) cerr << "error close LocalTraceCollector : "<< ret << endl; + if (ret) std::cerr << "error close LocalTraceCollector : "<< ret << std::endl; else DEVTRACE("LocalTraceCollector destruction OK"); delete _threadId; _threadId = 0; diff --git a/src/SALOMELocalTrace/Test/SALOMELocalTraceTest.cxx b/src/SALOMELocalTrace/Test/SALOMELocalTraceTest.cxx index 73db24652..61d5709d7 100644 --- a/src/SALOMELocalTrace/Test/SALOMELocalTraceTest.cxx +++ b/src/SALOMELocalTrace/Test/SALOMELocalTraceTest.cxx @@ -28,8 +28,6 @@ #include "LocalTraceBufferPool.hxx" #include "utilities.h" -using namespace std; - // ============================================================================ /*! @@ -67,12 +65,12 @@ SALOMELocalTraceTest::testSingletonBufferPool() // --- trace on file const char *theFileName = TRACEFILE; - string s = "file:"; + std::string s = "file:"; s += theFileName; CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite - ofstream traceFile; - traceFile.open(theFileName, ios::out | ios::app); + std::ofstream traceFile; + traceFile.open(theFileName, std::ios::out | std::ios::app); CPPUNIT_ASSERT(traceFile); // file created empty, then closed traceFile.close(); @@ -98,7 +96,7 @@ void *PrintHello(void *threadid); void SALOMELocalTraceTest::testLoadBufferPoolLocal() { - string s = "local"; + std::string s = "local"; CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite // --- numThread thread creation for trace generation. @@ -137,13 +135,13 @@ SALOMELocalTraceTest::testLoadBufferPoolFile() { const char *theFileName = TRACEFILE; - string s = "file:"; + std::string s = "file:"; s += theFileName; //s = "local"; CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite - ofstream traceFile; - traceFile.open(theFileName, ios::out | ios::trunc); + std::ofstream traceFile; + traceFile.open(theFileName, std::ios::out | std::ios::trunc); CPPUNIT_ASSERT(traceFile); // file created empty, then closed traceFile.close(); diff --git a/src/SALOMELocalTrace/utilities.h b/src/SALOMELocalTrace/utilities.h index 3a7691ead..ba6dcb5a9 100644 --- a/src/SALOMELocalTrace/utilities.h +++ b/src/SALOMELocalTrace/utilities.h @@ -67,12 +67,12 @@ #ifdef WIN32 #define IMMEDIATE_ABORT(code) {std::cout < @@ -108,8 +106,8 @@ void* SALOMETraceCollector::run(void *bid) m_pInterfaceLogger = SALOME_Logger::Logger::_narrow(obj); if (CORBA::is_nil(m_pInterfaceLogger)) { - cerr << "Logger server not found ! Abort" << endl; - cerr << flush ; + std::cerr << "Logger server not found ! Abort" << std::endl; + std::cerr << std::flush ; exit(1); } else @@ -136,7 +134,7 @@ void* SALOMETraceCollector::run(void *bid) { if (myTrace.traceType == ABORT_MESS) { - stringstream abortMessage(""); + std::stringstream abortMessage(""); #ifndef WIN32 abortMessage << "INTERRUPTION from thread " << myTrace.threadId << " : " << myTrace.trace; @@ -152,7 +150,7 @@ void* SALOMETraceCollector::run(void *bid) } else { - stringstream aMessage(""); + std::stringstream aMessage(""); #ifndef WIN32 aMessage << "th. " << myTrace.threadId #else @@ -188,7 +186,7 @@ SALOMETraceCollector:: ~SALOMETraceCollector() if (_threadId) { int ret = pthread_join(*_threadId, NULL); - if (ret) cerr << "error close SALOMETraceCollector : "<< ret << endl; + if (ret) std::cerr << "error close SALOMETraceCollector : "<< ret << std::endl; else DEVTRACE("SALOMETraceCollector destruction OK"); delete _threadId; _threadId = 0; diff --git a/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx b/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx index 5deb13cf0..c99c14c5d 100644 --- a/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx +++ b/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx @@ -28,7 +28,6 @@ #include "LocalTraceBufferPool.hxx" #include "utilities.h" -using namespace std; // ============================================================================ /*! @@ -65,7 +64,7 @@ void *PrintHello(void *threadid); void SALOMETraceCollectorTest::testLoadBufferPoolCORBA() { - string s = "with_logger"; + std::string s = "with_logger"; CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite // --- NUM_THREADS thread creation for trace generation. diff --git a/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.cxx b/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.cxx index dacb81248..823e1df67 100644 --- a/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.cxx +++ b/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.cxx @@ -32,8 +32,6 @@ #include #endif -using namespace std; - // ============================================================================ /*! * Wait until a server is registered in naming service. @@ -48,7 +46,7 @@ using namespace std; // ============================================================================ CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb, - string serverName) + std::string serverName) { long TIMESleep = 500000000; int NumberOfTries = 40; @@ -85,14 +83,14 @@ CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb, } catch( CORBA::SystemException& ) { - cout << "TraceCollector_WaitForServerReadiness: " + std::cout << "TraceCollector_WaitForServerReadiness: " << "CORBA::SystemException: " - << "Unable to contact the Naming Service" << endl; + << "Unable to contact the Naming Service" << std::endl; } catch(...) { - cout << "TraceCollector_WaitForServerReadiness: " - << "Unknown exception dealing with Naming Service" << endl; + std::cout << "TraceCollector_WaitForServerReadiness: " + << "Unknown exception dealing with Naming Service" << std::endl; } obj=CORBA::Object::_nil(); @@ -110,7 +108,7 @@ CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb, } catch (const CosNaming::NamingContext::NotFound&) { - cout << "Caught exception: Naming Service can't found Logger"; + std::cout << "Caught exception: Naming Service can't found Logger"; } } #ifndef WIN32 @@ -118,29 +116,29 @@ CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb, #else Sleep(TIMESleep / 1000000); #endif - cout << "TraceCollector_WaitForServerReadiness: retry look for" - << serverName << endl; + std::cout << "TraceCollector_WaitForServerReadiness: retry look for" + << serverName << std::endl; } } catch (const CosNaming::NamingContext::NotFound&) { - cout << "Caught exception: Naming Service can't found Logger"; + std::cout << "Caught exception: Naming Service can't found Logger"; } catch (CORBA::COMM_FAILURE&) { - cout << "Caught CORBA::SystemException CommFailure."; + std::cout << "Caught CORBA::SystemException CommFailure."; } catch (CORBA::SystemException&) { - cout << "Caught CORBA::SystemException."; + std::cout << "Caught CORBA::SystemException."; } catch (CORBA::Exception&) { - cout << "Caught CORBA::Exception."; + std::cout << "Caught CORBA::Exception."; } catch (...) { - cout << "Caught unknown exception."; + std::cout << "Caught unknown exception."; } return obj._retn(); } diff --git a/src/TOOLSDS/SALOMEDS_Tool.cxx b/src/TOOLSDS/SALOMEDS_Tool.cxx index 5b234d22b..a366e3307 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.cxx +++ b/src/TOOLSDS/SALOMEDS_Tool.cxx @@ -48,9 +48,7 @@ #include #include CORBA_SERVER_HEADER(SALOMEDS_Attributes) -using namespace std; - -bool Exists(const string thePath) +bool Exists(const std::string thePath) { #ifdef WIN32 if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) { @@ -136,11 +134,11 @@ void SALOMEDS_Tool::RemoveTemporaryFiles(const std::string& theDirectory, const SALOMEDS::ListOfFileNames& theFiles, const bool IsDirDeleted) { - string aDirName = theDirectory; + std::string aDirName = theDirectory; int i, aLength = theFiles.length(); for(i=1; i<=aLength; i++) { - string aFile(aDirName); + std::string aFile(aDirName); aFile += theFiles[i-1]; if(!Exists(aFile)) continue; @@ -180,7 +178,7 @@ namespace return (new SALOMEDS::TMPFile); //Get a temporary directory for saved a file - string aTmpDir = theFromDirectory; + std::string aTmpDir = theFromDirectory; long aBufferSize = 0; long aCurrentPos; @@ -196,14 +194,14 @@ namespace //Check if the file exists if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero - string aFullPath = aTmpDir + const_cast(theFiles[i].in()); + std::string aFullPath = aTmpDir + const_cast(theFiles[i].in()); if(!Exists(aFullPath)) continue; #ifdef WIN32 - ifstream aFile(aFullPath.c_str(), ios::binary); + std::ifstream aFile(aFullPath.c_str(), std::ios::binary); #else - ifstream aFile(aFullPath.c_str()); + std::ifstream aFile(aFullPath.c_str()); #endif - aFile.seekg(0, ios::end); + aFile.seekg(0, std::ios::end); aFileSize[i] = aFile.tellg(); aBufferSize += aFileSize[i]; //Add a space to store the file } @@ -228,14 +226,14 @@ namespace aCurrentPos = 4; for(i=0; i(theFiles[i].in()); + std::string aFullPath = aTmpDir + const_cast(theFiles[i].in()); if(!Exists(aFullPath)) continue; #ifdef WIN32 - aFile = new ifstream(aFullPath.c_str(), ios::binary); + aFile = new std::ifstream(aFullPath.c_str(), std::ios::binary); #else - aFile = new ifstream(aFullPath.c_str()); + aFile = new std::ifstream(aFullPath.c_str()); #endif } //Initialize 4 bytes of the buffer by 0 @@ -255,7 +253,7 @@ namespace memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long))); aCurrentPos += 8; - aFile->seekg(0, ios::beg); + aFile->seekg(0, std::ios::beg); aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]); aFile->close(); delete(aFile); @@ -307,7 +305,7 @@ SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream, return aFiles; //Get a temporary directory for saving a file - string aTmpDir = theToDirectory; + std::string aTmpDir = theToDirectory; unsigned char *aBuffer = (unsigned char*)theStream.NP_data(); @@ -338,11 +336,11 @@ SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream, memcpy(&aFileSize, (aBuffer + aCurrentPos), ((sizeof(long) > 8) ? 8 : sizeof(long))); aCurrentPos += 8; - string aFullPath = aTmpDir + aFileName; + std::string aFullPath = aTmpDir + aFileName; #ifdef WIN32 - ofstream aFile(aFullPath.c_str(), ios::binary); + std::ofstream aFile(aFullPath.c_str(), std::ios::binary); #else - ofstream aFile(aFullPath.c_str()); + std::ofstream aFile(aFullPath.c_str()); #endif aFile.write((char *)(aBuffer+aCurrentPos), aFileSize); aFile.close(); @@ -361,7 +359,7 @@ SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream, //============================================================================ std::string SALOMEDS_Tool::GetNameFromPath(const std::string& thePath) { if (thePath.empty()) return ""; - string aPath = thePath; + std::string aPath = thePath; bool isFound = false; int pos = aPath.rfind('/'); if(pos > 0) { @@ -394,7 +392,7 @@ std::string SALOMEDS_Tool::GetDirFromPath(const std::string& thePath) { if (thePath.empty()) return ""; int pos = thePath.rfind('/'); - string path; + std::string path; if(pos > 0) { path = thePath.substr(0, pos+1); } diff --git a/src/TestContainer/SALOME_TestComponent_i.cxx b/src/TestContainer/SALOME_TestComponent_i.cxx index 3ffd39037..305325262 100644 --- a/src/TestContainer/SALOME_TestComponent_i.cxx +++ b/src/TestContainer/SALOME_TestComponent_i.cxx @@ -33,7 +33,6 @@ #include #include #include -using namespace std; Engines_TestComponent_i::Engines_TestComponent_i(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, @@ -73,7 +72,7 @@ char* Engines_TestComponent_i::Coucou(CORBA::Long L) void Engines_TestComponent_i::Setenv() { // bool overwrite = true; - map::iterator it; + std::map::iterator it; MESSAGE("set environment associated with keys in map _fieldsDict"); for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++) { diff --git a/src/TestMPIContainer/TestMPIComponentEngine.cxx b/src/TestMPIContainer/TestMPIComponentEngine.cxx index 7a154b75f..cee083246 100644 --- a/src/TestMPIContainer/TestMPIComponentEngine.cxx +++ b/src/TestMPIContainer/TestMPIComponentEngine.cxx @@ -30,7 +30,6 @@ #include #include "utilities.h" #include "TestMPIComponentEngine.hxx" -using namespace std; TestMPIComponentEngine::TestMPIComponentEngine(int nbproc, int numproc, CORBA::ORB_ptr orb, diff --git a/src/TestMPIContainer/TestMPIContainer.cxx b/src/TestMPIContainer/TestMPIContainer.cxx index c6c5a2f95..09131abac 100644 --- a/src/TestMPIContainer/TestMPIContainer.cxx +++ b/src/TestMPIContainer/TestMPIContainer.cxx @@ -19,7 +19,6 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// using namespace std; //============================================================================= // File : TestMPIContainer.cxx // Created : mer jui 4 13:11:27 CEST 2003 @@ -41,7 +40,6 @@ # include "Utils_SINGLETON.hxx" #include "SALOME_NamingService.hxx" #include "OpUtil.hxx" -using namespace std; int main (int argc, char * argv[]) { @@ -57,7 +55,7 @@ int main (int argc, char * argv[]) int status; if( argc != 3 || strcmp(argv[1],"-np") ){ - cout << "Usage: TestMPIContainer -np nbproc" << endl; + std::cout << "Usage: TestMPIContainer -np nbproc" << std::endl; exit(0); } @@ -67,11 +65,11 @@ int main (int argc, char * argv[]) // Use Name Service to find container SALOME_NamingService NS(orb) ; - string containerName = "/Containers/" ; - string hostName = Kernel_Utils::GetHostname(); + std::string containerName = "/Containers/" ; + std::string hostName = Kernel_Utils::GetHostname(); containerName += hostName + "/MPIFactoryServer_" + argv[2]; - string dirn(getenv("KERNEL_ROOT_DIR")); + std::string dirn(getenv("KERNEL_ROOT_DIR")); dirn += "/lib/salome/libSalomeTestMPIComponentEngine.so"; // Try to resolve MPI Container @@ -81,7 +79,7 @@ int main (int argc, char * argv[]) if(CORBA::is_nil(iGenFact)){ // Launch MPI Container - string cmd("mpirun -np "); + std::string cmd("mpirun -np "); cmd += argv[2]; cmd += " "; cmd += getenv("KERNEL_ROOT_DIR"); diff --git a/src/Utils/OpUtil.cxx b/src/Utils/OpUtil.cxx index b15053090..7c39258e1 100644 --- a/src/Utils/OpUtil.cxx +++ b/src/Utils/OpUtil.cxx @@ -33,7 +33,7 @@ #else #include #endif -using namespace std; + //int gethostname(char *name, size_t len); std::string GetHostname() @@ -70,7 +70,7 @@ std::string GetHostname() char *aDot = (strchr(s,'.')); if (aDot) aDot[0] = '\0'; - string p = s; + std::string p = s; delete [] s; return p; } diff --git a/src/Utils/Test/UtilsTest.cxx b/src/Utils/Test/UtilsTest.cxx index 0ee9fb081..dd34d2f13 100644 --- a/src/Utils/Test/UtilsTest.cxx +++ b/src/Utils/Test/UtilsTest.cxx @@ -28,7 +28,6 @@ #include "Utils_SALOME_Exception.hxx" #include "utilities.h" -using namespace std; #define TRACEFILE "/tmp/traceUnitTest.log" @@ -50,12 +49,12 @@ UtilsTest::setUp() // --- trace on file const char *theFileName = TRACEFILE; - string s = "file:"; + std::string s = "file:"; s += theFileName; CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite - ofstream traceFile; - traceFile.open(theFileName, ios::out | ios::app); + std::ofstream traceFile; + traceFile.open(theFileName, std::ios::out | std::ios::app); CPPUNIT_ASSERT(traceFile); // file created empty, then closed traceFile.close(); @@ -110,8 +109,8 @@ UtilsTest::testSALOME_ExceptionMessage() } catch (const SALOME_Exception &ex) { - string expectedMessage = EXAMPLE_EXCEPTION_MESSAGE; - string actualMessage = ex.what(); - CPPUNIT_ASSERT(actualMessage.find(expectedMessage) != string::npos); + std::string expectedMessage = EXAMPLE_EXCEPTION_MESSAGE; + std::string actualMessage = ex.what(); + CPPUNIT_ASSERT(actualMessage.find(expectedMessage) != std::string::npos); } } diff --git a/src/Utils/Utils_CommException.cxx b/src/Utils/Utils_CommException.cxx index 0b1cb28f8..580f09c46 100644 --- a/src/Utils/Utils_CommException.cxx +++ b/src/Utils/Utils_CommException.cxx @@ -26,7 +26,6 @@ // $Header$ // # include "Utils_CommException.hxx" -using namespace std; CommException::CommException( void ): SALOME_Exception( "CommException" ) { diff --git a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx index 0db4277a5..03a768ebc 100644 --- a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx +++ b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx @@ -43,8 +43,6 @@ void Nettoyage(); // static int MYDEBUG = 0; #endif -using namespace std; - std::list *DESTRUCTEUR_GENERIQUE_::Destructeurs=0 ; /*! \class ATEXIT_ diff --git a/src/Utils/Utils_ExceptHandlers.cxx b/src/Utils/Utils_ExceptHandlers.cxx index cac47ee15..62c2b7501 100644 --- a/src/Utils/Utils_ExceptHandlers.cxx +++ b/src/Utils/Utils_ExceptHandlers.cxx @@ -31,8 +31,6 @@ #include #include CORBA_SERVER_HEADER(SALOME_Exception) -using namespace std; - void SalomeException () { throw SALOME_Exception("Salome Exception"); diff --git a/src/Utils/duplicate.cxx b/src/Utils/duplicate.cxx index e8f8581d5..0772a44b0 100644 --- a/src/Utils/duplicate.cxx +++ b/src/Utils/duplicate.cxx @@ -38,8 +38,6 @@ extern "C" #include "utilities.h" #include "OpUtil.hxx" -using namespace std; - const char* duplicate( const char *const str ) { ASSERT(str!=NULL) ;