#include "BasicsGenericDestructor.hxx"
-using namespace std;
-
void HouseKeeping();
std::list<PROTECTED_DELETE*> PROTECTED_DELETE::_objList;
# include <time.h>
#endif
-using namespace std;
-
#ifdef WIN32
# define _separator_ '\\'
#else
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 )
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
{
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
}
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++) {
// function : GetTempDir
// purpose : Returns a temp directory to store created files like "/tmp/sub_dir/"
//============================================================================
- string GetTmpDir()
+ std::string GetTmpDir()
{
return GetTmpDirByPath( "" );
}
// 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++) {
// 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 ) {
// 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++ )
}
- 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: )
// 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;
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);
#include <winsock2.h>
#endif
-using namespace std;
-
namespace Kernel_Utils
{
- string GetHostname()
+ std::string GetHostname()
{
int ls = 100, r = 1;
char *s;
char *aDot = (strchr(s,'.'));
if (aDot) aDot[0] = '\0';
- string p = s;
+ std::string p = s;
delete [] s;
return p;
}
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "MultiCommException.hxx"
-using namespace std;
MultiCommException::MultiCommException(const char *message)
{
//
#include "Receiver.hxx"
#include <string.h>
-using namespace std;
/*!
return a deep copy of the array contained in the servant.
#endif
#include "ReceiverFactory.hxx"
#include "Receivers.hxx"
-using namespace std;
#ifdef COMP_CORBA_DOUBLE
#define CorbaDNoCopyReceiver CorbaNCNoCopyReceiver
//
#include "omniORB4/poa.h"
#include "utilities.h"
-using namespace std;
#define TAILLE_SPLIT 100000
#define TIMEOUT 20
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
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
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
#include "utilities.h"
#include "SenderFactory.hxx"
-using namespace std;
#ifndef WIN32
CORBA::ORB_var &getGlobalORB(){
#include "SenderFactory.hxx"
#include "utilities.h"
#include "SALOMEMultiComm.hxx"
-using namespace std;
#ifdef COMP_CORBA_DOUBLE
#define SALOME_CorbaDoubleSender SALOME_CorbaDoubleNCSender_i
#include <process.h>
#endif
-
-using namespace std;
-
extern bool _Sleeping ;
static Engines_Component_i * theEngines_Component ;
{
Engines::FieldsDict_var copie = new Engines::FieldsDict;
copie->length(_fieldsDict.size());
- map<std::string,CORBA::Any>::iterator it;
+ std::map<std::string,CORBA::Any>::iterator it;
CORBA::ULong i = 0;
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++, i++)
{
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
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 ;
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
}
// --- all strings given with setProperties are set in environment
- map<std::string,CORBA::Any>::iterator it;
+ std::map<std::string,CORBA::Any>::iterator it;
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++)
{
std::string cle((*it).first);
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 <<endl);
+ << std::endl << " Component instance : " << _instanceName << " StartUsed "
+ << _StartUsed << " _ThreadCpuUsed "<< _ThreadCpuUsed << std::endl <<std::endl);
_ThreadId = 0 ;
}
cpu = usage.ru_utime.tv_sec*1000 +usage.ru_utime.tv_usec/1000;
cpu = cpu+ usage.ru_stime.tv_sec*1000 +usage.ru_stime.tv_usec/1000;
cpu=cpu-_StartUsed ;
- // cout << pthread_self() << " Engines_Component_i::CpuUsed " << " "
+ // std::cout << pthread_self() << " Engines_Component_i::CpuUsed " << " "
// << _serviceName << usage.ru_utime.tv_sec << " - " << _StartUsed
- // << " = " << cpu << endl ;
+ // << " = " << cpu << std::endl ;
}
else
{
- // cout << pthread_self() << "Engines_Component_i::CpuUsed _ThreadId "
+ // std::cout << pthread_self() << "Engines_Component_i::CpuUsed _ThreadId "
// << _ThreadId << " " << _serviceName<< " _StartUsed "
- // << _StartUsed << endl ;
+ // << _StartUsed << std::endl ;
}
-#else
+#else
// NOT implementet yet
#endif
*/
//=============================================================================
-string Engines_Component_i::GetDynLibraryName(const char *componentName)
+std::string Engines_Component_i::GetDynLibraryName(const char *componentName)
{
- string ret="lib";
+ std::string ret="lib";
ret+=componentName;
ret+="Engine.so";
return ret;
CORBA::String_var containerName=_container->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;
#include <Python.h>
#include "Container_init_python.hxx"
-using namespace std;
-
bool _Sleeping = false ;
// // Needed by multi-threaded Python --- Supervision
#define SLASH '/'
#endif
-map<std::string, int> Engines_Container_i::_cntInstances_map;
-map<std::string, void *> Engines_Container_i::_library_map;
-map<std::string, void *> Engines_Container_i::_toRemove_map;
+std::map<std::string, int> Engines_Container_i::_cntInstances_map;
+std::map<std::string, void *> Engines_Container_i::_library_map;
+std::map<std::string, void *> Engines_Container_i::_toRemove_map;
omni_mutex Engines_Container_i::_numInstanceMutex ;
static PyObject* _pyCont;
_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 " <<
// 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";
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()) ;
}
retso="Component ";
retso+=componentName;
retso+=": Can't find C++ implementation ";
- retso+=string(LIB) + componentName + ENGINESO;
+ retso+=std::string(LIB) + componentName + ENGINESO;
//=================================================================
// --- Python implementation section
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
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
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
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());
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,
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);
{
// --- 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,
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
CORBA::Long studyId)
{
Engines::Component_var anEngine = Engines::Component::_nil();
- map<string,Engines::Component_var>::iterator itm =_listInstances_map.begin();
+ std::map<std::string,Engines::Component_var>::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)
{
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);
MESSAGE("finalize unload : dlclose");
_numInstanceMutex.lock(); // lock to be alone
// (see decInstanceCnt, load_component_Library)
- map<string, void *>::iterator ith;
+ std::map<std::string, void *>::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);
{
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
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];
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);
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");
// --- 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;
// 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 )
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 )
{
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] != '/')
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();
* 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;
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;
#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;
#include "Container_init_python.hxx"
-using namespace std;
-
extern "C" void HandleServerSideSignals(CORBA::ORB_ptr theORB);
#include <stdexcept>
if(getenv ("DEBUGGER"))
{
setsig(SIGSEGV,&Handler);
- set_terminate(&terminateHandler);
- set_unexpected(&unexpectedHandler);
+ std::set_terminate(&terminateHandler);
+ std::set_unexpected(&unexpectedHandler);
}
#endif
// 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
#define TIME_OUT_TO_LAUNCH_CONT 61
-using namespace std;
-
const char *SALOME_ContainerManager::_ContainerManagerNameInNS =
"/ContainerManager";
#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());
bool isOK;
isOK = _NS->Change_Directory("/Containers");
if( isOK ){
- vector<string> vec = _NS->list_directory_recurs();
- list<string> lstCont;
- for(vector<string>::iterator iter = vec.begin();iter!=vec.end();iter++)
+ std::vector<std::string> vec = _NS->list_directory_recurs();
+ std::list<std::string> lstCont;
+ for(std::vector<std::string>::iterator iter = vec.begin();iter!=vec.end();iter++)
{
SCRUTE((*iter));
CORBA::Object_var obj=_NS->Resolve((*iter).c_str());
}
}
MESSAGE("Container list: ");
- for(list<string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++){
+ for(std::list<std::string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++){
SCRUTE((*iter));
}
- for(list<string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++)
+ for(std::list<std::string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++)
{
try
{
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
try
{
if(!cont->_non_existent())
- local_resources.push_back(string(possibleResources[i]));
+ local_resources.push_back(std::string(possibleResources[i]));
}
catch(CORBA::Exception&) {}
}
}
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;
//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)
{
*/
//=============================================================================
-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
* 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)
{
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
{
// 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
o << " -";
AddOmninamesParams(o);
- ofstream command_file( _TmpFileName.c_str() );
+ std::ofstream command_file( _TmpFileName.c_str() );
command_file << o.str();
command_file.close();
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 );
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
*/
//=============================================================================
-void SALOME_ContainerManager::AddOmninamesParams(string& command) const
+void SALOME_ContainerManager::AddOmninamesParams(std::string& command) const
{
CORBA::String_var iorstr = _NS->getIORaddr();
command += "ORBInitRef NameService=";
*/
//=============================================================================
-void SALOME_ContainerManager::AddOmninamesParams(ofstream& fileStream) const
+void SALOME_ContainerManager::AddOmninamesParams(std::ofstream& fileStream) const
{
CORBA::String_var iorstr = _NS->getIORaddr();
fileStream << "ORBInitRef NameService=";
*/
//=============================================================================
-void SALOME_ContainerManager::AddOmninamesParams(ostringstream& oss) const
+void SALOME_ContainerManager::AddOmninamesParams(std::ostringstream& oss) const
{
CORBA::String_var iorstr = _NS->getIORaddr();
oss << "ORBInitRef NameService=";
*/
//=============================================================================
-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
*/
//=============================================================================
-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
tempOutputFile << _NS->ContainerName(params) << " -";
AddOmninamesParams(tempOutputFile);
- tempOutputFile << " &" << endl;
+ tempOutputFile << " &" << std::endl;
tempOutputFile.flush();
tempOutputFile.close();
#ifndef WIN32
// --- 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;
else if (resInfo.Protocol == ssh)
{
command = "ssh ";
- string commandRcp = "scp ";
+ std::string commandRcp = "scp ";
commandRcp += _TmpFileName;
commandRcp += " ";
commandRcp += resInfo.HostName;
}
-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 )
{
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;
}
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();
for(int i=0;i<nbproc;i++)
if( fpi >> tmp )
- fpo << tmp << endl;
+ fpo << tmp << std::endl;
else
throw SALOME_Exception("You ask more processes than batch session have allocated!");
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);
// 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
#include "Basics_Utils.hxx"
#include <string>
-using namespace std;
-
//=============================================================================
/*!
* Default constructor, not for use
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] != '/')
{
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 "
#include "HDFascii.hxx"
#include <stdlib.h>
-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;
}
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);
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");
}
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);
// 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;
}
#include "DF_definitions.hxx"
#include "DF_Application.hxx"
-using namespace std;
-
//Constructor
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;
}
//Returns a list of IDs of all currently opened documents
-vector<int> DF_Application::GetDocumentIDs()
+std::vector<int> DF_Application::GetDocumentIDs()
{
- vector<int> ids;
- typedef map<int, DF_Document*>::const_iterator DI;
+ std::vector<int> ids;
+ typedef std::map<int, DF_Document*>::const_iterator DI;
for(DI p = _documents.begin(); p!=_documents.end(); p++)
ids.push_back(p->first);
return ids;
//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;
//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
}
#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
//Remove an attribute from a map of the node's attributes to
//avoid double deletion on the node destruction
if(_node) {
- map<string, DF_Attribute*>::iterator mi;
+ std::map<std::string, DF_Attribute*>::iterator mi;
for(mi =_node->_attributes.begin(); mi != _node->_attributes.end(); mi++) {
if(mi->second == this) {
_node->_attributes.erase(mi);
}
//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);
//
#include "DF_ChildIterator.hxx"
-using namespace std;
-
-
//Constructor
DF_ChildIterator::DF_ChildIterator(const DF_Label& theLabel, bool allLevels)
:_root(NULL), _current(NULL)
#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;
}
}
//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;
}
//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;
}
//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();
}
DF_Container* attr = dynamic_cast<DF_Container*>(theAttribute);
if(!attr) return;
- typedef map<string, int>::const_iterator SI;
+ typedef std::map<std::string, int>::const_iterator SI;
for(SI p = attr->_ints.begin(); p != attr->_ints.end(); p++)
_ints[p->first] = p->second;
- typedef map<string, double>::const_iterator SD;
+ typedef std::map<std::string, double>::const_iterator SD;
for(SD p = attr->_doubles.begin(); p != attr->_doubles.end(); p++)
_doubles[p->first] = p->second;
- typedef map<string, string>::const_iterator SS;
+ typedef std::map<std::string, std::string>::const_iterator SS;
for(SS p = attr->_strings.begin(); p != attr->_strings.end(); p++)
_strings[p->first] = p->second;
- typedef map<string, bool>::const_iterator SB;
+ typedef std::map<std::string, bool>::const_iterator SB;
for(SB p = attr->_bools.begin(); p != attr->_bools.end(); p++)
_bools[p->first] = p->second;
}
attr->Clear();
- typedef map<string, int>::const_iterator SI;
+ typedef std::map<std::string, int>::const_iterator SI;
for(SI p = _ints.begin(); p != _ints.end(); p++)
attr->_ints[p->first] = p->second;
- typedef map<string, double>::const_iterator SD;
+ typedef std::map<std::string, double>::const_iterator SD;
for(SD p = _doubles.begin(); p != _doubles.end(); p++)
attr->_doubles[p->first] = p->second;
- typedef map<string, string>::const_iterator SS;
+ typedef std::map<std::string, std::string>::const_iterator SS;
for(SS p = _strings.begin(); p != _strings.end(); p++)
attr->_strings[p->first] = p->second;
- typedef map<string, bool>::const_iterator SB;
+ typedef std::map<std::string, bool>::const_iterator SB;
for(SB p = _bools.begin(); p != _bools.end(); p++)
attr-> _bools[p->first] = p->second;
}
-
#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;
}
//Returns a type of the Document
-string DF_Document::GetDocumentType()
+std::string DF_Document::GetDocumentType()
{
return _type;
}
{
if(_root.IsNull()) return;
- vector<DF_LabelNode*> vn;
+ std::vector<DF_LabelNode*> vn;
DF_ChildIterator CI(_root, true);
for(; CI.More(); CI.Next()) {
DF_LabelNode* node = CI.Value()._node;
}
//Converts a content of the Document into the std::string
-string DF_Document::Save()
+std::string DF_Document::Save()
{
//Not implemented
return "";
#include <algorithm>
-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
// |
// |_ 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();
char* cc = (char*)theEntry.c_str();
int n = 0;
- vector<int> tags;
+ std::vector<int> tags;
while (*cc != '\0') {
while ( *cc >= '0' && *cc <= '9') {
{
if(!_node) return false;
- vector<DF_Attribute*> va = GetAttributes();
+ std::vector<DF_Attribute*> va = GetAttributes();
_node->_attributes.clear();
for(int i = 0, len = va.size(); i<len; i++) {
}
//Returns a list of Attributes of this Label.
-vector<DF_Attribute*> DF_Label::GetAttributes() const
+std::vector<DF_Attribute*> DF_Label::GetAttributes() const
{
- vector<DF_Attribute*> attributes;
+ std::vector<DF_Attribute*> attributes;
if(!_node) return attributes;
- typedef map<string, DF_Attribute*>::const_iterator AI;
- vector<string> sorted;
+ typedef std::map<std::string, DF_Attribute*>::const_iterator AI;
+ std::vector<std::string> sorted;
for(AI p = _node->_attributes.begin(); p!=_node->_attributes.end(); p++)
sorted.push_back(p->first);
}
//Returns a string entry of this Label
-string DF_Label::Entry() const
+std::string DF_Label::Entry() const
{
- string entry = "";
- vector<int> vi;
+ std::string entry = "";
+ std::vector<int> vi;
DF_LabelNode* father = this->_node;
while(father) {
vi.push_back(father->_tag);
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 += ":";
}
}
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;
}
}
DF_LabelNode::~DF_LabelNode()
{
- vector<DF_Attribute*> va;
- typedef map<string, DF_Attribute*>::const_iterator AI;
+ std::vector<DF_Attribute*> va;
+ typedef std::map<std::string, DF_Attribute*>::const_iterator AI;
for(AI p = _attributes.begin(); p!=_attributes.end(); p++)
va.push_back(p->second);
_depth = 0;
_tag = 0;
- vector<DF_Attribute*> va;
- typedef map<string, DF_Attribute*>::const_iterator AI;
+ std::vector<DF_Attribute*> va;
+ typedef std::map<std::string, DF_Attribute*>::const_iterator AI;
for(AI p = _attributes.begin(); p!=_attributes.end(); p++)
va.push_back(p->second);
#include <lmcons.h>
#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)
#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('\\');
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);
}
}
-bool Exists(const string thePath)
+bool Exists(const std::string thePath)
{
#ifdef WIN32
if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) {
}
-string divideString(const string& theValue, int nbChars)
+std::string divideString(const std::string& theValue, int nbChars)
{
return theValue.substr(nbChars, theValue.size());
}
-vector<string> splitString(const string& theValue, char separator)
+std::vector<std::string> splitString(const std::string& theValue, char separator)
{
- vector<string> vs;
+ std::vector<std::string> vs;
if(theValue[0] == separator && theValue.size() == 1) return vs;
int pos = theValue.find(separator);
if(pos < 0) {
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));
int main (int argc, char * argv[])
{
- cout << "Test started " << endl;
+ std::cout << "Test started " << std::endl;
DF_Application* appli = new DF_Application;
/*
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<DF_Container*>(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;
}
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
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<string> vs = splitString("/dn20/salome/srn/salome2/", '/');
+ std::vector<std::string> vs = splitString("/dn20/salome/srn/salome2/", '/');
for(int i = 0; i<vs.size(); i++)
- cout << vs[i] << endl;
+ std::cout << vs[i] << std::endl;
- cout << "Diveded str = " << divideString("abcdefg",3) << endl;
+ std::cout << "Diveded str = " << divideString("abcdefg",3) << std::endl;
//mkdir("/dn20/salome/srn/salome2", 0x1ff);
int month=0,day=0,year=0,hh=0,mn=0,ss=0;
GetSystemDate(year, month, day, hh, mn, ss);
- cout << "Date: " << year << " " << month << " " << day << " " << hh << " " << mn << " " << ss << endl;
+ std::cout << "Date: " << year << " " << month << " " << day << " " << hh << " " << mn << " " << ss << std::endl;
- string t("absd");
+ std::string t("absd");
t.insert(t.begin(), 'b');
cout << "Result = " << t << endl;
char* cstr = (char*)t.c_str();
DF_ChildIterator CI2(so5, true);
so5.dump();
for(; CI2.More(); CI2.Next()) {
- cout << " ###### Found child with entry = " << CI2.Value().Entry() << endl;
+ std::cout << " ###### Found child with entry = " << CI2.Value().Entry() << std::endl;
//CI2.Value().dump();
}
delete appli;
- cout << "Test finished " << endl;
+ std::cout << "Test finished " << std::endl;
return 0;
}
#include "utilities.h"
#include <iostream>
-using namespace std;
-
int main(int argc, char* argv[])
{
PortableServer::POA_var root_poa;
#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);
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();
}
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();
//
#include "data_short_port_uses.hxx"
#include <iostream>
-using namespace std;
data_short_port_uses::data_short_port_uses() {
_my_ports = NULL;
// 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++)
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);
}
#define PRG_MAIN
#include "calciumP.h"
-using namespace std;
-
namespace CalciumInterface
{
};
#include "utilities.h"
#include <iostream>
-using namespace std;
-CORBA_DATE_CAL_SCHEM::CORBA_DATE_CAL_SCHEM() : map<CalciumTypes::DateCalSchem,
+CORBA_DATE_CAL_SCHEM::CORBA_DATE_CAL_SCHEM() : std::map<CalciumTypes::DateCalSchem,
Ports::Calcium_Ports::DateCalSchem>()
{
- map<CalciumTypes::DateCalSchem,
+ std::map<CalciumTypes::DateCalSchem,
Ports::Calcium_Ports::DateCalSchem > &
- table = ( map<CalciumTypes::DateCalSchem,
+ table = ( std::map<CalciumTypes::DateCalSchem,
Ports::Calcium_Ports::DateCalSchem > & ) *this ;
table[CalciumTypes::TI_SCHEM ] = Ports::Calcium_Ports::TI_SCHEM ;
Ports::Calcium_Ports::DateCalSchem CORBA_DATE_CAL_SCHEM::operator[]( const CalciumTypes::DateCalSchem &c ) const
{
- map<CalciumTypes::DateCalSchem,
- Ports::Calcium_Ports::DateCalSchem > &table = (map<CalciumTypes::DateCalSchem,
+ std::map<CalciumTypes::DateCalSchem,
+ Ports::Calcium_Ports::DateCalSchem > &table = (std::map<CalciumTypes::DateCalSchem,
Ports::Calcium_Ports::DateCalSchem >&)*this ;
assert( table.find( (CalciumTypes::DateCalSchem)c ) != table.end() ) ;
return table[ (CalciumTypes::DateCalSchem)c ] ;
-CORBA_DEPENDENCY_TYPE::CORBA_DEPENDENCY_TYPE() : map<CalciumTypes::DependencyType,
+CORBA_DEPENDENCY_TYPE::CORBA_DEPENDENCY_TYPE() : std::map<CalciumTypes::DependencyType,
Ports::Calcium_Ports::DependencyType >()
{
- map<CalciumTypes::DependencyType,
+ std::map<CalciumTypes::DependencyType,
Ports::Calcium_Ports::DependencyType > &
- table = ( map<CalciumTypes::DependencyType,
+ table = ( std::map<CalciumTypes::DependencyType,
Ports::Calcium_Ports::DependencyType > & ) *this ;
table[CalciumTypes::TIME_DEPENDENCY ] = Ports::Calcium_Ports::TIME_DEPENDENCY ;
Ports::Calcium_Ports::DependencyType CORBA_DEPENDENCY_TYPE::operator[]( const CalciumTypes::DependencyType &c ) const
{
- map<CalciumTypes::DependencyType,
+ std::map<CalciumTypes::DependencyType,
Ports::Calcium_Ports::DependencyType > &
- table = (map<CalciumTypes::DependencyType,
+ table = (std::map<CalciumTypes::DependencyType,
Ports::Calcium_Ports::DependencyType >& ) *this ;
MESSAGE("CORBA_DEPENDENCY_TYPE() : ::operator["<<c<<"]: " << table[c]);
-CORBA_INTERPOLATION_SCHEM::CORBA_INTERPOLATION_SCHEM() : map<CalciumTypes::InterpolationSchem,
+CORBA_INTERPOLATION_SCHEM::CORBA_INTERPOLATION_SCHEM() : std::map<CalciumTypes::InterpolationSchem,
Ports::Calcium_Ports::InterpolationSchem > ()
{
- map<CalciumTypes::InterpolationSchem,
+ std::map<CalciumTypes::InterpolationSchem,
Ports::Calcium_Ports::InterpolationSchem > &
- table = ( map<CalciumTypes::InterpolationSchem,
+ table = ( std::map<CalciumTypes::InterpolationSchem,
Ports::Calcium_Ports::InterpolationSchem > & ) *this ;
table[CalciumTypes::L0_SCHEM ] = Ports::Calcium_Ports::L0_SCHEM ;
Ports::Calcium_Ports::InterpolationSchem CORBA_INTERPOLATION_SCHEM::operator[]( const CalciumTypes::InterpolationSchem &c ) const
{
- map<CalciumTypes::InterpolationSchem,
+ std::map<CalciumTypes::InterpolationSchem,
Ports::Calcium_Ports::InterpolationSchem > &table =
- (map<CalciumTypes::InterpolationSchem,
+ (std::map<CalciumTypes::InterpolationSchem,
Ports::Calcium_Ports::InterpolationSchem >& ) *this ;
assert( table.find( (CalciumTypes::InterpolationSchem)c ) != table.end() ) ;
-CORBA_EXTRAPOLATION_SCHEM::CORBA_EXTRAPOLATION_SCHEM() : map<CalciumTypes::ExtrapolationSchem,
+CORBA_EXTRAPOLATION_SCHEM::CORBA_EXTRAPOLATION_SCHEM() : std::map<CalciumTypes::ExtrapolationSchem,
Ports::Calcium_Ports::ExtrapolationSchem > ()
{
- map<CalciumTypes::ExtrapolationSchem,
+ std::map<CalciumTypes::ExtrapolationSchem,
Ports::Calcium_Ports::ExtrapolationSchem > &
- table = ( map<CalciumTypes::ExtrapolationSchem,
+ table = ( std::map<CalciumTypes::ExtrapolationSchem,
Ports::Calcium_Ports::ExtrapolationSchem > & ) *this ;
table[CalciumTypes::E0_SCHEM ] = Ports::Calcium_Ports::E0_SCHEM ;
Ports::Calcium_Ports::ExtrapolationSchem CORBA_EXTRAPOLATION_SCHEM::operator[]( const CalciumTypes::ExtrapolationSchem &c ) const
{
- map<CalciumTypes::ExtrapolationSchem,
+ std::map<CalciumTypes::ExtrapolationSchem,
Ports::Calcium_Ports::ExtrapolationSchem > &table =
- (map<CalciumTypes::ExtrapolationSchem,
+ (std::map<CalciumTypes::ExtrapolationSchem,
Ports::Calcium_Ports::ExtrapolationSchem >& ) *this ;
assert( table.find( (CalciumTypes::ExtrapolationSchem)c ) != table.end() ) ;
#include "utilities.h"
#include <iostream>
-using namespace std;
-
-DATE_CAL_SCHEM::DATE_CAL_SCHEM() : map<Ports::Calcium_Ports::DateCalSchem,
+DATE_CAL_SCHEM::DATE_CAL_SCHEM() : std::map<Ports::Calcium_Ports::DateCalSchem,
CalciumTypes::DateCalSchem>()
{
- map<Ports::Calcium_Ports::DateCalSchem,
+ std::map<Ports::Calcium_Ports::DateCalSchem,
CalciumTypes::DateCalSchem > &
- table = ( map<Ports::Calcium_Ports::DateCalSchem,
+ table = ( std::map<Ports::Calcium_Ports::DateCalSchem,
CalciumTypes::DateCalSchem > & ) *this ;
table[Ports::Calcium_Ports::TI_SCHEM ] = CalciumTypes::TI_SCHEM ;
CalciumTypes::DateCalSchem DATE_CAL_SCHEM::operator[]( const Ports::Calcium_Ports::DateCalSchem &c ) const
{
- map<Ports::Calcium_Ports::DateCalSchem,
- CalciumTypes::DateCalSchem> &table = (map<Ports::Calcium_Ports::DateCalSchem,
+ std::map<Ports::Calcium_Ports::DateCalSchem,
+ CalciumTypes::DateCalSchem> &table = (std::map<Ports::Calcium_Ports::DateCalSchem,
CalciumTypes::DateCalSchem>&)*this ;
assert( table.find( (Ports::Calcium_Ports::DateCalSchem)c ) != table.end() ) ;
return table[ (Ports::Calcium_Ports::DateCalSchem)c ] ;
-DEPENDENCY_TYPE::DEPENDENCY_TYPE() : map<Ports::Calcium_Ports::DependencyType,
+DEPENDENCY_TYPE::DEPENDENCY_TYPE() : std::map<Ports::Calcium_Ports::DependencyType,
CalciumTypes::DependencyType>()
{
- map<Ports::Calcium_Ports::DependencyType,
+ std::map<Ports::Calcium_Ports::DependencyType,
CalciumTypes::DependencyType > &
- table = ( map<Ports::Calcium_Ports::DependencyType,
+ table = ( std::map<Ports::Calcium_Ports::DependencyType,
CalciumTypes::DependencyType > & ) *this ;
table[Ports::Calcium_Ports::TIME_DEPENDENCY ] = CalciumTypes::TIME_DEPENDENCY ;
CalciumTypes::DependencyType DEPENDENCY_TYPE::operator[]( const Ports::Calcium_Ports::DependencyType &c ) const
{
- map<Ports::Calcium_Ports::DependencyType,
- CalciumTypes::DependencyType> &table = (map<Ports::Calcium_Ports::DependencyType,
+ std::map<Ports::Calcium_Ports::DependencyType,
+ CalciumTypes::DependencyType> &table = (std::map<Ports::Calcium_Ports::DependencyType,
CalciumTypes::DependencyType>&)*this ;
MESSAGE("DEPENDENCY_TYPE() : ::operator["<<c<<"]: " << table[c]);
-INTERPOLATION_SCHEM::INTERPOLATION_SCHEM() : map<Ports::Calcium_Ports::InterpolationSchem,
+INTERPOLATION_SCHEM::INTERPOLATION_SCHEM() : std::map<Ports::Calcium_Ports::InterpolationSchem,
CalciumTypes::InterpolationSchem > ()
{
- map<Ports::Calcium_Ports::InterpolationSchem,
+ std::map<Ports::Calcium_Ports::InterpolationSchem,
CalciumTypes::InterpolationSchem > &
- table = ( map<Ports::Calcium_Ports::InterpolationSchem,
+ table = ( std::map<Ports::Calcium_Ports::InterpolationSchem,
CalciumTypes::InterpolationSchem > & ) *this ;
table[Ports::Calcium_Ports::L0_SCHEM ] = CalciumTypes::L0_SCHEM ;
CalciumTypes::InterpolationSchem INTERPOLATION_SCHEM::operator[]( const Ports::Calcium_Ports::InterpolationSchem &c ) const
{
- map<Ports::Calcium_Ports::InterpolationSchem,
+ std::map<Ports::Calcium_Ports::InterpolationSchem,
CalciumTypes::InterpolationSchem> &table =
- (map<Ports::Calcium_Ports::InterpolationSchem,
+ (std::map<Ports::Calcium_Ports::InterpolationSchem,
CalciumTypes::InterpolationSchem>& ) *this ;
assert( table.find( (Ports::Calcium_Ports::InterpolationSchem)c ) != table.end() ) ;
-EXTRAPOLATION_SCHEM::EXTRAPOLATION_SCHEM() : map<Ports::Calcium_Ports::ExtrapolationSchem,
+EXTRAPOLATION_SCHEM::EXTRAPOLATION_SCHEM() : std::map<Ports::Calcium_Ports::ExtrapolationSchem,
CalciumTypes::ExtrapolationSchem > ()
{
- map<Ports::Calcium_Ports::ExtrapolationSchem,
+ std::map<Ports::Calcium_Ports::ExtrapolationSchem,
CalciumTypes::ExtrapolationSchem > &
- table = ( map<Ports::Calcium_Ports::ExtrapolationSchem,
+ table = ( std::map<Ports::Calcium_Ports::ExtrapolationSchem,
CalciumTypes::ExtrapolationSchem > & ) *this ;
table[Ports::Calcium_Ports::E0_SCHEM ] = CalciumTypes::E0_SCHEM ;
CalciumTypes::ExtrapolationSchem EXTRAPOLATION_SCHEM::operator[]( const Ports::Calcium_Ports::ExtrapolationSchem &c ) const
{
- map<Ports::Calcium_Ports::ExtrapolationSchem,
+ std::map<Ports::Calcium_Ports::ExtrapolationSchem,
CalciumTypes::ExtrapolationSchem> &table =
- (map<Ports::Calcium_Ports::ExtrapolationSchem,
+ (std::map<Ports::Calcium_Ports::ExtrapolationSchem,
CalciumTypes::ExtrapolationSchem>& ) *this ;
assert( table.find( (Ports::Calcium_Ports::ExtrapolationSchem)c ) != table.end() ) ;
#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);
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")
}
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")
#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);
}
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();
}
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;
}
#endif
using namespace SALOME;
-using namespace std;
GenericObj_i::GenericObj_i(PortableServer::POA_ptr thePOA): myRefCounter(1){
if(MYDEBUG)
#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);
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);
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);
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();
}
else {
aTmpDir = thePath;
- aFullName = string(thePath)+".ascii_tmp";
+ aFullName = std::string(thePath)+".ascii_tmp";
}
FILE *fp = fopen(thePath, "r");
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;
}
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();
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;
}
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;
}
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;
}
// 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+='\\';
}
else {
#ifdef WIN32
- aTmpDir = string("C:\\");
+ aTmpDir = std::string("C:\\");
#else
- aTmpDir = string("/tmp/");
+ aTmpDir = std::string("/tmp/");
#endif
}
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
#endif
*/
- string aDir = aTmpDir;
+ std::string aDir = aTmpDir;
for(aRND = 0; Exists(aDir); aRND++) {
sprintf(buffer, "%d", aRND);
char* makeName(char* name)
{
- string aName(name), aNewName;
+ std::string aName(name), aNewName;
int i, length = aName.size();
char replace = (char)19;
char* restoreName(char* name)
{
- string aName(name), aNewName;
+ std::string aName(name), aNewName;
int i, length = aName.size();
char replace = (char)19;
}
}
-bool Exists(const string thePath)
+bool Exists(const std::string thePath)
{
#ifdef WIN32
if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) {
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);
#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)
}
#include "HDFcontainerObject.hxx"
#include "HDFexception.hxx"
-using namespace std;
HDFcontainerObject::HDFcontainerObject(const char *name)
: HDFinternalObject(name)
// Module : SALOME
//
#include "HDFconvert.hxx"
-using namespace std;
#ifdef WIN32
#include <io.h>
#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;
#include "HDFexception.hxx"
#include <iostream>
-using namespace std;
herr_t dataset_attr(hid_t loc_id, const char *attr_name, void *operator_data)
{
#include "HDFexception.hxx"
#include "HDFinternalObject.hxx"
#include "HDFexplorer.hxx"
-using namespace std;
HDFexplorer::HDFexplorer(HDFcontainerObject *container)
{
#include <iostream>
#include "HDFfile.hxx"
#include "HDFexception.hxx"
-using namespace std;
herr_t file_attr(hid_t loc_id, const char *attr_name, void *operator_data)
{
}
#include "HDFgroup.hxx"
#include "HDFexception.hxx"
-using namespace std;
herr_t group_attr(hid_t loc_id, const char *attr_name, void *operator_data)
{
#include <cstring>
#include <stdlib.h>
-using namespace std;
#ifdef WNT
#define strdup _strdup
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
{
//
#include "HDFIO.hxx"
#include <iostream.h>
-using namespace std;
+
int main()
{
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
#include <iostream.h>
#include "HDFOI.hxx"
#include <stdlib.h>
-using namespace std;
int main()
#include <sys/stat.h>
#include <time.h>
-using namespace std;
-
//=============================================================================
/*!
* Constructor
{
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<int, Launcher::Job *>::const_iterator it_job;
// 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
#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);
#include <sys/types.h>
#include <vector>
-using namespace std;
-
const char *SALOME_Launcher::_LauncherNameInNS = "/SalomeLauncher";
//=============================================================================
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);
#include <stdexcept>
#include <libxml/parser.h>
-using namespace std;
-
void AttachDebugger()
{
#ifndef WIN32
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
#include <iostream>
#include <map>
-using namespace std;
-
//=============================================================================
/*!
* Constructor
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)){
#define NULL_VALUE 0
-using namespace std;
-
void MachineParameters::Clear()
{
EnvFile = "";
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 <InputFile.size();i++)
oss << InputFile[i] << " ";
- oss << endl << "OutputFile: ";
+ oss << std::endl << "OutputFile: ";
for(int i=0; i <OutputFile.size();i++)
oss << OutputFile[i] << " ";
- oss << endl <<
- "Command: " << Command << endl <<
- "Machines: " << endl;
+ oss << std::endl <<
+ "Command: " << Command << std::endl <<
+ "Machines: " << std::endl;
- cout << oss.str();
+ std::cout << oss.str();
- std::map < string, MachineParameters >::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();
}
#include "Basics_Utils.hxx"
#include <cstdio>
-using namespace std;
-
/*! \class SALOME_FileTransferCORBA
\brief A class to manage file transfer in SALOME (CORBA context)
*/
//=============================================================================
-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);
*/
//=============================================================================
-string SALOME_FileTransferCORBA::getLocalFile(string localFile)
+std::string SALOME_FileTransferCORBA::getLocalFile(std::string localFile)
{
MESSAGE("SALOME_FileTransferCORBA::getLocalFile " << 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
{
#include "SALOME_NamingService.hxx"
#include "SALOME_FileTransferCORBA.hxx"
-using namespace std;
-
IncompatibleComponent::IncompatibleComponent( void ):
SALOME_Exception( "IncompatibleComponent" )
{
// --- 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;
}
}
- string hostname = Kernel_Utils::GetHostname();
+ std::string hostname = Kernel_Utils::GetHostname();
// 1) ConnectionManager
try
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() );
// 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() );
}
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 !");
#include <string>
#include <cstdlib>
-using namespace std;
// --- uncomment to have some traces on standard error
// (useful only when adding new tests...)
// --- 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();
// --- 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));
// --- 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");
// --- 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);
}
// --- 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");
// --- 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");
// --- 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);
}
// --- 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");
// --- 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 =
// --- 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");
// --- 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)
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();
// --- 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);
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);
}
}
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");
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());
}
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");
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);
}
// ============================================================================
{
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 =
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);
}
{
SALOME_LifeCycleCORBA _LCC(&_NS);
- string remoteHost = GetRemoteHost();
+ std::string remoteHost = GetRemoteHost();
Engines::MachineParameters params;
_LCC.preSet(params);
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);
}
{
SALOME_LifeCycleCORBA _LCC(&_NS);
- string remoteHost = GetRemoteHost();
+ std::string remoteHost = GetRemoteHost();
Engines::MachineParameters params;
_LCC.preSet(params);
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);
}
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);
}
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);
}
*/
// ============================================================================
-string LifeCycleCORBATest::GetRemoteHost()
+std::string LifeCycleCORBATest::GetRemoteHost()
{
SALOME_LifeCycleCORBA _LCC(&_NS);
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;
#include "utilities.h"
#include <Basics_Utils.hxx>
-using namespace std;
-
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 =
// --- 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");
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,
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
#define PY_SSIZE_T_MIN INT_MIN
#endif
-using namespace std;
-
//--- from omniORBpy.h (not present on Debian Sarge packages)
struct omniORBpyAPI {
// ----------------------------------------------------------------------------
-using namespace std;
-
%typemap(out) Engines::Container_ptr, Engines::Component_ptr, Engines::fileRef_ptr,
Engines::ContainerManager_ptr, Engines::ResourcesManager_ptr
//#include <stdio.h>
#include <stdlib.h>
#include <iostream>
-using namespace std;
#ifdef WIN32
#include <omnithread/pthread_nt.h>
}
if (CORBA::is_nil(inc)) {
- cout<<"SALOME_Trace can not find NameService"<<endl;
+ std::cout<<"SALOME_Trace can not find NameService"<<std::endl;
return 0;
}
}
}
if (CORBA::is_nil(m_pInterfaceLogger)) {
- cout<<"SALOME_Trace can not find Logger"<<endl;
+ std::cout<<"SALOME_Trace can not find Logger"<<std::endl;
return 0;
}
}
return 1;
}
-void SALOME_Trace::putMessage(ostream& msg)
+void SALOME_Trace::putMessage(std::ostream& msg)
{
- //if (!isInitialized) cout<<"!!! SALOME_Trace is used without initialising !!!"<<endl;
+ //if (!isInitialized) std::cout<<"!!! SALOME_Trace is used without initialising !!!"<<std::endl;
//write resulting string into Logger CORBA server
//concatenate string from passing parameters for transfering into Logger CORBA server
- //cerr << "-+- " << msg << " ";
+ //std::cerr << "-+- " << msg << " ";
// CORBA::String_var LogMsg = CORBA::string_dup( str() );
//Allow automatic deletion of ostrstream content
seekp(0);
if (CORBA::is_nil(m_pInterfaceLogger))
- cout << LogMsg;
+ std::cout << LogMsg;
else
m_pInterfaceLogger-> putMessage (LogMsg) ;
}
#include <pthread.h> // must be before Python.h !
#include <Python.h>
#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,
_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());
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))
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");
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;
//--- 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];
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,
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
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){
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();
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()) ;
}
_numInstanceMutex.lock(); // lock to be alone
// (see decInstanceCnt, load_component_Library)
- map<string, void *>::iterator ith;
+ std::map<std::string, void *>::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);
#include "MPIObject_i.hxx"
#include "utilities.h"
#include "Utils_SALOME_Exception.hxx"
-using namespace std;
+
#define TIMEOUT 5
MPIObject_i::MPIObject_i()
int err, ip, n;
char *ior;
MPI_Status status; /* status de reception de message MPI */
- ostringstream msg;
+ std::ostringstream msg;
if( _numproc == 0 )
{
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 )
{
{
_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
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++;
void MPIObject_i::remoteMPI2Disconnect(std::string service)
{
- ostringstream msg;
+ std::ostringstream msg;
if( service.size() == 0 )
{
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);
}
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
#include "utilities.h"
-using namespace std;
int main(int argc, char* argv[])
{
#include "utilities.h"
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
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;
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;
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;
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;
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;
#include "SALOME_ModuleCatalog.hh"
#include <string>
#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);
}
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.")
void PrintInterface(SALOME_ModuleCatalog::Acomponent_ptr C,
- const string & InterfaceName)
+ const std::string & InterfaceName)
{
unsigned int i, n;
}
void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C,
- const string & InterfaceName,
- const string & ServiceName)
+ const std::string & InterfaceName,
+ const std::string & ServiceName)
{
int i, n;
#include "utilities.h"
#include <sstream>
-using namespace std;
#ifdef _DEBUG_
static int MYDEBUG = 0;
#include <iostream>
#include "utilities.h"
-using namespace std;
-
std::ostream & operator<< (std::ostream & f, const ParserParameter & P)
{
f << " name : " << P.name << std::endl;
#ifdef CHECKTIME
#include <Utils_Timer.hxx>
#endif
-using namespace std;
int main(int argc,char **argv)
{
# include <process.h>
#endif
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static const char* OLD_SEPARATOR = ":";
-list<string> splitStringToList(const string& theString, const string& theSeparator)
+std::list<std::string> splitStringToList(const std::string& theString, const std::string& theSeparator)
{
- list<string> aList;
+ std::list<std::string> 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);
// Affect the _general_module_list and _general_path_list members
// with the common catalog
- list<string> dirList;
+ std::list<std::string> 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);
}
#endif
- for (list<string>::iterator iter = dirList.begin(); iter != dirList.end(); iter++)
+ for (std::list<std::string>::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(),
}
ParserComponent *
-SALOME_ModuleCatalogImpl::findComponent(const string & name)
+SALOME_ModuleCatalogImpl::findComponent(const std::string & name)
{
ParserComponent * C_parser = NULL;
SALOME_ModuleCatalogImpl::_verify_path_prefix(ParserPathPrefixes & pathList)
{
bool _return_value = true;
- vector<string> _machine_list;
+ std::vector<std::string> _machine_list;
// Fill a list of all computers indicated in the path list
for (unsigned int ind = 0; ind < pathList.size(); ind++)
// Module : SALOME
//
#include "NOTIFICATION_Swig.hxx"
-using namespace std;
// Swig notification supplier
// --------------------------
#include <iostream>
#include <ctime>
-using namespace std;
-
// ============================================================================
/*!
* Wait until a server is registered in naming service.
void NamingService_WaitForServerReadiness(SALOME_NamingService* NS,
- string serverName)
+ std::string serverName)
{
long TIMESleep = 500000000; // 500 ms.
int NumberOfTries = 40; // total wait = 20 s.
#define strdup _strdup
#endif
-using namespace std;
-
/*! \class SALOME_NamingService
\brief A class to manage the SALOME naming service
// to place the current_context to the correct node
CosNaming::Name context_name;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
int dimension_resultat = _createContextNameDir(Path,
context_name,
splitPath,
// to place the current_context to the correct node
CosNaming::Name context_name;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
_createContextNameDir(Path,
context_name,
splitPath,
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);
if (isOk)
{
- vector<string> listElem = list_directory();
- vector<string>::iterator its = listElem.begin();
+ std::vector<std::string> listElem = list_directory();
+ std::vector<std::string>::iterator its = listElem.begin();
while (its != listElem.end())
{
Utils_Locker lock (&_myMutex);
- string name = "/Containers/";
+ std::string name = "/Containers/";
name += hostname;
else
{
SCRUTE(name);
- string basename = name;
+ std::string basename = name;
if (Change_Directory(basename.c_str()))
{
- vector<string> contList = list_subdirs();
+ std::vector<std::string> contList = list_subdirs();
for (unsigned int ind = 0; ind < contList.size(); ind++)
{
*/
// ============================================================================
-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";
*/
// ============================================================================
-string
+std::string
SALOME_NamingService::ContainerName(const Engines::MachineParameters& params)
{
int nbproc;
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 )
{
return ret;
}
-string
+std::string
SALOME_NamingService::ContainerName(const Engines::ContainerParameters& params)
{
int nbproc;
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 )
{
*/
// ============================================================================
-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);
*/
// ============================================================================
-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);
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);
Utils_Locker lock (&_myMutex);
- string path(Path);
+ std::string path(Path);
// --- if path empty, nothing to create, no context change
// MESSAGE("BEGIN OF Change_Directory " << Path);
Utils_Locker lock (&_myMutex);
- string path(Path);
+ std::string path(Path);
// --- if path empty, nothing to do
if (path[path.length()-1] != '/') path += '/';
// SCRUTE(path);
CosNaming::Name context_name;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
_createContextNameDir(path.c_str(),
context_name,
splitPath,
CosNaming::NamingContext_var ref_context = _current_context;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
splitPath.resize(0);
int lengthPath = 0;
bool notFound = true ;
throw ServiceUnreachable();
}
- string path;
+ std::string path;
lengthPath = splitPath.size();
for (int k = 0 ; k < lengthPath ;k++)
{
*/
// ============================================================================
-vector<string> SALOME_NamingService::list_directory()
+std::vector<std::string> SALOME_NamingService::list_directory()
throw(ServiceUnreachable)
{
// MESSAGE("list_directory");
- vector<string> dirList ;
+ std::vector<std::string> dirList ;
dirList.resize(0);
CosNaming::BindingList_var binding_list;
{
// 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));
}
}
*/
// ============================================================================
-vector<string> SALOME_NamingService::list_subdirs()
+std::vector<std::string> SALOME_NamingService::list_subdirs()
throw(ServiceUnreachable)
{
MESSAGE("list_subdirs");
- vector<string> dirList ;
+ std::vector<std::string> dirList ;
dirList.resize(0);
CosNaming::BindingList_var binding_list;
*/
// ============================================================================
-vector<string> SALOME_NamingService::list_directory_recurs()
+std::vector<std::string> SALOME_NamingService::list_directory_recurs()
throw(ServiceUnreachable)
{
MESSAGE("list_directory_recurs");
Utils_Locker lock (&_myMutex);
- vector<string> dirList ;
+ std::vector<std::string> dirList ;
char* currentDir = Current_Directory();
Utils_Locker lock (&_myMutex);
- string path(Path);
+ std::string path(Path);
// --- if path empty, nothing to do
// --- context of the directory containing the object
CosNaming::Name context_name;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
int dimension_resultat = _createContextNameDir(path.c_str(),
context_name,
splitPath,
Utils_Locker lock (&_myMutex);
- string path(Path);
+ std::string path(Path);
// --- if path empty, nothing to do
// --- context of the directory
CosNaming::Name context_name;
- vector<string> splitPath;
+ std::vector<std::string> splitPath;
int dimension_resultat = _createContextNameDir(path.c_str(),
context_name,
splitPath,
MESSAGE("begin of Destroy_FullDirectory " << Path);
if( Change_Directory(Path) )
{
- vector<string> contList = list_directory();
+ std::vector<std::string> contList = list_directory();
for (unsigned int ind = 0; ind < contList.size(); ind++)
Destroy_Name(contList[ind].c_str());
// ============================================================================
int
-SALOME_NamingService::_createContextNameDir(string path,
+SALOME_NamingService::_createContextNameDir(std::string path,
CosNaming::Name& context_name,
- vector<string>& splitPath,
+ std::vector<std::string>& 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)
void
SALOME_NamingService::
-_current_directory(vector<string>& splitPath,
+_current_directory(std::vector<std::string>& splitPath,
int& lengthResult,
CosNaming::NamingContext_var contextToFind,
bool& notFound)
*/
// ============================================================================
-void SALOME_NamingService::_list_directory_recurs(vector<string>& myList,
- string relativeSubDir,
- string absCurDirectory)
+void SALOME_NamingService::_list_directory_recurs(std::vector<std::string>& myList,
+ std::string relativeSubDir,
+ std::string absCurDirectory)
{
CosNaming::BindingList_var binding_list;
CosNaming::BindingIterator_var binding_iterator;
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;
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);
}
// Module : SALOME
//
#include "ServiceUnreachable.hxx"
-using namespace std;
ServiceUnreachable::ServiceUnreachable( void ): SALOME_Exception( "ServiceUnreachable" )
{
#include <cstdlib>
#include <cstdio>
-using namespace std;
// --- uncomment to have some traces on standard error
// (useful only when adding new tests...)
// --- 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();
{
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;
for (int i=0; i<NB_OBJS; i++)
{
- string name = "/nstestfirst/echo_";
+ std::string name = "/nstestfirst/echo_";
char anum[10];
sprintf(anum,"%d",ref[i]);
name += anum;
CPPUNIT_ASSERT(anEchoRef->getId() == 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);
{
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;
for (int i=0; i<NB_OBJS; i++)
{
_NS.Change_Directory("/nstestfirstrel");
- string name = "echo_";
+ std::string name = "echo_";
char anum[10];
sprintf(anum,"%d",ref[i]);
name += anum;
}
_NS.Change_Directory("/nstestfirstrel");
- string name = "echo";
+ std::string name = "echo";
obj = _NS.ResolveFirst(name.c_str());
CPPUNIT_ASSERT(!CORBA::is_nil(obj));
}
void
NamingServiceTest::testResolveFirstUnknown()
{
- string name = "/notYeyRegistered";
+ std::string name = "/notYeyRegistered";
CORBA::Object_var obj= _NS.ResolveFirst(name.c_str());
CPPUNIT_ASSERT(CORBA::is_nil(obj));
_NS.Create_Directory("/myContext");
_NS.Change_Directory("/myContext");
- string name = "RelnotYeyRegistered";
+ std::string name = "RelnotYeyRegistered";
CORBA::Object_var obj = _NS.ResolveFirst(name.c_str());
CPPUNIT_ASSERT(CORBA::is_nil(obj));
void
NamingServiceTest::testContainerName()
{
- string ref0 = "FactoryServer";
- string ret = _NS.ContainerName("");
+ std::string ref0 = "FactoryServer";
+ std::string ret = _NS.ContainerName("");
CPPUNIT_ASSERT(ret == ref0);
ref0 = "MyContainerName";
params.nb_node = 0;
params.isMPI = false;
- string ref0 = "FactoryServer";
- string ret = _NS.ContainerName(params);
+ std::string ref0 = "FactoryServer";
+ std::string ret = _NS.ContainerName(params);
CPPUNIT_ASSERT(ret == ref0);
ref0 = "MyContainerName";
void
NamingServiceTest::testBuildContainerNameForNS()
{
- string ref0 = "/Containers/theHostName/theContainerName";
- string ret = _NS.BuildContainerNameForNS("theContainerName","theHostName");
+ std::string ref0 = "/Containers/theHostName/theContainerName";
+ std::string ret = _NS.BuildContainerNameForNS("theContainerName","theHostName");
CPPUNIT_ASSERT(ret == ref0);
ref0 = "/Containers/theHostName/FactoryServer";
params.isMPI = false;
params.container_name = "theContainerName";
- string ref0 = "/Containers/theHostName/theContainerName";
- string ret = _NS.BuildContainerNameForNS(params,"theHostName");
+ std::string ref0 = "/Containers/theHostName/theContainerName";
+ std::string ret = _NS.BuildContainerNameForNS(params,"theHostName");
CPPUNIT_ASSERT(ret == ref0);
params.container_name = "";
_NS.Change_Directory("/aaa/bbb/ccc/ddd/eee");
NSTEST::echo_var anEchoRef = myFactory->createInstance();
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));
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);
}
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());
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());
*/
// ============================================================================
-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<string> subdirs = _NS.list_subdirs();
+ std::vector<std::string> subdirs = _NS.list_subdirs();
for (int i=0; i<subdirs.size(); i++)
{
- string subpath=path + "/" +subdirs[i];
+ std::string subpath=path + "/" +subdirs[i];
_destroyDirectoryRecurs(subpath);
}
if (_NS.Change_Directory(path.c_str()))
{
_NS.Destroy_FullDirectory("/Containers");
CPPUNIT_ASSERT(_NS.Change_Directory("/Containers"));
- vector<string> subdirs = _NS.list_subdirs();
+ std::vector<std::string> 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("/");
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
-using namespace std;
CosNA_EventChannel_ptr NOTIFICATION_channel() {
ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance(); ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
// Module : SALOME
//
#include "NOTIFICATION.hxx"
-using namespace std;
NOTIFICATION_Consumer::NOTIFICATION_Consumer():
proxy_supplier(0),
// Module : SALOME
//
#include "NOTIFICATION.hxx"
-using namespace std;
long NOTIFICATION_Supplier::_stamp = 0;
#include <paco_dummy.h>
#include <paco_omni.h>
-using namespace std;
extern bool _Sleeping ;
static Engines_Parallel_Component_i * theEngines_Component ;
{
Engines::FieldsDict_var copie = new Engines::FieldsDict;
copie->length(_fieldsDict.size());
- map<std::string,CORBA::Any>::iterator it;
+ std::map<std::string,CORBA::Any>::iterator it;
CORBA::ULong i = 0;
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++, i++)
{
{
_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<<endl;
+ // std::cout<< pthread_self()<<"Engines_Parallel_Component_i::CpuUsed_impl _ThreadId "
+ // <<_ThreadId <<" "<<_serviceName<<" _StartUsed "<<_StartUsed<<std::endl;
}
return cpu ;
}
// --- for supervisor : all strings given with setProperties
// are set in environment
bool overwrite = true;
- map<std::string,CORBA::Any>::iterator it;
+ std::map<std::string,CORBA::Any>::iterator it;
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++)
{
std::string cle((*it).first);
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
*/
//=============================================================================
-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;
#include "Container_init_python.hxx"
-using namespace std;
-
#ifdef _DEBUG_
#include <signal.h>
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
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,
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();
#include "Container_init_python.hxx"
-using namespace std;
#ifdef _DEBUG_
#include <signal.h>
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
}
#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);
*/
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,
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);
// 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();
#ifdef DEBUG_PARALLEL
#include <signal.h>
-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
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();
#ifdef _DEBUG_
#include <signal.h>
-using namespace std;
+
typedef void (*sighandler_t)(int);
sighandler_t setsig(int sig, sighandler_t handler)
}
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
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();
#include <Python.h>
#include "Container_init_python.hxx"
-using namespace std;
bool _Sleeping = false ;
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
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();
CORBA::Long studyId)
{
Engines::Component_var anEngine = Engines::Component::_nil();
- map<string,Engines::Component_var>::iterator itm =_listInstances_map.begin();
+ std::map<std::string,Engines::Component_var>::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)
{
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<std::string, Engines::Component_var>::iterator itm;
MESSAGE("WARNING FINALIZE DOES CURRENTLY NOTHING !!!");
// (see decInstanceCnt, load_component_Library)
- //map<string, void *>::iterator ith;
+ //std::map<std::string, void *>::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);
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] != '/')
//=============================================================================
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 ))
{
*/
//=============================================================================
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();
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__");
*/
//=============================================================================
Engines::Component_ptr
-Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName,
+Engines_Parallel_Container_i::createCPPInstance(std::string genericRegisterName,
void *handle,
int studyId)
{
// --- 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,
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
{
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)
*/
//=============================================================================
-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
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];
{
# include <stdio.h>
}
-using namespace std;
-
Registry::Components_var Connexion( int argc , char **argv , const char *ptrSessionName ) throw( CommException )
{
#include <process.h>
#define getpid _getpid
#endif
-using namespace std;
/* ------------------------------*/
/* Constructors and Destructors */
RegistryService::~RegistryService()
{
BEGIN_OF("RegistryService::~RegistryService()") ;
- map<int,client_infos *>::iterator im;
+ std::map<int,client_infos *>::iterator im;
for (im=_reg.begin();im!=_reg.end(); im++)
{
MESSAGE("Delete _reg item " << im->second->_name) ;
return RegistryService::makeseq(_fin) ;
}
-Registry::AllInfos* RegistryService::makeseq(map<int,client_infos *> &mymap )
+Registry::AllInfos* RegistryService::makeseq(std::map<int,client_infos *> &mymap )
{
int i=0 ;
const int RegLength = mymap.size();
all->length(RegLength);
- map<int,client_infos *>::iterator im;
+ std::map<int,client_infos *>::iterator im;
for (im=mymap.begin();im!=mymap.end(); im++)
{
#ifdef CHECKTIME
#include <Utils_Timer.hxx>
#endif
-using namespace std;
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
#define MAX_SIZE_FOR_HOSTNAME 256;
-using namespace std;
-
static LoadRateManagerFirst first;
static LoadRateManagerCycl cycl;
static LoadRateManagerAltCycl altcycl;
{
_path_resources.push_back(xmlFilePath);
#if defined(_DEBUG_) || defined(_DEBUG)
- cerr << "ResourcesManager_cpp constructor" << endl;
+ std::cerr << "ResourcesManager_cpp constructor" << std::endl;
#endif
_resourceManagerMap["first"]=&first;
_resourceManagerMap["cycl"]=&cycl;
li.sort();
vec.clear();
- for (list<ResourceDataToSort>::iterator iter2 = li.begin(); iter2 != li.end(); iter2++)
+ for (std::list<ResourceDataToSort>::iterator iter2 = li.begin(); iter2 != li.end(); iter2++)
vec.push_back((*iter2)._Name);
}
return _resourcesList;
}
-string ResourcesManager_cpp::Find(const std::string& policy, const std::vector<std::string>& listOfResources)
+std::string ResourcesManager_cpp::Find(const std::string& policy, const std::vector<std::string>& listOfResources)
{
if(_resourceManagerMap.count(policy)==0)
return _resourceManagerMap[""]->Find(listOfResources, _resourcesList);
// a computer list is given : take only resources with OS on those computers
std::vector<std::string> vec_tmp = resources;
resources.clear();
- vector<string>::iterator iter = vec_tmp.begin();
+ std::vector<std::string>::iterator iter = vec_tmp.begin();
for (; iter != vec_tmp.end(); iter++)
{
MapOfParserResourcesType::const_iterator it = _resourcesList.find(*iter);
//=============================================================================
void
ResourcesManager_cpp::KeepOnlyResourcesWithComponent(std::vector<std::string>& resources,
- const vector<string>& componentList)
+ const std::vector<std::string>& componentList)
{
std::vector<std::string>::iterator iter = resources.begin();
for (; iter != resources.end(); iter++)
{
MapOfParserResourcesType::const_iterator it = _resourcesList.find(*iter);
- const vector<string>& mapOfComponentsOfCurrentHost = (*it).second.ComponentsList;
+ const std::vector<std::string>& mapOfComponentsOfCurrentHost = (*it).second.ComponentsList;
bool erasedHost = false;
if( mapOfComponentsOfCurrentHost.size() > 0 )
for(unsigned int i=0; i<componentList.size(); i++)
{
const char* compoi = componentList[i].c_str();
- vector<string>::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(),
+ std::vector<std::string>::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(),
mapOfComponentsOfCurrentHost.end(),
compoi);
if (itt == mapOfComponentsOfCurrentHost.end())
#include <iostream>
#include <map>
-using namespace std;
-
-string LoadRateManagerFirst::Find(const vector<string>& hosts,
+std::string LoadRateManagerFirst::Find(const std::vector<std::string>& 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<string>& hosts,
+std::string LoadRateManagerCycl::Find(const std::vector<std::string>& hosts,
MapOfParserResourcesType& resList)
{
static int imachine = 0;
// 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<string>& hosts,
+std::string LoadRateManagerAltCycl::Find(const std::vector<std::string>& hosts,
MapOfParserResourcesType& resList)
{
if (hosts.size() == 0)
- return string("");
+ return std::string("");
std::string selected=hosts[0];
int uses=0;
#include <sstream>
#include <map>
-using namespace std;
-
//=============================================================================
/*!
* Constructor
_resource.DataForSort._Name = Kernel_Utils::GetHostname();
}
}
- map<string, ParserResourcesType>::const_iterator iter = _resources_list.find(_resource.Name);
+ std::map<std::string, ParserResourcesType>::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;
_resource.Clear();
if(ProcessCluster(aCurNode, _resource))
{
- map<string, ParserResourcesType>::const_iterator iter = _resources_list.find(_resource.Name);
+ std::map<std::string, ParserResourcesType>::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;
}
#ifdef _DEBUG_
- for (map<string, ParserResourcesType>::const_iterator iter = _resources_list.begin();
+ for (std::map<std::string, ParserResourcesType>::const_iterator iter = _resources_list.begin();
iter != _resources_list.end();
iter++)
{
#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;
ResourceDataToSort::ResourceDataToSort()
{}
-ResourceDataToSort::ResourceDataToSort(const string& name,
+ResourceDataToSort::ResourceDataToSort(const std::string& name,
unsigned int nbOfNodes,
unsigned int nbOfProcPerNode,
unsigned int CPUFreqMHz,
//! 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<ComponentsList.size();i++)
- oss << "Component " << i+1 << " called : " << ComponentsList[i] << endl;
+ oss << "Component " << i+1 << " called : " << ComponentsList[i] << std::endl;
std::list<ParserResourcesClusterMembersType>::iterator it;
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
#define MAX_SIZE_FOR_HOSTNAME 256;
-using namespace std;
-
const char *SALOME_ResourcesManager::_ResourcesManagerNameInNS = "/ResourcesManager";
//=============================================================================
p.cpu_clock = params.cpu_clock;
p.mem_mb = params.mem_mb;
for(unsigned int i=0; i<params.componentList.length(); i++)
- p.componentList.push_back(string(params.componentList[i]));
+ p.componentList.push_back(std::string(params.componentList[i]));
for(unsigned int i=0; i<params.resList.length(); i++)
- p.resourceList.push_back(string(params.resList[i]));
+ p.resourceList.push_back(std::string(params.resList[i]));
try
{
// Call C++ ResourceManager
- vector <std::string> vec = _rm.GetFittingResources(p);
+ std::vector <std::string> vec = _rm.GetFittingResources(p);
// C++ -> CORBA
ret->length(vec.size());
SALOME_ResourcesManager::FindFirst(const Engines::ResourceList& listOfResources)
{
// CORBA -> C++
- vector<string> rl;
+ std::vector<std::string> rl;
for(unsigned int i=0; i<listOfResources.length(); i++)
- rl.push_back(string(listOfResources[i]));
+ rl.push_back(std::string(listOfResources[i]));
return CORBA::string_dup(_rm.Find("first", rl).c_str());
}
SALOME_ResourcesManager::Find(const char* policy, const Engines::ResourceList& listOfResources)
{
// CORBA -> C++
- vector<string> rl;
+ std::vector<std::string> rl;
for(unsigned int i=0; i<listOfResources.length(); i++)
- rl.push_back(string(listOfResources[i]));
+ rl.push_back(std::string(listOfResources[i]));
return CORBA::string_dup(_rm.Find(policy, rl).c_str());
}
// 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);
CORBA::Long machine_number = 0;
std::list<std::string>::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++;
{
// 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<ParserResourcesClusterMembersType>::iterator cluster_it =
{
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++;
}
}
{
// 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<ParserResourcesClusterMembersType>::iterator cluster_it =
{
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++;
}
}
#include CORBA_SERVER_HEADER(SALOMEDS)
#include <SALOME_NamingService.hxx>
-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()
void SALOMEDS::unlock()
{
- Locker::MutexDS.unlock();
+ SALOMEDS::Locker::MutexDS.unlock();
}
#include "utilities.h"
#include <stdio.h>
#include <SALOMEDSImpl_AttributeInteger.hxx>
-using namespace std;
+
//============================================================================
/*! Function : Set
#include <stdio.h>
#include <cstring>
#include <SALOMEDSImpl_AttributeReal.hxx>
-using namespace std;
+
//============================================================================
/*! Function : Set
#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeComment_i::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<SALOMEDSImpl_AttributeComment*>(_impl)->SetValue(aValue);
}
#include "SALOMEDS_AttributeDrawable_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Boolean SALOMEDS_AttributeDrawable_i::IsDrawable()
{
SALOMEDS::Locker lock;
#include "SALOMEDS_AttributeExpandable_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Boolean SALOMEDS_AttributeExpandable_i::IsExpandable()
{
SALOMEDS::Locker lock;
#include "SALOMEDS_AttributeExternalFileDef_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeExternalFileDef_i::Value()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(_impl)->SetValue(string(Str));
+ dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(_impl)->SetValue(std::string(Str));
}
#include "SALOMEDS_AttributeFileType_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeFileType_i::Value()
{
SALOMEDS::Locker lock;
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<SALOMEDSImpl_AttributeFileType*>(_impl)->SetValue(aValue);
}
#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
#include "SALOMEDS_AttributeGraphic_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
/*
Class : SALOMEDS_AttributeGraphic_i
Description : This class is intended for storing information about
#include "SALOMEDS_AttributeIOR_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeIOR_i::Value()
{
SALOMEDS::Locker lock;
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<SALOMEDSImpl_AttributeIOR*>(_impl)->SetValue(anExtStr);
}
#include "SALOMEDS_AttributeInteger_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Long SALOMEDS_AttributeInteger_i::Value()
{
SALOMEDS::Locker lock;
#include "SALOMEDS_AttributeLocalID_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Long SALOMEDS_AttributeLocalID_i::Value()
{
SALOMEDS::Locker lock;
#include "SALOMEDS_AttributeName_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeName_i::Value()
{
SALOMEDS::Locker lock;
{
SALOMEDS::Locker lock;
CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeName*>(_impl)->SetValue(string(value));
+ dynamic_cast<SALOMEDSImpl_AttributeName*>(_impl)->SetValue(std::string(value));
}
#include "SALOMEDS_AttributeOpened_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Boolean SALOMEDS_AttributeOpened_i::IsOpened()
{
SALOMEDS::Locker lock;
#include <string>
-using namespace std;
-
//=======================================================================
/*!
* Function : Constructor
* 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();
* 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) {
* 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();
* 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) {
* 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();
* 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<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetString(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();
* 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;
* Purpose : Associates an array of double values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetRealArray(const string& theID, const vector<double>& theArray)
+void SALOMEDS_AttributeParameter::SetRealArray(const std::string& theID, const std::vector<double>& theArray)
{
CheckLocked();
* Purpose : Returns an array of double values associated with the ID
*/
//=======================================================================
-vector<double> SALOMEDS_AttributeParameter::GetRealArray(const string& theID)
+std::vector<double> SALOMEDS_AttributeParameter::GetRealArray(const std::string& theID)
{
- vector<double> v;
+ std::vector<double> v;
if(_isLocal) {
SALOMEDS::Locker lock;
return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetRealArray(theID);
* Purpose : Associates an array of int values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetIntArray(const string& theID, const vector<int>& theArray)
+void SALOMEDS_AttributeParameter::SetIntArray(const std::string& theID, const std::vector<int>& theArray)
{
CheckLocked();
* Purpose : Returns an array of int values associated with the ID
*/
//=======================================================================
-vector<int> SALOMEDS_AttributeParameter::GetIntArray(const string& theID)
+std::vector<int> SALOMEDS_AttributeParameter::GetIntArray(const std::string& theID)
{
- vector<int> v;
+ std::vector<int> v;
if(_isLocal) {
SALOMEDS::Locker lock;
return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetIntArray(theID);
* Purpose : Associates an array of string values with the given ID
*/
//=======================================================================
-void SALOMEDS_AttributeParameter::SetStrArray(const string& theID, const vector<string>& theArray)
+void SALOMEDS_AttributeParameter::SetStrArray(const std::string& theID, const std::vector<std::string>& theArray)
{
CheckLocked();
* Purpose : Returns an array of string values associated with the ID
*/
//=======================================================================
-vector<string> SALOMEDS_AttributeParameter::GetStrArray(const string& theID)
+std::vector<std::string> SALOMEDS_AttributeParameter::GetStrArray(const std::string& theID)
{
- vector<string> v;
+ std::vector<std::string> v;
if(_isLocal) {
SALOMEDS::Locker lock;
return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl)->GetStrArray(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;
* 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;
* 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();
* Purpose : Returns an array of all ID's of the given type
*/
//=======================================================================
-vector<string> SALOMEDS_AttributeParameter::GetIDs(const int theType)
+std::vector<std::string> SALOMEDS_AttributeParameter::GetIDs(const int theType)
{
- vector<string> v;
+ std::vector<std::string> v;
if(_isLocal) {
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeParameter* AP_impl = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_local_impl);
int length = CorbaSeq->length();
if(length) {
v.resize(length);
- for(int i = 0; i <length; i++) v[i] = string(CorbaSeq[i].in());
+ for(int i = 0; i <length; i++) v[i] = std::string(CorbaSeq[i].in());
}
}
#include <vector>
-using namespace std;
-
#include "Utils_ExceptHandlers.hxx"
UNEXPECT_CATCH(AP_InvalidIdentifier, SALOMEDS::AttributeParameter::InvalidIdentifier);
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<double> v;
+ std::vector<double> v;
int length = theArray.length();
if(length) {
v.resize(length);
SALOMEDS::Locker lock;
Unexpect aCatch (AP_InvalidIdentifier);
SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq;
- vector<double> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetRealArray(theID);
+ std::vector<double> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetRealArray(theID);
int length = v.size();
if(length) {
aSeq->length(length);
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<int> v;
+ std::vector<int> v;
int length = theArray.length();
if(length) {
v.resize(length);
SALOMEDS::Locker lock;
Unexpect aCatch (AP_InvalidIdentifier);
SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq;
- vector<int> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIntArray(theID);
+ std::vector<int> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIntArray(theID);
int length = v.size();
if(length) {
aSeq->length(length);
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<string> v;
+ std::vector<std::string> v;
int length = theArray.length();
if(length) {
v.resize(length);
- for(int i = 0; i<length; i++) v[i] = string(theArray[i].in());
+ for(int i = 0; i<length; i++) v[i] = std::string(theArray[i].in());
}
dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->SetStrArray(theID, v);
}
SALOMEDS::Locker lock;
Unexpect aCatch (AP_InvalidIdentifier);
SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq;
- vector<string> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetStrArray(theID);
+ std::vector<std::string> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetStrArray(theID);
int length = v.size();
if(length) {
aSeq->length(length);
{
SALOMEDS::Locker lock;
SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq;
- vector<string> A = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIDs((Parameter_Types)theType);
+ std::vector<std::string> A = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIDs((Parameter_Types)theType);
if(A.size()) {
int length = A.size();
#include "SALOMEDS_AttributePersistentRef_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributePersistentRef_i::Value()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributePersistentRef*>(_impl)->SetValue(string(Str));
+ dynamic_cast<SALOMEDSImpl_AttributePersistentRef*>(_impl)->SetValue(std::string(Str));
}
#include "SALOMEDS_AttributePixMap_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Boolean SALOMEDS_AttributePixMap_i::HasPixMap()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_impl)->SetPixMap(string(Str));
+ dynamic_cast<SALOMEDSImpl_AttributePixMap*>(_impl)->SetPixMap(std::string(Str));
}
#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;
char* SALOMEDS_AttributePythonObject_i::GetObject()
{
SALOMEDS::Locker lock;
- string aSeq(dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_impl)->GetObject());
+ std::string aSeq(dynamic_cast<SALOMEDSImpl_AttributePythonObject*>(_impl)->GetObject());
CORBA::String_var aStr = CORBA::string_dup(aSeq.c_str());
return aStr._retn();
}
#include "SALOMEDS.hxx"
#include <sstream>
-using namespace std;
-
CORBA::Double SALOMEDS_AttributeReal_i::Value()
{
SALOMEDS::Locker lock;
#include "SALOMEDS_AttributeSelectable_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
CORBA::Boolean SALOMEDS_AttributeSelectable_i::IsSelectable()
{
SALOMEDS::Locker lock;
#include <vector>
-using namespace std;
-
-
void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& other)
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<int> aSeq;
+ std::vector<int> aSeq;
for(int i = 0, len = other.length(); i<len; i++) aSeq.push_back(other[i]);
dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Assign(aSeq);
}
{
SALOMEDS::Locker lock;
SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
- const vector<int>& CasCadeSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Array();
+ const std::vector<int>& CasCadeSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_impl)->Array();
int len = CasCadeSeq.size();
CorbaSeq->length(len);
for (int i = 0; i < len; i++) {
#include "SALOMEDS.hxx"
#include <vector>
-using namespace std;
-
void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other)
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<double> CasCadeSeq;
+ std::vector<double> CasCadeSeq;
for (int i = 0; i < other.length(); i++) {
CasCadeSeq.push_back(other[i]);
}
{
SALOMEDS::Locker lock;
SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq;
- const vector<double>& CasCadeSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Array();
+ const std::vector<double>& CasCadeSeq = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(_impl)->Array();
int len = CasCadeSeq.size();
CorbaSeq->length(len);
for (int i = 0; i < len; i++) {
#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeString_i::Value()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
- dynamic_cast<SALOMEDSImpl_AttributeString*>(_impl)->SetValue(string(value));
+ dynamic_cast<SALOMEDSImpl_AttributeString*>(_impl)->SetValue(std::string(value));
}
#include "SALOMEDS_AttributeStudyProperties.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
SALOMEDS_AttributeStudyProperties::SALOMEDS_AttributeStudyProperties
(SALOMEDSImpl_AttributeStudyProperties* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_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,
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
+ std::vector<std::string> aNames;
+ std::vector<int> aMinutes, aHours, aDays, aMonths, aYears;
SALOMEDSImpl_AttributeStudyProperties* anImpl = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl);
anImpl->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
aLength = aNames.size();
//
#include "SALOMEDS_AttributeStudyProperties_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
#define CREATION_MODE_NOTDEFINED 0
#define CREATION_MODE_SCRATCH 1
char* SALOMEDS_AttributeStudyProperties_i::GetUserName()
{
SALOMEDS::Locker lock;
- string S = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->GetCreatorName();
+ std::string S = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->GetCreatorName();
CORBA::String_var c_s = CORBA::string_dup(S.c_str());
return c_s._retn();
}
SALOMEDSImpl_AttributeStudyProperties* aProp = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_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);
}
CORBA::Boolean theWithCreator)
{
SALOMEDS::Locker lock;
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
+ std::vector<std::string> aNames;
+ std::vector<int> aMinutes, aHours, aDays, aMonths, aYears;
SALOMEDSImpl_AttributeStudyProperties* aProp = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl);
aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
int aLength = aNames.size();
#include "SALOMEDS_AttributeTableOfReal.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
SALOMEDS_AttributeTableOfReal::SALOMEDS_AttributeTableOfReal
(SALOMEDSImpl_AttributeTableOfReal* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
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;
}
#include <string>
-using namespace std;
-
SALOMEDS_AttributeTableOfString::SALOMEDS_AttributeTableOfString
(SALOMEDSImpl_AttributeTableOfString* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
#include "SALOMEDSImpl_SObject.hxx"
#include "SALOMEDS_SObject.hxx"
-using namespace std;
-
SALOMEDS_AttributeTarget::SALOMEDS_AttributeTarget(SALOMEDSImpl_AttributeTarget* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_local_impl)->Get();
+ std::vector<SALOMEDSImpl_SObject> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_local_impl)->Get();
aLength = aSeq.size();
for (i = 0; i < aLength; i++) {
aSO = new SALOMEDS_SObject(aSeq[i]);
#include <vector>
-using namespace std;
-
void SALOMEDS_AttributeTarget_i::Add(SALOMEDS::SObject_ptr anObject)
{
SALOMEDS::Locker lock;
SALOMEDS::Study::ListOfSObject* SALOMEDS_AttributeTarget_i::Get()
{
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_impl)->Get();
+ std::vector<SALOMEDSImpl_SObject> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTarget*>(_impl)->Get();
SALOMEDS::Study::ListOfSObject_var aSList = new SALOMEDS::Study::ListOfSObject;
int aLength = aSeq.size(), i;
if (aLength == 0) return aSList._retn();
#include <vector>
-using namespace std;
-
SALOMEDS_AttributeTextColor::SALOMEDS_AttributeTextColor(SALOMEDSImpl_AttributeTextColor* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
STextColor aColor;
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_local_impl)->TextColor();
+ std::vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_local_impl)->TextColor();
aColor.R = aSeq[0];
aColor.G = aSeq[1];
aColor.B = aSeq[2];
if (_isLocal) {
CheckLocked();
SALOMEDS::Locker lock;
- vector<double> aSeq;
+ std::vector<double> aSeq;
aSeq.push_back( value.R );
aSeq.push_back( value.G );
aSeq.push_back( value.B );
#include "SALOMEDS.hxx"
#include <vector>
-using namespace std;
-
SALOMEDS::Color SALOMEDS_AttributeTextColor_i::TextColor()
{
SALOMEDS::Locker lock;
SALOMEDS::Color TextColor;
- vector<double> anArray = dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_impl)->TextColor();
+ std::vector<double> anArray = dynamic_cast<SALOMEDSImpl_AttributeTextColor*>(_impl)->TextColor();
if (anArray.size()!=3) {
TextColor.R = 0;
TextColor.G = 0;
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<double> anArray;
+ std::vector<double> anArray;
anArray.push_back(value.R);
anArray.push_back(value.G);
anArray.push_back(value.B);
#include <vector>
-using namespace std;
-
SALOMEDS_AttributeTextHighlightColor::SALOMEDS_AttributeTextHighlightColor
(SALOMEDSImpl_AttributeTextHighlightColor* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
STextColor aColor;
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_local_impl)->TextHighlightColor();
+ std::vector<double> aSeq = dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_local_impl)->TextHighlightColor();
aColor.R = aSeq[0];
aColor.G = aSeq[1];
aColor.B = aSeq[2];
if (_isLocal) {
CheckLocked();
SALOMEDS::Locker lock;
- vector<double> aSeq;
+ std::vector<double> aSeq;
aSeq.push_back(value.R);
aSeq.push_back(value.G);
aSeq.push_back(value.B);
#include "SALOMEDS.hxx"
#include <vector>
-using namespace std;
-
SALOMEDS::Color SALOMEDS_AttributeTextHighlightColor_i::TextHighlightColor()
{
SALOMEDS::Locker lock;
SALOMEDS::Color TextHighlightColor;
- vector<double> anArray = dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_impl)->TextHighlightColor();
+ std::vector<double> anArray = dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(_impl)->TextHighlightColor();
if (anArray.size()!=3) {
TextHighlightColor.R = 0;
TextHighlightColor.G = 0;
{
SALOMEDS::Locker lock;
CheckLocked();
- vector<double> anArray;
+ std::vector<double> anArray;
anArray.push_back(value.R);
anArray.push_back(value.G);
anArray.push_back(value.B);
#include "SALOMEDSImpl_AttributeTreeNode.hxx"
#include "SALOMEDS_AttributeTreeNode.hxx"
-using namespace std;
-
SALOMEDS_AttributeTreeNode::SALOMEDS_AttributeTreeNode(SALOMEDSImpl_AttributeTreeNode* theAttr)
:SALOMEDS_GenericAttribute(theAttr)
{}
std::string SALOMEDS_AttributeTreeNode::GetTreeID()
{
- string aGUID;
+ std::string aGUID;
if (_isLocal) {
SALOMEDS::Locker lock;
SALOMEDSImpl_AttributeTreeNode* aNode = dynamic_cast<SALOMEDSImpl_AttributeTreeNode*>(_local_impl);
std::string SALOMEDS_AttributeTreeNode::Label()
{
- string aLabel;
+ std::string aLabel;
if (_isLocal) {
SALOMEDS::Locker lock;
aLabel = _local_impl->Label().Entry();
#include "utilities.h"
#include "SALOMEDS.hxx"
-using namespace std;
-
static SALOMEDSImpl_AttributeTreeNode* GetNode(SALOMEDS::AttributeTreeNode_ptr value,
SALOMEDSImpl_AttributeTreeNode* aNode)
{
#include "SALOMEDS_AttributeUserID_i.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
char* SALOMEDS_AttributeUserID_i::Value()
{
SALOMEDS::Locker lock;
SALOMEDS::Locker lock;
CheckLocked();
CORBA::String_var Str = CORBA::string_dup(value);
- dynamic_cast<SALOMEDSImpl_AttributeUserID*>(_impl)->SetValue(string(Str));
+ dynamic_cast<SALOMEDSImpl_AttributeUserID*>(_impl)->SetValue(std::string(Str));
}
//
#include "SALOMEDS_BasicAttributeFactory.hxx"
#include "utilities.h"
-using namespace std;
+
//============================================================================
/*! Function : Create
// $Header$
//
#include "SALOMEDS_BasicAttribute_i.hxx"
-using namespace std;
//============================================================================
/*! Function : SetLabel
#include "SALOMEDS_SObject.hxx"
#include "SALOMEDS.hxx"
-using namespace std;
-
SALOMEDS_ChildIterator::SALOMEDS_ChildIterator(const SALOMEDSImpl_ChildIterator& theIterator)
{
SALOMEDS::Locker lock;
#include "SALOMEDSImpl_Study.hxx"
#include "utilities.h"
-using namespace std;
-
//============================================================================
/*! Function : constructor
* Purpose :
#include "utilities.h"
#include "HDFOI.hxx"
-using namespace std;
-
//============================================================================
/*! Function :
* Purpose :
#include "SALOMEDS.hxx"
#include <stdlib.h>
-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)
{
}
SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::SaveASCII(const SALOMEDSImpl_SComponent& theComponent,
- const string& theURL,
+ const std::string& theURL,
long& theStreamLength,
bool isMultiFile)
{
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);
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);
-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)
{
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)
{
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)
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);
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)
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,
// 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";
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());
#include <unistd.h>
#endif
-using namespace std;
-
SALOMEDS_GenericAttribute::SALOMEDS_GenericAttribute(SALOMEDSImpl_GenericAttribute* theGA)
{
_isLocal = true;
#include <unistd.h>
#endif
-using namespace std;
-
UNEXPECT_CATCH(GALockProtection, SALOMEDS::GenericAttribute::LockProtection);
SALOMEDS_GenericAttribute_i::SALOMEDS_GenericAttribute_i(DF_Attribute* theImpl, CORBA::ORB_ptr theOrb)
{
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());
}
{
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());
}
{
SALOMEDS::Locker lock;
- string aClassType = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr)->GetClassType();
+ std::string aClassType = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr)->GetClassType();
char* aTypeOfAttribute = (char*)aClassType.c_str();
SALOMEDS::GenericAttribute_var anAttribute;
SALOMEDS_GenericAttribute_i* attr_servant = NULL;
#include "SALOMEDS_IParameters.hxx"
#include <utilities.h>
-using namespace std;
-
#define PT_INTEGER 0
#define PT_REAL 1
#define PT_BOOLEAN 2
_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<string> v;
+ std::vector<std::string> 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_ &&
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<string> v = _ap->GetStrArray(listName);
+ std::vector<std::string> v = _ap->GetStrArray(listName);
return v.size();
}
-vector<string> SALOMEDS_IParameters::getValues(const string& listName)
+std::vector<std::string> SALOMEDS_IParameters::getValues(const std::string& listName)
{
- vector<string> v;
+ std::vector<std::string> 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<string> v = _ap->GetStrArray(listName);
+ std::vector<std::string> v = _ap->GetStrArray(listName);
if(index >= v.size()) return "";
return v[index];
}
-vector<string> SALOMEDS_IParameters::getLists()
+std::vector<std::string> SALOMEDS_IParameters::getLists()
{
- vector<string> v;
+ std::vector<std::string> 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<string> v;
+ std::vector<std::string> 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);
}
-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<string> v = _ap->GetStrArray(entry);
+ std::vector<std::string> v = _ap->GetStrArray(entry);
int length = v.size();
for(int i = 0; i<length; i+=1) {
if(v[i] == parameterName) return v[i+1];
}
-vector<string> SALOMEDS_IParameters::getAllParameterNames(const string& entry)
+std::vector<std::string> SALOMEDS_IParameters::getAllParameterNames(const std::string& entry)
{
- vector<string> v, names;
+ std::vector<std::string> v, names;
if(!_ap) return v;
if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
v = _ap->GetStrArray(entry);
return names;
}
-vector<string> SALOMEDS_IParameters::getAllParameterValues(const string& entry)
+std::vector<std::string> SALOMEDS_IParameters::getAllParameterValues(const std::string& entry)
{
- vector<string> v, values;
+ std::vector<std::string> v, values;
if(!_ap) return v;
if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
v = _ap->GetStrArray(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<string> SALOMEDS_IParameters::getEntries()
+std::vector<std::string> SALOMEDS_IParameters::getEntries()
{
- vector<string> v;
+ std::vector<std::string> 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)) {
_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<string> SALOMEDS_IParameters::getProperties()
+std::vector<std::string> SALOMEDS_IParameters::getProperties()
{
- vector<string> v;
+ std::vector<std::string> v;
if(!_ap) return v;
if(!_ap->IsSet(_AP_PROPERTIES_LIST_, PT_STRARRAY)) return v;
return _ap->GetStrArray(_AP_PROPERTIES_LIST_);
}
-vector<string> SALOMEDS_IParameters::parseValue(const string& value, const char separator, bool fromEnd)
+std::vector<std::string> SALOMEDS_IParameters::parseValue(const std::string& value, const char separator, bool fromEnd)
{
- string val(value);
- vector<string> v;
+ std::string val(value);
+ std::vector<std::string> v;
int pos;
if(fromEnd) pos = val.rfind(separator);
else pos = val.find(separator);
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);
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);
}
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;
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;
return (bool)ap->GetBool(_AP_DUMP_PYTHON_);
}
-string SALOMEDS_IParameters::getDefaultVisualComponent()
+std::string SALOMEDS_IParameters::getDefaultVisualComponent()
{
return "Interface Applicative";
}
#include <string>
-using namespace std;
-
SALOMEDS_SComponent::SALOMEDS_SComponent(SALOMEDS::SComponent_ptr theSComponent)
:SALOMEDS_SObject(theSComponent)
{}
#include "SALOMEDS.hxx"
#include "SALOMEDSImpl_SComponent.hxx"
-using namespace std;
-
//============================================================================
/*! Function : constructor
*
#include "utilities.h"
#include <map>
-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);
char* SALOMEDS_SComponent_i::ComponentDataType()
{
SALOMEDS::Locker lock;
- string aType = dynamic_cast<SALOMEDSImpl_SComponent*>(_impl)->ComponentDataType();
+ std::string aType = dynamic_cast<SALOMEDSImpl_SComponent*>(_impl)->ComponentDataType();
return CORBA::string_dup(aType.c_str());
}
CORBA::Boolean SALOMEDS_SComponent_i::ComponentIOR(CORBA::String_out IOR)
{
SALOMEDS::Locker lock;
- string ior;
+ std::string ior;
if(!dynamic_cast<SALOMEDSImpl_SComponent*>(_impl)->ComponentIOR(ior)) {
IOR = CORBA::string_dup("");
return false;
#endif
-
-using namespace std;
-
SALOMEDS_SObject::SALOMEDS_SObject(SALOMEDS::SObject_ptr theSObject)
{
#ifdef WIN32
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<DF_Attribute*> aSeq = _local_impl->GetAllAttributes();
+ std::vector<DF_Attribute*> aSeq = _local_impl->GetAllAttributes();
aLength = aSeq.size();
for (int i = 0; i < aLength; i++) {
anAttr = SALOMEDS_GenericAttribute::CreateAttribute(dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aSeq[i]));
#include <unistd.h>
#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);
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));
SALOMEDS::ListOfAttributes* SALOMEDS_SObject_i::GetAllAttributes()
{
SALOMEDS::Locker lock;
- vector<DF_Attribute*> aSeq = _impl->GetAllAttributes();
+ std::vector<DF_Attribute*> aSeq = _impl->GetAllAttributes();
SALOMEDS::ListOfAttributes_var SeqOfAttr = new SALOMEDS::ListOfAttributes;
int length = aSeq.size();
void SALOMEDS_SObject_i::Name(const char* name)
{
SALOMEDS::Locker lock;
- string aName((char*)name);
+ std::string aName((char*)name);
_impl->Name(aName);
}
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);
#ifdef CHECKTIME
#include <Utils_Timer.hxx>
#endif
-using namespace std;
// extern "C"
// { // for ccmalloc memory debug
#include <unistd.h>
#endif
-using namespace std;
-
SALOMEDS_Study::SALOMEDS_Study(SALOMEDSImpl_Study* theStudy)
{
_isLocal = true;
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = _local_impl->FindObjectByName(anObjectName, aComponentName);
+ std::vector<SALOMEDSImpl_SObject> 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])));
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = _local_impl->FindDependances(*(aSO->GetLocalImpl()));
+ std::vector<SALOMEDSImpl_SObject> aSeq = _local_impl->FindDependances(*(aSO->GetLocalImpl()));
if (aSeq.size()) {
aLength = aSeq.size();
for (i = 0; i < aLength; i++)
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
return ret;
}
-void SALOMEDS_Study::SetStudyLock(const string& theLockerID)
+void SALOMEDS_Study::SetStudyLock(const std::string& theLockerID)
{
if (_isLocal) {
SALOMEDS::Locker lock;
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<string> SALOMEDS_Study::GetLockerID()
+std::vector<std::string> SALOMEDS_Study::GetLockerID()
{
std::vector<std::string> aVector;
int aLength, i;
}
-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;
_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;
_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;
_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;
_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;
_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) {
return aResult;
}
-int SALOMEDS_Study::GetInteger(const string& theVarName)
+int SALOMEDS_Study::GetInteger(const std::string& theVarName)
{
int aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::GetBoolean(const string& theVarName)
+bool SALOMEDS_Study::GetBoolean(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-std::string SALOMEDS_Study::GetString(const string& theVarName)
+std::string SALOMEDS_Study::GetString(const std::string& theVarName)
{
std::string aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::IsReal(const string& theVarName)
+bool SALOMEDS_Study::IsReal(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::IsInteger(const string& theVarName)
+bool SALOMEDS_Study::IsInteger(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::IsBoolean(const string& theVarName)
+bool SALOMEDS_Study::IsBoolean(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::IsString(const string& theVarName)
+bool SALOMEDS_Study::IsString(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-bool SALOMEDS_Study::IsVariable(const string& theVarName)
+bool SALOMEDS_Study::IsVariable(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-vector<string> SALOMEDS_Study::GetVariableNames()
+std::vector<std::string> SALOMEDS_Study::GetVariableNames()
{
- vector<string> aVector;
+ std::vector<std::string> aVector;
if (_isLocal) {
SALOMEDS::Locker lock;
aVector = _local_impl->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) {
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) {
return aResult;
}
-bool SALOMEDS_Study::IsVariableUsed(const string& theVarName)
+bool SALOMEDS_Study::IsVariableUsed(const std::string& theVarName)
{
bool aResult;
if (_isLocal) {
return aResult;
}
-vector< vector<string> > SALOMEDS_Study::ParseVariables(const string& theVars)
+std::vector< std::vector<std::string> > SALOMEDS_Study::ParseVariables(const std::string& theVars)
{
- vector< vector<string> > aResult;
+ std::vector< std::vector<std::string> > aResult;
if (_isLocal) {
SALOMEDS::Locker lock;
aResult = _local_impl->ParseVariables(theVars);
else {
SALOMEDS::ListOfListOfStrings_var aSeq = _corba_impl->ParseVariables(theVars.c_str());
for (int i = 0, n = aSeq->length(); i < n; i++) {
- vector<string> aVector;
+ std::vector<std::string> 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 );
}
}
-_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) {
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) {
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
-using namespace std;
-
SALOMEDS_StudyBuilder::SALOMEDS_StudyBuilder(SALOMEDSImpl_StudyBuilder* theBuilder)
{
_isLocal = true;
#include <DF_Document.hxx>
#include <stdlib.h>
-using namespace std;
-
UNEXPECT_CATCH(SBSalomeException, SALOME::SALOME_Exception);
UNEXPECT_CATCH(SBLockProtection, SALOMEDS::StudyBuilder::LockProtection);
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();
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();
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;
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));
}
//============================================================================
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();
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));
}
//============================================================================
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));
}
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));
}
//============================================================================
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));
}
//============================================================================
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));
}
#include <unistd.h>
#endif
-using namespace std;
-
SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_ptr orb);
SALOMEDS_StudyManager::SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManager)
if (_isLocal) {
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_Study*> aSeq = _local_impl->GetOpenStudies();
+ std::vector<SALOMEDSImpl_Study*> aSeq = _local_impl->GetOpenStudies();
aLength = aSeq.size();
for(i = 0; i < aLength; i++)
aVector.push_back(aSeq[i]->Name());
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) ;
#include <unistd.h>
#endif
-using namespace std;
-
UNEXPECT_CATCH(SalomeException,SALOME::SALOME_Exception);
UNEXPECT_CATCH(LockProtection, SALOMEDS::StudyBuilder::LockProtection);
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)
}
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)
}
SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
- return _impl->SaveAsASCII(string(aUrl), aStudyImpl, _factory, theMultiFile);
+ return _impl->SaveAsASCII(std::string(aUrl), aStudyImpl, _factory, theMultiFile);
}
//============================================================================
{
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_Study*> anOpened = _impl->GetOpenStudies();
+ std::vector<SALOMEDSImpl_Study*> anOpened = _impl->GetOpenStudies();
int aLength = anOpened.size();
SALOMEDS::ListOfOpenStudies_var _list_open_studies = new SALOMEDS::ListOfOpenStudies;
{
SALOMEDS::Locker lock;
- SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByName(string(aStudyName));
+ SALOMEDSImpl_Study* aStudyImpl = _impl->GetStudyByName(std::string(aStudyName));
if (!aStudyImpl)
{
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) ;
#include <unistd.h>
#endif
-using namespace std;
-
std::map<SALOMEDSImpl_Study* , SALOMEDS_Study_i*> SALOMEDS_Study_i::_mapOfStudies;
//============================================================================
{
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);
{
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);
{
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()) {
{
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();
{
SALOMEDS::Locker lock;
- vector<SALOMEDSImpl_SObject> aSeq = _impl->FindObjectByName(string((char*)anObjectName),
- string((char*)aComponentName));
+ std::vector<SALOMEDSImpl_SObject> 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);
{
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);
{
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);
{
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);
{
SALOMEDS::Locker lock;
- _impl->SetContext(string((char*)thePath));
+ _impl->SetContext(std::string((char*)thePath));
if(_impl->IsError() && _impl->GetErrorCode() == "InvalidContext")
throw SALOMEDS::Study::StudyInvalidContext();
}
if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
throw SALOMEDS::Study::StudyInvalidContext();
- vector<string> aSeq = _impl->GetObjectNames(string((char*)theContext));
+ std::vector<std::string> aSeq = _impl->GetObjectNames(std::string((char*)theContext));
if (_impl->GetErrorCode() == "InvalidContext")
throw SALOMEDS::Study::StudyInvalidContext();
if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
throw SALOMEDS::Study::StudyInvalidContext();
- vector<string> aSeq = _impl->GetDirectoryNames(string((char*)theContext));
+ std::vector<std::string> aSeq = _impl->GetDirectoryNames(std::string((char*)theContext));
if (_impl->GetErrorCode() == "InvalidContext")
throw SALOMEDS::Study::StudyInvalidContext();
if (strlen(theContext) == 0 && !_impl->HasCurrentContext())
throw SALOMEDS::Study::StudyInvalidContext();
- vector<string> aSeq = _impl->GetFileNames(string((char*)theContext));
+ std::vector<std::string> aSeq = _impl->GetFileNames(std::string((char*)theContext));
if (_impl->GetErrorCode() == "InvalidContext")
throw SALOMEDS::Study::StudyInvalidContext();
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
- vector<string> aSeq = _impl->GetComponentNames(string((char*)theContext));
+ std::vector<std::string> aSeq = _impl->GetComponentNames(std::string((char*)theContext));
int aLength = aSeq.size();
aResult->length(aLength);
void SALOMEDS_Study_i::Name(const char* name)
{
SALOMEDS::Locker lock;
- _impl->Name(string((char*)name));
+ _impl->Name(std::string((char*)name));
}
//============================================================================
void SALOMEDS_Study_i::URL(const char* url)
{
SALOMEDS::Locker lock;
- _impl->URL(string((char*)url));
+ _impl->URL(std::string((char*)url));
}
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)
{
SALOMEDS::Locker lock;
- vector<string> aSeq = _impl->GetModificationsDate();
+ std::vector<std::string> aSeq = _impl->GetModificationsDate();
int aLength = aSeq.size();
SALOMEDS::ListOfDates_var aDates = new SALOMEDS::ListOfDates;
aDates->length(aLength);
{
SALOMEDS::Locker lock;
- vector<string> anIORs = _impl->GetIORs();
+ std::vector<std::string> anIORs = _impl->GetIORs();
int i, aSize = (int)anIORs.size();
for(i = 0; i < aSize; i++) {
{
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;
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
- vector<string> aSeq = _impl->GetLockerID();
+ std::vector<std::string> aSeq = _impl->GetLockerID();
int aLength = aSeq.size();
aResult->length(aLength);
//============================================================================
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);
}
//============================================================================
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);
}
//============================================================================
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);
}
//============================================================================
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);
}
//============================================================================
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);
}
//============================================================================
CORBA::Double SALOMEDS_Study_i::GetReal(const char* theVarName)
{
- return _impl->GetVariableValue(string(theVarName));
+ return _impl->GetVariableValue(std::string(theVarName));
}
//============================================================================
//============================================================================
CORBA::Long SALOMEDS_Study_i::GetInteger(const char* theVarName)
{
- return (int)_impl->GetVariableValue(string(theVarName));
+ return (int)_impl->GetVariableValue(std::string(theVarName));
}
//============================================================================
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::GetBoolean(const char* theVarName)
{
- return (bool)_impl->GetVariableValue(string(theVarName));
+ return (bool)_impl->GetVariableValue(std::string(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());
}
//============================================================================
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsReal(const char* theVarName)
{
- return _impl->IsTypeOf(string(theVarName),
+ return _impl->IsTypeOf(std::string(theVarName),
SALOMEDSImpl_GenericVariable::REAL_VAR);
}
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsInteger(const char* theVarName)
{
- return _impl->IsTypeOf(string(theVarName),
+ return _impl->IsTypeOf(std::string(theVarName),
SALOMEDSImpl_GenericVariable::INTEGER_VAR);
}
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsBoolean(const char* theVarName)
{
- return _impl->IsTypeOf(string(theVarName),
+ return _impl->IsTypeOf(std::string(theVarName),
SALOMEDSImpl_GenericVariable::BOOLEAN_VAR);
}
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsString(const char* theVarName)
{
- return _impl->IsTypeOf(string(theVarName),
+ return _impl->IsTypeOf(std::string(theVarName),
SALOMEDSImpl_GenericVariable::STRING_VAR);
}
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsVariable(const char* theVarName)
{
- return _impl->IsVariable(string(theVarName));
+ return _impl->IsVariable(std::string(theVarName));
}
//============================================================================
//============================================================================
SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetVariableNames()
{
- vector<string> aVarNames = _impl->GetVariableNames();
+ std::vector<std::string> aVarNames = _impl->GetVariableNames();
SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
int aLen = aVarNames.size();
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::RemoveVariable(const char* theVarName)
{
- return _impl->RemoveVariable(string(theVarName));
+ return _impl->RemoveVariable(std::string(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));
}
//============================================================================
//============================================================================
CORBA::Boolean SALOMEDS_Study_i::IsVariableUsed(const char* theVarName)
{
- return _impl->IsVariableUsed(string(theVarName));
+ return _impl->IsVariableUsed(std::string(theVarName));
}
//============================================================================
SALOMEDS::ListOfListOfStrings* SALOMEDS_Study_i::ParseVariables(const char* theVarName)
{
- vector< vector<string> > aSections = _impl->ParseVariables(string(theVarName));
+ std::vector< std::vector<std::string> > aSections = _impl->ParseVariables(std::string(theVarName));
SALOMEDS::ListOfListOfStrings_var aResult = new SALOMEDS::ListOfListOfStrings;
aResult->length(aSectionsLen);
for (int aSectionInd = 0; aSectionInd < aSectionsLen; aSectionInd++) {
- vector<string> aVarNames = aSections[aSectionInd];
+ std::vector<std::string> aVarNames = aSections[aSectionInd];
SALOMEDS::ListOfStrings_var aList = new SALOMEDS::ListOfStrings;
{
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());
}
#include <string>
-using namespace std;
-
SALOMEDS_UseCaseBuilder::SALOMEDS_UseCaseBuilder(SALOMEDSImpl_UseCaseBuilder* theBuilder)
{
_isLocal = true;
#include "utilities.h"
-using namespace std;
-
//============================================================================
/*! Function : constructor
* Purpose :
#include "SALOMEDS.hxx"
#include "SALOMEDS_SObject.hxx"
-using namespace std;
-
SALOMEDS_UseCaseIterator::SALOMEDS_UseCaseIterator(const SALOMEDSImpl_UseCaseIterator& theIterator)
{
_isLocal = true;
#include "SALOMEDSImpl_SObject.hxx"
#include "utilities.h"
-using namespace std;
-
//============================================================================
/*! Function : constructor
* Purpose :
#include "SALOMEDS_SObject.hxx"
-using namespace std;
// ============================================================================
/*!
void SALOMEDSTest::tearDown()
{
_PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) );
- vector<string> v = sm->GetOpenStudies();
+ std::vector<std::string> v = sm->GetOpenStudies();
for(int i = 0; i<v.size(); i++) {
_PTR(Study) study = sm->GetStudyByName(v[i]);
if(study)
CPPUNIT_ASSERT(_attr);
//Check method Value
- string value = _attr->Value();
+ std::string value = _attr->Value();
CPPUNIT_ASSERT(value.empty());
CPPUNIT_ASSERT(_attr);
//Check method Value
- string value = _attr->Value();
+ std::string value = _attr->Value();
CPPUNIT_ASSERT(value.empty());
CPPUNIT_ASSERT(_attr);
//Check method Value
- string value = _attr->Value();
+ std::string value = _attr->Value();
CPPUNIT_ASSERT(value.empty());
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);
CPPUNIT_ASSERT(_attr);
//Check method Value
- string value = _attr->Value();
+ std::string value = _attr->Value();
CPPUNIT_ASSERT(value.empty());
CPPUNIT_ASSERT(_attr->IsSet("BoolValue", PT_BOOLEAN));
CPPUNIT_ASSERT(!_attr->GetBool("BoolValue"));
- vector<int> intArray;
+ std::vector<int> intArray;
intArray.push_back(0);
intArray.push_back(1);
CPPUNIT_ASSERT(_attr->GetIntArray("IntArray")[0] == 0);
CPPUNIT_ASSERT(_attr->GetIntArray("IntArray")[1] == 1);
- vector<double> realArray;
+ std::vector<double> realArray;
realArray.push_back(0.0);
realArray.push_back(1.1);
CPPUNIT_ASSERT(_attr->GetRealArray("RealArray")[0] == 0.0);
CPPUNIT_ASSERT(_attr->GetRealArray("RealArray")[1] == 1.1);
- vector<string> strArray;
+ std::vector<std::string> strArray;
strArray.push_back("hello");
strArray.push_back("world");
CPPUNIT_ASSERT(_attr);
//Check method Value
- string value = _attr->Value();
+ std::string value = _attr->Value();
CPPUNIT_ASSERT(value.empty());
CPPUNIT_ASSERT(!_attr->HasPixMap());
//Check method SetPixMap
- string pixmap = "something";
+ std::string pixmap = "something";
_attr->SetPixMap(pixmap);
CPPUNIT_ASSERT(_attr->HasPixMap());
//Check method IsScript
CPPUNIT_ASSERT(!_attr->IsScript());
- string pyobj = "some object!";
+ std::string pyobj = "some object!";
//Check method SetObject
_attr->SetObject(pyobj, true);
CPPUNIT_ASSERT(_attr->Value(3) == 3);
//Check method CorbaSequence
- vector<int> v = _attr->CorbaSequence();
+ std::vector<int> v = _attr->CorbaSequence();
CPPUNIT_ASSERT(v.size() == 3);
CPPUNIT_ASSERT(_attr->Value(3) == 3.3);
//Check method CorbaSequence
- vector<double> v = _attr->CorbaSequence();
+ std::vector<double> v = _attr->CorbaSequence();
CPPUNIT_ASSERT(v.size() == 3);
v.push_back(5.5);
CPPUNIT_ASSERT(_attr->GetUserName() == "srn");
//Check method SetCreationMode
- string value = "from scratch";
+ std::string value = "from scratch";
_attr->SetCreationMode(value);
//Check method GetCreationMode
_attr->SetModification("srn2", 6, 7, 8, 9, 10);
//Check method GetModificationsList
- vector<string> vs;
- vector<int> vi[5];
+ std::vector<std::string> vs;
+ std::vector<int> 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);
CPPUNIT_ASSERT(_attr->GetValue(1, 1) == 23);
//Check method GetRowSetIndices
- vector<int> rs = _attr->GetRowSetIndices(1);
+ std::vector<int> rs = _attr->GetRowSetIndices(1);
CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1);
_attr->PutValue(32, 2,2);
CPPUNIT_ASSERT(_attr->HasValue(2, 2));
- vector<string> rowTitles;
+ std::vector<std::string> rowTitles;
rowTitles.push_back("title1");
rowTitles.push_back("title2");
_attr->SetRowTitle(1, "new_title");
//Check method GetRowTitles
- vector<string> rt = _attr->GetRowTitles();
+ std::vector<std::string> rt = _attr->GetRowTitles();
CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2");
- vector<string> colTitles;
+ std::vector<std::string> colTitles;
colTitles.push_back("title1");
colTitles.push_back("title2");
_attr->SetColumnTitle(1, "new_title");
//Check method GetColumnTitles
- vector<string> ct = _attr->GetColumnTitles();
+ std::vector<std::string> ct = _attr->GetColumnTitles();
CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2");
- vector<string> rowUnits;
+ std::vector<std::string> rowUnits;
rowUnits.push_back("unit1");
rowUnits.push_back("unit2");
_attr->SetRowUnit(1, "new_unit");
//Check method GetRowUnits
- vector<string> ru = _attr->GetRowUnits();
+ std::vector<std::string> ru = _attr->GetRowUnits();
CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2");
CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
//Check method AddRow
- vector<int> data;
+ std::vector<int> data;
data.push_back(11);
data.push_back(22);
CPPUNIT_ASSERT(_attr->GetNbRows() == 3);
//Check method GetRow
- vector<int> data2 = _attr->GetRow(3);
+ std::vector<int> data2 = _attr->GetRow(3);
CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == 11 && data2[1] == 22);
CPPUNIT_ASSERT(_attr->GetValue(1, 1) == 23.23);
//Check method GetRowSetIndices
- vector<int> rs = _attr->GetRowSetIndices(1);
+ std::vector<int> 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<string> rowTitles;
+ std::vector<std::string> rowTitles;
rowTitles.push_back("title1");
rowTitles.push_back("title2");
_attr->SetRowTitle(1, "new_title");
//Check method GetRowTitles
- vector<string> rt = _attr->GetRowTitles();
+ std::vector<std::string> rt = _attr->GetRowTitles();
CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2");
- vector<string> colTitles;
+ std::vector<std::string> colTitles;
colTitles.push_back("title1");
colTitles.push_back("title2");
_attr->SetColumnTitle(1, "new_title");
//Check method GetColumnTitles
- vector<string> ct = _attr->GetColumnTitles();
+ std::vector<std::string> ct = _attr->GetColumnTitles();
CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2");
- vector<string> rowUnits;
+ std::vector<std::string> rowUnits;
rowUnits.push_back("unit1");
rowUnits.push_back("unit2");
_attr->SetRowUnit(1, "new_unit");
//Check method GetRowUnits
- vector<string> ru = _attr->GetRowUnits();
+ std::vector<std::string> ru = _attr->GetRowUnits();
CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2");
CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
//Check method AddRow
- vector<double> data;
+ std::vector<double> data;
data.push_back(11.11);
data.push_back(22.22);
CPPUNIT_ASSERT(_attr->GetNbRows() == 3);
//Check method GetRow
- vector<double> data2 = _attr->GetRow(3);
+ std::vector<double> data2 = _attr->GetRow(3);
CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == 11.11 && data2[1] == 22.22);
CPPUNIT_ASSERT(_attr->GetValue(1, 1) == "23");
//Check method GetRowSetIndices
- vector<int> rs = _attr->GetRowSetIndices(1);
+ std::vector<int> rs = _attr->GetRowSetIndices(1);
CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1);
_attr->PutValue("32", 2,2);
CPPUNIT_ASSERT(_attr->HasValue(2, 2));
- vector<string> rowTitles;
+ std::vector<std::string> rowTitles;
rowTitles.push_back("title1");
rowTitles.push_back("title2");
_attr->SetRowTitle(1, "new_title");
//Check method GetRowTitles
- vector<string> rt = _attr->GetRowTitles();
+ std::vector<std::string> rt = _attr->GetRowTitles();
CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2");
- vector<string> colTitles;
+ std::vector<std::string> colTitles;
colTitles.push_back("title1");
colTitles.push_back("title2");
_attr->SetColumnTitle(1, "new_title");
//Check method GetColumnTitles
- vector<string> ct = _attr->GetColumnTitles();
+ std::vector<std::string> ct = _attr->GetColumnTitles();
CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2");
- vector<string> rowUnits;
+ std::vector<std::string> rowUnits;
rowUnits.push_back("unit1");
rowUnits.push_back("unit2");
_attr->SetRowUnit(1, "new_unit");
//Check method GetRowUnits
- vector<string> ru = _attr->GetRowUnits();
+ std::vector<std::string> ru = _attr->GetRowUnits();
CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2");
CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
//Check method AddRow
- vector<string> data;
+ std::vector<std::string> data;
data.push_back("11");
data.push_back("22");
CPPUNIT_ASSERT(_attr->GetNbRows() == 3);
//Check method GetRow
- vector<string> data2 = _attr->GetRow(3);
+ std::vector<std::string> data2 = _attr->GetRow(3);
CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == "11" && data2[1] == "22");
_attr->Add(so2);
//Check method Get
- vector< _PTR(SObject) > v = _attr->Get();
+ std::vector< _PTR(SObject) > v = _attr->Get();
CPPUNIT_ASSERT(v.size() == 2);
//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");
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);
//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);
//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);
studyBuilder->NewComponent("Test1");
studyBuilder->NewComponent("Test2");
- vector<string> v;
+ std::vector<std::string> v;
v.push_back("Test1");
v.push_back("Test2");
_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");
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
CPPUNIT_ASSERT(!study->FindComponent(""));
//Check method GetComponentNames
- vector<string> components = study->GetComponentNames(""); //The context doesn't matter
+ std::vector<std::string> components = study->GetComponentNames(""); //The context doesn't matter
CPPUNIT_ASSERT(components.size() == 1 && components[0] == "sco1");
//Check method FindComponentID
_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);
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
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;
study->SetContext("/"); //Root
//Check method GetObjectNames
- vector<string> vs = study->GetObjectNames("/sco1");
+ std::vector<std::string> vs = study->GetObjectNames("/sco1");
CPPUNIT_ASSERT(vs.size() == 2);
//Check method GetDirectoryNames
//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
//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");
//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");
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);
//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);
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));
CPPUNIT_ASSERT(study4->Name() == study2->Name());
//Check method GetOpenStudies
- vector<string> v = sm->GetOpenStudies();
+ std::vector<std::string> v = sm->GetOpenStudies();
CPPUNIT_ASSERT(v.size() == 2);
//Check method Close
//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
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);
#include "NamingService_WaitForServerReadiness.hxx"
#include "SALOMEDS_StudyManager_i.hxx"
-using namespace std;
// ============================================================================
/*!
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_<ORB_INIT>::Instance() ;
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();
if(host.empty())
NamingService_WaitForServerReadiness(&NS, "/myStudyManager");
else {
- string serverName = "/Containers/"+host+"/SuperVisionContainer";
+ std::string serverName = "/Containers/"+host+"/SuperVisionContainer";
NamingService_WaitForServerReadiness(&NS, serverName);
}
}
//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";
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;
//
#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()))) {
//function : SetValue
//purpose :
//=======================================================================
-void SALOMEDSImpl_AttributeComment::SetValue (const string& S)
+void SALOMEDSImpl_AttributeComment::SetValue (const std::string& S)
{
CheckLocked();
//function : ID
//purpose :
//=======================================================================
-const string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); }
+const std::string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); }
//=======================================================================
//function : NewEmpty
//
#include "SALOMEDSImpl_AttributeDrawable.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//
#include "SALOMEDSImpl_AttributeExpandable.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//
#include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//
#include "SALOMEDSImpl_AttributeFileType.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//
#include "SALOMEDSImpl_AttributeFlags.hxx"
-using namespace std;
-
-
/*
Class : SALOMEDSImpl_AttributeFlags
Description : This class is intended for storing different object attributes that
#include "SALOMEDSImpl_AttributeGraphic.hxx"
#include "DF_Attribute.hxx"
-using namespace std;
-
/*
Class : SALOMEDSImpl_AttributeGraphic
Description : This class is intended for storing information about
//function : SetVisibility
//purpose : Set visibility of object in all views
//=======================================================================
-void SALOMEDSImpl_AttributeGraphic::SetVisibility( const map<int, int>& theMap )
+void SALOMEDSImpl_AttributeGraphic::SetVisibility( const std::map<int, int>& theMap )
{
myVisibility = theMap;
}
//function : SetVisibility
//purpose : Get visibility of object in all views
//=======================================================================
-const map<int, int>& SALOMEDSImpl_AttributeGraphic::GetVisibility()
+const std::map<int, int>& SALOMEDSImpl_AttributeGraphic::GetVisibility()
{
return myVisibility;
}
#include "SALOMEDSImpl_AttributeIOR.hxx"
#include "SALOMEDSImpl_Study.hxx"
-using namespace std;
-
//to disable automatic genericobj management comment the following line
#define WITHGENERICOBJ
#include "SALOMEDSImpl_AttributeInteger.hxx"
#include <stdlib.h>
-using namespace std;
//=======================================================================
//function : GetID
//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());
}
//
#include "SALOMEDSImpl_AttributeLocalID.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//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());
}
//
#include "SALOMEDSImpl_AttributeName.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//
#include "SALOMEDSImpl_AttributeOpened.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
#include <sstream>
#include <sstream>
-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();
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];
buffer[pos] = (char)val;
}
- string RS(buffer);
+ std::string RS(buffer);
delete c;
delete buffer;
return RS;
* 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();
* 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];
* 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();
* 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];
* 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();
* 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];
* 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();
* 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];
* Purpose : Associates an array of double values with the given ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetRealArray(const string& theID, const vector<double>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetRealArray(const std::string& theID, const std::vector<double>& theArray)
{
CheckLocked();
* Purpose : Returns double values associated with the ID
*/
//=======================================================================
-vector<double> SALOMEDSImpl_AttributeParameter::GetRealArray(const string& theID)
+std::vector<double> SALOMEDSImpl_AttributeParameter::GetRealArray(const std::string& theID)
{
if(!IsSet(theID, PT_REALARRAY)) throw DFexception("Invalid ID");
return _realarrays[theID];
* Purpose : Associates an array of int values with the given ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetIntArray(const string& theID, const vector<int>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetIntArray(const std::string& theID, const std::vector<int>& theArray)
{
CheckLocked();
* Purpose : Returns int values associated with the ID
*/
//=======================================================================
-vector<int> SALOMEDSImpl_AttributeParameter::GetIntArray(const string& theID)
+std::vector<int> SALOMEDSImpl_AttributeParameter::GetIntArray(const std::string& theID)
{
if(!IsSet(theID, PT_INTARRAY)) throw DFexception("Invalid ID");
return _intarrays[theID];
* Purpose : Associates an array of string values with the given ID
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::SetStrArray(const string& theID, const vector<string>& theArray)
+void SALOMEDSImpl_AttributeParameter::SetStrArray(const std::string& theID, const std::vector<std::string>& theArray)
{
CheckLocked();
* Purpose : Returns string values associated with the ID
*/
//=======================================================================
-vector<string> SALOMEDSImpl_AttributeParameter::GetStrArray(const string& theID)
+std::vector<std::string> SALOMEDSImpl_AttributeParameter::GetStrArray(const std::string& theID)
{
if(!IsSet(theID, PT_STRARRAY)) throw DFexception("Invalid ID");
return _strarrays[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: {
* 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();
* Purpose : Returns an array of all ID's of the given type
*/
//=======================================================================
-vector<string> SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType)
+std::vector<std::string> SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types theType)
{
- vector<string> anArray;
+ std::vector<std::string> anArray;
int i = 0;
switch(theType) {
case PT_INTEGER: {
if(_ints.size()) {
anArray.resize(_ints.size());
- for(map<string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++)
+ for(std::map<std::string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++)
anArray[i] = p->first;
}
break;
case PT_REAL: {
if(_reals.size()) {
anArray.resize(_reals.size());
- for(map<string,double>::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++)
+ for(std::map<std::string,double>::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++)
anArray[i] = p->first;
}
break;
case PT_BOOLEAN: {
if(_bools.size()) {
anArray.resize(_bools.size());
- for(map<string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++)
+ for(std::map<std::string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++)
anArray[i] = p->first;
}
break;
case PT_STRING: {
if(_strings.size()) {
anArray.resize(_strings.size());
- for(map<string,string>::const_iterator p = _strings.begin(); p!= _strings.end(); p++)
+ for(std::map<std::string,std::string>::const_iterator p = _strings.begin(); p!= _strings.end(); p++)
anArray[i] = p->first;
}
break;
case PT_REALARRAY: {
if(_realarrays.size()) {
anArray.resize(_realarrays.size());
- for(map< string, vector<double> >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++)
+ for(std::map< std::string, std::vector<double> >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++)
anArray[i] = p->first;
}
break;
case PT_INTARRAY: {
if(_intarrays.size()) {
anArray.resize(_intarrays.size());
- for(map< string, vector<int> >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++)
+ for(std::map< std::string, std::vector<int> >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++)
anArray[i] = p->first;
}
break;
case PT_STRARRAY: {
if(_strarrays.size()) {
anArray.resize(_strarrays.size());
- for(map< string, vector<string> >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++)
+ for(std::map< std::string, std::vector<std::string> >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++)
anArray[i] = p->first;
}
break;
_intarrays.clear();
_strarrays.clear();
- for(map<string,int>::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++)
+ for(std::map<std::string,int>::const_iterator p = A->_ints.begin(); p!= A->_ints.end(); p++)
if(p->first.size()) _ints[p->first] = p->second;
- for(map<string,double>::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++)
+ for(std::map<std::string,double>::const_iterator p = A->_reals.begin(); p!= A->_reals.end(); p++)
if(p->first.size()) _reals[p->first] = p->second;
- for(map<string,bool>::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++)
+ for(std::map<std::string,bool>::const_iterator p = A->_bools.begin(); p!= A->_bools.end(); p++)
if(p->first.size()) _bools[p->first] = p->second;
- for(map<string,string>::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++)
+ for(std::map<std::string,std::string>::const_iterator p = A->_strings.begin(); p!= A->_strings.end(); p++)
if(p->first.size()) _strings[p->first] = p->second;
- for(map< string,vector<double> >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++)
+ for(std::map< std::string,std::vector<double> >::const_iterator p = A->_realarrays.begin(); p!= A->_realarrays.end(); p++)
if(p->first.size()) _realarrays[p->first] = p->second;
- for(map< string,vector<int> >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++)
+ for(std::map< std::string,std::vector<int> >::const_iterator p = A->_intarrays.begin(); p!= A->_intarrays.end(); p++)
if(p->first.size()) _intarrays[p->first] = p->second;
- for(map< string,vector<string> >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++)
+ for(std::map< std::string,std::vector<std::string> >::const_iterator p = A->_strarrays.begin(); p!= A->_strarrays.end(); p++)
if(p->first.size()) _strarrays[p->first] = p->second;
}
* 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<string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++) {
+ for(std::map<std::string,int>::const_iterator p = _ints.begin(); p != _ints.end(); p++) {
buffer << convertString(p->first) << " " << p->second << " ";
}
buffer << _reals.size() << " ";
- for(map<string,double>::const_iterator p =_reals.begin(); p != _reals.end(); p++) {
+ for(std::map<std::string,double>::const_iterator p =_reals.begin(); p != _reals.end(); p++) {
sprintf(tmpBuffer, "%.64e", p->second);
buffer << convertString(p->first) << " " << tmpBuffer << " ";
}
buffer << _bools.size() << " ";
- for(map<string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++) {
+ for(std::map<std::string,bool>::const_iterator p = _bools.begin(); p != _bools.end(); p++) {
buffer << convertString(p->first) << " " << p->second << " ";
}
buffer << _strings.size() << " ";
- for(map<string,string>::const_iterator p = _strings.begin(); p != _strings.end(); p++) {
+ for(std::map<std::string,std::string>::const_iterator p = _strings.begin(); p != _strings.end(); p++) {
buffer << convertString(p->first) << " " << convertString(p->second) << " ";
}
buffer << _realarrays.size() << " ";
- for(map< string,vector<double> >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) {
- vector<double> v(p->second);
+ for(std::map< std::string,std::vector<double> >::const_iterator p = _realarrays.begin(); p != _realarrays.end(); p++) {
+ std::vector<double> v(p->second);
sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
buffer << tmpBuffer;
for(int i = 0; i<v.size(); i++) {
}
buffer << _intarrays.size() << " ";
- for(map< string,vector<int> >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) {
- vector<int> v(p->second);
+ for(std::map< std::string,std::vector<int> >::const_iterator p = _intarrays.begin(); p != _intarrays.end(); p++) {
+ std::vector<int> v(p->second);
sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
buffer << tmpBuffer;
for(int i = 0; i<v.size(); i++) {
}
buffer << _strarrays.size() << " ";
- for(map< string,vector<string> >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) {
- vector<string> v(p->second);
+ for(std::map< std::string,std::vector<std::string> >::const_iterator p = _strarrays.begin(); p != _strarrays.end(); p++) {
+ std::vector<std::string> v(p->second);
sprintf(tmpBuffer, " %s %d ", convertString(p->first).c_str(), v.size());
buffer << tmpBuffer;
for(int i = 0; i<v.size(); i++) {
delete tmpBuffer;
- string AS = buffer.str();
+ std::string AS = buffer.str();
return AS;
}
* Purpose : Restores the attribute from the string
*/
//=======================================================================
-void SALOMEDSImpl_AttributeParameter::Load(const string& theValue)
+void SALOMEDSImpl_AttributeParameter::Load(const std::string& theValue)
{
Backup();
_realarrays.clear();
_intarrays.clear();
- istringstream buffer(theValue.c_str());
+ std::istringstream buffer(theValue.c_str());
int size, val, ival;
double val2;
- string s, id;
+ std::string s, id;
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> id >> val;
- vector<double> v;
+ std::vector<double> v;
v.resize(val);
for(int j = 0; j<val; j++) {
buffer >> val2;
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> id >> val;
- vector<int> v;
+ std::vector<int> v;
v.resize(val);
for(int j = 0; j<val; j++) {
buffer >> ival;
buffer >> size;
for(int i = 1; i<=size; i++) {
buffer >> id >> val;
- vector<string> v;
+ std::vector<std::string> v;
v.resize(val);
for(int j = 0; j<val; j++) {
buffer >> s;
//
#include "SALOMEDSImpl_AttributePersistentRef.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//
#include "SALOMEDSImpl_AttributePixMap.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//
#include "SALOMEDSImpl_AttributePythonObject.hxx"
-using namespace std;
-
const std::string& SALOMEDSImpl_AttributePythonObject::GetID()
{
static std::string SALOMEDSImpl_AttributePythonObjectID ("128371A3-8F52-11d6-A8A3-0001021E8C7F");
myIsScript = false;
}
-void SALOMEDSImpl_AttributePythonObject::SetObject(const string& theSequence,
+void SALOMEDSImpl_AttributePythonObject::SetObject(const std::string& theSequence,
const bool theScript)
{
CheckLocked();
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;
}
}
-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');
//
#include "SALOMEDSImpl_AttributeReal.hxx"
-using namespace std;
-
#include <stdlib.h>
//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());
}
//
#include "SALOMEDSImpl_AttributeReference.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
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);
}
//
#include "SALOMEDSImpl_AttributeSelectable.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
#include "SALOMEDSImpl_AttributeSequenceOfInteger.hxx"
#include <string.h>
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(into)->Assign(myValue);
}
-void SALOMEDSImpl_AttributeSequenceOfInteger::Assign(const vector<int>& other)
+void SALOMEDSImpl_AttributeSequenceOfInteger::Assign(const std::vector<int>& other)
{
CheckLocked();
Backup();
if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range");
- typedef vector<int>::iterator VI;
+ typedef std::vector<int>::iterator VI;
int i = 1;
for(VI p = myValue.begin(); p!=myValue.end(); p++, i++) {
if(i == Index) {
-string SALOMEDSImpl_AttributeSequenceOfInteger::Save()
+std::string SALOMEDSImpl_AttributeSequenceOfInteger::Save()
{
int aLength = Length();
char* aResult = new char[aLength * 25];
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, " ");
#include "SALOMEDSImpl_AttributeSequenceOfReal.hxx"
#include <string.h>
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
dynamic_cast<SALOMEDSImpl_AttributeSequenceOfReal*>(into)->Assign(myValue);
}
-void SALOMEDSImpl_AttributeSequenceOfReal::Assign(const vector<double>& other)
+void SALOMEDSImpl_AttributeSequenceOfReal::Assign(const std::vector<double>& other)
{
CheckLocked();
Backup();
if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range");
- typedef vector<double>::iterator VI;
+ typedef std::vector<double>::iterator VI;
int i = 1;
for(VI p = myValue.begin(); p!=myValue.end(); p++, i++) {
if(i == Index) {
}
-string SALOMEDSImpl_AttributeSequenceOfReal::Save()
+std::string SALOMEDSImpl_AttributeSequenceOfReal::Save()
{
int aLength = Length();
char* aResult = new char[aLength * 127];
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();
//
#include "SALOMEDSImpl_AttributeString.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
#include "SALOMEDSImpl_AttributeStudyProperties.hxx"
#include <string.h>
-using namespace std;
-
-
const std::string& SALOMEDSImpl_AttributeStudyProperties::GetID()
{
static std::string SALOMEDSImpl_AttributeStudyPropertiesID ("128371A2-8F52-11d6-A8A3-0001021E8C7F");
}
void SALOMEDSImpl_AttributeStudyProperties::GetModifications
- (vector<string>& theUserNames,
- vector<int>& theMinutes,
- vector<int>& theHours,
- vector<int>& theDays,
- vector<int>& theMonths,
- vector<int>& theYears) const
+ (std::vector<std::string>& theUserNames,
+ std::vector<int>& theMinutes,
+ std::vector<int>& theHours,
+ std::vector<int>& theDays,
+ std::vector<int>& theMonths,
+ std::vector<int>& theYears) const
{
theUserNames = myUserName;
theMinutes = myMinute;
dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(with);
Init();
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
+ std::vector<std::string> aNames;
+ std::vector<int> 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]);
}
-string SALOMEDSImpl_AttributeStudyProperties::Save()
+std::string SALOMEDSImpl_AttributeStudyProperties::Save()
{
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
+ std::vector<std::string> aNames;
+ std::vector<int> aMinutes, aHours, aDays, aMonths, aYears;
GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
int aLength, anIndex;
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();
#include "SALOMEDSImpl_AttributeReference.hxx"
#include "SALOMEDSImpl_Study.hxx"
-using namespace std;
-
-
//=======================================================================
//function : GetID
//purpose :
//function : Get
//purpose :
//=======================================================================
-vector<SALOMEDSImpl_SObject> SALOMEDSImpl_AttributeTarget::Get()
+std::vector<SALOMEDSImpl_SObject> SALOMEDSImpl_AttributeTarget::Get()
{
- vector<SALOMEDSImpl_SObject> aSeq;
+ std::vector<SALOMEDSImpl_SObject> aSeq;
for(int i = 0, len = myVariables.size(); i<len; i++)
aSeq.push_back( SALOMEDSImpl_Study::SObject(myVariables[i]->Label()));
Backup();
DF_Label aRefLabel = theSO.GetLabel();
- vector<DF_Attribute*> va;
+ std::vector<DF_Attribute*> va;
for(int i = 0, len = myVariables.size(); i<len; i++) {
DF_Label L = myVariables[i]->Label();
if(myVariables[i]->Label() == aRefLabel) continue;
//
#include "SALOMEDSImpl_AttributeTextColor.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//function : TextColor
//purpose :
//=======================================================================
-vector<double> SALOMEDSImpl_AttributeTextColor::TextColor()
+std::vector<double> SALOMEDSImpl_AttributeTextColor::TextColor()
{
return myValue;
}
//function : ChangeArray
//purpose :
//=======================================================================
-void SALOMEDSImpl_AttributeTextColor::ChangeArray(const vector<double>& newArray)
+void SALOMEDSImpl_AttributeTextColor::ChangeArray(const std::vector<double>& newArray)
{
Backup();
-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);
//
#include "SALOMEDSImpl_AttributeTextHighlightColor.hxx"
-using namespace std;
-
//=======================================================================
//function : GetID
//purpose :
//function : TextHighlightColor
//purpose :
//=======================================================================
-vector<double> SALOMEDSImpl_AttributeTextHighlightColor::TextHighlightColor()
+std::vector<double> SALOMEDSImpl_AttributeTextHighlightColor::TextHighlightColor()
{
return myValue;
}
//function : ChangeArray
//purpose :
//=======================================================================
-void SALOMEDSImpl_AttributeTextHighlightColor::ChangeArray(const vector<double>& newArray)
+void SALOMEDSImpl_AttributeTextHighlightColor::ChangeArray(const std::vector<double>& newArray)
{
Backup();
dynamic_cast<SALOMEDSImpl_AttributeTextHighlightColor*>(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);
#include "SALOMEDSImpl_AttributeTreeNode.hxx"
#include <string.h>
-using namespace std;
-
const std::string& SALOMEDSImpl_AttributeTreeNode::GetDefaultTreeID()
{
static std::string TreeNodeID ("0E1C36E6-379B-4d90-AC37-17A14310E648");
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 = "!";
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, " ");
#include "SALOMEDSImpl_AttributeUserID.hxx"
#include "Basics_Utils.hxx"
-using namespace std;
-
std::string SALOMEDSImpl_AttributeUserID::DefaultID()
{
return Kernel_Utils::GetGUID(Kernel_Utils::DefUserID);
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;
#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<SALOMEDSImpl_GenericAttribute*>(theAttr);
if (ga)
return "";
}
-string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr)
+std::string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr)
{
SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
if (ga)
ga->CheckLocked();
}
-string SALOMEDSImpl_GenericAttribute::Type()
+std::string SALOMEDSImpl_GenericAttribute::Type()
{
return _type;
}
#include <string>
-using namespace std;
-
//============================================================================
/*! Function : SALOMEDSImpl_GenericVariable
* Purpose :
//============================================================================
SALOMEDSImpl_GenericVariable::
SALOMEDSImpl_GenericVariable(SALOMEDSImpl_GenericVariable::VariableTypes theType,
- const string& theName):
+ const std::string& theName):
_type(theType),
_name(theName)
{}
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_GenericVariable::Name() const
+std::string SALOMEDSImpl_GenericVariable::Name() const
{
return _name;
}
* 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());
}
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_GenericVariable::Save() const
+std::string SALOMEDSImpl_GenericVariable::Save() const
{
- return string();
+ return std::string();
}
* 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();
}
//============================================================================
* Purpose :
*/
//============================================================================
-void SALOMEDSImpl_GenericVariable::Load(const string& theStrValue)
+void SALOMEDSImpl_GenericVariable::Load(const std::string& theStrValue)
{
}
#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"
_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<string> v;
+ std::vector<std::string> 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_ &&
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<string> v = _ap->GetStrArray(listName);
+ std::vector<std::string> v = _ap->GetStrArray(listName);
return v.size();
}
-vector<string> SALOMEDSImpl_IParameters::getValues(const string& listName)
+std::vector<std::string> SALOMEDSImpl_IParameters::getValues(const std::string& listName)
{
- vector<string> v;
+ std::vector<std::string> 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<string> v = _ap->GetStrArray(listName);
+ std::vector<std::string> v = _ap->GetStrArray(listName);
if(index >= v.size()) return "";
return v[index];
}
-vector<string> SALOMEDSImpl_IParameters::getLists()
+std::vector<std::string> SALOMEDSImpl_IParameters::getLists()
{
- vector<string> v;
+ std::vector<std::string> 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<string> v;
+ std::vector<std::string> 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);
}
-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<string> v = _ap->GetStrArray(entry);
+ std::vector<std::string> v = _ap->GetStrArray(entry);
int length = v.size();
for(int i = 0; i<length; i+=1) {
if(v[i] == parameterName) return v[i+1];
}
-vector<string> SALOMEDSImpl_IParameters::getAllParameterNames(const string& entry)
+std::vector<std::string> SALOMEDSImpl_IParameters::getAllParameterNames(const std::string& entry)
{
- vector<string> v, names;
+ std::vector<std::string> v, names;
if(!_ap) return v;
if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
v = _ap->GetStrArray(entry);
return names;
}
-vector<string> SALOMEDSImpl_IParameters::getAllParameterValues(const string& entry)
+std::vector<std::string> SALOMEDSImpl_IParameters::getAllParameterValues(const std::string& entry)
{
- vector<string> v, values;
+ std::vector<std::string> v, values;
if(!_ap) return v;
if(!_ap->IsSet(entry, PT_STRARRAY)) return v;
v = _ap->GetStrArray(entry);
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<string> SALOMEDSImpl_IParameters::getEntries()
+std::vector<std::string> SALOMEDSImpl_IParameters::getEntries()
{
- vector<string> v;
+ std::vector<std::string> 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)) {
_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<string> SALOMEDSImpl_IParameters::getProperties()
+std::vector<std::string> SALOMEDSImpl_IParameters::getProperties()
{
- vector<string> v;
+ std::vector<std::string> 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);
}
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;
}
-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;
-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<string> v = ip.getProperties();
+ std::vector<std::string> v = ip.getProperties();
if(v.size() > 0) {
dump += "#Set up visual properties:\n";
for(int i = 0; i<v.size(); i++) {
- string prp = ip.getProperty(v[i]);
+ std::string prp = ip.getProperty(v[i]);
dump += "ipar.setProperty(\""+v[i]+"\", \""+prp+"\")\n";
}
}
if(v.size() > 0) {
dump += "#Set up lists:\n";
for(int i = 0; i<v.size(); i++) {
- vector<string> lst = ip.getValues(v[i]);
+ std::vector<std::string> lst = ip.getValues(v[i]);
dump += "# fill list "+v[i]+"\n";
for(int j = 0; j < lst.size(); j++) {
if (lst[j].find('\"') == -1)
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;
dump += shift +"import iparameters\n";
dump += shift + "ipar = iparameters.IParameters(theStudy.GetModuleParameters(\""+anID+"\", \""+moduleName+"\", 1))\n\n";
- vector<string> v = ip.getProperties();
+ std::vector<std::string> v = ip.getProperties();
if(v.size() > 0) {
dump += shift +"#Set up visual properties:\n";
for(int i = 0; i<v.size(); i++) {
- string prp = ip.getProperty(v[i]);
+ std::string prp = ip.getProperty(v[i]);
dump += shift +"ipar.setProperty(\""+v[i]+"\", \""+prp+"\")\n";
}
}
if(v.size() > 0) {
dump += shift +"#Set up lists:\n";
for(int i = 0; i<v.size(); i++) {
- vector<string> lst = ip.getValues(v[i]);
+ std::vector<std::string> 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";
if(v.size() > 0) {
dump += shift + "#Set up entries:\n";
for(int i = 0; i<v.size(); i++) {
- vector<string> names = ip.getAllParameterNames(v[i]);
- vector<string> values = ip.getAllParameterValues(v[i]);
- string decodedEntry = ip.decodeEntry(v[i]);
+ std::vector<std::string> names = ip.getAllParameterNames(v[i]);
+ std::vector<std::string> 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++)
}
-string SALOMEDSImpl_IParameters::getDefaultVisualComponent()
+std::string SALOMEDSImpl_IParameters::getDefaultVisualComponent()
{
return "Interface Applicative";
}
#include "SALOMEDSImpl_AttributeComment.hxx"
#include "SALOMEDSImpl_AttributeIOR.hxx"
-using namespace std;
-
//============================================================================
/*! Function : Empty constructor
* Purpose :
* 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();
* 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())) )
#include "SALOMEDSImpl_SComponentIterator.hxx"
#include "SALOMEDSImpl_Study.hxx"
-using namespace std;
-
//============================================================================
/*! Function : constructor
*
#include "SALOMEDSImpl_SComponent.hxx"
#include "SALOMEDSImpl_Study.hxx"
-using namespace std;
-
#include <map>
#include <string.h>
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_SObject::GetID() const
+std::string SALOMEDSImpl_SObject::GetID() const
{
return _lab.Entry();
}
*/
//============================================================================
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);
* Purpose : Returns list of all attributes for this sobject
*/
//============================================================================
-vector<DF_Attribute*> SALOMEDSImpl_SObject::GetAllAttributes() const
+std::vector<DF_Attribute*> SALOMEDSImpl_SObject::GetAllAttributes() const
{
- vector<DF_Attribute*> va1, va = _lab.GetAttributes();
+ std::vector<DF_Attribute*> va1, va = _lab.GetAttributes();
for(int i = 0, len = va.size(); i<len; i++) {
SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(va[i]);
- if(ga && ga->Type() != string("AttributeReference"))
+ if(ga && ga->Type() != std::string("AttributeReference"))
va1.push_back(va[i]);
}
* 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();
* 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();
* 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<SALOMEDSImpl_AttributeIOR*>(anIOR)->Value();
}
-std::string SALOMEDSImpl_SObject::GetGUID(const string& theType)
+std::string SALOMEDSImpl_SObject::GetGUID(const std::string& theType)
{
__AttributeTypeToGUIDForSObject
#include <cstdlib>
#include <cstdio>
-using namespace std;
-
//============================================================================
/*! Function : SALOMEDSImpl_ScalarVariable
* Purpose :
//============================================================================
SALOMEDSImpl_ScalarVariable::
SALOMEDSImpl_ScalarVariable(SALOMEDSImpl_GenericVariable::VariableTypes type,
- const string& theName):
+ const std::string& theName):
SALOMEDSImpl_GenericVariable(type,theName)
{}
* Purpose :
*/
//============================================================================
-bool SALOMEDSImpl_ScalarVariable::setStringValue(const string& theValue)
+bool SALOMEDSImpl_ScalarVariable::setStringValue(const std::string& theValue)
{
if(myStrValue == theValue)
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_ScalarVariable::getStringValue() const
+std::string SALOMEDSImpl_ScalarVariable::getStringValue() const
{
return myStrValue;
}
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_ScalarVariable::Save() const{
+std::string SALOMEDSImpl_ScalarVariable::Save() const{
char buffer[255];
switch(Type())
{
}
default:break;
}
- return string(buffer);
+ return std::string(buffer);
}
//============================================================================
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_ScalarVariable::SaveToScript() const
+std::string SALOMEDSImpl_ScalarVariable::SaveToScript() const
{
char buffer[255];
switch(Type())
}
default:break;
}
- return string(buffer);
+ return std::string(buffer);
}
//============================================================================
* 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);
}
//============================================================================
* Purpose :
*/
//============================================================================
-void SALOMEDSImpl_ScalarVariable::Load(const string& theStrValue)
+void SALOMEDSImpl_ScalarVariable::Load(const std::string& theStrValue)
{
double aValue = atof(theStrValue.c_str());
setValue(aValue);
#include <stdlib.h>
#include <string.h>
-using namespace std;
-
#define USE_CASE_LABEL_TAG 2
#define DIRECTORYID 16661
#define FILELOCALID 26662
* 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();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::DefineComponentInstance(const SALOMEDSImpl_SComponent& aComponent,
- const string& IOR)
+ const std::string& IOR)
{
_errorCode = "";
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;
DefineComponentInstance (anSCO, aDriver->GetIOR());
- string aHDFUrl;
+ std::string aHDFUrl;
bool isASCII = false;
if (HDFascii::isASCII(aHDFPath.c_str())) {
isASCII = true;
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();
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'):
delete hdf_file;
if (isASCII) {
- vector<string> aFilesToRemove;
+ std::vector<std::string> aFilesToRemove;
aFilesToRemove.push_back("hdf_from_ascii.hdf");
SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl),
aFilesToRemove, true);
delete hdf_file;
if (isASCII) {
- vector<string> aFilesToRemove;
+ std::vector<std::string> aFilesToRemove;
aFilesToRemove.push_back(aHDFUrl);
SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
}
*/
//============================================================================
DF_Attribute* SALOMEDSImpl_StudyBuilder::FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject,
- const string& aTypeOfAttribute)
+ const std::string& aTypeOfAttribute)
{
_errorCode = "";
if(!anObject) {
//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 {
bool SALOMEDSImpl_StudyBuilder::FindAttribute(const SALOMEDSImpl_SObject& anObject,
DF_Attribute*& anAttribute,
- const string& aTypeOfAttribute)
+ const std::string& aTypeOfAttribute)
{
_errorCode = "";
if(!anObject) {
//============================================================================
bool SALOMEDSImpl_StudyBuilder::RemoveAttribute(const SALOMEDSImpl_SObject& anObject,
- const string& aTypeOfAttribute)
+ const std::string& aTypeOfAttribute)
{
_errorCode = "";
CheckLocked();
}
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());
* 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();
return false;
}
- string aPath(thePath), aContext(""), aFatherPath;
+ std::string aPath(thePath), aContext(""), aFatherPath;
DF_Label aLabel;
SALOMEDSImpl_SObject anObject;
aPath = _study->GetContext() + aPath;
}
- vector<string> vs = SALOMEDSImpl_Tool::splitString(aPath, '/');
+ std::vector<std::string> vs = SALOMEDSImpl_Tool::splitString(aPath, '/');
if(vs.size() == 1)
aFatherPath = "/";
else {
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetGUID(const SALOMEDSImpl_SObject& anObject,
- const string& theGUID)
+ const std::string& theGUID)
{
_errorCode = "";
CheckLocked();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::IsGUID(const SALOMEDSImpl_SObject& anObject,
- const string& theGUID)
+ const std::string& theGUID)
{
_errorCode = "";
if(!anObject) {
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetName(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
+ const std::string& theValue)
{
_errorCode = "";
CheckLocked();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetComment(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
+ const std::string& theValue)
{
_errorCode = "";
CheckLocked();
*/
//============================================================================
bool SALOMEDSImpl_StudyBuilder::SetIOR(const SALOMEDSImpl_SObject& theSO,
- const string& theValue)
+ const std::string& theValue)
{
_errorCode = "";
CheckLocked();
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);
# undef GetUserName
#endif
-using namespace std;
-
#define USE_CASE_LABEL_ID "0:2"
static void SaveAttributes(const SALOMEDSImpl_SObject& SO, HDFgroup *hdf_group_sobject);
* 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 = "";
* 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 = "";
HDFgroup *hdf_notebook_vars = 0;
char* aC_HDFUrl;
- string aHDFUrl;
+ std::string aHDFUrl;
bool isASCII = false;
if (HDFascii::isASCII(aUrl.c_str())) {
isASCII = true;
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;
}
{
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;
}
hdf_group_study_structure = new HDFgroup("STUDY_STRUCTURE",hdf_file);
if (isASCII) {
- vector<string> aFilesToRemove;
+ std::vector<std::string> aFilesToRemove;
aFilesToRemove.push_back("hdf_from_ascii.hdf");
SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true);
}
{
_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;
{
_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;
* 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)
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)
* Purpose : Get name list of open studies in the session
*/
//============================================================================
-vector<SALOMEDSImpl_Study*> SALOMEDSImpl_StudyManager::GetOpenStudies()
+std::vector<SALOMEDSImpl_Study*> SALOMEDSImpl_StudyManager::GetOpenStudies()
{
_errorCode = "";
- vector<SALOMEDSImpl_Study*> aList;
+ std::vector<SALOMEDSImpl_Study*> aList;
int nbDocs = _appli->NbDocuments();
}
else {
SALOMEDSImpl_Study* aStudy;
- vector<int> ids = _appli->GetDocumentIDs();
+ std::vector<int> ids = _appli->GetDocumentIDs();
for (int i = 0, len = ids.size(); i<len; i++) {
DF_Document* D = _appli->GetDocument(ids[i]);
if(D == _clipboard) continue;
*/
//============================================================================
SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::GetStudyByName
- (const string& aStudyName)
+ (const std::string& aStudyName)
{
_errorCode = "";
int nbDocs = _appli->NbDocuments();
return NULL;
}
else {
- vector<SALOMEDSImpl_Study*> studies = GetOpenStudies();
+ std::vector<SALOMEDSImpl_Study*> studies = GetOpenStudies();
for (int i = 0, len = studies.size(); i<len; i++) {
if (studies[i]->Name() == 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;
}
return NULL;
}
else {
- vector<SALOMEDSImpl_Study*> studies = GetOpenStudies();
+ std::vector<SALOMEDSImpl_Study*> studies = GetOpenStudies();
for (int i = 0, len = studies.size(); i<len; i++) {
if (studies[i]->StudyId() == aStudyID) return studies[i];
}
if (aLocked) aProp->SetLocked(true);
- vector<string> aNames;
- vector<int> aMinutes, aHours, aDays, aMonths, aYears;
+ std::vector<std::string> aNames;
+ std::vector<int> aMinutes, aHours, aDays, aMonths, aYears;
aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears);
* 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,
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";
}
//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<string, SALOMEDSImpl_Driver*> aMapTypeDriver;
+ std::map<std::string, SALOMEDSImpl_Driver*> aMapTypeDriver;
try
{
{
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);
}
}
- string anOldName = aStudy->Name();
+ std::string anOldName = aStudy->Name();
aStudy->URL(aStudyUrl);
// To change for Save
{
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;
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);
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
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);
//-----------------------------------------------------------------------
//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);
// 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;
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());
}
{
// mpv: don't save empty labels
- vector<DF_Attribute*> attr = itchild.Value().GetAttributes();
+ std::vector<DF_Attribute*> attr = itchild.Value().GetAttributes();
if (attr.size() == 0) { //No attributes on the label
DF_ChildIterator subchild(itchild.Value());
if (!subchild.More()) {
subchild.Init(itchild.Value(), true);
bool anEmpty = true;
for (; subchild.More() && anEmpty; subchild.Next()) {
- vector<DF_Attribute*> attr2 = subchild.Value().GetAttributes();
+ std::vector<DF_Attribute*> attr2 = subchild.Value().GetAttributes();
if (attr2.size()) {
anEmpty = false; //There are attributes on the child label
break;
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);
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_StudyManager::Impl_SubstituteSlash(const string& aUrl)
+std::string SALOMEDSImpl_StudyManager::Impl_SubstituteSlash(const std::string& aUrl)
{
_errorCode = "";
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);
aAuxTargetLabel = aAuxTargetLabel.FindChild(aSourceLabel.Tag());
}
// iterate attributes
- vector<DF_Attribute*> attrList = theSource.GetAttributes();
+ std::vector<DF_Attribute*> attrList = theSource.GetAttributes();
for(int i = 0, len = attrList.size(); i<len; i++) {
DF_Attribute* anAttr = attrList[i];
- string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(anAttr);
- if (type.substr(0, 17) == string("AttributeTreeNode")) continue; // never copy tree node attribute
- if (type == string("AttributeTarget")) continue; // and target attribute
+ std::string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(anAttr);
+ if (type.substr(0, 17) == std::string("AttributeTreeNode")) continue; // never copy tree node attribute
+ if (type == std::string("AttributeTarget")) continue; // and target attribute
- if (type == string("AttributeReference")) { // reference copied as Comment in aux tree
+ if (type == std::string("AttributeReference")) { // reference copied as Comment in aux tree
DF_Label aReferenced = dynamic_cast<SALOMEDSImpl_AttributeReference*>(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()))) {
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));
}
return false;
}
- string IOREngine;
+ std::string IOREngine;
if (!aComponent.ComponentIOR(IOREngine)) {
_errorCode = "component has no IOR";
return false;
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();
}
}
- 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());
}
// iterate attributes
- vector<DF_Attribute*> attrList = theSource.GetAttributes();
+ std::vector<DF_Attribute*> attrList = theSource.GetAttributes();
for(int i = 0, len = attrList.size(); i<len; i++) {
DF_Attribute* anAttr = attrList[i];
if (aTargetLabel.FindAttribute(anAttr->ID())) {
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';
static void SaveAttributes(const SALOMEDSImpl_SObject& aSO, HDFgroup *hdf_group_sobject)
{
hdf_size size[1];
- vector<DF_Attribute*> attrList = aSO.GetLabel().GetAttributes();
+ std::vector<DF_Attribute*> attrList = aSO.GetLabel().GetAttributes();
DF_Attribute* anAttr = NULL;
for(int i = 0, len = attrList.size(); i<len; i++) {
anAttr = attrList[i];
//The following attributes are not supposed to be written to the file
- string type = SALOMEDSImpl_GenericAttribute::Impl_GetType(anAttr);
- if(type == string("AttributeIOR")) continue; //IOR attribute is not saved
- string aSaveStr =anAttr->Save();
+ 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);
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());
//Get Nb of variables
int aNbVars = theGroup->nInternalObjects();
- map<int,SALOMEDSImpl_GenericVariable*> aVarsMap;
+ std::map<int,SALOMEDSImpl_GenericVariable*> aVarsMap;
for( int iVar=0;iVar < aNbVars;iVar++ ) {
theGroup->InternalObjectIndentify(iVar,aVarName);
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<int,SALOMEDSImpl_GenericVariable*>(order,aVariable));
+ new SALOMEDSImpl_ScalarVariable(aVarType,std::string(aVarName));
+ aVariable->Load(std::string(currentVarValue));
+ aVarsMap.insert(std::make_pair<int,SALOMEDSImpl_GenericVariable*>(order,aVariable));
delete [] currentVarValue;
- }
+ }
}
- map<int,SALOMEDSImpl_GenericVariable*>::const_iterator it= aVarsMap.begin();
+ std::map<int,SALOMEDSImpl_GenericVariable*>::const_iterator it= aVarsMap.begin();
for(;it!=aVarsMap.end();it++)
theStudy->AddVariable((*it).second);
#include <windows.h>
#endif
-using namespace std;
-
-
-bool Exists(const string thePath)
+bool Exists(const std::string thePath)
{
#ifdef WIN32
if ( GetFileAttributes ( thePath.c_str() ) == 0xFFFFFFFF ) {
// 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
}
else {
#ifdef WIN32
- aTmpDir = string("C:\\");
+ aTmpDir = std::string("C:\\");
#else
- aTmpDir = string("/tmp/");
+ aTmpDir = std::string("/tmp/");
#endif
}
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++) {
// function : RemoveTemporaryFiles
// purpose : Removes files listed in theFileList
//============================================================================
-void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const string& theDirectory,
- const vector<string>& theFiles,
+void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const std::string& theDirectory,
+ const std::vector<std::string>& 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;
// 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());
// 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('\\');
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;
// purpose : The functions returns a list of substring of initial string
// divided by given separator
//============================================================================
-vector<string> SALOMEDSImpl_Tool::splitString(const string& theValue, char separator)
+std::vector<std::string> SALOMEDSImpl_Tool::splitString(const std::string& theValue, char separator)
{
- vector<string> vs;
+ std::vector<std::string> vs;
if(theValue[0] == separator && theValue.size() == 1) return vs;
int pos = theValue.find(separator);
if(pos < 0) {
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));
// purpose : The functions returns a list of substring of initial string
// divided by given separator include empty strings
//============================================================================
-vector<string> SALOMEDSImpl_Tool::splitStringWithEmpty(const string& theValue, char sep)
+std::vector<std::string> SALOMEDSImpl_Tool::splitStringWithEmpty(const std::string& theValue, char sep)
{
- vector<string> aResult;
- if(theValue[0] == sep ) aResult.push_back(string());
+ std::vector<std::string> 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));
}
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;
}
// purpose : The functions returns a list of lists of substrings of initial string
// divided by two given separators include empty strings
//============================================================================
-vector< vector<string> > SALOMEDSImpl_Tool::splitStringWithEmpty(const string& theValue, char sep1, char sep2)
+std::vector< std::vector<std::string> > SALOMEDSImpl_Tool::splitStringWithEmpty(const std::string& theValue, char sep1, char sep2)
{
- vector< vector<string> > aResult;
+ std::vector< std::vector<std::string> > aResult;
if(theValue.size() > 0) {
- vector<string> aSections = splitStringWithEmpty( theValue, sep1 );
+ std::vector<std::string> aSections = splitStringWithEmpty( theValue, sep1 );
for( int i = 0, n = aSections.size(); i < n; i++ )
aResult.push_back( splitStringWithEmpty( aSections[i], sep2 ) );
}
#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
}
#include "DF_ChildIterator.hxx"
-using namespace std;
-
#define USE_CASE_LABEL_TAG 2
#define USE_CASE_GUID "AA43BB12-D9CD-11d6-945D-0050DA506788"
aNode->Remove();
- vector<DF_Attribute*> aList;
+ std::vector<DF_Attribute*> aList;
aList.push_back(aNode);
SALOMEDSImpl_AttributeReference* aRef = NULL;
* Purpose :
*/
//============================================================================
-bool SALOMEDSImpl_UseCaseBuilder::SetName(const string& theName) {
+bool SALOMEDSImpl_UseCaseBuilder::SetName(const std::string& theName) {
if(!_root) return false;
SALOMEDSImpl_AttributeName* aNameAttrib = NULL;
* Purpose :
*/
//============================================================================
-string SALOMEDSImpl_UseCaseBuilder::GetName()
+std::string SALOMEDSImpl_UseCaseBuilder::GetName()
{
- string aString;
+ std::string aString;
if(!_root) return aString;
SALOMEDSImpl_AttributeName* aName = NULL;
* 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
}
-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);
#include "SALOMEDSImpl_SObject.hxx"
#include "SALOMEDSImpl_Study.hxx"
-using namespace std;
-
//============================================================================
/*! Function : empty constructor
* Purpose :
*/
//============================================================================
SALOMEDSImpl_UseCaseIterator::SALOMEDSImpl_UseCaseIterator(const DF_Label& theLabel,
- const string& theGUID,
+ const std::string& theGUID,
const bool allLevels)
:_guid(theGUID), _levels(allLevels)
{
#include "SALOMEDSImpl_StudyBuilder.hxx"
#include "SALOMEDSImpl_GenericAttribute.hxx"
-using namespace std;
// ============================================================================
/*!
CPPUNIT_ASSERT(_ap->IsSet("BoolValue", PT_BOOLEAN));
CPPUNIT_ASSERT(!_ap->GetBool("BoolValue"));
- vector<int> intArray;
+ std::vector<int> intArray;
intArray.push_back(0);
intArray.push_back(1);
CPPUNIT_ASSERT(_ap->GetIntArray("IntArray")[0] == 0);
CPPUNIT_ASSERT(_ap->GetIntArray("IntArray")[1] == 1);
- vector<double> realArray;
+ std::vector<double> realArray;
realArray.push_back(0.0);
realArray.push_back(1.1);
CPPUNIT_ASSERT(_ap->GetRealArray("RealArray")[0] == 0.0);
CPPUNIT_ASSERT(_ap->GetRealArray("RealArray")[1] == 1.1);
- vector<string> strArray;
+ std::vector<std::string> strArray;
strArray.push_back("hello");
strArray.push_back("world");
//#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<string> ids = aStudy->GetLockerID();
+ std::cout << "Is study locked = " << aStudy->IsStudyLocked() << std::endl;
+ std::vector<std::string> ids = aStudy->GetLockerID();
for(int i = 0; i<ids.size(); i++)
- cout << "Get study locker : " << ids[i] << endl;
+ std::cout << "Get study locker : " << ids[i] << std::endl;
aStudy->UnLockStudy("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<SALOMEDSImpl_AttributeIOR*>(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<SALOMEDSImpl_AttributeIOR*>(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<SALOMEDSImpl_AttributeName*>(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");
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<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << endl;
+ std::cout << "Attribute UserID was created succesfully : id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(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<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->SetValue(id);
- cout << "SetValue id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << endl;
+ std::cout << "SetValue id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(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<SALOMEDSImpl_AttributeUserID*>(aTDFAttr)->Value() << endl;
+ std::cout << "Attribute UserID was created succesfully : id = " << dynamic_cast<SALOMEDSImpl_AttributeUserID*>(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<SALOMEDSImpl_GenericAttribute*>(aTDFAttr)->Type() << endl;
- cout << "Check AttributeTreeNode : done " << endl;
+ std::cout << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aTDFAttr)->Type() << std::endl;
+ std::cout << "Check AttributeTreeNode : done " << std::endl;
aTDFAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeParameter");
- cout << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aTDFAttr)->Type() << endl;
+ std::cout << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aTDFAttr)->Type() << std::endl;
- cout << "Check the attributes on SObject" << endl;
- vector<DF_Attribute*> aSeq = aSO.GetAllAttributes();
+ std::cout << "Check the attributes on SObject" << std::endl;
+ std::vector<DF_Attribute*> aSeq = aSO.GetAllAttributes();
for(int i = 0; i < aSeq.size(); i++)
- cout << "Found: " << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aSeq[i])->Type() << endl;
+ std::cout << "Found: " << dynamic_cast<SALOMEDSImpl_GenericAttribute*>(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<SALOMEDSImpl_AttributeParameter*>(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<double> v;
+ std::vector<double> 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<double> v2 = AP->GetRealArray("1");
- cout.precision(10);
- cout << " values : ";
- for(int i = 0; i<v2.size(); i++) cout << v2[i] << " ";
- cout << endl;
+ std::cout << "IsSet for array: " << AP->IsSet("1", PT_REALARRAY);
+ std::vector<double> v2 = AP->GetRealArray("1");
+ std::cout.precision(10);
+ std::cout << " values : ";
+ for(int i = 0; i<v2.size(); i++) std::cout << v2[i] << " ";
+ std::cout << std::endl;
v[0] = 211.111;
v[1] = 422.22222;
v[2] = 633.3333333;
AP->SetRealArray("2", v);
- vector<int> vi;
+ std::vector<int> vi;
vi.push_back(1);
vi.push_back(2);
AP->SetIntArray("2", vi);
- vector<string> vs;
+ std::vector<std::string> 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; i<v2.size(); i++) cout << v2[i] << " ";
- cout << endl;
+ std::cout << "Restored real array with id = 2 is: ";
+ for(int i = 0; i<v2.size(); i++) std::cout << v2[i] << " ";
+ std::cout << std::endl;
vi = AP->GetIntArray("2");
- cout << "Restored int array with id = 2 is: ";
- for(int i = 0; i<vi.size(); i++) cout << vi[i] << " ";
- cout << endl;
+ std::cout << "Restored int array with id = 2 is: ";
+ for(int i = 0; i<vi.size(); i++) std::cout << vi[i] << " ";
+ std::cout << std::endl;
vs = AP->GetStrArray("3");
- cout << "Restored string array with id = 2 is: ";
- for(int i = 0; i<vs.size(); i++) cout << vs[i] << " ";
- cout << endl;
+ std::cout << "Restored string array with id = 2 is: ";
+ for(int i = 0; i<vs.size(); i++) std::cout << vs[i] << " ";
+ std::cout << std::endl;
- cout << "Check RemoveID 1 with type PT_INTEGER" << endl;
+ std::cout << "Check RemoveID 1 with type PT_INTEGER" << std::endl;
AP->RemoveID("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");
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;
}
#include "BaseTraceCollector.hxx"
#include "LocalTraceBufferPool.hxx"
-using namespace std;
-
// Class attributes initialisation, for class method BaseTraceCollector::run
BaseTraceCollector* BaseTraceCollector::_singleton = 0;
#include <fstream>
#include <cstdlib>
-using namespace std;
-
//#define _DEVDEBUG_
#include "FileTraceCollector.hxx"
// --- 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);
}
<< " : " << 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
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;
#include "FileTraceCollector.hxx"
#include "utilities.h"
-using namespace std;
-
// In case of truncated message, end of trace contains "...\n\0"
#define TRUNCATED_MESSAGE "...\n"
{
#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 )
#endif
if ( !TraceCollectorFactory )
{
- cerr << "Can't resolve symbol: SingletonInstance" <<endl;
+ std::cerr << "Can't resolve symbol: SingletonInstance" <<std::endl;
#ifndef WIN32
- cerr << "dlerror: " << dlerror() << endl;
+ std::cerr << "dlerror: " << dlerror() << std::endl;
#endif
exit( 1 );
}
}
else
{
- cerr << "library: " << impl_name << " not found !" << endl;
+ std::cerr << "library: " << impl_name << " not found !" << std::endl;
assert(handle); // to give file and line
exit(1); // in case assert is deactivated
}
#include <fstream>
#include <cstdlib>
-using namespace std;
-
#include "LocalTraceCollector.hxx"
// ============================================================================
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);
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;
#include "LocalTraceBufferPool.hxx"
#include "utilities.h"
-using namespace std;
-
// ============================================================================
/*!
// --- 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();
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.
{
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();
#ifdef WIN32
#define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
- std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << flush; \
+ std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << std::flush; \
std::cerr << "ABORT return code= "<< code << std::endl; \
/*std::*/exit(code);}
#else
#define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
- std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << flush; \
+ std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << std::flush; \
std::cerr << "ABORT return code= "<< code << std::endl; \
std::exit(code);}
#endif
#include <cstdlib>
#include <omniORB4/CORBA.h>
-using namespace std;
-
#include "SALOMETraceCollector.hxx"
#include "TraceCollector_WaitForServerReadiness.hxx"
#include <SALOMEconfig.h>
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
{
if (myTrace.traceType == ABORT_MESS)
{
- stringstream abortMessage("");
+ std::stringstream abortMessage("");
#ifndef WIN32
abortMessage << "INTERRUPTION from thread "
<< myTrace.threadId << " : " << myTrace.trace;
}
else
{
- stringstream aMessage("");
+ std::stringstream aMessage("");
#ifndef WIN32
aMessage << "th. " << myTrace.threadId
#else
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;
#include "LocalTraceBufferPool.hxx"
#include "utilities.h"
-using namespace std;
// ============================================================================
/*!
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.
#include <omnithread/pthread_nt.h>
#endif
-using namespace std;
-
// ============================================================================
/*!
* Wait until a server is registered in naming service.
// ============================================================================
CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb,
- string serverName)
+ std::string serverName)
{
long TIMESleep = 500000000;
int NumberOfTries = 40;
}
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();
}
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
#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();
}
#include <SALOMEconfig.h>
#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 ) {
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;
return (new SALOMEDS::TMPFile);
//Get a temporary directory for saved a file
- string aTmpDir = theFromDirectory;
+ std::string aTmpDir = theFromDirectory;
long aBufferSize = 0;
long aCurrentPos;
//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<char*>(theFiles[i].in());
+ std::string aFullPath = aTmpDir + const_cast<char*>(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
}
aCurrentPos = 4;
for(i=0; i<aLength; i++) {
- ifstream *aFile;
+ std::ifstream *aFile;
if (!theNamesOnly) { // mpv 15.01.2003: we don't open any file if theNamesOnly = true
- string aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
+ std::string aFullPath = aTmpDir + const_cast<char*>(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
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);
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();
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();
//============================================================================
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) {
if (thePath.empty()) return "";
int pos = thePath.rfind('/');
- string path;
+ std::string path;
if(pos > 0) {
path = thePath.substr(0, pos+1);
}
#include <stdio.h>
#include <cstdlib>
#include <map>
-using namespace std;
Engines_TestComponent_i::Engines_TestComponent_i(CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa,
void Engines_TestComponent_i::Setenv()
{
// bool overwrite = true;
- map<std::string,CORBA::Any>::iterator it;
+ std::map<std::string,CORBA::Any>::iterator it;
MESSAGE("set environment associated with keys in map _fieldsDict");
for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++)
{
#include <mpi.h>
#include "utilities.h"
#include "TestMPIComponentEngine.hxx"
-using namespace std;
TestMPIComponentEngine::TestMPIComponentEngine(int nbproc, int numproc,
CORBA::ORB_ptr orb,
//
// 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
# include "Utils_SINGLETON.hxx"
#include "SALOME_NamingService.hxx"
#include "OpUtil.hxx"
-using namespace std;
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);
}
// 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
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");
#else
#include <winsock2.h>
#endif
-using namespace std;
+
//int gethostname(char *name, size_t len);
std::string GetHostname()
char *aDot = (strchr(s,'.'));
if (aDot) aDot[0] = '\0';
- string p = s;
+ std::string p = s;
delete [] s;
return p;
}
#include "Utils_SALOME_Exception.hxx"
#include "utilities.h"
-using namespace std;
#define TRACEFILE "/tmp/traceUnitTest.log"
// --- 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();
}
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);
}
}
// $Header$
//
# include "Utils_CommException.hxx"
-using namespace std;
CommException::CommException( void ): SALOME_Exception( "CommException" )
{
// static int MYDEBUG = 0;
#endif
-using namespace std;
-
std::list<DESTRUCTEUR_GENERIQUE_*> *DESTRUCTEUR_GENERIQUE_::Destructeurs=0 ;
/*! \class ATEXIT_
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_Exception)
-using namespace std;
-
void SalomeException ()
{
throw SALOME_Exception("Salome Exception");
#include "utilities.h"
#include "OpUtil.hxx"
-using namespace std;
-
const char* duplicate( const char *const str )
{
ASSERT(str!=NULL) ;