From: ribes Date: Tue, 19 Jan 2010 09:57:10 +0000 (+0000) Subject: Merge from mergeto_BR_V51_AR_19Jan10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=84fd42b08b1fa412f626d65b18ee40d45e760a82;p=modules%2Fkernel.git Merge from mergeto_BR_V51_AR_19Jan10 --- diff --git a/salome_adm/cmake_files/FindBOOST.cmake b/salome_adm/cmake_files/FindBOOST.cmake index 9d87a7400..65600aa39 100644 --- a/salome_adm/cmake_files/FindBOOST.cmake +++ b/salome_adm/cmake_files/FindBOOST.cmake @@ -114,9 +114,9 @@ IF(BOOST_STATUS) FOREACH(version 1_35 1_38) SET(LIB_NAMES ${LIB_NAMES} libboost_${name}-vc90-mt${EXTENSION}-${version}) ENDFOREACH(version 1_35 1_38) - FIND_LIBRARY(BOOST_LIB_${name} NAMES ${LIB_NAMES} PATHS ${BOOST_LIB_PATHS}) + FIND_LIBRARY(BOOST_LIB_${name} NAMES ${LIB_NAMES} PATHS ${BOOST_LIB_PATHS} ${BOOST_FIND_PATHS_OPTION}) ELSE(WINDOWS) - FIND_LIBRARY(BOOST_LIB_${name} boost_${name} PATHS ${BOOST_LIB_PATHS}) + FIND_LIBRARY(BOOST_LIB_${name} boost_${name} PATHS ${BOOST_LIB_PATHS} ${BOOST_FIND_PATHS_OPTION}) ENDIF(WINDOWS) IF(NOT BOOST_LIB_${name}) SET(BOOST_STATUS 0) diff --git a/salome_adm/cmake_files/FindHDF5.cmake b/salome_adm/cmake_files/FindHDF5.cmake index fe54d590a..e7e8d2f83 100644 --- a/salome_adm/cmake_files/FindHDF5.cmake +++ b/salome_adm/cmake_files/FindHDF5.cmake @@ -104,7 +104,7 @@ IF(HDF5_STATUS) IF(HDF5_ROOT_USER) SET(HDF5_INCLUDES -I${HDF5_INCLUDE_DIR}) ENDIF(HDF5_ROOT_USER) - SET(HDF5_INCLUDES -D_HDF5USEDLL_ ${HDF5_INCLUDES}) + SET(HDF5_INCLUDES -DH5_USE_16_API -D_HDF5USEDLL_ ${HDF5_INCLUDES}) MESSAGE(STATUS "${HDF5_INCLUDE_TO_FIND} found in ${HDF5_INCLUDE_DIR}") ELSE(HDF5_INCLUDE_DIR) SET(HDF5_STATUS 0) diff --git a/salome_adm/cmake_files/FindPLATFORM.cmake b/salome_adm/cmake_files/FindPLATFORM.cmake index f0ab69771..eaa0eaa75 100644 --- a/salome_adm/cmake_files/FindPLATFORM.cmake +++ b/salome_adm/cmake_files/FindPLATFORM.cmake @@ -49,8 +49,8 @@ IF(CMAKE_BUILD_TYPE) SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "compilation types" FORCE) ELSE(WINDOWS) IF(CMAKE_BUILD_TYPE STREQUAL Release) - SET(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG") - SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") + SET(CMAKE_C_FLAGS_RELEASE "-O1 -DNDEBUG") + SET(CMAKE_CXX_FLAGS_RELEASE "-O1 -DNDEBUG") ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) ENDIF(WINDOWS) ENDIF(CMAKE_BUILD_TYPE) diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index 314fe54c2..8affe058b 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -633,6 +633,7 @@ class CMakeFile(object): newlines.append(""" SET(SALOME_KERNEL ON) SET(HAS_GUI ON) + SET(WITH_QT4 ON) """) pass # -- @@ -957,9 +958,17 @@ class CMakeFile(object): COMMAND ${OMNIORB_IDL} ${flags} ${input} MAIN_DEPENDENCY ${input} ) + ''') + newlines.append(''' install(FILES ${input} DESTINATION idl/salome) - SET(IDL_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh) - install(FILES ${IDL_HEADER} DESTINATION include/salome) + ''') + if self.module not in ["pyhello"]: + newlines.append(''' + SET(IDL_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh) + install(FILES ${IDL_HEADER} DESTINATION include/salome) + ''') + pass + newlines.append(''' INSTALL(CODE "SET(IDL_FILE ${input})") INSTALL(CODE "SET(DIR lib/python${PYTHON_VERSION}/site-packages/salome)") INSTALL(CODE "SET(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})") @@ -1013,9 +1022,22 @@ class CMakeFile(object): ELSE(SWIG_SOURCES MATCHES ";") SET(SWIG_SOURCES_FIRST "${SWIG_SOURCES}") ENDIF(SWIG_SOURCES MATCHES ";") + SET(flags) + FOREACH(f ${SWIG_FLAGS} ${MY_SWIG_FLAGS}) + SET(test ON) + IF(flags) + LIST(FIND flags ${f} index) + IF(NOT index EQUAL -1) + SET(test OFF) + ENDIF(NOT index EQUAL -1) + ENDIF(flags) + IF(test) + SET(flags ${flags} ${f}) + ENDIF(test) + ENDFOREACH(f ${SWIG_FLAGS} ${MY_SWIG_FLAGS}) ADD_CUSTOM_COMMAND( OUTPUT ${build_srcs} - COMMAND ${SWIG_EXECUTABLE} ${SWIG_FLAGS} ${MY_SWIG_FLAGS} -o ${build_srcs} ${CMAKE_CURRENT_SOURCE_DIR}/${SWIG_SOURCES_FIRST} + COMMAND ${SWIG_EXECUTABLE} ${flags} -o ${build_srcs} ${CMAKE_CURRENT_SOURCE_DIR}/${SWIG_SOURCES_FIRST} MAIN_DEPENDENCY ${SWIG_SOURCES} ) ''') diff --git a/src/Basics/BasicsGenericDestructor.cxx b/src/Basics/BasicsGenericDestructor.cxx index 65464f664..92f22c2b7 100644 --- a/src/Basics/BasicsGenericDestructor.cxx +++ b/src/Basics/BasicsGenericDestructor.cxx @@ -60,17 +60,17 @@ void PROTECTED_DELETE::deleteInstance(PROTECTED_DELETE *anObject) return; else { - int ret; - ret = pthread_mutex_lock(&_listMutex); // acquire lock, an check again - if (std::find(_objList.begin(), _objList.end(), anObject) - != _objList.end()) - { - DEVTRACE("PROTECTED_DELETE::deleteInstance1 " << anObject); - delete anObject; - DEVTRACE("PROTECTED_DELETE::deleteInstance2 " << &_objList); - _objList.remove(anObject); - } - ret = pthread_mutex_unlock(&_listMutex); // release lock + int ret; + ret = pthread_mutex_lock(&_listMutex); // acquire lock, an check again + if (std::find(_objList.begin(), _objList.end(), anObject) + != _objList.end()) + { + DEVTRACE("PROTECTED_DELETE::deleteInstance1 " << anObject); + delete anObject; + DEVTRACE("PROTECTED_DELETE::deleteInstance2 " << &_objList); + _objList.remove(anObject); + } + ret = pthread_mutex_unlock(&_listMutex); // release lock } } @@ -116,12 +116,12 @@ public: { if (Make_ATEXIT && !atExitSingletonDone) { - DEVTRACE("atExitSingleton(" << Make_ATEXIT << ")"); - assert(GENERIC_DESTRUCTOR::Destructors == 0); - GENERIC_DESTRUCTOR::Destructors = new std::list; - int cr = atexit(HouseKeeping); - assert(cr == 0); - atExitSingletonDone = true; + DEVTRACE("atExitSingleton(" << Make_ATEXIT << ")"); + assert(GENERIC_DESTRUCTOR::Destructors == 0); + GENERIC_DESTRUCTOR::Destructors = new std::list; + int cr = atexit(HouseKeeping); + assert(cr == 0); + atExitSingletonDone = true; } } @@ -150,16 +150,16 @@ void HouseKeeping( void ) if(GENERIC_DESTRUCTOR::Destructors->size()) { std::list::iterator it = - GENERIC_DESTRUCTOR::Destructors->end(); + GENERIC_DESTRUCTOR::Destructors->end(); do - { - it-- ; - GENERIC_DESTRUCTOR* ptr = *it ; - DEVTRACE("HouseKeeping() " << typeid(ptr).name()); - (*ptr)(); - delete ptr ; - } + { + it-- ; + GENERIC_DESTRUCTOR* ptr = *it ; + DEVTRACE("HouseKeeping() " << typeid(ptr).name()); + (*ptr)(); + delete ptr ; + } while (it != GENERIC_DESTRUCTOR::Destructors->begin()) ; DEVTRACE("HouseKeeping() end list "); @@ -186,7 +186,7 @@ void HouseKeeping( void ) const int GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject) { DEVTRACE("GENERIC_DESTRUCTOR::Add("<= 0); } @@ -153,9 +153,9 @@ public: { if (_objectPtr) { - DEVTRACE("DESTRUCTOR_OF<>::operator() " << _objectPtr); - if (_objectPtr) PROTECTED_DELETE::deleteInstance(_objectPtr); - _objectPtr = NULL; + DEVTRACE("DESTRUCTOR_OF<>::operator() " << _objectPtr); + if (_objectPtr) PROTECTED_DELETE::deleteInstance(_objectPtr); + _objectPtr = NULL; } } diff --git a/src/Communication/Receivers.cxx b/src/Communication/Receivers.cxx index 6249f65eb..e00b27bd8 100644 --- a/src/Communication/Receivers.cxx +++ b/src/Communication/Receivers.cxx @@ -67,13 +67,13 @@ T *CorbaNCWithCopyReceiver::get for(long i=0;iTAILLE_SPLIT) - n=TAILLE_SPLIT; + n=TAILLE_SPLIT; else - n=size-i; + n=size-i; TSeqCorba seq=_mySender->sendPart(i,n); T *seqd=(T *)seq->get_buffer(0); for(long j=0;j::getDi for(long i=0;iTAILLE_SPLIT) - n=TAILLE_SPLIT; + n=TAILLE_SPLIT; else - n=size-i; + n=size-i; TSeqCorba seq=_mySender->sendPart(i,n); TCorba *seqd=seq->get_buffer(0); for(long j=0;j::get for(long i=0;iTAILLE_SPLIT) - n=TAILLE_SPLIT; + n=TAILLE_SPLIT; else - n=size-i; + n=size-i; TSeqCorba seq=_mySender->sendPart(i,n); TCorba *seqd=seq->get_buffer(0); for(long j=0;j::getDistValue(long &size){ else{ // Connect to service, get the inter-communicator server // Attention MPI_Comm_connect est un appel collectif : - // - Si lancement mpirun -c n -----> uniquement MPI_COMM_SELF fonctionne - // - Si lancement client_server&client_server ----> MPI_COMM_WORLD fonctionne + // - Si lancement mpirun -c n -----> uniquement MPI_COMM_SELF fonctionne + // - Si lancement client_server&client_server ----> MPI_COMM_WORLD fonctionne // TIMEOUT is inefficient since MPI_Comm_Connect doesn't return if we asked for // a service that has been unpublished ! @@ -282,12 +282,12 @@ T* SocketReceiver::getDistValue(long &siz while( n < size*sizeof(T) ){ m = read(_clientSockfd, (char*)v+n, size*sizeof(T)-n); if( m < 0 ){ - closeCom(); - delete [] v; - SALOME::ExceptionStruct es; - es.type = SALOME::COMM; - es.text = "error read Socket exception"; - throw SALOME::SALOME_Exception(es); + closeCom(); + delete [] v; + SALOME::ExceptionStruct es; + es.type = SALOME::COMM; + es.text = "error read Socket exception"; + throw SALOME::SALOME_Exception(es); } n += m; } @@ -300,9 +300,9 @@ T* SocketReceiver::getDistValue(long &siz catch(SALOME::SALOME_Exception &ex){ if( ex.details.type == SALOME::COMM ) { - _senderDestruc=false; - cout << ex.details.text << endl; - throw MultiCommException("Unknown sender protocol"); + _senderDestruc=false; + cout << ex.details.text << endl; + throw MultiCommException("Unknown sender protocol"); } else throw ex; @@ -330,9 +330,9 @@ void SocketReceiver::initCom() catch(SALOME::SALOME_Exception &ex){ if( ex.details.type == SALOME::COMM ) { - _senderDestruc=false; - cout << ex.details.text << endl; - throw MultiCommException("Unknown sender protocol"); + _senderDestruc=false; + cout << ex.details.text << endl; + throw MultiCommException("Unknown sender protocol"); } else throw ex; @@ -363,8 +363,8 @@ void SocketReceiver::connectCom(const cha serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = INADDR_ANY; bcopy((char *)server->h_addr, - (char *)&serv_addr.sin_addr.s_addr, - server->h_length); + (char *)&serv_addr.sin_addr.s_addr, + server->h_length); serv_addr.sin_port = htons(port); if( connect(_clientSockfd, (struct sockaddr *) & serv_addr, sizeof(struct sockaddr)) < 0 ){ @@ -381,9 +381,9 @@ void SocketReceiver::connectCom(const cha catch(SALOME::SALOME_Exception &ex){ if( ex.details.type == SALOME::COMM ) { - _senderDestruc=false; - cout << ex.details.text << endl; - throw MultiCommException("Unknown sender protocol"); + _senderDestruc=false; + cout << ex.details.text << endl; + throw MultiCommException("Unknown sender protocol"); } else throw ex; diff --git a/src/Communication/SALOME_Comm_i.cxx b/src/Communication/SALOME_Comm_i.cxx index e706c8d53..f2643d2be 100644 --- a/src/Communication/SALOME_Comm_i.cxx +++ b/src/Communication/SALOME_Comm_i.cxx @@ -378,7 +378,7 @@ std::string SALOME_SocketSender_i::inetAddress() host = gethostbyname(s); if (host != NULL) inet_ntop(AF_INET, (struct in_addr *) *host->h_addr_list, - t, INET_ADDRSTRLEN); + t, INET_ADDRSTRLEN); } return std::string(t); } @@ -432,19 +432,19 @@ void* SALOME_SocketSender_i::myThread(void *args) *errorFlag = false; while( n < *lgrTabToSend*sizeof(double) ){ - m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(double)-n); - if( m < 0 ){ - if( *clientSockfd >= 0 ){ - ::close(*clientSockfd); - *clientSockfd = -1; - } - if( *serverSockfd >= 0 ){ - ::close(*serverSockfd); - *serverSockfd = -1; - } - *errorFlag = true; - } - n += m; + m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(double)-n); + if( m < 0 ){ + if( *clientSockfd >= 0 ){ + ::close(*clientSockfd); + *clientSockfd = -1; + } + if( *serverSockfd >= 0 ){ + ::close(*serverSockfd); + *serverSockfd = -1; + } + *errorFlag = true; + } + n += m; } xdr_destroy( &xp ); @@ -458,19 +458,19 @@ void* SALOME_SocketSender_i::myThread(void *args) *errorFlag = false; while( n < *lgrTabToSend*sizeof(int) ){ - m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(int)-n); - if( m < 0 ){ - if( *clientSockfd >= 0 ){ - ::close(*clientSockfd); - *clientSockfd = -1; - } - if( *serverSockfd >= 0 ){ - ::close(*serverSockfd); - *serverSockfd = -1; - } - *errorFlag = true; - } - n += m; + m = write(*clientSockfd, (char*)tabToSend+n, *lgrTabToSend*sizeof(int)-n); + if( m < 0 ){ + if( *clientSockfd >= 0 ){ + ::close(*clientSockfd); + *clientSockfd = -1; + } + if( *serverSockfd >= 0 ){ + ::close(*serverSockfd); + *serverSockfd = -1; + } + *errorFlag = true; + } + n += m; } xdr_destroy( &xp ); @@ -502,7 +502,7 @@ void SALOME_SocketSender_i::initCom() throw(SALOME::SALOME_Exception) /* Association of socket with a port */ if( ::bind(_serverSockfd, (struct sockaddr *) & serv_addr, - sizeof(struct sockaddr)) < 0 ) { + sizeof(struct sockaddr)) < 0 ) { closeCom(); es.type = SALOME::COMM; es.text = "error bind Socket exception"; diff --git a/src/Communication/SALOME_Comm_i.hxx b/src/Communication/SALOME_Comm_i.hxx index af386ba09..9ea22cca1 100644 --- a/src/Communication/SALOME_Comm_i.hxx +++ b/src/Communication/SALOME_Comm_i.hxx @@ -63,7 +63,7 @@ public: }; class COMMUNICATION_EXPORT SALOME_SenderDouble_i : public virtual POA_SALOME::SenderDouble, - public virtual SALOME_Sender_i + public virtual SALOME_Sender_i { public: SALOME_SenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false); @@ -74,7 +74,7 @@ public: }; class COMMUNICATION_EXPORT SALOME_SenderInt_i : public virtual POA_SALOME::SenderInt, - public virtual SALOME_Sender_i + public virtual SALOME_Sender_i { public: SALOME_SenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false); @@ -87,7 +87,7 @@ public: /*! Servant class for CORBA sender for double* when no copy of array _tabToSend is required, that is to say double and CORBA::Double are binary equal. */ class COMMUNICATION_EXPORT SALOME_CorbaDoubleNCSender_i : public POA_SALOME::CorbaDoubleNCSender, - public SALOME_SenderDouble_i + public SALOME_SenderDouble_i { public: SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false); @@ -100,7 +100,7 @@ public: /*! Servant class for CORBA sender for double* when copy of array _tabToSend is required, that is to say double and CORBA::Double are NOT binary equal. */ class COMMUNICATION_EXPORT SALOME_CorbaDoubleCSender_i : public POA_SALOME::CorbaDoubleCSender, - public SALOME_SenderDouble_i + public SALOME_SenderDouble_i { public: SALOME_CorbaDoubleCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false); @@ -112,7 +112,7 @@ public: /*! Servant class for CORBA sender for int* when no copy of array _tabToSend is required, that is to say int and CORBA::Long are binary equal. */ class COMMUNICATION_EXPORT SALOME_CorbaLongNCSender_i : public POA_SALOME::CorbaLongNCSender, - public SALOME_SenderInt_i + public SALOME_SenderInt_i { public: SALOME_CorbaLongNCSender_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false); @@ -125,7 +125,7 @@ public: /*! Servant class for CORBA sender for int* when copy of array _tabToSend is required, that is to say int and CORBA::Long are NOT binary equal. */ class COMMUNICATION_EXPORT SALOME_CorbaLongCSender_i : public POA_SALOME::CorbaLongCSender, - public SALOME_SenderInt_i + public SALOME_SenderInt_i { public: SALOME_CorbaLongCSender_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false); @@ -142,7 +142,7 @@ public: /*! Servant class of sender using MPI2. */ class COMMUNICATION_EXPORT SALOME_MPISender_i : public virtual POA_SALOME::MPISender, - public virtual SALOME_Sender_i + public virtual SALOME_Sender_i { private: static unsigned long _tag1; @@ -173,16 +173,16 @@ private: }; class COMMUNICATION_EXPORT SALOME_MPISenderDouble_i : public POA_SALOME::MPISenderDouble, - public SALOME_SenderDouble_i, - public SALOME_MPISender_i + public SALOME_SenderDouble_i, + public SALOME_MPISender_i { public: SALOME_MPISenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false); }; class COMMUNICATION_EXPORT SALOME_MPISenderInt_i : public POA_SALOME::MPISenderInt, - public SALOME_SenderInt_i, - public SALOME_MPISender_i + public SALOME_SenderInt_i, + public SALOME_MPISender_i { public: SALOME_MPISenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false); @@ -195,7 +195,7 @@ public: /*! Servant class of sender using Sockets. */ class COMMUNICATION_EXPORT SALOME_SocketSender_i : public virtual POA_SALOME::SocketSender, - public virtual SALOME_Sender_i + public virtual SALOME_Sender_i { private: int _serverSockfd; @@ -222,16 +222,16 @@ private: }; class COMMUNICATION_EXPORT SALOME_SocketSenderDouble_i : public POA_SALOME::SocketSenderDouble, - public SALOME_SenderDouble_i, - public SALOME_SocketSender_i + public SALOME_SenderDouble_i, + public SALOME_SocketSender_i { public: SALOME_SocketSenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend=false); }; class COMMUNICATION_EXPORT SALOME_SocketSenderInt_i : public POA_SALOME::SocketSenderInt, - public SALOME_SenderInt_i, - public SALOME_SocketSender_i + public SALOME_SenderInt_i, + public SALOME_SocketSender_i { public: SALOME_SocketSenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend=false); diff --git a/src/Communication/SALOME_Matrix_i.cxx b/src/Communication/SALOME_Matrix_i.cxx index 8fb95a2c4..603cf4aa4 100644 --- a/src/Communication/SALOME_Matrix_i.cxx +++ b/src/Communication/SALOME_Matrix_i.cxx @@ -23,10 +23,10 @@ #include "SenderFactory.hxx" SALOME_Matrix_i::SALOME_Matrix_i(const SALOMEMultiComm& multiCommunicator,const double *tabToSend,int nbOfRow,int nbOfColumn,bool ownTabToSend):_tabToSend(tabToSend), - _nbOfRow(nbOfRow), - _nbOfColumn(nbOfColumn), - _ownTabToSend(ownTabToSend), - _type(multiCommunicator) + _nbOfRow(nbOfRow), + _nbOfColumn(nbOfColumn), + _ownTabToSend(ownTabToSend), + _type(multiCommunicator) { } diff --git a/src/Communication/SenderFactory.cxx b/src/Communication/SenderFactory.cxx index d0f38a4ab..b272679c3 100644 --- a/src/Communication/SenderFactory.cxx +++ b/src/Communication/SenderFactory.cxx @@ -42,29 +42,29 @@ SALOME::SenderDouble_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommun { case SALOME::CORBA_: { - SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab); - return retc->_this(); + SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab); + return retc->_this(); } #ifdef HAVE_MPI2 case SALOME::MPI_: { - SALOME_MPISenderDouble_i* retm=new SALOME_MPISenderDouble_i(tab,lgr,ownTab); - return retm->_this(); + SALOME_MPISenderDouble_i* retm=new SALOME_MPISenderDouble_i(tab,lgr,ownTab); + return retm->_this(); } #endif #ifdef HAVE_SOCKET case SALOME::SOCKET_: { - SALOME_SocketSenderDouble_i* rets=new SALOME_SocketSenderDouble_i(tab,lgr,ownTab); - return rets->_this(); + SALOME_SocketSenderDouble_i* rets=new SALOME_SocketSenderDouble_i(tab,lgr,ownTab); + return rets->_this(); } #endif default: { - multiCommunicator.setProtocol(SALOME::CORBA_); - MESSAGE("PROTOCOL CHANGED TO CORBA"); - SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab); - return retc->_this(); + multiCommunicator.setProtocol(SALOME::CORBA_); + MESSAGE("PROTOCOL CHANGED TO CORBA"); + SALOME_CorbaDoubleSender * retc=new SALOME_CorbaDoubleSender(tab,lgr,ownTab); + return retc->_this(); } // throw MultiCommException("Communication protocol not implemented"); } @@ -75,28 +75,28 @@ SALOME::SenderInt_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunica { case SALOME::CORBA_: { - SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab); - return retc->_this(); + SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab); + return retc->_this(); } #ifdef HAVE_MPI2 case SALOME::MPI_: { - SALOME_MPISenderInt_i* retm=new SALOME_MPISenderInt_i(tab,lgr,ownTab); - return retm->_this(); + SALOME_MPISenderInt_i* retm=new SALOME_MPISenderInt_i(tab,lgr,ownTab); + return retm->_this(); } #endif #ifdef HAVE_SOCKET case SALOME::SOCKET_: { - SALOME_SocketSenderInt_i* rets=new SALOME_SocketSenderInt_i(tab,lgr,ownTab); - return rets->_this(); + SALOME_SocketSenderInt_i* rets=new SALOME_SocketSenderInt_i(tab,lgr,ownTab); + return rets->_this(); } #endif default: { - multiCommunicator.setProtocol(SALOME::CORBA_); - SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab); - return retc->_this(); + multiCommunicator.setProtocol(SALOME::CORBA_); + SALOME_CorbaLongSender * retc=new SALOME_CorbaLongSender(tab,lgr,ownTab); + return retc->_this(); } // throw MultiCommException("Communication protocol not implemented"); } diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index 51e5b02d6..0c0d6dca8 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -263,7 +263,7 @@ void Engines_Component_i::destroy() //SCRUTE(_refcount_value()); _poa->deactivate_object(*_id); //SCRUTE(_refcount_value()); - _remove_ref(); + //_remove_ref(); // VSR: commented, since raises SIGSEGV because of double deactivate_object() //SCRUTE(_refcount_value()); MESSAGE("Engines_Component_i::destroyed") ; } diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 0eb47f92e..6358393a7 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -276,6 +276,8 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param } MESSAGE("[GiveContainer] Resource selected is: " << resource_selected); + _numInstanceMutex.lock(); + // Step 5: get container in the naming service Engines::ResourceDefinition_var resource_definition = _ResManager->GetResourceDefinition(resource_selected.c_str()); std::string hostname(resource_definition->name.in()); @@ -334,6 +336,7 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param if (std::string(local_params.parallelLib.in()) != "") { INFOS("[GiveContainer] PaCO++ container are not currently available"); + _numInstanceMutex.unlock(); return ret; } // Classic or Exe ? @@ -347,6 +350,7 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param if (CORBA::is_nil (Catalog)) { INFOS("[GiveContainer] Module Catalog is not found -> cannot launch a container"); + _numInstanceMutex.unlock(); return ret; } // Loop through component list @@ -365,6 +369,7 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param if(found) { INFOS("ContainerManager Error: you can't have 2 CEXE component in the same container" ); + _numInstanceMutex.unlock(); return Engines::Container::_nil(); } MESSAGE("[GiveContainer] Exe container found !: " << container_exe_tmp); @@ -376,11 +381,13 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param catch (ServiceUnreachable&) { INFOS("Caught exception: Naming Service Unreachable"); + _numInstanceMutex.unlock(); return ret; } catch (...) { INFOS("Caught unknown exception."); + _numInstanceMutex.unlock(); return ret; } @@ -425,6 +432,8 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param // launch container with a system call int status=system(command.c_str()); + _numInstanceMutex.unlock(); + if (status == -1){ MESSAGE("SALOME_ContainerManager::StartContainer rsh failed (system command status -1)"); RmTmpFile(_TmpFileName); // command file can be removed here diff --git a/src/Container/SALOME_ContainerManager.hxx b/src/Container/SALOME_ContainerManager.hxx index 0caeaafcb..89fa303fa 100644 --- a/src/Container/SALOME_ContainerManager.hxx +++ b/src/Container/SALOME_ContainerManager.hxx @@ -91,6 +91,8 @@ protected: std::string machinesFile(const int nbproc); + void machinesFile(const int nbproc); + // For PacO++ Parallel extension typedef std::vector actual_launch_machine_t; std::string BuildCommandToLaunchParallelContainer(const std::string& exe_name, diff --git a/src/DF/DF_ChildIterator.cxx b/src/DF/DF_ChildIterator.cxx index 889220896..834c36159 100644 --- a/src/DF/DF_ChildIterator.cxx +++ b/src/DF/DF_ChildIterator.cxx @@ -75,25 +75,25 @@ void DF_ChildIterator::Next() } else { if(_current->_next) { //Next Brother - _current = _current->_next; + _current = _current->_next; } else { - if(_current->_father && _current->_father != _root) { - DF_LabelNode *father = _current->_father; - _current = father->_next; - if(!_current) { - while(father && father != _root) { - father = father->_father; - if(father->_next) break; - } - if(father == _root) father = NULL; - if(father) _current = father->_next; - else _current = NULL; - } - } - else { - _current = NULL; //We iterate the whole sub tree - } + if(_current->_father && _current->_father != _root) { + DF_LabelNode *father = _current->_father; + _current = father->_next; + if(!_current) { + while(father && father != _root) { + father = father->_father; + if(father->_next) break; + } + if(father == _root) father = NULL; + if(father) _current = father->_next; + else _current = NULL; + } + } + else { + _current = NULL; //We iterate the whole sub tree + } } } } diff --git a/src/DF/DF_definitions.hxx b/src/DF/DF_definitions.hxx index de5d65e6d..512769887 100644 --- a/src/DF/DF_definitions.hxx +++ b/src/DF/DF_definitions.hxx @@ -44,27 +44,27 @@ public: template explicit df_shared_ptr(Y * p) { - boost::shared_ptr::reset(p); + boost::shared_ptr::reset(p); } template df_shared_ptr(df_shared_ptr const & r): boost::shared_ptr(r,boost::detail::dynamic_cast_tag()) - {} + {} template df_shared_ptr & operator=(df_shared_ptr const & r) { - df_shared_ptr(r).swap(*this); - return *this; + df_shared_ptr(r).swap(*this); + return *this; } template df_shared_ptr& operator()(Y * p) // Y must be complete { if(T* pt = dynamic_cast(p)) - boost::shared_ptr::reset(pt); + boost::shared_ptr::reset(pt); else - boost::throw_exception(std::bad_cast()); + boost::throw_exception(std::bad_cast()); return *this; } diff --git a/src/DF/testDF.cxx b/src/DF/testDF.cxx index 202ab7089..c73c20d5b 100644 --- a/src/DF/testDF.cxx +++ b/src/DF/testDF.cxx @@ -179,7 +179,7 @@ vector splitString(const string& theValue, char separator) vs.push_back(s.substr(0, pos)); s = s.substr(pos+1, s.size()); } - + if(!s.empty() && s[0] != separator) vs.push_back(s); return vs; } diff --git a/src/DSC/DSC_Basic/ConnectionManager_i.cxx b/src/DSC/DSC_Basic/ConnectionManager_i.cxx index 67801bd60..04a2706c3 100644 --- a/src/DSC/DSC_Basic/ConnectionManager_i.cxx +++ b/src/DSC/DSC_Basic/ConnectionManager_i.cxx @@ -47,9 +47,9 @@ ConnectionManager_i::~ConnectionManager_i() {} Engines::ConnectionManager::connectionId ConnectionManager_i::connect(Engines::DSC_ptr uses_component, - const char* uses_port_name, - Engines::DSC_ptr provides_component, - const char* provides_port_name) + const char* uses_port_name, + Engines::DSC_ptr provides_component, + const char* provides_port_name) { Ports::Port_var p_port = provides_component->get_provides_port(provides_port_name, false); @@ -79,7 +79,7 @@ ConnectionManager_i::connect(Engines::DSC_ptr uses_component, void ConnectionManager_i::disconnect(Engines::ConnectionManager::connectionId id, - Engines::DSC::Message message) + Engines::DSC::Message message) { int err=0; // Connection id exist ? @@ -93,7 +93,7 @@ ConnectionManager_i::disconnect(Engines::ConnectionManager::connectionId id, try { infos->provides_component->disconnect_provides_port(infos->provides_port_name.c_str(), - message); + message); } catch(CORBA::SystemException& ex) { @@ -103,8 +103,8 @@ ConnectionManager_i::disconnect(Engines::ConnectionManager::connectionId id, try { infos->uses_component->disconnect_uses_port(infos->uses_port_name.c_str(), - infos->provides_port, - message); + infos->provides_port, + message); } catch(CORBA::SystemException& ex) { diff --git a/src/DSC/DSC_Basic/ConnectionManager_i.hxx b/src/DSC/DSC_Basic/ConnectionManager_i.hxx index 7a9b0a4ee..7b4133f9a 100644 --- a/src/DSC/DSC_Basic/ConnectionManager_i.hxx +++ b/src/DSC/DSC_Basic/ConnectionManager_i.hxx @@ -50,9 +50,9 @@ class ConnectionManager_i : * \see Engines::ConnectionManager::connect */ Engines::ConnectionManager::connectionId connect(Engines::DSC_ptr uses_component, - const char* uses_port_name, - Engines::DSC_ptr provides_component, - const char* provides_port_name); + const char* uses_port_name, + Engines::DSC_ptr provides_component, + const char* provides_port_name); /*! * CORBA method : releases a connection performed with @@ -61,7 +61,7 @@ class ConnectionManager_i : * \see Engines::ConnectionManager::disconnect */ void disconnect(Engines::ConnectionManager::connectionId id, - Engines::DSC::Message message); + Engines::DSC::Message message); /*! Shutdown the ConnectionManager process. @@ -84,9 +84,9 @@ class ConnectionManager_i : }; typedef std::map ids_type; + connection_infos *> ids_type; typedef std::map::iterator ids_it_type; + connection_infos *>::iterator ids_it_type; ids_type ids; ids_it_type ids_it; diff --git a/src/DSC/DSC_Basic/DSC_Callbacks.hxx b/src/DSC/DSC_Basic/DSC_Callbacks.hxx index c1e8b884b..72ce77bfb 100644 --- a/src/DSC/DSC_Basic/DSC_Callbacks.hxx +++ b/src/DSC/DSC_Basic/DSC_Callbacks.hxx @@ -53,8 +53,8 @@ class DSC_BASIC_EXPORT DSC_Callbacks * \param message contains informations about the modification of the port. */ virtual void provides_port_changed(const char* provides_port_name, - int connection_nbr, - const Engines::DSC::Message message) = 0; + int connection_nbr, + const Engines::DSC::Message message) = 0; /*! \brief This method is used by the component when the number of connection * on a uses port changes. @@ -66,8 +66,8 @@ class DSC_BASIC_EXPORT DSC_Callbacks * \param message contains informations about the modification of the port. */ virtual void uses_port_changed(const char* uses_port_name, - Engines::DSC::uses_port * new_uses_port, - const Engines::DSC::Message message) = 0; + Engines::DSC::uses_port * new_uses_port, + const Engines::DSC::Message message) = 0; }; #endif diff --git a/src/DSC/DSC_Basic/DSC_i.cxx b/src/DSC/DSC_Basic/DSC_i.cxx index b4a98493f..6b7e2e946 100644 --- a/src/DSC/DSC_Basic/DSC_i.cxx +++ b/src/DSC/DSC_Basic/DSC_i.cxx @@ -29,15 +29,15 @@ Engines_DSC_i:: Engines_DSC_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, - bool notif) : Engines_Component_i(orb, - poa, - contId, - instanceName, - interfaceName) + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName, + bool notif) : Engines_Component_i(orb, + poa, + contId, + instanceName, + interfaceName) { #ifdef MYDEBUG std::cerr << "--Engines_DSC_i: MARK 1 --" << instanceName << "----" << std::endl; diff --git a/src/DSC/DSC_Basic/DSC_i.hxx b/src/DSC/DSC_Basic/DSC_i.hxx index ccfd98786..ddb549538 100644 --- a/src/DSC/DSC_Basic/DSC_i.hxx +++ b/src/DSC/DSC_Basic/DSC_i.hxx @@ -43,24 +43,24 @@ */ class DSC_BASIC_EXPORT Engines_DSC_i: public Engines_Component_i, // keyword virtual is not use to be able to - // call the right Engines_Component_i constructor. - // If virtual is used, a derived class of Engines_DSC_i - // will have to call the right Engines_Component_i constructor. + // call the right Engines_Component_i constructor. + // If virtual is used, a derived class of Engines_DSC_i + // will have to call the right Engines_Component_i constructor. public virtual POA_Engines::DSC, public Engines_DSC_interface { public: Engines_DSC_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, - bool notif = false); + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName, + bool notif = false); Engines_DSC_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - Engines::Container_ptr container, - const char *instanceName, - const char *interfaceName, + PortableServer::POA_ptr poa, + Engines::Container_ptr container, + const char *instanceName, + const char *interfaceName, bool notif = false, bool regist = true ); @@ -70,38 +70,38 @@ public: * \see Engines::DSC::add_provides_port */ virtual void add_provides_port(Ports::Port_ptr ref, - const char* provides_port_name, - Ports::PortProperties_ptr port_prop) + const char* provides_port_name, + Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::NilPort, - Engines::DSC::BadProperty) { + Engines::DSC::NilPort, + Engines::DSC::BadProperty) { Engines_DSC_interface::add_provides_port(ref, - provides_port_name, - port_prop); + provides_port_name, + port_prop); } /*! * \see Engines::DSC::add_uses_port */ virtual void add_uses_port(const char* repository_id, - const char* uses_port_name, - Ports::PortProperties_ptr port_prop) + const char* uses_port_name, + Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::BadProperty) { + Engines::DSC::BadProperty) { Engines_DSC_interface::add_uses_port(repository_id, - uses_port_name, - port_prop); + uses_port_name, + port_prop); } /*! * \see Engines::DSC::get_provides_port */ virtual Ports::Port_ptr get_provides_port(const char* provides_port_name, - const CORBA::Boolean connection_error) + const CORBA::Boolean connection_error) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + Engines::DSC::PortNotConnected) { return Engines_DSC_interface::get_provides_port(provides_port_name, - connection_error); + connection_error); } /*! @@ -109,7 +109,7 @@ public: */ virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + Engines::DSC::PortNotConnected) { return Engines_DSC_interface::get_uses_port(uses_port_name); } @@ -125,12 +125,12 @@ public: * \see Engines::DSC::connect_uses_port */ virtual void connect_uses_port(const char* uses_port_name, - Ports::Port_ptr provides_port_ref) + Ports::Port_ptr provides_port_ref) throw (Engines::DSC::PortNotDefined, - Engines::DSC::BadPortType, - Engines::DSC::NilPort) { + Engines::DSC::BadPortType, + Engines::DSC::NilPort) { Engines_DSC_interface::connect_uses_port(uses_port_name, - provides_port_ref); + provides_port_ref); } /*! @@ -145,25 +145,25 @@ public: * \see Engines::DSC::disconnect_provides_port */ virtual void disconnect_provides_port(const char* provides_port_name, - const Engines::DSC::Message message) + const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + Engines::DSC::PortNotConnected) { Engines_DSC_interface::disconnect_provides_port(provides_port_name, - message); + message); } /*! * \see Engines::DSC::disconnect_uses_port */ virtual void disconnect_uses_port(const char* uses_port_name, - Ports::Port_ptr provides_port_ref, - const Engines::DSC::Message message) + Ports::Port_ptr provides_port_ref, + const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortReference) { + Engines::DSC::PortNotConnected, + Engines::DSC::BadPortReference) { Engines_DSC_interface::disconnect_uses_port(uses_port_name, - provides_port_ref, - message); + provides_port_ref, + message); } /*! diff --git a/src/DSC/DSC_Basic/DSC_interface.cxx b/src/DSC/DSC_Basic/DSC_interface.cxx index 3c15326a6..b471145ea 100644 --- a/src/DSC/DSC_Basic/DSC_interface.cxx +++ b/src/DSC/DSC_Basic/DSC_interface.cxx @@ -48,8 +48,8 @@ Engines_DSC_interface::~Engines_DSC_interface() void Engines_DSC_interface::add_provides_port(Ports::Port_ptr ref, - const char* provides_port_name, - Ports::PortProperties_ptr port_prop) + const char* provides_port_name, + Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, Engines::DSC::NilPort, Engines::DSC::BadProperty) @@ -79,8 +79,8 @@ throw (Engines::DSC::PortAlreadyDefined, void Engines_DSC_interface::add_uses_port(const char* repository_id, - const char* uses_port_name, - Ports::PortProperties_ptr port_prop) + const char* uses_port_name, + Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, Engines::DSC::BadProperty) { @@ -111,10 +111,10 @@ throw (Engines::DSC::PortAlreadyDefined, Ports::Port_ptr Engines_DSC_interface::get_provides_port(const char* provides_port_name, - const CORBA::Boolean connection_error) + const CORBA::Boolean connection_error) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortType) + Engines::DSC::PortNotConnected, + Engines::DSC::BadPortType) { // Method arg test assert(provides_port_name); @@ -148,8 +148,8 @@ Engines_DSC_interface::get_provides_port(const char* provides_port_name, Engines::DSC::uses_port * Engines_DSC_interface::get_uses_port(const char* uses_port_name) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortType) + Engines::DSC::PortNotConnected, + Engines::DSC::BadPortType) { // Method arg test assert(uses_port_name); @@ -204,17 +204,17 @@ Engines_DSC_interface::connect_provides_port(const char* provides_port_name) my_ports[provides_port_name]->connection_nbr += 1; // User code is informed provides_port_changed(provides_port_name, - my_ports[provides_port_name]->connection_nbr, - Engines::DSC::AddingConnection - ); + my_ports[provides_port_name]->connection_nbr, + Engines::DSC::AddingConnection + ); } void Engines_DSC_interface::connect_uses_port(const char* uses_port_name, - Ports::Port_ptr provides_port_ref) + Ports::Port_ptr provides_port_ref) throw (Engines::DSC::PortNotDefined, - Engines::DSC::BadPortType, - Engines::DSC::NilPort) + Engines::DSC::BadPortType, + Engines::DSC::NilPort) { // Method arg test assert(uses_port_name); @@ -248,14 +248,14 @@ Engines_DSC_interface::connect_uses_port(const char* uses_port_name, my_ports[uses_port_name]->connection_nbr += 1; // User code is informed uses_port_changed(uses_port_name, - new Engines::DSC::uses_port(my_ports[uses_port_name]->uses_port_refs), - Engines::DSC::AddingConnection); + new Engines::DSC::uses_port(my_ports[uses_port_name]->uses_port_refs), + Engines::DSC::AddingConnection); } else { Engines::DSC::BadPortType BPT; BPT.expected = CORBA::string_dup("Expected ..."); BPT.received = CORBA::string_dup((std::string("Received an incorrect repository id type ")+ - repository_id).c_str()); + repository_id).c_str()); throw BPT; } @@ -283,7 +283,7 @@ Engines_DSC_interface::is_connected(const char* port_name) void Engines_DSC_interface::disconnect_provides_port(const char* provides_port_name, - const Engines::DSC::Message message) + const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected) { @@ -301,8 +301,8 @@ throw (Engines::DSC::PortNotDefined, { my_ports[provides_port_name]->connection_nbr -= 1; provides_port_changed(provides_port_name, - my_ports[provides_port_name]->connection_nbr, - message); + my_ports[provides_port_name]->connection_nbr, + message); } else throw Engines::DSC::PortNotConnected(); @@ -310,8 +310,8 @@ throw (Engines::DSC::PortNotDefined, void Engines_DSC_interface::disconnect_uses_port(const char* uses_port_name, - Ports::Port_ptr provides_port_ref, - const Engines::DSC::Message message) + Ports::Port_ptr provides_port_ref, + const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, Engines::DSC::PortNotConnected, Engines::DSC::BadPortReference) @@ -336,8 +336,8 @@ throw (Engines::DSC::PortNotDefined, { if (my_ports[uses_port_name]->uses_port_refs[i]->_is_equivalent(provides_port_ref)) { - port_index = i; - break; + port_index = i; + break; } } if (port_index == -1) @@ -353,15 +353,15 @@ throw (Engines::DSC::PortNotDefined, for(;index_ancien < seq_length;) { if (index_ancien == port_index) { - // Rien a faire ! - // On ne change pas le index du nouveau tableau - index_ancien += 1; + // Rien a faire ! + // On ne change pas le index du nouveau tableau + index_ancien += 1; } else { - (*new_uses_port)[index_nouveau] = my_ports[uses_port_name]->uses_port_refs[index_ancien]; - index_ancien += 1; - index_nouveau += 1; + (*new_uses_port)[index_nouveau] = my_ports[uses_port_name]->uses_port_refs[index_ancien]; + index_ancien += 1; + index_nouveau += 1; } } @@ -370,8 +370,8 @@ throw (Engines::DSC::PortNotDefined, // The user code is informed uses_port_changed(uses_port_name, - new_uses_port, - message); + new_uses_port, + message); } else throw Engines::DSC::PortNotConnected(); diff --git a/src/DSC/DSC_Basic/DSC_interface.hxx b/src/DSC/DSC_Basic/DSC_interface.hxx index ad0eb3539..f0a147ae7 100644 --- a/src/DSC/DSC_Basic/DSC_interface.hxx +++ b/src/DSC/DSC_Basic/DSC_interface.hxx @@ -50,37 +50,37 @@ public: * \see Engines::DSC::add_provides_port */ virtual void add_provides_port(Ports::Port_ptr ref, - const char* provides_port_name, - Ports::PortProperties_ptr port_prop) + const char* provides_port_name, + Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::NilPort, - Engines::DSC::BadProperty); + Engines::DSC::NilPort, + Engines::DSC::BadProperty); /*! * \see Engines::DSC::add_uses_port */ virtual void add_uses_port(const char* repository_id, - const char* uses_port_name, - Ports::PortProperties_ptr port_prop) + const char* uses_port_name, + Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::BadProperty); + Engines::DSC::BadProperty); /*! * \see Engines::DSC::get_provides_port */ virtual Ports::Port_ptr get_provides_port(const char* provides_port_name, - const CORBA::Boolean connection_error) + const CORBA::Boolean connection_error) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortType); + Engines::DSC::PortNotConnected, + Engines::DSC::BadPortType); /*! * \see Engines::DSC::get_uses_port */ virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortType); + Engines::DSC::PortNotConnected, + Engines::DSC::BadPortType); /*! * \see Engines::DSC::connect_provides_port @@ -100,10 +100,10 @@ public: * port how much provides ports are connected with. */ virtual void connect_uses_port(const char* uses_port_name, - Ports::Port_ptr provides_port_ref) + Ports::Port_ptr provides_port_ref) throw (Engines::DSC::PortNotDefined, - Engines::DSC::BadPortType, - Engines::DSC::NilPort); + Engines::DSC::BadPortType, + Engines::DSC::NilPort); /*! * \see Engines::DSC::is_connected @@ -120,9 +120,9 @@ public: * to manage connections between ports. */ virtual void disconnect_provides_port(const char* provides_port_name, - const Engines::DSC::Message message) + const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected); + Engines::DSC::PortNotConnected); /*! * \see Engines::DSC::disconnect_uses_port @@ -136,11 +136,11 @@ public: * the sequence. */ virtual void disconnect_uses_port(const char* uses_port_name, - Ports::Port_ptr provides_port_ref, - const Engines::DSC::Message message) + Ports::Port_ptr provides_port_ref, + const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortReference); + Engines::DSC::PortNotConnected, + Engines::DSC::BadPortReference); /*! * \see Engines::DSC::get_port_properties diff --git a/src/DSC/DSC_Basic/PortProperties_i.hxx b/src/DSC/DSC_Basic/PortProperties_i.hxx index 0afa212de..7ef4a63b5 100644 --- a/src/DSC/DSC_Basic/PortProperties_i.hxx +++ b/src/DSC/DSC_Basic/PortProperties_i.hxx @@ -46,7 +46,7 @@ class DSC_BASIC_EXPORT PortProperties_i: * \see Ports::PortProperties::set_property */ virtual void set_property(const char * name, - const CORBA::Any& value) + const CORBA::Any& value) throw (Ports::NotDefined, Ports::BadType); /*! diff --git a/src/DSC/DSC_User/Basic/data_short_port_provides.cxx b/src/DSC/DSC_User/Basic/data_short_port_provides.cxx index cd6c02f37..69a0965a3 100644 --- a/src/DSC/DSC_User/Basic/data_short_port_provides.cxx +++ b/src/DSC/DSC_User/Basic/data_short_port_provides.cxx @@ -27,12 +27,12 @@ data_short_port_provides::data_short_port_provides() { _val = 0; - short_termine = false; + short_termine = false; short_mutex = new pthread_mutex_t(); pthread_mutex_init(short_mutex, NULL); short_condition = new pthread_cond_t(); pthread_cond_init(short_condition, NULL); - short_termine_cp = true; + short_termine_cp = true; short_mutex_cp = new pthread_mutex_t(); pthread_mutex_init(short_mutex_cp, NULL); short_condition_cp = new pthread_cond_t(); diff --git a/src/DSC/DSC_User/Basic/data_short_port_uses.cxx b/src/DSC/DSC_User/Basic/data_short_port_uses.cxx index ecc1ca0a2..1127a0034 100644 --- a/src/DSC/DSC_User/Basic/data_short_port_uses.cxx +++ b/src/DSC/DSC_User/Basic/data_short_port_uses.cxx @@ -56,7 +56,7 @@ data_short_port_uses::put(CORBA::Short data) { void data_short_port_uses::uses_port_changed(Engines::DSC::uses_port * new_uses_port, - const Engines::DSC::Message message) + const Engines::DSC::Message message) { if (_my_ports) delete _my_ports; diff --git a/src/DSC/DSC_User/Basic/data_short_port_uses.hxx b/src/DSC/DSC_User/Basic/data_short_port_uses.hxx index 682c0480c..e45862d51 100644 --- a/src/DSC/DSC_User/Basic/data_short_port_uses.hxx +++ b/src/DSC/DSC_User/Basic/data_short_port_uses.hxx @@ -64,7 +64,7 @@ class data_short_port_uses : * \param message message associated to the modification. */ virtual void uses_port_changed(Engines::DSC::uses_port * new_uses_port, - const Engines::DSC::Message message); + const Engines::DSC::Message message); private : Engines::DSC::uses_port * _my_ports; diff --git a/src/DSC/DSC_User/DSC_Exception.hxx b/src/DSC/DSC_User/DSC_Exception.hxx index 09315144d..89cf74bb6 100644 --- a/src/DSC/DSC_User/DSC_Exception.hxx +++ b/src/DSC/DSC_User/DSC_Exception.hxx @@ -105,9 +105,9 @@ struct DSC_Exception : public SALOME_Exception { // soit utilisable. // Ne pas mettre lineNumber=0 à cause du calcul log dans la SALOME_Exception si fileName est défini DSC_Exception( const std::string & text, - const char *fileName="", - const unsigned int lineNumber=0, - const char *funcName="" ): + const char *fileName="", + const unsigned int lineNumber=0, + const char *funcName="" ): SALOME_Exception(text.c_str()) , _dscText(text), _filefuncName(setFileFuncName(fileName?fileName:"",funcName?funcName:"")), @@ -166,7 +166,7 @@ protected: #define DSC_EXCEPTION(Derived) struct Derived : public DSC_Exception { \ Derived ( const std::string & text, const char *fileName="", const unsigned int lineNumber=0, const char *funcName="" \ - ) : DSC_Exception(text,fileName,lineNumber,funcName) { \ + ) : DSC_Exception(text,fileName,lineNumber,funcName) { \ _exceptionName = #Derived; \ } \ virtual ~Derived(void) throw();\ diff --git a/src/DSC/DSC_User/Datastream/AdjacentFunctor.hxx b/src/DSC/DSC_User/Datastream/AdjacentFunctor.hxx index 7f909cc19..d25d40402 100644 --- a/src/DSC/DSC_User/Datastream/AdjacentFunctor.hxx +++ b/src/DSC/DSC_User/Datastream/AdjacentFunctor.hxx @@ -47,8 +47,8 @@ template < typename T > struct AdjacentFunctor { bool _minFound,_maxFound,_equal; AdjacentFunctor(const T& value):_minValue(value),_maxValue(value), - _minFound(false),_maxFound(false), - _equal(false) {} + _minFound(false),_maxFound(false), + _equal(false) {} // Suppose que les valeurs passées en paramètres sont triées par ordre croissant bool operator()(const T &v1) { diff --git a/src/DSC/DSC_User/Datastream/AdjacentPredicate.hxx b/src/DSC/DSC_User/Datastream/AdjacentPredicate.hxx index fd24b4c48..bfc754f3b 100644 --- a/src/DSC/DSC_User/Datastream/AdjacentPredicate.hxx +++ b/src/DSC/DSC_User/Datastream/AdjacentPredicate.hxx @@ -47,14 +47,14 @@ struct AdjacentPredicate : public std::binary_function < T, T, bool > template struct AdjacentPredicate< std::pair, T3 > > : public std::binary_function < std::pair, T3 >, - std::pair, T3 >, bool > + std::pair, T3 >, bool > { std::pair _value; AdjacentPredicate(const std::pair & value):_value(value){ std::cout << "1-Initializing with value " << _value << std::endl; } bool operator()( const std::pair, T3 > & v1, - const std::pair, T3 > v2) const { + const std::pair, T3 > v2) const { std::cout << "1-> :" << v1 << "," << v2 << " " << std::endl; return (v1.first <= _value ) && (_value < v2.first) ; } diff --git a/src/DSC/DSC_User/Datastream/Calcium/Calcium.c b/src/DSC/DSC_User/Datastream/Calcium/Calcium.c index 20c11ada4..b9ce3521e 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/Calcium.c +++ b/src/DSC/DSC_User/Datastream/Calcium/Calcium.c @@ -49,34 +49,34 @@ typedef char bool; /* Attention si les niveaux sont actifs le buffer peut être supprimé automatiquement par calcium. */ #define CALCIUM_EXT_LECT_INTERFACE_C_(_name,_timeType,_type,_typeName,_qual) \ - InfoType ecp_##_name (void * component, int mode, \ - _timeType * ti, _timeType * tf, int * i, \ - char * nomvar, int bufferLength, \ - int * nRead, _type _qual ** data ) { \ - size_t _nRead; \ - long _i=*i; \ - fflush(stdout); \ - fflush(stderr); \ - \ + InfoType ecp_##_name (void * component, int mode, \ + _timeType * ti, _timeType * tf, int * i, \ + char * nomvar, int bufferLength, \ + int * nRead, _type _qual ** data ) { \ + size_t _nRead; \ + long _i=*i; \ + fflush(stdout); \ + fflush(stderr); \ + \ InfoType info = ecp_lecture_##_typeName (component, mode, ti, tf, &_i, \ - nomvar, bufferLength, &_nRead, \ - data ); \ + nomvar, bufferLength, &_nRead, \ + data ); \ /* std::cout << "-------- CalciumInterface(C Part), Valeur de data : " << std::endl; */ \ - /* std::cout << "Ptr :" << *data << std::endl; */ \ - /* for (int j=0; j<_nRead;++j) */ \ - /* printf("--- Valeur de data[%d] : %d \n",j,(*data)[j]); */ \ - /* std::cout << "Ptr :" << *data << std::endl; */ \ - /* */ \ + /* std::cout << "Ptr :" << *data << std::endl; */ \ + /* for (int j=0; j<_nRead;++j) */ \ + /* printf("--- Valeur de data[%d] : %d \n",j,(*data)[j]); */ \ + /* std::cout << "Ptr :" << *data << std::endl; */ \ + /* */ \ /* std::cerr << "-------- CalciumInterface(C Part) MARK 2 ------------------" << std::endl; */ \ if(mode == CP_SEQUENTIEL) \ - *i = _i; \ - *nRead=_nRead; \ + *i = _i; \ + *nRead=_nRead; \ /* std::cerr << "-------- CalciumInterface(C Part) MARK 3 ------------------" << std::endl; */ \ - \ - return info; \ - }; \ - void ecp_##_name##_free ( _type _qual * data) { \ - ecp_lecture_##_typeName##_free(data); \ + \ + return info; \ + }; \ + void ecp_##_name##_free ( _type _qual * data) { \ + ecp_lecture_##_typeName##_free(data); \ }; @@ -85,29 +85,29 @@ typedef char bool; Le paramètre supplémentaire strSize indique la taille fixe et identique des chaînes stockées dans data (les ports CALCIUM n'en n'ont pas besoin) */ -InfoType ecp_lch(void * component, int mode, float * ti, float * tf, int * i, - char * nomvar, int bufferLength, int * nRead, - char *** data, int strSize) { +InfoType ecp_lch(void * component, int mode, float * ti, float * tf, int * i, + char * nomvar, int bufferLength, int * nRead, + char *** data, int strSize) { - size_t _nRead; - long _i=*i; - fflush(stdout);fflush(stderr); + size_t _nRead; + long _i=*i; + fflush(stdout);fflush(stderr); InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i, - nomvar, bufferLength, &_nRead, - data);/*, strSize ); - strSize est inutile pour les ports CALCIUM - qui gèrent des tailles quelconques de chaines. */ - if(mode == CP_SEQUENTIEL) - *i = _i; - *nRead=_nRead; - fflush(stdout);fflush(stderr); - - return info; -}; - -void ecp_lch_free (char* * data) { \ - ecp_lecture_str_free(data); \ + nomvar, bufferLength, &_nRead, + data);/*, strSize ); + strSize est inutile pour les ports CALCIUM + qui gèrent des tailles quelconques de chaines. */ + if(mode == CP_SEQUENTIEL) + *i = _i; + *nRead=_nRead; + fflush(stdout);fflush(stderr); + + return info; +}; + +void ecp_lch_free (char* * data) { \ + ecp_lecture_str_free(data); \ }; @@ -126,34 +126,34 @@ CALCIUM_EXT_LECT_INTERFACE_C_(lcp,float,float,cplx,); /**************************************/ #define CALCIUM_LECT_INTERFACE_C_(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \ - _calInt cp_##_name (void * component, _calInt mode, \ - _timeType * ti, _timeType * tf, _calInt * i, \ - char * nomvar, _calInt bufferLength, \ - _calInt * nRead, _type _qual * data \ - lastarg ) { \ - \ - int _mode = (int) mode; \ - size_t _bufferLength = bufferLength; \ - size_t _nRead; \ - long _i =*i; \ - fflush(stdout); \ - fflush(stderr); \ - \ - if ( (data == NULL) || (_bufferLength < 1) ) return CPNTNULL; \ - \ + _calInt cp_##_name (void * component, _calInt mode, \ + _timeType * ti, _timeType * tf, _calInt * i, \ + char * nomvar, _calInt bufferLength, \ + _calInt * nRead, _type _qual * data \ + lastarg ) { \ + \ + int _mode = (int) mode; \ + size_t _bufferLength = bufferLength; \ + size_t _nRead; \ + long _i =*i; \ + fflush(stdout); \ + fflush(stderr); \ + \ + if ( (data == NULL) || (_bufferLength < 1) ) return CPNTNULL; \ + \ _calInt info = ecp_lecture_##_typeName (component, _mode, ti, tf, &_i, \ - nomvar, _bufferLength, &_nRead, \ - &data ); \ - if(mode == CP_SEQUENTIEL) \ - *i = _i; \ - *nRead=_nRead; \ - fflush(stdout); \ - fflush(stderr); \ - \ - return info; \ - }; \ - void cp_##_name##_free ( _type _qual * data) { \ - ecp_lecture_##_typeName##_free(data); \ + nomvar, _bufferLength, &_nRead, \ + &data ); \ + if(mode == CP_SEQUENTIEL) \ + *i = _i; \ + *nRead=_nRead; \ + fflush(stdout); \ + fflush(stderr); \ + \ + return info; \ + }; \ + void cp_##_name##_free ( _type _qual * data) { \ + ecp_lecture_##_typeName##_free(data); \ }; @@ -163,31 +163,31 @@ CALCIUM_EXT_LECT_INTERFACE_C_(lcp,float,float,cplx,); des chaînes stockées dans data (les ports CALCIUM n'en n'ont pas besoin) */ -/* InfoType cp_lch(void * component, int mode, float * ti, float * tf, int * i, */ -/* char * nomvar, int bufferLength, int * nRead, */ -/* char ** data, int strSize) { */ +/* InfoType cp_lch(void * component, int mode, float * ti, float * tf, int * i, */ +/* char * nomvar, int bufferLength, int * nRead, */ +/* char ** data, int strSize) { */ -/* size_t _nRead; */ -/* long _i=*i; */ -/* fflush(stdout);fflush(stderr); */ -/* fprintf(stderr,"Beginning of cp_lch: %s %d %f\n",nomvar,*i,*ti); */ - -/* if ( (data == NULL) || (bufferLength < 1) ) return CPNTNULL; */ +/* size_t _nRead; */ +/* long _i=*i; */ +/* fflush(stdout);fflush(stderr); */ +/* fprintf(stderr,"Beginning of cp_lch: %s %d %f\n",nomvar,*i,*ti); */ + +/* if ( (data == NULL) || (bufferLength < 1) ) return CPNTNULL; */ /* InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i, */ -/* nomvar, bufferLength, &_nRead, */ -/* &data);*/ +/* nomvar, bufferLength, &_nRead, */ +/* &data);*/ /*, strSize ); */ -/* strSize est inutile pour les ports CALCIUM */ -/* qui gèrent des tailles quelconques de chaines. */ -/* if(mode == CP_SEQUENTIEL) */ -/* *i = _i; */ -/* *nRead=_nRead; */ -/* fprintf(stderr,"End of cp_lch: %s %d \n",nomvar,*i); */ -/* fflush(stdout);fflush(stderr); */ - -/* return info; */ -/* }; */ +/* strSize est inutile pour les ports CALCIUM */ +/* qui gèrent des tailles quelconques de chaines. */ +/* if(mode == CP_SEQUENTIEL) */ +/* *i = _i; */ +/* *nRead=_nRead; */ +/* fprintf(stderr,"End of cp_lch: %s %d \n",nomvar,*i); */ +/* fflush(stdout);fflush(stderr); */ + +/* return info; */ +/* }; */ /* Definition des méthodes calcium standard */ @@ -247,51 +247,51 @@ InfoType cp_fin (void * component, int code) { /***************************/ #define CALCIUM_ECR_INTERFACE_C_(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \ - _calInt cp_##_name (void * component, _calInt mode, \ - _timeType t, _calInt i, \ - char * nomvar, _calInt nbelem, \ - _type _qual * data \ - lastarg ) { \ - \ - int _mode = mode; \ - long _i = i; \ - size_t _nbelem = nbelem; \ - _timeType _t = t; \ - fflush(stdout); \ - fflush(stderr); \ - if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; \ - \ + _calInt cp_##_name (void * component, _calInt mode, \ + _timeType t, _calInt i, \ + char * nomvar, _calInt nbelem, \ + _type _qual * data \ + lastarg ) { \ + \ + int _mode = mode; \ + long _i = i; \ + size_t _nbelem = nbelem; \ + _timeType _t = t; \ + fflush(stdout); \ + fflush(stderr); \ + if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; \ + \ _calInt info = ecp_ecriture_##_typeName (component, _mode, &_t, _i, \ - nomvar, _nbelem, \ - data ); \ - fflush(stdout); \ - fflush(stderr); \ - \ - return info; \ - }; \ + nomvar, _nbelem, \ + data ); \ + fflush(stdout); \ + fflush(stderr); \ + \ + return info; \ + }; \ /* InfoType cp_ech(void * component, int mode, float t, int i, */ -/* char * nomvar, int nbelem, */ -/* char ** data, int strSize) { */ - -/*long _i=i;*/ -/* fflush(stdout);fflush(stderr); */ -/* fprintf(stderr,"Beginning of cp_ech: %s %d %f\n",nomvar,i,t); */ -/* if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; */ +/* char * nomvar, int nbelem, */ +/* char ** data, int strSize) { */ + +/*long _i=i;*/ +/* fflush(stdout);fflush(stderr); */ +/* fprintf(stderr,"Beginning of cp_ech: %s %d %f\n",nomvar,i,t); */ +/* if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; */ -/* InfoType info = ecp_ecriture_str (component, mode, &t, i, */ -/* nomvar, nbelem, */ -/* data); */ +/* InfoType info = ecp_ecriture_str (component, mode, &t, i, */ +/* nomvar, nbelem, */ +/* data); */ /*, strSize );*/ -/* fprintf(stderr,"End of cp_ech: %s %d \n",nomvar,i); */ -/* fflush(stdout); */ -/* fflush(stderr); */ - -/* return info; */ -/* }; */ +/* fprintf(stderr,"End of cp_ech: %s %d \n",nomvar,i); */ +/* fflush(stdout); */ +/* fflush(stderr); */ + +/* return info; */ +/* }; */ /* Definition des méthodes calcium standard */ /* CALCIUM_ECR_INTERFACE_C_(_name,_timeType,_calInt,type,_typeName,_qual) */ diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx index 43dc0cc82..960473900 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx @@ -61,13 +61,13 @@ ecp_fin_ (void * component, int code) { bool provideLastGivenValue = false; if (code == CalciumTypes::CP_CONT ) provideLastGivenValue = true; - try { - CalciumInterface::ecp_fin( *_component, - provideLastGivenValue); + try { + CalciumInterface::ecp_fin( *_component, + provideLastGivenValue); } catch ( const CalciumException & ex) { //tester l'arrêt par exception DEBTRACE( ex.what() ); - return ex.getInfo(); - } + return ex.getInfo(); + } return CalciumTypes::CPOK; }; @@ -84,72 +84,72 @@ ecp_cd_ (void * component, char * instanceName) { // Le paramètre supplémentaire strsize n'étant pas utilisé // j'utilise la génération par la macro CALCIUM_C2CPP_INTERFACE_(str,char*,); // extern "C" CalciumTypes::InfoType ecp_lecture_str (void * component, int dependencyType, -// float * ti, float * tf, long * i, -// const char * const nomvar, size_t bufferLength, -// size_t * nRead, char ** *data, size_t strsize ) { +// float * ti, float * tf, long * i, +// const char * const nomvar, size_t bufferLength, +// size_t * nRead, char ** *data, size_t strsize ) { // Superv_Component_i * _component = static_cast(component); -// double _ti=*ti; -// double _tf=*tf; -// size_t _nRead=0; -// size_t _bufferLength=bufferLength; -// CalciumTypes::DependencyType dependencyType= -// static_cast(dependencyType); +// double _ti=*ti; +// double _tf=*tf; +// size_t _nRead=0; +// size_t _bufferLength=bufferLength; +// CalciumTypes::DependencyType dependencyType= +// static_cast(dependencyType); // // - GERER POINTEUR NULL : NOTHING TODO // // - VERIFIER LA TAILLE DES CHAINES RETOURNEES (ELLES DEVRAIENT ETRES CORRECTES SI L'ECRITURE EST BIEN CODEE.) // DEBTRACE( "-------- CalciumInterface(lecture Inter Part) MARK 1 ------------------" ) -// try { -// CalciumInterface::ecp_lecture< char*, char* >( *_component, -// dependencyType, -// _ti, _tf, *i, -// nomvar, -// _bufferLength, _nRead, *data); -// } catch ( const CalciumException & ex) { +// try { +// CalciumInterface::ecp_lecture< char*, char* >( *_component, +// dependencyType, +// _ti, _tf, *i, +// nomvar, +// _bufferLength, _nRead, *data); +// } catch ( const CalciumException & ex) { // DEBTRACE( ex.what() ); -// return ex.getInfo(); -// } +// return ex.getInfo(); +// } -// *nRead = _nRead; +// *nRead = _nRead; // if (dependencyType == CalciumTypes::CP_SEQUENTIEL ) -// *ti=(float)(_ti); +// *ti=(float)(_ti); // DEBTRACE( "-------- CalciumInterface(lecture Inter Part), Data Ptr :" << *data ) ; // return CalciumTypes::CPOK; -// }; - - -// extern "C" void ecp_lecture_str_free (char** data) { -// CalciumInterface::ecp_free< char*, char* >(data); -// }; - - +// }; + + +// extern "C" void ecp_lecture_str_free (char** data) { +// CalciumInterface::ecp_free< char*, char* >(data); +// }; + + // extern "C" CalciumTypes::InfoType ecp_ecriture_str (void * component, int dependencyType, -// float *t, long i, -// const char * const nomvar, size_t bufferLength, -// char ** data, int strsize ) { +// float *t, long i, +// const char * const nomvar, size_t bufferLength, +// char ** data, int strsize ) { // Superv_Component_i * _component = static_cast(component); // /* Je ne sais pas pourquoi, je n'arrive pas à passer t par valeur : corruption de la pile*/ -// double _t=*t; -// size_t _bufferLength=bufferLength; +// double _t=*t; +// size_t _bufferLength=bufferLength; // // - VERIFIER LA TAILLE DES CHAINES RETOURNEES (ELLES DEVRAIENT ETRES CORRECTES SI L'ECRITURE EST BIEN CODEE.) // DEBTRACE( "-------- CalciumInterface(ecriture Inter Part) MARK 1 ------------------" ) -// try { -// std::string essai(nomvar); -// DEBTRACE( "----------->-" << nomvar ) -// CalciumInterface::ecp_ecriture< char*, char* >( *_component, -// static_cast(dependencyType), -// _t,i,nomvar,_bufferLength,*data); -// } catch ( const CalciumException & ex) { -// std::cerr << ex.what() << std::endl; -// return ex.getInfo(); -// } +// try { +// std::string essai(nomvar); +// DEBTRACE( "----------->-" << nomvar ) +// CalciumInterface::ecp_ecriture< char*, char* >( *_component, +// static_cast(dependencyType), +// _t,i,nomvar,_bufferLength,*data); +// } catch ( const CalciumException & ex) { +// std::cerr << ex.what() << std::endl; +// return ex.getInfo(); +// } // DEBTRACE( "-------- CalciumInterface(ecriture Inter Part), Valeur de data :" << data ) -// return CalciumTypes::CPOK; -// }; +// return CalciumTypes::CPOK; +// }; diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.cxx index d64d28a39..99d46f060 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.cxx @@ -27,12 +27,12 @@ #include "CalciumCouplingPolicy.hxx" CalciumCouplingPolicy::CalciumCouplingPolicy():_dependencyType(CalciumTypes::UNDEFINED_DEPENDENCY), - _storageLevel(CalciumTypes::UNLIMITED_STORAGE_LEVEL), - _dateCalSchem(CalciumTypes::TI_SCHEM), - _interpolationSchem(CalciumTypes::L1_SCHEM), - _extrapolationSchem(CalciumTypes::UNDEFINED_EXTRA_SCHEM), - _alpha(0.0),_deltaT(CalciumTypes::EPSILON), - _disconnectDirective(CalciumTypes::UNDEFINED_DIRECTIVE){}; + _storageLevel(CalciumTypes::UNLIMITED_STORAGE_LEVEL), + _dateCalSchem(CalciumTypes::TI_SCHEM), + _interpolationSchem(CalciumTypes::L1_SCHEM), + _extrapolationSchem(CalciumTypes::UNDEFINED_EXTRA_SCHEM), + _alpha(0.0),_deltaT(CalciumTypes::EPSILON), + _disconnectDirective(CalciumTypes::UNDEFINED_DIRECTIVE){}; void CalciumCouplingPolicy::setDependencyType (CalciumTypes::DependencyType dependencyType) {_dependencyType=dependencyType;} CalciumTypes::DependencyType CalciumCouplingPolicy::getDependencyType () const { return _dependencyType;} @@ -93,7 +93,7 @@ CalciumTypes::ExtrapolationSchem CalciumCouplingPolicy::getExtrapolationSchem () CalciumCouplingPolicy::TimeType CalciumCouplingPolicy::getEffectiveTime(CalciumCouplingPolicy::TimeType ti, - CalciumCouplingPolicy::TimeType tf) { + CalciumCouplingPolicy::TimeType tf) { if ( _dateCalSchem == CalciumTypes::TI_SCHEM ) return ti; if ( _dateCalSchem == CalciumTypes::TF_SCHEM ) return tf; diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx index 962794c26..ca587bb99 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx @@ -109,7 +109,7 @@ public: inline TagType getTag (const DataId &dataId) const { return dataId.second;} template struct BoundedDataIdProcessor; + class EnableIf = void > struct BoundedDataIdProcessor; //template struct BoundedDataIdProcessor; template struct EraseDataIdProcessor; template struct DisconnectProcessor; @@ -122,9 +122,9 @@ public: // Le container doit être associatif template < typename AssocContainer > bool isDataIdConveniant( AssocContainer & storedDatas, - const typename AssocContainer::key_type & expectedDataId, - bool & isEqual, bool & isBounded, - typename AssocContainer::iterator & wDataIt1) const; + const typename AssocContainer::key_type & expectedDataId, + bool & isEqual, bool & isBounded, + typename AssocContainer::iterator & wDataIt1) const; TimeType getEffectiveTime(TimeType ti, TimeType tf); @@ -145,8 +145,8 @@ struct CalciumCouplingPolicy::InternalDataIdContainer : public std::vector< std: typedef std::vector < DataId > DataIdVect; InternalDataIdContainer(const DataId & dataId, - const CalciumCouplingPolicy & policy - ):std::vector< std::pair< T_TIME,T_TAG> >() { + const CalciumCouplingPolicy & policy + ):std::vector< std::pair< T_TIME,T_TAG> >() { // Ignore les paramètres qui ne sont pas en rapport avec le type de dépendance switch (policy._dependencyType) { case CalciumTypes::TIME_DEPENDENCY: @@ -168,8 +168,8 @@ struct CalciumCouplingPolicy::BoundedDataIdProcessor{ BoundedDataIdProcessor(const CouplingPolicy & couplingPolicy) {}; template < typename Iterator, typename DataId > void inline apply(typename iterator_t::value_type & data, - const DataId & dataId, - const Iterator & it1) const { + const DataId & dataId, + const Iterator & it1) const { typedef typename iterator_t::value_type value_type; #ifdef MYDEBUG std::cout << "-------- Calcium Generic BoundedDataIdProcessor.apply() called " << std::endl; @@ -192,7 +192,7 @@ struct CalciumCouplingPolicy::BoundedDataIdProcessor< // Méthode implémentant l'interpolation temporelle template < typename MapIterator > void inline apply (typename iterator_t::value_type & data, - const DataId & dataId, const MapIterator & it1) const { + const DataId & dataId, const MapIterator & it1) const { typedef typename iterator_t::value_type value_type; typedef typename DataManipulator::InnerType InnerType; @@ -263,9 +263,9 @@ struct CalciumCouplingPolicy::BoundedDataIdProcessor< // OLD: REM : Pour des buffers de type int // OLD: le compilo indiquera warning: converting to `long int' from `Double' std::transform(InIt1,InIt1+dataSize,InIt2,OutIt, - ( _1 - _2 ) * coeff + _2 ); + ( _1 - _2 ) * coeff + _2 ); // for(size_t i =0; i < dataSize3; ++i) { -// OutIt[i]=(InIt1[i] - InIt2[i]) * coeff + InIt2[i]; +// OutIt[i]=(InIt1[i] - InIt2[i]) * coeff + InIt2[i]; // } } @@ -287,7 +287,7 @@ struct CalciumCouplingPolicy::BoundedDataIdProcessor< // Le container doit être associatif template < typename AssocContainer > bool CalciumCouplingPolicy::isDataIdConveniant( AssocContainer & storedDatas, const typename AssocContainer::key_type & expectedDataId, - bool & isEqual, bool & isBounded, typename AssocContainer::iterator & wDataIt1) const { + bool & isEqual, bool & isBounded, typename AssocContainer::iterator & wDataIt1) const { // Rem : le type key_type == DataId typedef typename AssocContainer::key_type key_type; @@ -314,7 +314,7 @@ bool CalciumCouplingPolicy::isDataIdConveniant( AssocContainer & storedDatas, co // // L'algo find_if ne peut être utilisé car il recopie l'AdjacentFunctor // qui ne peut alors pas mémoriser ses états précédents - // + // // Un codage en reverse serait plus efficace typename AssocContainer::iterator prev = storedDatas.begin(); @@ -364,7 +364,7 @@ struct CalciumCouplingPolicy::EraseDataIdProcessor { template < typename Container > void apply(Container & storedDatas, - typename Container::iterator & wDataIt1 ) const { + typename Container::iterator & wDataIt1 ) const { typedef typename Container::key_type key_type; typedef typename Container::value_type value_type; @@ -381,15 +381,15 @@ struct CalciumCouplingPolicy::EraseDataIdProcessor { if (s > 0 ) { size_t dist=distance(storedDatas.begin(),wDataIt1); for (int i=0; i bool apply(Container & storedDatas, - const DataId & expectedDataId, - typename Container::iterator & wDataIt1 ) const { + const DataId & expectedDataId, + typename Container::iterator & wDataIt1 ) const { typedef typename Container::key_type key_type; typedef typename Container::value_type value_type; @@ -438,7 +438,7 @@ struct CalciumCouplingPolicy::DisconnectProcessor { // TODO : Ds GenericPort::next il faut convertir en CPSTOPSEQ if ( _couplingPolicy._disconnectDirective == CalciumTypes::CP_ARRET ) throw(CalciumException(CalciumTypes::CPINARRET,LOC(OSS()<< "CP_ARRET directive" - << " interrupts all further data reading"))); + << " interrupts all further data reading"))); #ifdef MYDEBUG std::cout << "-------- CalciumCouplingPolicy::DisconnectProcessor MARK3 --------" << std::endl; #endif @@ -448,7 +448,7 @@ struct CalciumCouplingPolicy::DisconnectProcessor { // TODO : Dans la gestion des niveaux il faut peut être interdire un niveau == 0 if ( storedDatas.empty() ) throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "CP_CONT directive" - << " is active but no data is available."))); + << " is active but no data is available."))); // expectedDataId n'a ni été trouvé dans storedDataIds ni encadré mais il se peut // qu'en mode itératif il ne soit pas plus grand que le plus grand DataId stocké auquel @@ -470,7 +470,7 @@ struct CalciumCouplingPolicy::DisconnectProcessor { // TODO : Il faut en fait renvoyer le plus proche cf IT ou DT if (it1 == storedDatas.end()) throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "CP_CONT directive" - << " is active but the requested dataId is less or equal to the last one received."))); + << " is active but the requested dataId is less or equal to the last one received."))); #ifdef MYDEBUG std::cout << "-------- CalciumCouplingPolicy::DisconnectProcessor MARK6 " << std::endl; diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumException.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumException.hxx index 4587f71bb..75f393b1b 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumException.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumException.hxx @@ -36,17 +36,17 @@ struct CalciumException : public DSC_Exception { CalciumException( const CalciumTypes::InfoType info, - const std::string & text, - const char *fileName, - const unsigned int lineNumber, - const char *funcName): + const std::string & text, + const char *fileName, + const unsigned int lineNumber, + const char *funcName): DSC_Exception(text,fileName,lineNumber,funcName), _info(info),_exceptionName("CalciumException") {}; CalciumException( const CalciumTypes::InfoType info, - const std::string & text ): + const std::string & text ): DSC_Exception(text),_info(info),_exceptionName("CalciumException") {}; diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericProvidesPort.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericProvidesPort.hxx index bfd6b3fdc..b5474d71d 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericProvidesPort.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericProvidesPort.hxx @@ -54,22 +54,22 @@ // (qui est considéré comme un séparateur d'argument par le PP ) #define CALCIUM_GENERIC_PROVIDES_PORT_HXX(specificPortName,CorbaInterface,...) \ - class specificPortName : public virtual CorbaInterface , \ - public virtual POA_Ports::PortProperties, \ - public GenericProvidesPort< __VA_ARGS__ , CalciumCouplingPolicy, calcium_provides_port > { \ - private : \ + class specificPortName : public virtual CorbaInterface , \ + public virtual POA_Ports::PortProperties, \ + public GenericProvidesPort< __VA_ARGS__ , CalciumCouplingPolicy, calcium_provides_port > { \ + private : \ omni_mutex _disconnect_mutex; \ int _mustnotdisconnect; \ - public : \ - typedef __VA_ARGS__ DataManipulator; \ - typedef DataManipulator::Type CorbaDataType; \ - typedef GenericPort< DataManipulator , \ - CalciumCouplingPolicy > Port; \ + public : \ + typedef __VA_ARGS__ DataManipulator; \ + typedef DataManipulator::Type CorbaDataType; \ + typedef GenericPort< DataManipulator , \ + CalciumCouplingPolicy > Port; \ specificPortName () : _mustnotdisconnect(0) {}; \ - \ - virtual ~ specificPortName (); \ - \ - inline void disconnect(bool provideLastGivenValue) { \ + \ + virtual ~ specificPortName (); \ + \ + inline void disconnect(bool provideLastGivenValue) { \ _disconnect_mutex.lock(); \ if(_mustnotdisconnect > 1) \ { \ @@ -81,157 +81,157 @@ Port::disconnect(provideLastGivenValue); \ } \ _disconnect_mutex.unlock(); \ - } \ + } \ inline void setDependencyType(CalciumTypes::DependencyType dependencyType) { \ - Port::setDependencyType(dependencyType); \ - } \ - inline CalciumTypes::DependencyType getDependencyType () const { \ - return Port::getDependencyType(); \ - } \ - inline void setStorageLevel (size_t storageLevel) { \ - Port::setStorageLevel(storageLevel); \ - } \ - inline size_t getStorageLevel () const { \ - return Port::getStorageLevel(); \ - } \ + Port::setDependencyType(dependencyType); \ + } \ + inline CalciumTypes::DependencyType getDependencyType () const { \ + return Port::getDependencyType(); \ + } \ + inline void setStorageLevel (size_t storageLevel) { \ + Port::setStorageLevel(storageLevel); \ + } \ + inline size_t getStorageLevel () const { \ + return Port::getStorageLevel(); \ + } \ inline void setDateCalSchem (CalciumTypes::DateCalSchem dateCalSchem) { \ - Port::setDateCalSchem (dateCalSchem); \ - } \ - inline CalciumTypes::DateCalSchem getDateCalSchem () const { \ - return Port::getDateCalSchem (); \ - } \ - inline void setAlpha(double alpha) { \ - Port::setAlpha(alpha); \ - } \ - inline double getAlpha() const { \ - return Port::getAlpha(); \ - } \ - inline void setDeltaT(double deltaT ) { \ - Port::setDeltaT(deltaT); \ - } \ - inline double getDeltaT() const { \ - return Port::getDeltaT(); \ - } \ + Port::setDateCalSchem (dateCalSchem); \ + } \ + inline CalciumTypes::DateCalSchem getDateCalSchem () const { \ + return Port::getDateCalSchem (); \ + } \ + inline void setAlpha(double alpha) { \ + Port::setAlpha(alpha); \ + } \ + inline double getAlpha() const { \ + return Port::getAlpha(); \ + } \ + inline void setDeltaT(double deltaT ) { \ + Port::setDeltaT(deltaT); \ + } \ + inline double getDeltaT() const { \ + return Port::getDeltaT(); \ + } \ inline void setInterpolationSchem (CalciumTypes::InterpolationSchem interpolationSchem) { \ - Port::setInterpolationSchem(interpolationSchem); \ - } \ + Port::setInterpolationSchem(interpolationSchem); \ + } \ inline void setExtrapolationSchem (CalciumTypes::ExtrapolationSchem extrapolationSchem) { \ - Port::setExtrapolationSchem(extrapolationSchem); \ - } \ + Port::setExtrapolationSchem(extrapolationSchem); \ + } \ inline CalciumTypes::InterpolationSchem getInterpolationSchem() const { \ - return Port::getInterpolationSchem(); \ - } \ + return Port::getInterpolationSchem(); \ + } \ inline CalciumTypes::ExtrapolationSchem getExtrapolationSchem() const { \ - return Port::getExtrapolationSchem(); \ - } \ - \ - inline void put( DataManipulator::CorbaInType data, \ - CORBA::Double time, CORBA::Long tag) { \ - Port::put(data, time, tag); \ - } \ - \ - inline Ports::Port_ptr get_port_ref() { \ - return _this(); \ - } \ - \ - Ports::PortProperties_ptr get_port_properties() { \ - return POA_Ports::PortProperties::_this(); \ - } \ - \ + return Port::getExtrapolationSchem(); \ + } \ + \ + inline void put( DataManipulator::CorbaInType data, \ + CORBA::Double time, CORBA::Long tag) { \ + Port::put(data, time, tag); \ + } \ + \ + inline Ports::Port_ptr get_port_ref() { \ + return _this(); \ + } \ + \ + Ports::PortProperties_ptr get_port_properties() { \ + return POA_Ports::PortProperties::_this(); \ + } \ + \ virtual void set_property(const char * name, const CORBA::Any& value) \ - throw (Ports::NotDefined, Ports::BadType, Ports::BadValue); \ - \ - virtual CORBA::Any* get_property(const char* name) \ - throw (Ports::NotDefined); \ - \ - virtual void provides_port_changed(int connection_nbr, \ - const Engines::DSC::Message message) { \ - if ( message == Engines::DSC::AddingConnection) \ + throw (Ports::NotDefined, Ports::BadType, Ports::BadValue); \ + \ + virtual CORBA::Any* get_property(const char* name) \ + throw (Ports::NotDefined); \ + \ + virtual void provides_port_changed(int connection_nbr, \ + const Engines::DSC::Message message) { \ + if ( message == Engines::DSC::AddingConnection) \ { \ _disconnect_mutex.lock(); \ _mustnotdisconnect++; \ _disconnect_mutex.unlock(); \ } \ - else if ( message == Engines::DSC::RemovingConnection ) \ + else if ( message == Engines::DSC::RemovingConnection ) \ { \ disconnect(false); \ } \ - } \ - }; \ + } \ + }; \ -#define CALCIUM_GENERIC_PROVIDES_PORT_CXX(specificPortName) \ - \ - specificPortName::~specificPortName(void) {}; \ - \ +#define CALCIUM_GENERIC_PROVIDES_PORT_CXX(specificPortName) \ + \ + specificPortName::~specificPortName(void) {}; \ + \ void specificPortName::set_property(const char * name, const CORBA::Any& value) \ - throw (Ports::NotDefined, Ports::BadType, Ports::BadValue) { \ - \ - const std::string key(name); \ - CORBA::Long sl; \ - CORBA::Double alpha,delta; \ - Ports::Calcium_Ports::DependencyType dt; \ - Ports::Calcium_Ports::DateCalSchem dcs; \ - Ports::Calcium_Ports::InterpolationSchem is; \ - Ports::Calcium_Ports::ExtrapolationSchem es; \ - bool ok=false; \ - \ - try { \ - \ - if (key == "StorageLevel" ) \ - {if ( ( ok=(value >>= sl) ) ) Port::setStorageLevel(sl);} \ - else if (key == "Alpha" ) \ - {if ( ( ok=(value >>= alpha) ) ) Port::setAlpha(alpha);} \ - else if (key == "DeltaT" ) \ - {if ( ( ok=(value >>= delta) ) ) Port::setDeltaT(delta);} \ - else if (key == "DependencyType" ) \ - {if ( ( ok=( value >>= dt) ) ) Port::setDependencyType(dependencyType[dt]);} \ - else if (key == "DateCalSchem" ) \ - {if ( ( ok=(value >>= dcs) ) ) \ - Port::setDateCalSchem(dateCalSchem[dcs]);} \ - else if (key == "InterpolationSchem") \ - {if ( ( ok=(value >>= is) ) ) \ - Port::setInterpolationSchem(interpolationSchem[is]);} \ - else if (key == "ExtrapolationSchem") \ - {if ( ( ok=(value >>= es) ) ) \ - Port::setExtrapolationSchem(extrapolationSchem[es]);} \ - else \ - throw Ports::NotDefined(); \ - if (!ok) throw Ports::BadType(); \ - \ - } catch ( const DSC_Exception & ex ) { \ - \ - std::cerr << ex.what() << std::endl; \ - throw Ports::BadValue(); \ - } \ - } \ - \ - \ - CORBA::Any* specificPortName::get_property(const char* name) \ - throw (Ports::NotDefined) { \ - const std::string key(name); \ - CORBA::Any* value=new CORBA::Any; \ - if (key == "StorageLevel" ) \ + throw (Ports::NotDefined, Ports::BadType, Ports::BadValue) { \ + \ + const std::string key(name); \ + CORBA::Long sl; \ + CORBA::Double alpha,delta; \ + Ports::Calcium_Ports::DependencyType dt; \ + Ports::Calcium_Ports::DateCalSchem dcs; \ + Ports::Calcium_Ports::InterpolationSchem is; \ + Ports::Calcium_Ports::ExtrapolationSchem es; \ + bool ok=false; \ + \ + try { \ + \ + if (key == "StorageLevel" ) \ + {if ( ( ok=(value >>= sl) ) ) Port::setStorageLevel(sl);} \ + else if (key == "Alpha" ) \ + {if ( ( ok=(value >>= alpha) ) ) Port::setAlpha(alpha);} \ + else if (key == "DeltaT" ) \ + {if ( ( ok=(value >>= delta) ) ) Port::setDeltaT(delta);} \ + else if (key == "DependencyType" ) \ + {if ( ( ok=( value >>= dt) ) ) Port::setDependencyType(dependencyType[dt]);} \ + else if (key == "DateCalSchem" ) \ + {if ( ( ok=(value >>= dcs) ) ) \ + Port::setDateCalSchem(dateCalSchem[dcs]);} \ + else if (key == "InterpolationSchem") \ + {if ( ( ok=(value >>= is) ) ) \ + Port::setInterpolationSchem(interpolationSchem[is]);} \ + else if (key == "ExtrapolationSchem") \ + {if ( ( ok=(value >>= es) ) ) \ + Port::setExtrapolationSchem(extrapolationSchem[es]);} \ + else \ + throw Ports::NotDefined(); \ + if (!ok) throw Ports::BadType(); \ + \ + } catch ( const DSC_Exception & ex ) { \ + \ + std::cerr << ex.what() << std::endl; \ + throw Ports::BadValue(); \ + } \ + } \ + \ + \ + CORBA::Any* specificPortName::get_property(const char* name) \ + throw (Ports::NotDefined) { \ + const std::string key(name); \ + CORBA::Any* value=new CORBA::Any; \ + if (key == "StorageLevel" ) \ { (*value) <<= static_cast(Port::getStorageLevel()); } \ - else if (key == "Alpha" ) \ - { *value <<= (CORBA::Double) Port::getAlpha();} \ - else if (key == "DeltaT" ) \ - { *value <<= (CORBA::Double) Port::getDeltaT();} \ - else if (key == "DependencyType" ) \ - { *value <<= corbaDependencyType[Port::getDependencyType()];} \ - else if (key == "DateCalSchem" ) \ - { *value <<= corbaDateCalSchem[Port::getDateCalSchem()];} \ - else if (key == "InterpolationSchem") \ + else if (key == "Alpha" ) \ + { *value <<= (CORBA::Double) Port::getAlpha();} \ + else if (key == "DeltaT" ) \ + { *value <<= (CORBA::Double) Port::getDeltaT();} \ + else if (key == "DependencyType" ) \ + { *value <<= corbaDependencyType[Port::getDependencyType()];} \ + else if (key == "DateCalSchem" ) \ + { *value <<= corbaDateCalSchem[Port::getDateCalSchem()];} \ + else if (key == "InterpolationSchem") \ { *value <<= corbaInterpolationSchem[Port::getInterpolationSchem()];} \ - else if (key == "ExtrapolationSchem") \ + else if (key == "ExtrapolationSchem") \ { *value <<= corbaExtrapolationSchem[Port::getExtrapolationSchem()];} \ - else { \ - delete value; \ - throw Ports::NotDefined(); \ - } \ - return value; \ - }; - + else { \ + delete value; \ + throw Ports::NotDefined(); \ + } \ + return value; \ + }; + #endif diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericUsesPort.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericUsesPort.hxx index 8524723df..c95f331ec 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericUsesPort.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericUsesPort.hxx @@ -32,7 +32,7 @@ template class CalciumGenericUsesPort : public GenericUsesPort + calcium_uses_port > { public : virtual ~CalciumGenericUsesPort() {}; diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.cxx index 7baab48d9..f13289bb0 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumProvidesPort.cxx @@ -28,7 +28,7 @@ CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_long_port_provides) CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_intc_port_provides) -CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_real_port_provides) +CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_real_port_provides) CALCIUM_GENERIC_PROVIDES_PORT_CXX(calcium_double_port_provides) diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.cxx index b94d092f7..7513d2a21 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.cxx @@ -30,12 +30,12 @@ using namespace std; CORBA_DATE_CAL_SCHEM::CORBA_DATE_CAL_SCHEM() : map() + Ports::Calcium_Ports::DateCalSchem>() { map & table = ( map & ) *this ; + Ports::Calcium_Ports::DateCalSchem > & ) *this ; table[CalciumTypes::TI_SCHEM ] = Ports::Calcium_Ports::TI_SCHEM ; table[CalciumTypes::TF_SCHEM ] = Ports::Calcium_Ports::TF_SCHEM ; @@ -47,7 +47,7 @@ Ports::Calcium_Ports::DateCalSchem CORBA_DATE_CAL_SCHEM::operator[]( const Calci { map &table = (map&)*this ; + Ports::Calcium_Ports::DateCalSchem >&)*this ; assert( table.find( (CalciumTypes::DateCalSchem)c ) != table.end() ) ; return table[ (CalciumTypes::DateCalSchem)c ] ; } @@ -57,7 +57,7 @@ const CORBA_DATE_CAL_SCHEM corbaDateCalSchem ; CORBA_DEPENDENCY_TYPE::CORBA_DEPENDENCY_TYPE() : map() + Ports::Calcium_Ports::DependencyType >() { map & @@ -94,12 +94,12 @@ const CORBA_DEPENDENCY_TYPE corbaDependencyType ; CORBA_INTERPOLATION_SCHEM::CORBA_INTERPOLATION_SCHEM() : map () + Ports::Calcium_Ports::InterpolationSchem > () { map & table = ( map & ) *this ; + Ports::Calcium_Ports::InterpolationSchem > & ) *this ; table[CalciumTypes::L0_SCHEM ] = Ports::Calcium_Ports::L0_SCHEM ; table[CalciumTypes::L1_SCHEM ] = Ports::Calcium_Ports::L1_SCHEM ; @@ -122,12 +122,12 @@ const CORBA_INTERPOLATION_SCHEM corbaInterpolationSchem ; CORBA_EXTRAPOLATION_SCHEM::CORBA_EXTRAPOLATION_SCHEM() : map () + Ports::Calcium_Ports::ExtrapolationSchem > () { map & table = ( map & ) *this ; + Ports::Calcium_Ports::ExtrapolationSchem > & ) *this ; table[CalciumTypes::E0_SCHEM ] = Ports::Calcium_Ports::E0_SCHEM ; table[CalciumTypes::E1_SCHEM ] = Ports::Calcium_Ports::E1_SCHEM ; diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.hxx index 1d5861d7d..ed3909535 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes2CorbaTypes.hxx @@ -34,7 +34,7 @@ class CORBA_DATE_CAL_SCHEM : public std::map + Ports::Calcium_Ports::DateCalSchem > { public : @@ -46,7 +46,7 @@ public : extern const CORBA_DATE_CAL_SCHEM corbaDateCalSchem ; class CORBA_DEPENDENCY_TYPE : public std::map + Ports::Calcium_Ports::DependencyType> { public : @@ -57,7 +57,7 @@ public : extern const CORBA_DEPENDENCY_TYPE corbaDependencyType ; class CORBA_INTERPOLATION_SCHEM : public std::map + Ports::Calcium_Ports::InterpolationSchem> { public : @@ -68,7 +68,7 @@ public : extern const CORBA_INTERPOLATION_SCHEM corbaInterpolationSchem ; class CORBA_EXTRAPOLATION_SCHEM : public std::map + Ports::Calcium_Ports::ExtrapolationSchem> { public : diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypesManipulator.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypesManipulator.hxx index 9a8b3e53d..e6da0ec9d 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypesManipulator.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypesManipulator.hxx @@ -31,13 +31,13 @@ template struct CalciumTypesManipulator : public seq_u_manipulation { + Ports::Calcium_Ports::Complex> { static bool needInterpolation=true; } template struct CalciumTypesManipulator : public seq_u_manipulation { + Ports::Calcium_Ports::Complex> { static bool needInterpolation=true; } diff --git a/src/DSC/DSC_User/Datastream/Calcium/Copy2CorbaSpace.hxx b/src/DSC/DSC_User/Datastream/Calcium/Copy2CorbaSpace.hxx index 18518eb80..b7a3b4a9f 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/Copy2CorbaSpace.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/Copy2CorbaSpace.hxx @@ -57,7 +57,7 @@ struct Copy2CorbaSpace { corbaData = DataManipulator::create(nRead,const_cast (&data),false); #ifdef MYDEBUG std::cerr << "-------- Copy2CorbaSpace MARK 2 --(dataPtr : " - << DataManipulator::getPointer(corbaData,false)<<")----------------" << std::endl; + << DataManipulator::getPointer(corbaData,false)<<")----------------" << std::endl; #endif } diff --git a/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.cxx b/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.cxx index 74d238f3c..2db543e9f 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.cxx @@ -30,12 +30,12 @@ using namespace std; DATE_CAL_SCHEM::DATE_CAL_SCHEM() : map() + CalciumTypes::DateCalSchem>() { map & table = ( map & ) *this ; + CalciumTypes::DateCalSchem > & ) *this ; table[Ports::Calcium_Ports::TI_SCHEM ] = CalciumTypes::TI_SCHEM ; table[Ports::Calcium_Ports::TF_SCHEM ] = CalciumTypes::TF_SCHEM ; @@ -47,7 +47,7 @@ CalciumTypes::DateCalSchem DATE_CAL_SCHEM::operator[]( const Ports::Calcium_Port { map &table = (map&)*this ; + CalciumTypes::DateCalSchem>&)*this ; assert( table.find( (Ports::Calcium_Ports::DateCalSchem)c ) != table.end() ) ; return table[ (Ports::Calcium_Ports::DateCalSchem)c ] ; } @@ -57,7 +57,7 @@ const DATE_CAL_SCHEM dateCalSchem ; DEPENDENCY_TYPE::DEPENDENCY_TYPE() : map() + CalciumTypes::DependencyType>() { map & @@ -78,7 +78,7 @@ CalciumTypes::DependencyType DEPENDENCY_TYPE::operator[]( const Ports::Calcium_P { map &table = (map&)*this ; + CalciumTypes::DependencyType>&)*this ; MESSAGE("DEPENDENCY_TYPE() : ::operator["< () + CalciumTypes::InterpolationSchem > () { map & table = ( map & ) *this ; + CalciumTypes::InterpolationSchem > & ) *this ; table[Ports::Calcium_Ports::L0_SCHEM ] = CalciumTypes::L0_SCHEM ; table[Ports::Calcium_Ports::L1_SCHEM ] = CalciumTypes::L1_SCHEM ; @@ -120,12 +120,12 @@ const INTERPOLATION_SCHEM interpolationSchem ; EXTRAPOLATION_SCHEM::EXTRAPOLATION_SCHEM() : map () + CalciumTypes::ExtrapolationSchem > () { map & table = ( map & ) *this ; + CalciumTypes::ExtrapolationSchem > & ) *this ; table[Ports::Calcium_Ports::E0_SCHEM ] = CalciumTypes::E0_SCHEM ; table[Ports::Calcium_Ports::E1_SCHEM ] = CalciumTypes::E1_SCHEM ; diff --git a/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.hxx b/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.hxx index b7a748c7b..dc2392db3 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CorbaTypes2CalciumTypes.hxx @@ -34,7 +34,7 @@ class DATE_CAL_SCHEM : public std::map + CalciumTypes::DateCalSchem> { public : @@ -46,7 +46,7 @@ public : extern const DATE_CAL_SCHEM dateCalSchem ; class DEPENDENCY_TYPE : public std::map + CalciumTypes::DependencyType> { public : @@ -57,7 +57,7 @@ public : extern const DEPENDENCY_TYPE dependencyType ; class INTERPOLATION_SCHEM : public std::map + CalciumTypes::InterpolationSchem> { public : @@ -68,7 +68,7 @@ public : extern const INTERPOLATION_SCHEM interpolationSchem ; class EXTRAPOLATION_SCHEM : public std::map + CalciumTypes::ExtrapolationSchem> { public : diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium.h b/src/DSC/DSC_User/Datastream/Calcium/calcium.h index 3bee5c863..f547f3bce 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium.h +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium.h @@ -33,9 +33,9 @@ #include "calciumP.h" #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) -#define CPNeedPrototype 1 +#define CPNeedPrototype 1 #else -#define CPNeedPrototype 0 +#define CPNeedPrototype 0 #endif @@ -43,726 +43,726 @@ extern "C" { #endif -/* */ -/* */ -/* Fonctions de connexion */ -/* */ -/* */ -extern int cp_cd( -/* ----- */ +/* */ +/* */ +/* Fonctions de connexion */ +/* */ +/* */ +extern int cp_cd( +/* ----- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, char * /* S Nom de l instance appelante*/ #endif ); -/* */ -/* */ -/* Fonction de deconnexion */ -/* */ -/* */ -extern int cp_fin( -/* ------ */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Directive de continuation */ - /* CP_CONT ou CP_ARRET */ -#endif -); - - - -/* */ -/* */ -/* Fonctions de lecture bloquante */ -/* */ -/* */ -extern int cp_len( -/* ------ */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - int * /* S Tableau d'entiers pour stocker les */ - /* valeurs lues */ -#endif -); - -extern int cp_lre( -/* ------ */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - float * /* S Tableau de flottants pour stocker les */ - /* valeurs lues */ -#endif -); - -extern int cp_ldb( -/* ------ */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - double* /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - double* /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - double* /* S Tableau de doubles pour stocker les */ - /* valeurs lues */ -#endif -); - -extern int cp_lcp( -/* ------ */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - float * /* S Tableau de flottants pour stocker les */ - /* valeurs lues (dimension = 2 * le nombre */ - /* de valeurs lues) */ -#endif -); - -extern int cp_llo( -/* ------ */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - int * /* S Tableau d 'entier pour stocker les */ - /* valeurs lues (remplace le logiques) */ -#endif -); - -extern int cp_lch( -/* ------ */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - char *[]/* S Tableau de chaines pour stocker les */ - /* valeurs lues (remplace le logiques) */, - int /* E Taille des chaines du tablaeu */ -#endif -); - - - -/* */ -/* */ -/* Fonctions de lecture non bloquantes */ -/* */ -/* */ -extern int cp_nlen( -/* ------- */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - int * /* S Tableau d'entiers pour stocker les */ - /* valeurs lues */ -#endif -); - -extern int cp_nlre( -/* ------- */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - float * /* S Tableau de flottants pour stocker les */ - /* valeurs lues */ -#endif -); - -extern int cp_nldb( -/* ------- */ - -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - double */* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - double */* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - double* /* S Tableau de doubles pour stocker les */ - /* valeurs lues */ -#endif -); - -extern int cp_nlcp( -/* ------- */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - float * /* S Tableau de flottants pour stocker les */ - /* valeurs lues (dimension = 2 * le nombre */ - /* de valeurs lues) */ -#endif -); - -extern int cp_nllo( -/* ------- */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - int * /* S Tableau d 'entier pour stocker les */ - /* valeurs lues (remplace le logiques) */ -#endif -); - -extern int cp_nlch( -/* ------- */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - char *[]/* S Tableau de chaines pour stocker les */ - /* valeurs lues (remplace le logiques) */, - int /* E Taille des chaines du tablaeu */ -#endif -); - - - - -/* */ -/* */ -/* Fonctions d'ecriture */ -/* */ -/* */ - -extern int cp_een( -/* ------ */ -#if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance */ - /* CP_TEMPS, CP_ITERATION */, - float /* E Pas de temps a ecrire */, - int /* E Pas d'iteration a ecrire */, - char * /* E Nom de la variable a ecrire */, - int /* E Nombre de valeurs a ecrire */, - int * /* E Tableau d'entiers a ecrire */ +/* */ +/* */ +/* Fonction de deconnexion */ +/* */ +/* */ +extern int cp_fin( +/* ------ */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Directive de continuation */ + /* CP_CONT ou CP_ARRET */ +#endif +); + + + +/* */ +/* */ +/* Fonctions de lecture bloquante */ +/* */ +/* */ +extern int cp_len( +/* ------ */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + int * /* S Tableau d'entiers pour stocker les */ + /* valeurs lues */ +#endif +); + +extern int cp_lre( +/* ------ */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + float * /* S Tableau de flottants pour stocker les */ + /* valeurs lues */ +#endif +); + +extern int cp_ldb( +/* ------ */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + double* /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + double* /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + double* /* S Tableau de doubles pour stocker les */ + /* valeurs lues */ +#endif +); + +extern int cp_lcp( +/* ------ */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + float * /* S Tableau de flottants pour stocker les */ + /* valeurs lues (dimension = 2 * le nombre */ + /* de valeurs lues) */ +#endif +); + +extern int cp_llo( +/* ------ */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + int * /* S Tableau d 'entier pour stocker les */ + /* valeurs lues (remplace le logiques) */ +#endif +); + +extern int cp_lch( +/* ------ */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + char *[]/* S Tableau de chaines pour stocker les */ + /* valeurs lues (remplace le logiques) */, + int /* E Taille des chaines du tablaeu */ +#endif +); + + + +/* */ +/* */ +/* Fonctions de lecture non bloquantes */ +/* */ +/* */ +extern int cp_nlen( +/* ------- */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + int * /* S Tableau d'entiers pour stocker les */ + /* valeurs lues */ +#endif +); + +extern int cp_nlre( +/* ------- */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + float * /* S Tableau de flottants pour stocker les */ + /* valeurs lues */ +#endif +); + +extern int cp_nldb( +/* ------- */ + +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + double */* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + double */* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + double* /* S Tableau de doubles pour stocker les */ + /* valeurs lues */ +#endif +); + +extern int cp_nlcp( +/* ------- */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + float * /* S Tableau de flottants pour stocker les */ + /* valeurs lues (dimension = 2 * le nombre */ + /* de valeurs lues) */ +#endif +); + +extern int cp_nllo( +/* ------- */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + int * /* S Tableau d 'entier pour stocker les */ + /* valeurs lues (remplace le logiques) */ +#endif +); + +extern int cp_nlch( +/* ------- */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + char *[]/* S Tableau de chaines pour stocker les */ + /* valeurs lues (remplace le logiques) */, + int /* E Taille des chaines du tablaeu */ +#endif +); + + + + +/* */ +/* */ +/* Fonctions d'ecriture */ +/* */ +/* */ + +extern int cp_een( +/* ------ */ +#if CPNeedPrototype + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance */ + /* CP_TEMPS, CP_ITERATION */, + float /* E Pas de temps a ecrire */, + int /* E Pas d'iteration a ecrire */, + char * /* E Nom de la variable a ecrire */, + int /* E Nombre de valeurs a ecrire */, + int * /* E Tableau d'entiers a ecrire */ #endif ); -extern int cp_elg( -/* ------ */ +extern int cp_elg( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance */ - /* CP_TEMPS, CP_ITERATION */, - float /* E Pas de temps a ecrire */, - int /* E Pas d'iteration a ecrire */, - char * /* E Nom de la variable a ecrire */, - int /* E Nombre de valeurs a ecrire */, - long * /* E Tableau d'entiers a ecrire */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance */ + /* CP_TEMPS, CP_ITERATION */, + float /* E Pas de temps a ecrire */, + int /* E Pas d'iteration a ecrire */, + char * /* E Nom de la variable a ecrire */, + int /* E Nombre de valeurs a ecrire */, + long * /* E Tableau d'entiers a ecrire */ #endif ); -extern int cp_ere( -/* ------ */ +extern int cp_ere( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance */ - /* CP_TEMPS, CP_ITERATION */, - float /* E Pas de temps a ecrire */, - int /* E Pas d'iteration a ecrire */, - char * /* E Nom de la variable a ecrire */, - int /* E Nombre de valeurs a ecrire */, - float * /* E Tableau de flottants a ecrire */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance */ + /* CP_TEMPS, CP_ITERATION */, + float /* E Pas de temps a ecrire */, + int /* E Pas d'iteration a ecrire */, + char * /* E Nom de la variable a ecrire */, + int /* E Nombre de valeurs a ecrire */, + float * /* E Tableau de flottants a ecrire */ #endif ); -extern int cp_edb( -/* ------ */ +extern int cp_edb( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance */ - /* CP_TEMPS, CP_ITERATION */, - double /* E Pas de temps a ecrire */, - int /* E Pas d'iteration a ecrire */, - char * /* E Nom de la variable a ecrire */, - int /* E Nombre de valeurs a ecrire */, - double* /* E Tableau de doubles a ecrire */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance */ + /* CP_TEMPS, CP_ITERATION */, + double /* E Pas de temps a ecrire */, + int /* E Pas d'iteration a ecrire */, + char * /* E Nom de la variable a ecrire */, + int /* E Nombre de valeurs a ecrire */, + double* /* E Tableau de doubles a ecrire */ #endif ); -extern int cp_ecp( -/* ------ */ +extern int cp_ecp( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance */ - /* CP_TEMPS, CP_ITERATION */, - float /* E Pas de temps a ecrire */, - int /* E Pas d'iteration a ecrire */, - char * /* E Nom de la variable a ecrire */, - int /* E Nombre de valeurs a ecrire */, - float * /* E Tableau de flottants a ecrire */ - /* (dimension = 2 * le nombre de valeurs */ - /* a ecrire */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance */ + /* CP_TEMPS, CP_ITERATION */, + float /* E Pas de temps a ecrire */, + int /* E Pas d'iteration a ecrire */, + char * /* E Nom de la variable a ecrire */, + int /* E Nombre de valeurs a ecrire */, + float * /* E Tableau de flottants a ecrire */ + /* (dimension = 2 * le nombre de valeurs */ + /* a ecrire */ #endif ); -extern int cp_elo( -/* ------ */ +extern int cp_elo( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance */ - /* CP_TEMPS, CP_ITERATION */, - float /* E Pas de temps a ecrire */, - int /* E Pas d'iteration a ecrire */, - char * /* E Nom de la variable a ecrire */, - int /* E Nombre de valeurs a ecrire */, - int * /* E Tableau d'entiers a ecrire */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance */ + /* CP_TEMPS, CP_ITERATION */, + float /* E Pas de temps a ecrire */, + int /* E Pas d'iteration a ecrire */, + char * /* E Nom de la variable a ecrire */, + int /* E Nombre de valeurs a ecrire */, + int * /* E Tableau d'entiers a ecrire */ #endif ); -extern int cp_ech( -/* ------ */ +extern int cp_ech( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance */ - /* CP_TEMPS, CP_ITERATION */, - float /* E Pas de temps a ecrire */, - int /* E Pas d'iteration a ecrire */, - char * /* E Nom de la variable a ecrire */, - int /* E Nombre de valeurs a ecrire */, - char *[]/* E Tableau de chaines a ecrire */, - int /* E Taille des chaines a ecrire */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance */ + /* CP_TEMPS, CP_ITERATION */, + float /* E Pas de temps a ecrire */, + int /* E Pas d'iteration a ecrire */, + char * /* E Nom de la variable a ecrire */, + int /* E Nombre de valeurs a ecrire */, + char *[]/* E Tableau de chaines a ecrire */, + int /* E Taille des chaines a ecrire */ #endif ); -/* */ -/* */ -/* Fonctions de fin de pas */ -/* */ -/* */ -extern int cp_aufp( -/* ------- */ +/* */ +/* */ +/* Fonctions de fin de pas */ +/* */ +/* */ +extern int cp_aufp( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */ #endif ); -extern int cp_infp( -/* ------- */ +extern int cp_infp( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */ #endif ); -extern int cp_fini( -/* ------- */ +extern int cp_fini( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Tous les pas <= a cette valeur */ - /* seront oublies par le coupleur */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Tous les pas <= a cette valeur */ + /* seront oublies par le coupleur */ #endif ); -extern int cp_fint( -/* ------- */ +extern int cp_fint( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - float /* E Tous les pas <= a cette valeur */ - /* seront oublies par le coupleur */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + float /* E Tous les pas <= a cette valeur */ + /* seront oublies par le coupleur */ #endif ); -/* */ -/* */ -/* Fonctions d'effacement */ -/* */ -/* */ -extern int cp_effi( -/* ------- */ +/* */ +/* */ +/* Fonctions d'effacement */ +/* */ +/* */ +extern int cp_effi( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - char * /* E Nom de la variable a effacer */, - int /* E Tous les pas >= a cette valeurt */ - /* seront effaces par le coupleur */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + char * /* E Nom de la variable a effacer */, + int /* E Tous les pas >= a cette valeurt */ + /* seront effaces par le coupleur */ #endif ); -extern int cp_efft( -/* ------- */ +extern int cp_efft( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - char * /* E Nom de la variable a effacer */, - float /* E Tous les pas >= a cette valeur */ - /* seront effaces par le coupleur */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + char * /* E Nom de la variable a effacer */, + float /* E Tous les pas >= a cette valeur */ + /* seront effaces par le coupleur */ #endif ); -/* */ -/* */ -/* Fonctions de mode d'execution */ -/* */ -/* */ -extern int cp_pause( -/* -------- */ +/* */ +/* */ +/* Fonctions de mode d'execution */ +/* */ +/* */ +extern int cp_pause( +/* -------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */ #endif ); -extern int cp_run( -/* ------ */ +extern int cp_run( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */ #endif ); -extern int cp_npas( -/* ------- */ +extern int cp_npas( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Nombre de pas a executer */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Nombre de pas a executer */ #endif ); -/* */ -/* */ -/* Fonctions de configuration dynamique */ -/* */ -/* */ -extern int cp_dfcode( -/* -------- */ +/* */ +/* */ +/* Fonctions de configuration dynamique */ +/* */ +/* */ +extern int cp_dfcode( +/* -------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - char * /* E Declaration du code */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + char * /* E Declaration du code */ #endif ); -extern int cp_dfinst( -/* -------- */ +extern int cp_dfinst( +/* -------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - char * /* E Declaration de l'instance */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + char * /* E Declaration de l'instance */ #endif ); -extern int cp_dflien( -/* -------- */ +extern int cp_dflien( +/* -------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - char * /* E Declaration du lien */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + char * /* E Declaration du lien */ #endif ); -/* */ -/* */ -/* Fonctions d'interrogation */ -/* */ -/* */ -extern int cp_ivers( -/* -------- */ +/* */ +/* */ +/* Fonctions d'interrogation */ +/* */ +/* */ +extern int cp_ivers( +/* -------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - char * /* S Repertoire ACCC */, - char * /* S Repertoire ACCC */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + char * /* S Repertoire ACCC */, + char * /* S Repertoire ACCC */ #endif ); -extern int cp_icd( -/* ------ */ +extern int cp_icd( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Longueur du tableau passe en parametre */, - int * /* S Nombre de codes retournes */, - char *[]/* S Tableau contenant les noms des codes */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Longueur du tableau passe en parametre */, + int * /* S Nombre de codes retournes */, + char *[]/* S Tableau contenant les noms des codes */ #endif ); -extern int cp_iincd( -/* -------- */ +extern int cp_iincd( +/* -------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - char * /* E Nom du code dont on veut les instances */, - int /* E Longueur du tableau passe en parametre */, - int * /* S Nombre d'instances retournees */, - char *[]/* S Tableau contenant les noms des instances */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + char * /* E Nom du code dont on veut les instances */, + int /* E Longueur du tableau passe en parametre */, + int * /* S Nombre d'instances retournees */, + char *[]/* S Tableau contenant les noms des instances */ #endif ); -extern int cp_ivr( -/* ------ */ +extern int cp_ivr( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Longueur des tableaux passes en parametre */, - int * /* S Nombre de variables retournees */, - char *[]/* S Tableau contenant les noms des instances */, - char *[]/* S Tableau contenant les noms des variables */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Longueur des tableaux passes en parametre */, + int * /* S Nombre de variables retournees */, + char *[]/* S Tableau contenant les noms des instances */, + char *[]/* S Tableau contenant les noms des variables */ #endif ); -extern int cp_ivrcd( -/* -------- */ +extern int cp_ivrcd( +/* -------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - char * /* E Nom du code dont on veut les variables */, - int /* E Longueur des tableaux passes en parametre */, - int * /* S Nombre de variables retournees */, - char *[]/* S Tableau contenant les noms des variables */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + char * /* E Nom du code dont on veut les variables */, + int /* E Longueur des tableaux passes en parametre */, + int * /* S Nombre de variables retournees */, + char *[]/* S Tableau contenant les noms des variables */ #endif ); -extern int cp_ivrin( -/* -------- */ +extern int cp_ivrin( +/* -------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - char * /* E Nom de l'instance dont on veut la liste */ - /* des variables */, - char * /* S Nom du code pere de l'instance */, - int /* E Longueur du tableau pour les variables */ - /* entrantes */, - int /* E Longueur du tableau pour les variables */ - /* sortantes */, - int * /* S Nombre de variables entrantes retournees */, - int * /* S Nombre de variables sortantes retournees */, - char *[]/* S Tableau contenant les noms des variables */ - /* entrantes */, - char *[]/* S Tableau contenant les noms des variables */ - /* sortantes */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + char * /* E Nom de l'instance dont on veut la liste */ + /* des variables */, + char * /* S Nom du code pere de l'instance */, + int /* E Longueur du tableau pour les variables */ + /* entrantes */, + int /* E Longueur du tableau pour les variables */ + /* sortantes */, + int * /* S Nombre de variables entrantes retournees */, + int * /* S Nombre de variables sortantes retournees */, + char *[]/* S Tableau contenant les noms des variables */ + /* entrantes */, + char *[]/* S Tableau contenant les noms des variables */ + /* sortantes */ #endif ); -extern int cp_icavr( -/* -------- */ +extern int cp_icavr( +/* -------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - char * /* E Nom de l'instance contenant la variable */, - char * /* E Nom local de la variable */, - int * /* S Sens de la variable */, - int * /* S Dependance de la variable */, - int * /* S Type de la variable */, - int /* E Longueur des tableaux permettant de */ - /* recueillir les pas de temps et d'iteration*/, - int * /* S Nombre de codes retournes */, - float * /* S Tableau contenant les pas de temps */, - int * /* S Tableau contenant les pas d'iterations */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + char * /* E Nom de l'instance contenant la variable */, + char * /* E Nom local de la variable */, + int * /* S Sens de la variable */, + int * /* S Dependance de la variable */, + int * /* S Type de la variable */, + int /* E Longueur des tableaux permettant de */ + /* recueillir les pas de temps et d'iteration*/, + int * /* S Nombre de codes retournes */, + float * /* S Tableau contenant les pas de temps */, + int * /* S Tableau contenant les pas d'iterations */ #endif ); -extern int cp_ilien( -/* -------- */ +extern int cp_ilien( +/* -------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - char * /* E Nom global de la variable */, - int /* E Longueur des tableaux pour les noms des */ - /* instances et des variables */, - int * /* S Nombre de variables participant au lien */, - char *[]/* S Tableau contenant les noms des instances */, - char *[]/* S Tableau contenant les noms des variables */, - int * /* S Type du lien */, - int * /* S Niveau du lien */, - int * /* S Tableau des parametres d'interpolation */ - /* des variables entrantes */, - float * /* S Tableau des valeurs de delta utilisees */ - /* pour les variables entrantes */, - int * /* S Tableau des parametres d'extrapolation */ - /* des variables entrantes */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + char * /* E Nom global de la variable */, + int /* E Longueur des tableaux pour les noms des */ + /* instances et des variables */, + int * /* S Nombre de variables participant au lien */, + char *[]/* S Tableau contenant les noms des instances */, + char *[]/* S Tableau contenant les noms des variables */, + int * /* S Type du lien */, + int * /* S Niveau du lien */, + int * /* S Tableau des parametres d'interpolation */ + /* des variables entrantes */, + float * /* S Tableau des valeurs de delta utilisees */ + /* pour les variables entrantes */, + int * /* S Tableau des parametres d'extrapolation */ + /* des variables entrantes */ #endif ); -/* */ -/* */ -/* Fonctions de manipulation d'options */ -/* */ -/* */ -extern int cp_setopt( -/* --------- */ +/* */ +/* */ +/* Fonctions de manipulation d'options */ +/* */ +/* */ +extern int cp_setopt( +/* --------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Numero identifiant l'option a modifier */, - int /* E Valeur a donner a l'option */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Numero identifiant l'option a modifier */, + int /* E Valeur a donner a l'option */ #endif ); -extern int cp_getopt( -/* --------- */ +extern int cp_getopt( +/* --------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Numero identifiant l'option a consulter */, - int * /* S Valeur recupereee de l'option */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Numero identifiant l'option a consulter */, + int * /* S Valeur recupereee de l'option */ #endif ); diff --git a/src/DSC/DSC_User/Datastream/Calcium/calciumE.h b/src/DSC/DSC_User/Datastream/Calcium/calciumE.h index 4be7c286d..241fddc95 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calciumE.h +++ b/src/DSC/DSC_User/Datastream/Calcium/calciumE.h @@ -31,9 +31,9 @@ #include "calciumP.h" #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) -#define CPNeedPrototype 1 +#define CPNeedPrototype 1 #else -#define CPNeedPrototype 0 +#define CPNeedPrototype 0 #endif @@ -41,352 +41,352 @@ extern "C" { #endif -/* */ -/* */ -/* Fonctions de connexion */ -/* */ -/* */ -extern int ecp_cd( -/* ----- */ +/* */ +/* */ +/* Fonctions de connexion */ +/* */ +/* */ +extern int ecp_cd( +/* ----- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, char * /* S Nom de l instance appelante*/ #endif ); -/* */ -/* */ -/* Fonction de deconnexion */ -/* */ -/* */ -extern int ecp_fin( -/* ------ */ +/* */ +/* */ +/* Fonction de deconnexion */ +/* */ +/* */ +extern int ecp_fin( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Directive de continuation */ - /* CP_CONT ou CP_ARRET */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Directive de continuation */ + /* CP_CONT ou CP_ARRET */ #endif ); -/* */ -/* */ -/* Fonctions de libération du buffer 0 copy */ -/* */ +/* */ +/* */ +/* Fonctions de libération du buffer 0 copy */ +/* */ extern void ecp_len_free( #if CPNeedPrototype - int * + int * #endif - ); + ); extern void ecp_lre_free( #if CPNeedPrototype - float * + float * #endif - ); + ); extern void ecp_ldb_free( #if CPNeedPrototype - double * + double * #endif - ); + ); extern void ecp_llo_free( #if CPNeedPrototype - int * + int * #endif - ); + ); extern void ecp_lcp_free( #if CPNeedPrototype - float * + float * #endif - ); + ); extern void ecp_lch_free( #if CPNeedPrototype - char ** + char ** #endif - ); + ); -/* */ -/* */ -/* Fonctions de lecture bloquante 0 copy */ -/* */ -/* */ -extern int ecp_len( -/* ------ */ +/* */ +/* */ +/* Fonctions de lecture bloquante 0 copy */ +/* */ +/* */ +extern int ecp_len( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - int ** /* E/S Tableau d'entiers pour stocker les */ - /* valeurs lues */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + int ** /* E/S Tableau d'entiers pour stocker les */ + /* valeurs lues */ #endif ); -extern int ecp_lre( -/* ------ */ +extern int ecp_lre( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - float **/* E/S Tableau de flottants pour stocker les */ - /* valeurs lues */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + float **/* E/S Tableau de flottants pour stocker les */ + /* valeurs lues */ #endif ); -extern int ecp_ldb( -/* ------ */ +extern int ecp_ldb( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - double* /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - double* /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - double**/* E/S Tableau de doubles pour stocker les */ - /* valeurs lues */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + double* /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + double* /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + double**/* E/S Tableau de doubles pour stocker les */ + /* valeurs lues */ #endif ); -extern int ecp_lcp( -/* ------ */ +extern int ecp_lcp( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - float **/* E/S Tableau de flottants pour stocker les */ - /* valeurs lues (dimension = 2 * le nombre */ - /* de valeurs lues) */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + float **/* E/S Tableau de flottants pour stocker les */ + /* valeurs lues (dimension = 2 * le nombre */ + /* de valeurs lues) */ #endif ); -extern int ecp_llo( -/* ------ */ +extern int ecp_llo( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - int ** /* E/S Tableau d 'entier pour stocker les */ - /* valeurs lues (remplace le logiques) */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + int ** /* E/S Tableau d 'entier pour stocker les */ + /* valeurs lues (remplace le logiques) */ #endif ); -extern int ecp_lch( -/* ------ */ +extern int ecp_lch( +/* ------ */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - char **[]/*E/S Tableau de chaines pour stocker les */ - /* valeurs lues (remplace le logiques) */, - int /* E Taille des chaines du tablaeu */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + char **[]/*E/S Tableau de chaines pour stocker les */ + /* valeurs lues (remplace le logiques) */, + int /* E Taille des chaines du tablaeu */ #endif ); -/* */ -/* */ -/* Fonctions de lecture non bloquantes */ -/* */ -/* */ -extern int ecp_nlen( -/* ------- */ +/* */ +/* */ +/* Fonctions de lecture non bloquantes */ +/* */ +/* */ +extern int ecp_nlen( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - int ** /* E/S Tableau d'entiers pour stocker les */ - /* valeurs lues */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + int ** /* E/S Tableau d'entiers pour stocker les */ + /* valeurs lues */ #endif ); -extern int ecp_nlre( -/* ------- */ +extern int ecp_nlre( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - float **/* E/S Tableau de flottants pour stocker les */ - /* valeurs lues */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + float **/* E/S Tableau de flottants pour stocker les */ + /* valeurs lues */ #endif ); -extern int ecp_nldb( -/* ------- */ +extern int ecp_nldb( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - double */* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - double */* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - double**/* E/S Tableau de doubles pour stocker les */ - /* valeurs lues */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + double */* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + double */* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + double**/* E/S Tableau de doubles pour stocker les */ + /* valeurs lues */ #endif ); -extern int ecp_nlcp( -/* ------- */ +extern int ecp_nlcp( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - float **/* E/S Tableau de flottants pour stocker les */ - /* valeurs lues (dimension = 2 * le nombre */ - /* de valeurs lues) */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + float **/* E/S Tableau de flottants pour stocker les */ + /* valeurs lues (dimension = 2 * le nombre */ + /* de valeurs lues) */ #endif ); -extern int ecp_nllo( -/* ------- */ +extern int ecp_nllo( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - int **/* E/S Tableau d 'entier pour stocker les */ - /* valeurs lues (remplace le logiques) */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + int **/* E/S Tableau d 'entier pour stocker les */ + /* valeurs lues (remplace le logiques) */ #endif ); -extern int ecp_nlch( -/* ------- */ +extern int ecp_nlch( +/* ------- */ #if CPNeedPrototype - void * component /* Pointeur de type Superv_Component_i* sur le */ - /* composant SALOME Supervisable */, - int /* E Type de dependance ou de lecture */ - /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, - float * /* E/S Borne inf de l'intervalle de lecture */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - float * /* E Borne Sup de l'intervalle de lecture */, - int * /* E/S Pas d'iteration a lire */ - /* Retourne le pas lu dans le cas de */ - /* lecture sequentielle */, - char * /* E Nom de la variable a lire */, - int /* E Nombre max de valeurs a lire */, - int * /* S Nombre de valeurs rellement lues */, - char **[]/* E/S Tableau de chaines pour stocker les */ - /* valeurs lues (remplace le logiques) */, - int /* E Taille des chaines du tablaeu */ + void * component /* Pointeur de type Superv_Component_i* sur le */ + /* composant SALOME Supervisable */, + int /* E Type de dependance ou de lecture */ + /* CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL */, + float * /* E/S Borne inf de l'intervalle de lecture */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + float * /* E Borne Sup de l'intervalle de lecture */, + int * /* E/S Pas d'iteration a lire */ + /* Retourne le pas lu dans le cas de */ + /* lecture sequentielle */, + char * /* E Nom de la variable a lire */, + int /* E Nombre max de valeurs a lire */, + int * /* S Nombre de valeurs rellement lues */, + char **[]/* E/S Tableau de chaines pour stocker les */ + /* valeurs lues (remplace le logiques) */, + int /* E Taille des chaines du tablaeu */ #endif ); diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_complex_port_uses.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_complex_port_uses.hxx index 5a1d2600e..e1a15a26c 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_complex_port_uses.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_complex_port_uses.hxx @@ -36,10 +36,10 @@ extern char _repository_Calcium_Complex_Port_name[]; class calcium_complex_port_uses : public virtual CalciumGenericUsesPort< seq_u_manipulation, - Ports::Calcium_Ports::Calcium_Complex_Port, - _repository_Calcium_Complex_Port_name - > + CORBA::Float >, + Ports::Calcium_Ports::Calcium_Complex_Port, + _repository_Calcium_Complex_Port_name + > { public : diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_double_port_uses.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_double_port_uses.hxx index 3a82d9e28..6fef8f6ea 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_double_port_uses.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_double_port_uses.hxx @@ -36,10 +36,10 @@ extern char _repository_Calcium_Double_Port_name[]; class calcium_double_port_uses : public virtual CalciumGenericUsesPort< seq_u_manipulation, - Ports::Calcium_Ports::Calcium_Double_Port, - _repository_Calcium_Double_Port_name - > + CORBA::Double >, + Ports::Calcium_Ports::Calcium_Double_Port, + _repository_Calcium_Double_Port_name + > { public : diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_intc_port_uses.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_intc_port_uses.hxx index 8d76a41c9..0660b275d 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_intc_port_uses.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_intc_port_uses.hxx @@ -38,10 +38,10 @@ extern char _repository_Calcium_Intc_Port_name[]; class calcium_intc_port_uses : public virtual CalciumGenericUsesPort< seq_u_manipulation, - Ports::Calcium_Ports::Calcium_Intc_Port, - _repository_Calcium_Intc_Port_name - > + CORBA::Long >, + Ports::Calcium_Ports::Calcium_Intc_Port, + _repository_Calcium_Intc_Port_name + > { public : diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_logical_port_uses.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_logical_port_uses.hxx index 9e9721ea3..fc7a5c82a 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_logical_port_uses.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_logical_port_uses.hxx @@ -36,10 +36,10 @@ extern char _repository_Calcium_Logical_Port_name[]; class calcium_logical_port_uses : public virtual CalciumGenericUsesPort< seq_u_manipulation, - Ports::Calcium_Ports::Calcium_Logical_Port, - _repository_Calcium_Logical_Port_name - > + CORBA::Boolean >, + Ports::Calcium_Ports::Calcium_Logical_Port, + _repository_Calcium_Logical_Port_name + > { public : diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_long_port_uses.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_long_port_uses.hxx index 7c2e4222f..e1c4c6eaa 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_long_port_uses.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_long_port_uses.hxx @@ -38,10 +38,10 @@ extern char _repository_Calcium_Long_Port_name[]; class calcium_long_port_uses : public virtual CalciumGenericUsesPort< seq_u_manipulation, - Ports::Calcium_Ports::Calcium_Long_Port, - _repository_Calcium_Long_Port_name - > + CORBA::LongLong >, + Ports::Calcium_Ports::Calcium_Long_Port, + _repository_Calcium_Long_Port_name + > { public : diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_real_port_uses.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_real_port_uses.hxx index d0ca3be95..8f51c9492 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_real_port_uses.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_real_port_uses.hxx @@ -37,10 +37,10 @@ extern char _repository_Calcium_Real_Port_name[]; class calcium_real_port_uses : public virtual CalciumGenericUsesPort< seq_u_manipulation, - Ports::Calcium_Ports::Calcium_Real_Port, - _repository_Calcium_Real_Port_name - > + CORBA::Float >, + Ports::Calcium_Ports::Calcium_Real_Port, + _repository_Calcium_Real_Port_name + > { public : diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_string_port_uses.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_string_port_uses.hxx index 157da4bcb..a0455ccf6 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_string_port_uses.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_string_port_uses.hxx @@ -36,10 +36,10 @@ extern char _repository_Calcium_String_Port_name[]; class calcium_string_port_uses : public virtual CalciumGenericUsesPort< seq_u_manipulation, - Ports::Calcium_Ports::Calcium_String_Port, - _repository_Calcium_String_Port_name - > + char * >, + Ports::Calcium_Ports::Calcium_String_Port, + _repository_Calcium_String_Port_name + > { public : diff --git a/src/DSC/DSC_User/Datastream/Calcium/calciumf.c b/src/DSC/DSC_User/Datastream/Calcium/calciumf.c index 3fa9d6295..b73dba9fa 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calciumf.c +++ b/src/DSC/DSC_User/Datastream/Calcium/calciumf.c @@ -92,7 +92,7 @@ void F_FUNC(cpfin,CPFIN)(long *compo,cal_int *dep,cal_int *err) /**************************************/ void F_FUNC(cplin,CPLIN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom), - cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom)); + cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom)); void F_FUNC(cpllg,CPLLG)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom), cal_int *max,cal_int *n, long *tab,cal_int *err STR_PLEN(nom)); void F_FUNC(cplen,CPLEN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom), @@ -110,7 +110,7 @@ void F_FUNC(cplch,CPLCH)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i void F_FUNC(cplin,CPLIN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom), - cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom)) + cal_int *max,cal_int *n, int *tab,cal_int *err STR_PLEN(nom)) { char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom)); @@ -120,7 +120,7 @@ void F_FUNC(cplin,CPLIN)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i *err=cp_lin_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab); #else fprintf(stderr,"End of CPLIN: %s : Can't use fortran INTEGER*4 because int C is not 32bits long on this machine.\n", - cnom); + cnom); #endif free_str1(cnom); } @@ -135,7 +135,7 @@ void F_FUNC(cpllg,CPLLG)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i *err=cp_llg_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,tab); #else fprintf(stderr,"End of CPLLG: %s : Can't use fortran INTEGER*8 because long C is not 64bits long on this machine.\n", - cnom); + cnom); #endif free_str1(cnom); } @@ -210,7 +210,7 @@ void F_FUNC(cplch,CPLCH)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i /* INTERFACES D'ECRITURE */ /***************************/ void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err - STR_PLEN(nom) STR_PLEN(tab)); + STR_PLEN(nom) STR_PLEN(tab)); void F_FUNC(cpedb,CPEDB)(long *compo,cal_int *dep,double *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, double *tab,cal_int *err STR_PLEN(nom)); void F_FUNC(cpere,CPERE)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom)); void F_FUNC(cpecp,CPECP)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom)); @@ -220,7 +220,7 @@ void F_FUNC(cpeen,CPEEN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS void F_FUNC(cpelo,CPELO)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, int *tab,cal_int *err STR_PLEN(nom)); void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, char *tab,cal_int *err - STR_PLEN(nom) STR_PLEN(tab)) + STR_PLEN(nom) STR_PLEN(tab)) { char ** tabChaine=NULL; cal_int index=0,index2=0; @@ -234,8 +234,8 @@ void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS tabChaine[index][STR_LEN(tab)]='\0'; for (index2 = STR_LEN(tab) - 1; index2 >= 0; index2--) { if ( tabChaine[index][index2] == ' ' || - tabChaine[index][index2] == '\0' ) - tabChaine[index][index2]='\0'; + tabChaine[index][index2] == '\0' ) + tabChaine[index][index2]='\0'; } } @@ -282,7 +282,7 @@ void F_FUNC(cpein,CPEIN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS *err=cp_ein_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab); #else fprintf(stderr,"CPEIN: %s %f %d : Can't use fortran INTEGER*4 because int C is not 32bits long on this machine.\n", - cnom, *ti,*iter); + cnom, *ti,*iter); #endif free_str1(cnom); } @@ -297,7 +297,7 @@ void F_FUNC(cpelg,CPELG)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS *err=cp_elg_fort_((void *)*compo,*dep,*ti,*iter,cnom,*n,tab); #else fprintf(stderr,"CPELG: %s %f %d : Can't use fortran INTEGER*8 because long C is not 64bits long on this machine.\n", - cnom, *ti,*iter); + cnom, *ti,*iter); #endif free_str1(cnom); } diff --git a/src/DSC/DSC_User/Datastream/Calcium/calciumf.h b/src/DSC/DSC_User/Datastream/Calcium/calciumf.h index d4056e3f1..61ad82cba 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calciumf.h +++ b/src/DSC/DSC_User/Datastream/Calcium/calciumf.h @@ -37,11 +37,11 @@ #define CALCIUM_ECR_INTERFACE_C_H(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \ - extern _calInt cp_##_name (void * component, _calInt mode, \ - _timeType t, _calInt i, \ - char * nomvar, _calInt nbelem, \ - _type _qual * data \ - lastarg ) ; \ + extern _calInt cp_##_name (void * component, _calInt mode, \ + _timeType t, _calInt i, \ + char * nomvar, _calInt nbelem, \ + _type _qual * data \ + lastarg ) ; \ CALCIUM_ECR_INTERFACE_C_H(een_fort_,float ,cal_int,cal_int,integer,,); @@ -56,12 +56,12 @@ CALCIUM_ECR_INTERFACE_C_H(ech_fort_,float ,cal_int,char ,str,STAR,LCH_LAST_PARA #define CALCIUM_LECT_INTERFACE_C_H(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \ - extern _calInt cp_##_name (void * component, _calInt mode, \ - _timeType * ti, _timeType * tf, _calInt * i, \ - char * nomvar, _calInt bufferLength, \ - _calInt * nRead, _type _qual * data \ - lastarg ) ; \ - \ + extern _calInt cp_##_name (void * component, _calInt mode, \ + _timeType * ti, _timeType * tf, _calInt * i, \ + char * nomvar, _calInt bufferLength, \ + _calInt * nRead, _type _qual * data \ + lastarg ) ; \ + \ CALCIUM_LECT_INTERFACE_C_H(len_fort_,float ,cal_int,cal_int ,integer,,); diff --git a/src/DSC/DSC_User/Datastream/Calcium/testInterpolation.cxx b/src/DSC/DSC_User/Datastream/Calcium/testInterpolation.cxx index 8da37a287..e81ceec13 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/testInterpolation.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/testInterpolation.cxx @@ -39,7 +39,7 @@ struct MyRand { static const double MAXVALUE = 150.0; MyRand() { srand(getpid()); } int operator()() const { - return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0)); + return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0)); } }; @@ -89,17 +89,17 @@ int main() { //Calcul sans Lambda // ERREUR : il faut produire une binary pas avec compose2 // std::transform(InIt1,InIt1+dataSize3,InIt2,OutIt2, - // //std::minus(), - // __gnu_cxx::compose2(std::minus(), - // // __gnu_cxx::identity(), - // std::bind2nd( std::multiplies(), 1. ), - // std::bind2nd( std::multiplies(), 1.1 ) ) - // ); + // //std::minus(), + // __gnu_cxx::compose2(std::minus(), + // // __gnu_cxx::identity(), + // std::bind2nd( std::multiplies(), 1. ), + // std::bind2nd( std::multiplies(), 1.1 ) ) + // ); // InIt2 =vect2.begin(); // OutIt2=vect4.begin(); // std::transform(InIt2,InIt2+dataSize3,OutIt2,OutIt2, - // std::plus() ); + // std::plus() ); // Calcul direct InIt1=vect1.begin(); InIt2=vect2.begin();OutIt2=vect4.begin(); diff --git a/src/DSC/DSC_User/Datastream/Calcium/test_DataIdContainer.cxx b/src/DSC/DSC_User/Datastream/Calcium/test_DataIdContainer.cxx index 35743c54f..c0e5cce6c 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/test_DataIdContainer.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/test_DataIdContainer.cxx @@ -51,10 +51,10 @@ public: DataIdContainer::iterator dataIdIt = dataIds.begin(); if (!dataIds.empty()) - for (;dataIdIt != dataIds.end();++dataIdIt) { - std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt; - std::cout << " == " << dataId << " : " << (ret = (*dataIdIt == dataId)) << std::endl; - } + for (;dataIdIt != dataIds.end();++dataIdIt) { + std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt; + std::cout << " == " << dataId << " : " << (ret = (*dataIdIt == dataId)) << std::endl; + } } catch(const CalciumException & ex) { ret=1; std::cout << ex.what() << std::endl; @@ -69,7 +69,7 @@ public: int ret; TEST2() { - // Doit filtrer le mode de dépendance temporel car le mode est + // Doit filtrer le mode de dépendance temporel car le mode est // défini itératif ret=0; @@ -86,8 +86,8 @@ public: if (!dataIds.empty()) for (;dataIdIt != dataIds.end();++dataIdIt) { - std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt ; - std::cout << " == " << DataId(0,tag) << " : " << (ret = (*dataIdIt == DataId(0,tag))) << std::endl; + std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt ; + std::cout << " == " << DataId(0,tag) << " : " << (ret = (*dataIdIt == DataId(0,tag))) << std::endl; } } @@ -100,7 +100,7 @@ public: TEST3() { - // Doit filtrer le mode de dépendance temporel car le mode est + // Doit filtrer le mode de dépendance temporel car le mode est // défini itératif ret=0; @@ -117,8 +117,8 @@ public: if (!dataIds.empty()) for (;dataIdIt != dataIds.end();++dataIdIt) { - std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt ; - std::cout << " == " << DataId(time,0) << " : " << (ret = (*dataIdIt == DataId(time,0))) << std::endl; + std::cout << "(*dataIdIt) must be equal to given dataId parameter : " << *dataIdIt ; + std::cout << " == " << DataId(time,0) << " : " << (ret = (*dataIdIt == DataId(time,0))) << std::endl; } } diff --git a/src/DSC/DSC_User/Datastream/Calcium/version.h b/src/DSC/DSC_User/Datastream/Calcium/version.h index 5252619aa..c54e81df5 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/version.h +++ b/src/DSC/DSC_User/Datastream/Calcium/version.h @@ -27,12 +27,12 @@ #ifndef __VERSION_H #define __VERSION_H -/* Constantes servant a memoriser les repertoires des versions */ -/* de CALCIUM et de PVM ayant servi a la generation d'un */ -/* executable */ +/* Constantes servant a memoriser les repertoires des versions */ +/* de CALCIUM et de PVM ayant servi a la generation d'un */ +/* executable */ -#define ACCC_REP "/home/fayolle/CALCIUM3.0" -#define PVM_REP "/home/fayolle/pvm3" +#define ACCC_REP "/home/fayolle/CALCIUM3.0" +#define PVM_REP "/home/fayolle/pvm3" #endif diff --git a/src/DSC/DSC_User/Datastream/CorbaTypeManipulator.hxx b/src/DSC/DSC_User/Datastream/CorbaTypeManipulator.hxx index ada58a3c7..be6c8d68b 100644 --- a/src/DSC/DSC_User/Datastream/CorbaTypeManipulator.hxx +++ b/src/DSC/DSC_User/Datastream/CorbaTypeManipulator.hxx @@ -168,7 +168,7 @@ public: // Operation de création // static inline Type create(size_t size=1,InnerType * data=NULL, -// bool giveOwnerShip=false) { +// bool giveOwnerShip=false) { // Type dummy; // if (dataPtr) // return *data; @@ -306,7 +306,7 @@ public: // (généralement pas de recopie qlq soit l'ownership ) // data doit avoir été alloué par allocPointer si giveOwnerShip = true static inline Type create(size_t size, InnerType * const data = NULL, - bool giveOwnerShip = false ) { + bool giveOwnerShip = false ) { Type tmp; if (!data) { tmp = new seq_T(); @@ -464,7 +464,7 @@ public: // (généralement pas de recopie qlq soit l'ownership ) // data doit avoir été alloué par allocPointer si giveOwnerShip = true static inline Type create(size_t size, InnerType * const data = NULL, - bool giveOwnerShip = false ) { + bool giveOwnerShip = false ) { Type tmp; if (!data) { tmp = new seq_T(); diff --git a/src/DSC/DSC_User/Datastream/CouplingPolicy.hxx b/src/DSC/DSC_User/Datastream/CouplingPolicy.hxx index b7f980c2c..05dd5935a 100644 --- a/src/DSC/DSC_User/Datastream/CouplingPolicy.hxx +++ b/src/DSC/DSC_User/Datastream/CouplingPolicy.hxx @@ -74,9 +74,9 @@ public: // wDataIt1->first < wdataId < (wDataIt1+1)->first template < typename Container > bool isDataIdConveniant(Container & storedDatas, - const typename Container::key_type & expectedDataId, - bool & isEqual , bool & isBounded, - typename Container::iterator & wDataIt1 ) const { + const typename Container::key_type & expectedDataId, + bool & isEqual , bool & isBounded, + typename Container::iterator & wDataIt1 ) const { typedef typename Container::key_type key_type; typedef typename Container::value_type value_type; typedef typename Container::iterator iterator; @@ -98,8 +98,8 @@ public: BoundedDataIdProcessor(const CouplingPolicy & couplingPolicy) {}; template < typename Iterator, typename DataId > void inline apply(typename iterator_t::value_type & data, - const DataId & dataId, - const Iterator & it1) const { + const DataId & dataId, + const Iterator & it1) const { typedef typename iterator_t::value_type value_type; std::cout << "-------- Generic BoundedDataIdProcessor.apply() called " << std::endl; @@ -118,7 +118,7 @@ public: template < typename Container > void apply(Container & storedDatas, - typename Container::iterator & wDataIt1 ) const { + typename Container::iterator & wDataIt1 ) const { typedef typename Container::key_type key_type; typedef typename Container::value_type value_type; typedef typename Container::iterator iterator; @@ -139,8 +139,8 @@ public: template < typename Container, typename DataId > bool apply(Container & storedDatas, - const DataId & expectedDataId, - typename Container::iterator & wDataIt1 ) const { + const DataId & expectedDataId, + typename Container::iterator & wDataIt1 ) const { typedef typename Container::key_type key_type; typedef typename Container::value_type value_type; typedef typename Container::iterator iterator; diff --git a/src/DSC/DSC_User/Datastream/DataIdFilter.hxx b/src/DSC/DSC_User/Datastream/DataIdFilter.hxx index 393f1a9ec..7115ef5db 100644 --- a/src/DSC/DSC_User/Datastream/DataIdFilter.hxx +++ b/src/DSC/DSC_User/Datastream/DataIdFilter.hxx @@ -299,55 +299,55 @@ T filtre_conversion::applique_filtre_conversion (T valeur_initiale, std::vector< // Si la longueur du filtre est 1 if ((*i).filtre.len == 1) { - // Si la valeur initiale correspond à la valeur du filtre - if ((*i).filtre.debut == valeur_initiale) - si_passe_filtre = true; + // Si la valeur initiale correspond à la valeur du filtre + if ((*i).filtre.debut == valeur_initiale) + si_passe_filtre = true; } else { - // Si la valeur initiale est dans la séquence des valeurs du filtre - // la valeur est comprise dans les bornes [debut,fin] - // et sa distance du début de la séquence est modulo le pas - if ( ((*i).filtre.fin - valeur_initiale >= 0) == (valeur_initiale - (*i).filtre.debut >= 0) + // Si la valeur initiale est dans la séquence des valeurs du filtre + // la valeur est comprise dans les bornes [debut,fin] + // et sa distance du début de la séquence est modulo le pas + if ( ((*i).filtre.fin - valeur_initiale >= 0) == (valeur_initiale - (*i).filtre.debut >= 0) && (valeur_initiale - (*i).filtre.debut) % (*i).filtre.pas == 0 ) { - si_passe_filtre = true; - } + si_passe_filtre = true; + } } // Si la valeur initiale passe le filtre if (si_passe_filtre) { - // cout << "config: filtre passe " << endl; + // cout << "config: filtre passe " << endl; - // Si il y a une conversion à effectuer - if ((*i).p_convers != NULL) { + // Si il y a une conversion à effectuer + if ((*i).p_convers != NULL) { - // Si la longueur du filtre est 1 - if ((*i).filtre.len == 1) { + // Si la longueur du filtre est 1 + if ((*i).filtre.len == 1) { - // Si la longueur des paramètres de conversion est aussi 1 - if ((*i).p_convers->len == 1) { - // Ajoute la valeur de conversion à la liste des valeurs après conversion - liste_conversions.push_back ((*i).p_convers->debut); - } else { - // Ajoute la séquence de conversion à la liste des valeurs après conversion - for (int s = (*i).p_convers->debut; s != (*i).p_convers->fin; s += (*i).p_convers->pas) { - liste_conversions.push_back (s); - } - liste_conversions.push_back ((*i).p_convers->fin); - } + // Si la longueur des paramètres de conversion est aussi 1 + if ((*i).p_convers->len == 1) { + // Ajoute la valeur de conversion à la liste des valeurs après conversion + liste_conversions.push_back ((*i).p_convers->debut); + } else { + // Ajoute la séquence de conversion à la liste des valeurs après conversion + for (int s = (*i).p_convers->debut; s != (*i).p_convers->fin; s += (*i).p_convers->pas) { + liste_conversions.push_back (s); + } + liste_conversions.push_back ((*i).p_convers->fin); + } - } else { - // Le filtre est une séquence qui est convertie en une autre séquence de même longueur - // Choisit la valeur au rang désiré dans la séquence de conversion - int rang = (valeur_initiale - (*i).filtre.debut) / (*i).filtre.pas; + } else { + // Le filtre est une séquence qui est convertie en une autre séquence de même longueur + // Choisit la valeur au rang désiré dans la séquence de conversion + int rang = (valeur_initiale - (*i).filtre.debut) / (*i).filtre.pas; - int valeur_convertie = (*i).p_convers->debut + rang * (*i).p_convers->pas; + int valeur_convertie = (*i).p_convers->debut + rang * (*i).p_convers->pas; - // Ajoute cette valeur à la liste des valeurs après conversion - liste_conversions.push_back (valeur_convertie); - } - } else { - // Ajoute la valeur initiale telle-quelle à la liste des valeurs après conversion - liste_conversions.push_back (valeur_initiale); - } + // Ajoute cette valeur à la liste des valeurs après conversion + liste_conversions.push_back (valeur_convertie); + } + } else { + // Ajoute la valeur initiale telle-quelle à la liste des valeurs après conversion + liste_conversions.push_back (valeur_initiale); + } } } diff --git a/src/DSC/DSC_User/Datastream/FindKeyPredicate.hxx b/src/DSC/DSC_User/Datastream/FindKeyPredicate.hxx index 244f10020..e61492a8d 100644 --- a/src/DSC/DSC_User/Datastream/FindKeyPredicate.hxx +++ b/src/DSC/DSC_User/Datastream/FindKeyPredicate.hxx @@ -48,14 +48,14 @@ struct FindKeyPredicate : public std::unary_function < T, bool > // template // struct FindKeyPredicate< std::pair, T3 > > : // public std::binary_function < std::pair, T3 >, -// std::pair, T3 >, bool > +// std::pair, T3 >, bool > // { // std::pair _value; // FindKeyPredicate(const std::pair & value):_value(value){ // std::cout << "1-Initializing with value " << _value << std::endl; // } // bool operator()( const std::pair, T3 > & v1, -// const std::pair, T3 > v2) const { +// const std::pair, T3 > v2) const { // std::cout << "1-> :" << v1 << "," << v2 << " " << std::endl; // return (v1.first <= _value ) && (_value < v2.first) ; // } diff --git a/src/DSC/DSC_User/Datastream/GenericProvidesPort.hxx b/src/DSC/DSC_User/Datastream/GenericProvidesPort.hxx index 1005be51e..bfef159ed 100644 --- a/src/DSC/DSC_User/Datastream/GenericProvidesPort.hxx +++ b/src/DSC/DSC_User/Datastream/GenericProvidesPort.hxx @@ -32,7 +32,7 @@ template class GenericProvidesPort : public ProvidesPort, - public GenericPort< DataManipulator , CouplingPolicy > { + public GenericPort< DataManipulator , CouplingPolicy > { public : // Type de données manipulés typedef typename DataManipulator::Type DataType; diff --git a/src/DSC/DSC_User/Datastream/GenericUsesPort.hxx b/src/DSC/DSC_User/Datastream/GenericUsesPort.hxx index 351388554..ad7ca07c5 100644 --- a/src/DSC/DSC_User/Datastream/GenericUsesPort.hxx +++ b/src/DSC/DSC_User/Datastream/GenericUsesPort.hxx @@ -36,14 +36,14 @@ #include "DSC_Exception.hxx" -// #define GENERATE_USES_PORT(dataManip,portType,portName) \ +// #define GENERATE_USES_PORT(dataManip,portType,portName) \ // const char * _repository_##portType##_name_ = "IDL:Ports/##portType##:1.0"; \ // GenericUsesPort< dataManip, portType, _repository_##portType##_name_ > portName; //ex : GENERATE_USES_PORT(Ports::Data_Short_Port,data_short_port); template + typename UsesPort=uses_port > class GenericUsesPort : public UsesPort { public : @@ -59,7 +59,7 @@ public : void put(CorbaInDataType data, TimeType time, TagType tag); virtual void uses_port_changed(Engines::DSC::uses_port * new_uses_port, - const Engines::DSC::Message message); + const Engines::DSC::Message message); protected : Engines::DSC::uses_port * _my_ports; @@ -88,8 +88,8 @@ template void GenericUsesPort< DataManipulator,CorbaPortType, repositoryName, UsesPort >::put( CorbaInDataType data, - TimeType time, - TagType tag) { + TimeType time, + TagType tag) { typedef typename CorbaPortType::_var_type CorbaPortTypeVar; if (!_my_ports) throw DSC_Exception(LOC("There is no connected provides port to communicate with.")); @@ -117,7 +117,7 @@ GenericUsesPort< DataManipulator,CorbaPortType, repositoryName, UsesPort >::put } catch(const CORBA::SystemException& ex) { //OLD : DataManipulator::delete_data(copyOfData); throw DSC_Exception(LOC(OSS() << "Can't invoke put method on port number " - << i << "( i>= 0)")); + << i << "( i>= 0)")); } //if (i) PB1 @@ -132,8 +132,8 @@ GenericUsesPort< DataManipulator,CorbaPortType, repositoryName, UsesPort >::put template void GenericUsesPort< DataManipulator, CorbaPortType, repositoryName, UsesPort - >::uses_port_changed(Engines::DSC::uses_port * new_uses_port, - const Engines::DSC::Message message) + >::uses_port_changed(Engines::DSC::uses_port * new_uses_port, + const Engines::DSC::Message message) { if (_my_ports) delete _my_ports; diff --git a/src/DSC/DSC_User/Datastream/Palm/PalmCouplingPolicy.hxx b/src/DSC/DSC_User/Datastream/Palm/PalmCouplingPolicy.hxx index b07aea778..ec5bc7711 100644 --- a/src/DSC/DSC_User/Datastream/Palm/PalmCouplingPolicy.hxx +++ b/src/DSC/DSC_User/Datastream/Palm/PalmCouplingPolicy.hxx @@ -88,11 +88,11 @@ public: policy.filtre_convert_TIME.applique_filtre_conversion(dataId.first, _lTime); int c=0; for(std::vector::iterator i=_lTime.begin();i!=_lTime.end();++i) - std::cout << "_lTime["<< c++ << "] : " << *i << std::endl; + std::cout << "_lTime["<< c++ << "] : " << *i << std::endl; policy.filtre_convert_TAG.applique_filtre_conversion(dataId.second, _lTag); c=0; for(std::vector::iterator i=_lTag.begin();i!=_lTag.end();++i) - std::cout << "_lTag["<< c++ << "] : " << *i << std::endl; + std::cout << "_lTag["<< c++ << "] : " << *i << std::endl; } // Pas encore testé @@ -138,51 +138,51 @@ public: // Pas encore testé DataIdIterator(const InternalDataIdContainer & pc): - _pc(pc),_itTime(pc._lTime.begin()),_itTag(pc._lTag.begin()) {} + _pc(pc),_itTime(pc._lTime.begin()),_itTag(pc._lTag.begin()) {} DataIdIterator(const InternalDataIdContainer & pc, ItTime itTime, ItTag itTag): - _pc(pc),_itTime(itTime),_itTag(itTag) {} + _pc(pc),_itTime(itTime),_itTag(itTag) {} // Pas encore testé DataIdIterator(const DataIdIterator & dIt): - _pc(dIt._pc),_itTime(dIt._itTime),_itTag(dIt._itTag) {} + _pc(dIt._pc),_itTime(dIt._itTime),_itTag(dIt._itTag) {} ~DataIdIterator() {} // Pas encore testé DataIdIterator & operator=(const DataIdIterator & dIt) { - if (this != &dIt) { - _pc=dIt._pc;_itTime=dIt._itTime;_itTag=dIt._itTag; - } - return *this; + if (this != &dIt) { + _pc=dIt._pc;_itTime=dIt._itTime;_itTag=dIt._itTag; + } + return *this; } DataId operator*() const { - std::cout << "-------- operator*(), *_itTime : " << *_itTime << " *_itTag " << *_itTag <, - PalmCouplingPolicy > + PalmCouplingPolicy > { typedef Ports::Palm_Ports::seq_short CorbaDataType; typedef seq_u_manipulation DataManipulator; diff --git a/src/DSC/DSC_User/Datastream/ProcessTimeIntervalTraits.hxx b/src/DSC/DSC_User/Datastream/ProcessTimeIntervalTraits.hxx index f33d3fa68..1279af1a9 100644 --- a/src/DSC/DSC_User/Datastream/ProcessTimeIntervalTraits.hxx +++ b/src/DSC/DSC_User/Datastream/ProcessTimeIntervalTraits.hxx @@ -50,7 +50,7 @@ template struct ProcessTimeIntervalTraits { // template < typename Iterator > // typename iterator_t::value_type // CalciumCoulpingPolicy::processTimeInterval (DataId & dataId, -// Iterator & it1, Iterator & it2); +// Iterator & it1, Iterator & it2); #include "CalciumCouplingPolicy.hxx" template <> struct ProcessTimeIntervalTraits { diff --git a/src/DSC/DSC_User/Datastream/testAdjacentFunctor.cxx b/src/DSC/DSC_User/Datastream/testAdjacentFunctor.cxx index bbb645a7a..ae5c4b8f1 100644 --- a/src/DSC/DSC_User/Datastream/testAdjacentFunctor.cxx +++ b/src/DSC/DSC_User/Datastream/testAdjacentFunctor.cxx @@ -45,7 +45,7 @@ struct MyRand { static const double MAXVALUE = 150.0; MyRand() { srand(getpid()); } int operator()() const { - return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0)); + return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0)); } }; @@ -93,7 +93,7 @@ int main() { - + // if ( it == vect.end() ) { // std::cout << " Je n'ai pas trouvé la valeur " << valueToFind << std::endl; // } else { @@ -102,7 +102,7 @@ int main() { // Type min,max; // if ( ap.getBounds(min,max) ) { // it2=it;it2--; -// std::cout << "La valeur : " << valueToFind << " est encadrée par (*it) :" << (*it) << " et valeur de *(it-1) :" << (*it2) << std::endl; +// std::cout << "La valeur : " << valueToFind << " est encadrée par (*it) :" << (*it) << " et valeur de *(it-1) :" << (*it2) << std::endl; // } // } // } @@ -122,7 +122,7 @@ int main() { // AdjacentFunctor apMap(valueToFind); // for (itM1 = myMap.begin(); itM1 != myMap.end(); ++itM1) // if ( apMap(itM1->first) ) break; - + // if ( itM1 == myMap.end() ) { // std::cout << " Je n'est pas trouvé la valeur " << valueToFind << std::endl; // } else { @@ -131,7 +131,7 @@ int main() { // Type min,max; // if ( apMap.getBounds(min,max) ) { // itM2=itM1;itM2--; -// std::cout << "La valeur " << valueToFind << " est encadrée par (itM1->first) :" << (itM1->first) << " et valeur de (it-1)->first :" << (itM2->first) << std::endl; +// std::cout << "La valeur " << valueToFind << " est encadrée par (itM1->first) :" << (itM1->first) << " et valeur de (it-1)->first :" << (itM2->first) << std::endl; // } // } // } @@ -163,7 +163,7 @@ int main() { // MapIntDouble_Double::key_type min,max; // if ( apMapP.getBounds(min,max) ) { // itMP2=itMP1;itMP2--; -// std::cout << "La valeur " << valuePToFind << " est encadrée par (itMP1->first) :" << (itMP1->first) << " et valeur de (it-1)->first :" << (itMP2->first) << std::endl; +// std::cout << "La valeur " << valuePToFind << " est encadrée par (itMP1->first) :" << (itMP1->first) << " et valeur de (it-1)->first :" << (itMP2->first) << std::endl; // } // } // } diff --git a/src/DSC/DSC_User/Datastream/testAdjacentPredicate.cxx b/src/DSC/DSC_User/Datastream/testAdjacentPredicate.cxx index f6a14bee0..449b7357e 100644 --- a/src/DSC/DSC_User/Datastream/testAdjacentPredicate.cxx +++ b/src/DSC/DSC_User/Datastream/testAdjacentPredicate.cxx @@ -44,7 +44,7 @@ struct MyRand { static const double MAXVALUE = 150.0; MyRand() { srand(getpid()); } int operator()() const { - return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0)); + return 1+(int) ( MAXVALUE *rand()/(RAND_MAX +1.0)); } }; @@ -54,7 +54,7 @@ typedef std::pair< TimeType , TagType > DataId; template < typename DataType > DataType processTimeInterval (DataId & dataId, - typename std::map::const_iterator const & it1) { + typename std::map::const_iterator const & it1) { return (*it1).second; }; diff --git a/src/DSC/DSC_User/Superv_Component_i.cxx b/src/DSC/DSC_User/Superv_Component_i.cxx index c35017d3d..6a3773468 100644 --- a/src/DSC/DSC_User/Superv_Component_i.cxx +++ b/src/DSC/DSC_User/Superv_Component_i.cxx @@ -40,11 +40,11 @@ long Superv_Component_i::dscTimeOut=0; Superv_Component_i::Superv_Component_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, - bool notif) : + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName, + bool notif) : Engines_DSC_i(orb, poa, contId, instanceName, interfaceName) { #ifdef MYDEBUG @@ -53,11 +53,11 @@ Superv_Component_i::Superv_Component_i(CORBA::ORB_ptr orb, setTimeOut(); } Superv_Component_i::Superv_Component_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - Engines::Container_ptr container, - const char *instanceName, - const char *interfaceName, - bool notif, + PortableServer::POA_ptr poa, + Engines::Container_ptr container, + const char *instanceName, + const char *interfaceName, + bool notif, bool regist) : Engines_DSC_i(orb, poa, container, instanceName, interfaceName,notif,regist) { @@ -77,7 +77,7 @@ Superv_Component_i::~Superv_Component_i() void Superv_Component_i::register_factory(const std::string & factory_name, - port_factory * factory_ptr) + port_factory * factory_ptr) { factory_map_t::iterator it = _factory_map.find(factory_name); @@ -121,7 +121,7 @@ Superv_Component_i::create_provides_data_port(const std::string& port_fab_type) if (rtn_port == NULL) throw BadFabType( LOC(OSS()<< "No way to get the port factory " - <get_port_properties(); Ports::Port_var portref=port->get_port_ref(); Engines_DSC_interface::add_provides_port(portref, - provides_port_name, - portproperties); + provides_port_name, + portproperties); superv_port_t * new_superv_port = new superv_port_t(); new_superv_port->p_ref = port; @@ -205,7 +205,7 @@ Superv_Component_i::add_port(provides_port * port, } catch (const Engines::DSC::PortAlreadyDefined&) { throw PortAlreadyDefined( LOC(OSS()<< "provides port " - << provides_port_name <<" already exist.")); + << provides_port_name <<" already exist.")); } catch (const Engines::DSC::NilPort&) { throw NilPort( LOC(OSS()<< "provides port pointer is nul.")); @@ -217,7 +217,7 @@ Superv_Component_i::add_port(provides_port * port, void Superv_Component_i::add_port(uses_port * port, - const char* uses_port_name) + const char* uses_port_name) throw (PortAlreadyDefined, NilPort, BadProperty) { assert(port); @@ -226,15 +226,15 @@ Superv_Component_i::add_port(uses_port * port, try { Ports::PortProperties_var portproperties=port->get_port_properties(); Engines_DSC_interface::add_uses_port(port->get_repository_id(), - uses_port_name, - portproperties); + uses_port_name, + portproperties); superv_port_t * new_superv_port = new superv_port_t(); new_superv_port->u_ref = port; my_superv_ports[uses_port_name] = new_superv_port; } catch (const Engines::DSC::PortAlreadyDefined&) { throw PortAlreadyDefined( LOC(OSS()<< "uses port " - << uses_port_name <<" already exists.")); + << uses_port_name <<" already exists.")); } catch (const Engines::DSC::NilPort&) { throw NilPort( LOC(OSS()<< "uses port pointer is nul.")); @@ -246,7 +246,7 @@ Superv_Component_i::add_port(uses_port * port, void Superv_Component_i::get_port(provides_port *& port, - const char * provides_port_name) + const char * provides_port_name) throw (PortNotDefined,PortNotConnected) { assert(provides_port_name); @@ -256,16 +256,16 @@ Superv_Component_i::get_port(provides_port *& port, port = my_superv_ports[provides_port_name]->p_ref; } catch (const Engines::DSC::PortNotDefined&) { throw PortNotDefined( LOC(OSS()<< "provides port " - << provides_port_name <<" does not exist.")); + << provides_port_name <<" does not exist.")); } catch (const Engines::DSC::PortNotConnected&) { throw PortNotConnected( LOC(OSS()<< "provides port " << provides_port_name - << " is not connected.")); + << " is not connected.")); } } void Superv_Component_i::get_port(uses_port *& port, - const char * uses_port_name) + const char * uses_port_name) throw (PortNotDefined, PortNotConnected) { assert(uses_port_name); @@ -276,10 +276,10 @@ Superv_Component_i::get_port(uses_port *& port, port = my_superv_ports[uses_port_name]->u_ref; } catch (const Engines::DSC::PortNotDefined&) { throw PortNotDefined( LOC(OSS()<< "uses port " - << uses_port_name <<" does not exist.")); + << uses_port_name <<" does not exist.")); } catch (const Engines::DSC::PortNotConnected&) { throw PortNotConnected( LOC(OSS()<< "uses port " << uses_port_name - << " is not connected.")); + << " is not connected.")); } } @@ -287,24 +287,24 @@ Superv_Component_i::get_port(uses_port *& port, void Superv_Component_i::provides_port_changed(const char* provides_port_name, - int connection_nbr, - const Engines::DSC::Message message) + int connection_nbr, + const Engines::DSC::Message message) { my_superv_ports_it = my_superv_ports.find(provides_port_name); if (my_superv_ports_it != my_superv_ports.end()) my_superv_ports[provides_port_name]->p_ref->provides_port_changed(connection_nbr, - message); + message); } void Superv_Component_i::uses_port_changed(const char* uses_port_name, - Engines::DSC::uses_port * new_uses_port, - const Engines::DSC::Message message) + Engines::DSC::uses_port * new_uses_port, + const Engines::DSC::Message message) { my_superv_ports_it = my_superv_ports.find(uses_port_name); if (my_superv_ports_it != my_superv_ports.end()) my_superv_ports[uses_port_name]->u_ref->uses_port_changed(new Engines::DSC::uses_port(*new_uses_port), - message); + message); //delete the copy made by the caller delete new_uses_port; } @@ -313,7 +313,7 @@ Superv_Component_i::uses_port_changed(const char* uses_port_name, void Superv_Component_i::get_uses_port_names(std::vector & port_names, - const std::string servicename) const { + const std::string servicename) const { port_names.reserve(my_superv_ports.size()); diff --git a/src/DSC/DSC_User/Superv_Component_i.hxx b/src/DSC/DSC_User/Superv_Component_i.hxx index 246118160..d6719f4ca 100644 --- a/src/DSC/DSC_User/Superv_Component_i.hxx +++ b/src/DSC/DSC_User/Superv_Component_i.hxx @@ -55,17 +55,17 @@ class Superv_Component_i : { public: Superv_Component_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, - bool notif = false); + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName, + bool notif = false); Superv_Component_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - Engines::Container_ptr container, - const char *instanceName, - const char *interfaceName, - bool notif = false, + PortableServer::POA_ptr poa, + Engines::Container_ptr container, + const char *instanceName, + const char *interfaceName, + bool notif = false, bool regist = true ); virtual ~Superv_Component_i(); @@ -142,8 +142,8 @@ public: * \param port_name the name of the port in the component. */ virtual void add_port(const char * port_fab_type, - const char * port_type, - const char * port_name) + const char * port_type, + const char * port_name) throw (PortAlreadyDefined, BadFabType, BadType, BadProperty); /*! @@ -157,8 +157,8 @@ public: */ template < typename SpecificPortType > SpecificPortType * add_port(const char * port_fab_type, - const char * port_type, - const char * port_name) + const char * port_type, + const char * port_name) throw (PortAlreadyDefined, BadFabType, BadType, BadCast, BadProperty); /*! @@ -168,7 +168,7 @@ public: * \param provides_port_name the name of the port in the component. */ virtual void add_port(provides_port * port, - const char* provides_port_name) + const char* provides_port_name) throw (PortAlreadyDefined, NilPort, BadProperty); /*! @@ -178,7 +178,7 @@ public: * \param uses_port_name the name of the port in the component. */ virtual void add_port(uses_port * port, - const char* uses_port_name) + const char* uses_port_name) throw (PortAlreadyDefined, NilPort, BadProperty); /*! @@ -188,7 +188,7 @@ public: * \param provides_port_name the name of the port. */ virtual void get_port(provides_port *& port, - const char* provides_port_name) + const char* provides_port_name) throw (PortNotDefined, PortNotConnected); /*! @@ -198,7 +198,7 @@ public: * \param uses_port_name the name of the port. */ virtual void get_port(uses_port *& port, - const char* uses_port_name) + const char* uses_port_name) throw (PortNotDefined, PortNotConnected); /*! @@ -210,7 +210,7 @@ public: * \param servicename service's name. */ virtual void get_uses_port_names(std::vector & port_names, - const std::string servicename="") const; + const std::string servicename="") const; /*! * Gets a port already added in the component. @@ -226,15 +226,15 @@ public: * \see DSC_Callbacks::provides_port_changed */ virtual void provides_port_changed(const char* provides_port_name, - int connection_nbr, - const Engines::DSC::Message message); + int connection_nbr, + const Engines::DSC::Message message); /*! * \see DSC_Callbacks::uses_port_changed */ virtual void uses_port_changed(const char* uses_port_name, - Engines::DSC::uses_port * new_uses_port, - const Engines::DSC::Message message); + Engines::DSC::uses_port * new_uses_port, + const Engines::DSC::Message message); /*! @@ -246,7 +246,7 @@ public: * \param factory_ptr factory pointer (destroyed by the component) */ static void register_factory(const std::string & factory_name, - port_factory * factory_ptr); + port_factory * factory_ptr); /*! * Get a factory from the component. @@ -306,8 +306,8 @@ private: template < typename SpecificPortType > SpecificPortType * Superv_Component_i::add_port(const char * port_fab_type, - const char * port_type, - const char * port_name) + const char * port_type, + const char * port_name) throw (PortAlreadyDefined, BadFabType, BadType, BadCast, BadProperty) { assert(port_fab_type); @@ -345,7 +345,7 @@ Superv_Component_i::add_port(const char * port_fab_type, } else throw BadType(LOC(OSS()<< "port_type must be either 'provides' either 'uses' not " - << port_type)); + << port_type)); return retPort; }; @@ -382,10 +382,10 @@ Superv_Component_i::get_port( const char * port_name) } } catch (const Engines::DSC::PortNotDefined&) { throw PortNotDefined( LOC(OSS()<< "port " - << port_name <<" does not exist.")); + << port_name <<" does not exist.")); } catch (const Engines::DSC::PortNotConnected&) { throw PortNotConnected( LOC(OSS()<< "port " << port_name - << " is not connected.")); + << " is not connected.")); } retPort = dynamic_cast(port); diff --git a/src/DSC/DSC_User/provides_port.hxx b/src/DSC/DSC_User/provides_port.hxx index 2227ed9cf..49120699c 100644 --- a/src/DSC/DSC_User/provides_port.hxx +++ b/src/DSC/DSC_User/provides_port.hxx @@ -57,7 +57,7 @@ class provides_port : public base_port * \param message message associated with this connection. */ virtual void provides_port_changed(int connection_nbr, - const Engines::DSC::Message message) {} + const Engines::DSC::Message message) {} }; diff --git a/src/DSC/DSC_User/uses_port.hxx b/src/DSC/DSC_User/uses_port.hxx index 121996b18..17de59ed3 100644 --- a/src/DSC/DSC_User/uses_port.hxx +++ b/src/DSC/DSC_User/uses_port.hxx @@ -63,7 +63,7 @@ class uses_port : public base_port * \param message message associated with this modification. */ virtual void uses_port_changed(Engines::DSC::uses_port * new_uses_port, - const Engines::DSC::Message message) = 0; + const Engines::DSC::Message message) = 0; }; diff --git a/src/DSC/ParallelDSC/ParallelDSC_i.cxx b/src/DSC/ParallelDSC/ParallelDSC_i.cxx index 0c2706efe..1669dbdd1 100644 --- a/src/DSC/ParallelDSC/ParallelDSC_i.cxx +++ b/src/DSC/ParallelDSC/ParallelDSC_i.cxx @@ -26,13 +26,13 @@ #include "ParallelDSC_i.hxx" Engines_ParallelDSC_i::Engines_ParallelDSC_i(CORBA::ORB_ptr orb, - char * ior, - int rank, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, - bool notif) : + char * ior, + int rank, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName, + bool notif) : Engines_Parallel_Component_i(orb, ior, rank, poa, contId, instanceName, interfaceName, notif), Engines::Parallel_DSC_serv(orb, ior, rank), Engines::Parallel_DSC_base_serv(orb, ior, rank), @@ -57,12 +57,12 @@ Engines_ParallelDSC_i::~Engines_ParallelDSC_i() {} void Engines_ParallelDSC_i::set_paco_proxy(const CORBA::Object_ptr ref, - const char* provides_port_name, - Ports::PortProperties_ptr port_prop) { + const char* provides_port_name, + Ports::PortProperties_ptr port_prop) { assert(provides_port_name); Engines_DSC_interface::add_provides_port(Ports::Port::_narrow(ref), - provides_port_name, - port_prop); + provides_port_name, + port_prop); // Waiting that all the nodes have the proxy _my_com->paco_barrier(); cerr << "set_paco_proxy node fin" << endl; @@ -72,7 +72,7 @@ const char * Engines_ParallelDSC_i::get_proxy(const char* provides_port_name) { char * rtn_char = NULL; Ports::Port_ptr proxy = Engines_DSC_interface::get_provides_port(provides_port_name, - 0); + 0); if (!CORBA::is_nil(proxy)) rtn_char = (char *) _orb->object_to_string(proxy); return rtn_char; @@ -80,8 +80,8 @@ Engines_ParallelDSC_i::get_proxy(const char* provides_port_name) { CORBA::Boolean Engines_ParallelDSC_i::add_parallel_provides_proxy_port(const CORBA::Object_ptr ref, - const char * provides_port_name, - Ports::PortProperties_ptr port_prop) + const char * provides_port_name, + Ports::PortProperties_ptr port_prop) { assert(provides_port_name); CORBA::Boolean rtn_bool = false; @@ -105,7 +105,7 @@ Engines_ParallelDSC_i::add_parallel_provides_proxy_wait(const char * provides_po { sleep(1); try { - proxy = (char *) get_proxy(provides_port_name); + proxy = (char *) get_proxy(provides_port_name); } catch(...) {} } @@ -115,7 +115,7 @@ Engines_ParallelDSC_i::add_parallel_provides_proxy_wait(const char * provides_po CORBA::Boolean Engines_ParallelDSC_i::add_parallel_provides_node_port(Ports::Port_PaCO_ptr ref, - const char* provides_port_name) + const char* provides_port_name) { CORBA::Boolean rtn_bool = false; PaCO::InterfaceParallel_var node = PaCO::InterfaceParallel::_narrow(ref); diff --git a/src/DSC/ParallelDSC/ParallelDSC_i.hxx b/src/DSC/ParallelDSC/ParallelDSC_i.hxx index ac9273c46..1d18f5f9e 100644 --- a/src/DSC/ParallelDSC/ParallelDSC_i.hxx +++ b/src/DSC/ParallelDSC/ParallelDSC_i.hxx @@ -42,13 +42,13 @@ class Engines_ParallelDSC_i: { public: Engines_ParallelDSC_i(CORBA::ORB_ptr orb, - char * ior, - int rank, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, - bool notif = false); + char * ior, + int rank, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName, + bool notif = false); virtual ~Engines_ParallelDSC_i(); @@ -57,38 +57,38 @@ public: * \see Engines::DSC::add_provides_port */ virtual void add_provides_port(Ports::Port_ptr ref, - const char* provides_port_name, - Ports::PortProperties_ptr port_prop) + const char* provides_port_name, + Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::NilPort, - Engines::DSC::BadProperty) { + Engines::DSC::NilPort, + Engines::DSC::BadProperty) { Engines_DSC_interface::add_provides_port(ref, - provides_port_name, - port_prop); + provides_port_name, + port_prop); } /*! * \see Engines::DSC::add_uses_port */ virtual void add_uses_port(const char* repository_id, - const char* uses_port_name, - Ports::PortProperties_ptr port_prop) + const char* uses_port_name, + Ports::PortProperties_ptr port_prop) throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::BadProperty) { + Engines::DSC::BadProperty) { Engines_DSC_interface::add_uses_port(repository_id, - uses_port_name, - port_prop); + uses_port_name, + port_prop); } /*! * \see Engines::DSC::get_provides_port */ virtual Ports::Port_ptr get_provides_port(const char* provides_port_name, - const CORBA::Boolean connection_error) + const CORBA::Boolean connection_error) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + Engines::DSC::PortNotConnected) { return Engines_DSC_interface::get_provides_port(provides_port_name, - connection_error); + connection_error); } /*! @@ -96,7 +96,7 @@ public: */ virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + Engines::DSC::PortNotConnected) { return Engines_DSC_interface::get_uses_port(uses_port_name); } @@ -112,12 +112,12 @@ public: * \see Engines::DSC::connect_uses_port */ virtual void connect_uses_port(const char* uses_port_name, - Ports::Port_ptr provides_port_ref) + Ports::Port_ptr provides_port_ref) throw (Engines::DSC::PortNotDefined, - Engines::DSC::BadPortType, - Engines::DSC::NilPort) { + Engines::DSC::BadPortType, + Engines::DSC::NilPort) { Engines_DSC_interface::connect_uses_port(uses_port_name, - provides_port_ref); + provides_port_ref); } /*! @@ -132,25 +132,25 @@ public: * \see Engines::DSC::disconnect_provides_port */ virtual void disconnect_provides_port(const char* provides_port_name, - const Engines::DSC::Message message) + const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + Engines::DSC::PortNotConnected) { Engines_DSC_interface::disconnect_provides_port(provides_port_name, - message); + message); } /*! * \see Engines::DSC::disconnect_uses_port */ virtual void disconnect_uses_port(const char* uses_port_name, - Ports::Port_ptr provides_port_ref, - const Engines::DSC::Message message) + Ports::Port_ptr provides_port_ref, + const Engines::DSC::Message message) throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortReference) { + Engines::DSC::PortNotConnected, + Engines::DSC::BadPortReference) { Engines_DSC_interface::disconnect_uses_port(uses_port_name, - provides_port_ref, - message); + provides_port_ref, + message); } virtual Ports::PortProperties_ptr get_port_properties(const char* port_name) @@ -167,8 +167,8 @@ public: * \param port_prop port properties. */ virtual void set_paco_proxy(CORBA::Object_ptr ref, - const char* provides_port_name, - Ports::PortProperties_ptr port_prop); + const char* provides_port_name, + Ports::PortProperties_ptr port_prop); /*! * This method is used by the node that want to add the parallel proxy port. @@ -179,8 +179,8 @@ public: * \return true if the proxy is correctly added. */ virtual CORBA::Boolean add_parallel_provides_proxy_port(const CORBA::Object_ptr ref, - const char * provides_port_name, - Ports::PortProperties_ptr port_prop); + const char * provides_port_name, + Ports::PortProperties_ptr port_prop); /*! * This method by the nodes that do not add the proxy to wait is reference. @@ -200,7 +200,7 @@ public: * \return true if the node is correctly added. */ virtual CORBA::Boolean add_parallel_provides_node_port(Ports::Port_PaCO_ptr ref, - const char* provides_port_name); + const char* provides_port_name); /*! * Used to get the proxy of the parallel port. diff --git a/src/DSC/ParallelDSC/Param_Double_Port_provides_i.cxx b/src/DSC/ParallelDSC/Param_Double_Port_provides_i.cxx index ce1add092..3d4f3adb6 100644 --- a/src/DSC/ParallelDSC/Param_Double_Port_provides_i.cxx +++ b/src/DSC/ParallelDSC/Param_Double_Port_provides_i.cxx @@ -44,12 +44,12 @@ Param_Double_Port_provides_i::Param_Double_Port_provides_i(CORBA::ORB_ptr orb, c { _seq_data = NULL; - seq_data_termine = false; + seq_data_termine = false; seq_data_mutex = new pthread_mutex_t(); pthread_mutex_init(seq_data_mutex, NULL); seq_data_condition = new pthread_cond_t(); pthread_cond_init(seq_data_condition, NULL); - seq_data_termine_cp = true; + seq_data_termine_cp = true; seq_data_mutex_cp = new pthread_mutex_t(); pthread_mutex_init(seq_data_mutex_cp, NULL); seq_data_condition_cp = new pthread_cond_t(); @@ -57,12 +57,12 @@ Param_Double_Port_provides_i::Param_Double_Port_provides_i(CORBA::ORB_ptr orb, c _seq_results = NULL; - seq_results_termine = false; + seq_results_termine = false; seq_results_mutex = new pthread_mutex_t(); pthread_mutex_init(seq_results_mutex, NULL); seq_results_condition = new pthread_cond_t(); pthread_cond_init(seq_results_condition, NULL); - seq_results_termine_cp = true; + seq_results_termine_cp = true; seq_results_mutex_cp = new pthread_mutex_t(); pthread_mutex_init(seq_results_mutex_cp, NULL); seq_results_condition_cp = new pthread_cond_t(); @@ -98,8 +98,8 @@ Param_Double_Port_provides_i::~Param_Double_Port_provides_i() Param_Double_Port_provides_i * Param_Double_Port_provides_i::init_port(Engines_ParallelDSC_i * par_compo, - std::string port_name, - CORBA::ORB_ptr orb) + std::string port_name, + CORBA::ORB_ptr orb) { int rank = par_compo->getMyRank(); int totalNode = par_compo->getTotalNode(); @@ -125,7 +125,7 @@ Param_Double_Port_provides_i::init_port(Engines_ParallelDSC_i * par_compo, // lorsque le composant sera détruit proxy_node = new Ports::Param_Double_Port_proxy_impl(CORBA::ORB::_duplicate(orb), - pfm->get_thread("pdp_thread")); + pfm->get_thread("pdp_thread")); proxy_node->setLibCom("pdp_dummy", proxy_node); proxy_node->setLibThread("pdp_thread"); PaCO::PacoTopology_t serveur_topo; @@ -137,8 +137,8 @@ Param_Double_Port_provides_i::init_port(Engines_ParallelDSC_i * par_compo, // Enregistrement du proxy par_compo->add_parallel_provides_proxy_port(proxy_node->_this(), - port_name.c_str(), - proxy_node_properties->_this()); + port_name.c_str(), + proxy_node_properties->_this()); proxy_node->_remove_ref(); proxy_node_properties->_remove_ref(); } @@ -203,8 +203,8 @@ Param_Double_Port_provides_i::init_port(Engines_ParallelDSC_i * par_compo, void Param_Double_Port_provides_i::wait_init_port(Engines_ParallelDSC_i * par_compo, - std::string port_name, - CORBA::ORB_ptr orb) + std::string port_name, + CORBA::ORB_ptr orb) { int rank = par_compo->getMyRank(); int totalNode = par_compo->getTotalNode(); diff --git a/src/DSC/ParallelDSC/Param_Double_Port_provides_i.hxx b/src/DSC/ParallelDSC/Param_Double_Port_provides_i.hxx index 7a01fc56c..dfd66a094 100644 --- a/src/DSC/ParallelDSC/Param_Double_Port_provides_i.hxx +++ b/src/DSC/ParallelDSC/Param_Double_Port_provides_i.hxx @@ -42,18 +42,18 @@ class Param_Double_Port_provides_i : Ports::Param_Double_Port::seq_double * get_data(); void set_data(Ports::Param_Double_Port::seq_double * results); void configure_set_data(int data_length, - int totalNbElt, - int BeginEltPos); + int totalNbElt, + int BeginEltPos); // Aide à la création du port static Param_Double_Port_provides_i * init_port(Engines_ParallelDSC_i * par_compo, - std::string port_name, - CORBA::ORB_ptr orb); + std::string port_name, + CORBA::ORB_ptr orb); // Méthode temporaire en attendant d'avoir des méthodes parallèles bien synchronisé static void wait_init_port(Engines_ParallelDSC_i * par_compo, - std::string port_name, - CORBA::ORB_ptr orb); + std::string port_name, + CORBA::ORB_ptr orb); private: // Buffers pour la réception et l'envoi Ports::Param_Double_Port::seq_double * _seq_data; diff --git a/src/DSC/ParallelDSC/Param_Double_Port_uses_i.cxx b/src/DSC/ParallelDSC/Param_Double_Port_uses_i.cxx index e06906f01..0c8cee1af 100644 --- a/src/DSC/ParallelDSC/Param_Double_Port_uses_i.cxx +++ b/src/DSC/ParallelDSC/Param_Double_Port_uses_i.cxx @@ -23,8 +23,8 @@ #include "Param_Double_Port_uses_i.hxx" Param_Double_Port_uses_i::Param_Double_Port_uses_i(Engines_ParallelDSC_i * par_compo, - std::string port_name, - CORBA::ORB_ptr orb) + std::string port_name, + CORBA::ORB_ptr orb) { _orb = CORBA::ORB::_duplicate(orb); _fake_properties = new PortProperties_i(); @@ -54,8 +54,8 @@ void Param_Double_Port_uses_i::add_port_to_component() { _par_compo->add_uses_port("IDL:Ports/Param_Double_Port:1.0", - _port_name.c_str(), - _fake_prop_ref); + _port_name.c_str(), + _fake_prop_ref); } void diff --git a/src/DSC/ParallelDSC/Param_Double_Port_uses_i.hxx b/src/DSC/ParallelDSC/Param_Double_Port_uses_i.hxx index fa2e725d7..b42b1d337 100644 --- a/src/DSC/ParallelDSC/Param_Double_Port_uses_i.hxx +++ b/src/DSC/ParallelDSC/Param_Double_Port_uses_i.hxx @@ -36,8 +36,8 @@ class Param_Double_Port_uses_i { public : Param_Double_Port_uses_i(Engines_ParallelDSC_i * par_compo, - std::string port_name, - CORBA::ORB_ptr orb); + std::string port_name, + CORBA::ORB_ptr orb); virtual ~Param_Double_Port_uses_i(); // Port local init methods diff --git a/src/HDFPersist/HDFascii.hxx b/src/HDFPersist/HDFascii.hxx index 8dc4d405a..e51edfb30 100644 --- a/src/HDFPersist/HDFascii.hxx +++ b/src/HDFPersist/HDFascii.hxx @@ -36,9 +36,9 @@ class HDFPERSIST_EXPORT HDFascii public: static char* ConvertFromHDFToASCII(const char* thePath, - bool isReplaced = true, - const char* theExtension = NULL); - + bool isReplaced = true, + const char* theExtension = NULL); + static char* ConvertFromASCIIToHDF(const char* thePath); static bool isASCII(const char* thePath); diff --git a/src/HDFPersist/HDFattrGetType.c b/src/HDFPersist/HDFattrGetType.c index 671558867..9b78a4b86 100644 --- a/src/HDFPersist/HDFattrGetType.c +++ b/src/HDFPersist/HDFattrGetType.c @@ -46,9 +46,9 @@ HDFattrGetType(hdf_idt id) case H5T_INTEGER : size = H5Tget_size(type_id); if (size == 4) - type = HDF_INT32; + type = HDF_INT32; else - type = HDF_INT64; + type = HDF_INT64; break; case H5T_FLOAT : diff --git a/src/HDFPersist/HDFdataset.hxx b/src/HDFPersist/HDFdataset.hxx index 53db3a70f..a221f8ca0 100644 --- a/src/HDFPersist/HDFdataset.hxx +++ b/src/HDFPersist/HDFdataset.hxx @@ -48,7 +48,7 @@ private : public: HDFdataset(const char *name, HDFcontainerObject *father,hdf_type type, - hdf_size dim[],int dimsize, hdf_byte_order order = H5T_ORDER_NONE); + hdf_size dim[],int dimsize, hdf_byte_order order = H5T_ORDER_NONE); HDFdataset(const char *name,HDFcontainerObject *father); virtual ~HDFdataset(); diff --git a/src/HDFPersist/HDFdatasetCreate.c b/src/HDFPersist/HDFdatasetCreate.c index 12e8e79be..633f1e88f 100644 --- a/src/HDFPersist/HDFdatasetCreate.c +++ b/src/HDFPersist/HDFdatasetCreate.c @@ -42,7 +42,7 @@ SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) */ hdf_idt HDFdatasetCreate(hdf_idt pid,char *name,hdf_type type, - hdf_size *dimd, int ndim, hdf_byte_order order) + hdf_size *dimd, int ndim, hdf_byte_order order) { hdf_idt dataset, dataspace = 0; hdf_err ret; @@ -72,9 +72,9 @@ hdf_idt HDFdatasetCreate(hdf_idt pid,char *name,hdf_type type, case HDF_STRING : if((new_type_hdf = H5Tcopy(H5T_C_S1)) < 0) - return -1; + return -1; if((ret = H5Tset_size(new_type_hdf,1)) < 0) - return -1; + return -1; break; default : @@ -94,12 +94,12 @@ hdf_idt HDFdatasetCreate(hdf_idt pid,char *name,hdf_type type, if ((dataset = H5Dopen(pid,name)) < 0) { - if ((dataspace = H5Screate_simple(ndim, dimd, NULL)) < 0) - return -1; + if ((dataspace = H5Screate_simple(ndim, dimd, NULL)) < 0) + return -1; if ((dataset = H5Dcreate(pid,name, new_type_hdf < 0 ? type_hdf : new_type_hdf, dataspace, H5P_DEFAULT)) < 0) - return -1; + return -1; } else return -1; diff --git a/src/HDFPersist/HDFdatasetGetDim.c b/src/HDFPersist/HDFdatasetGetDim.c index b3a504585..c2a5abd61 100644 --- a/src/HDFPersist/HDFdatasetGetDim.c +++ b/src/HDFPersist/HDFdatasetGetDim.c @@ -52,4 +52,4 @@ HDFdatasetGetDim(hdf_idt id,hdf_size dim[]) return ret; } - + diff --git a/src/HDFPersist/HDFdatasetGetType.c b/src/HDFPersist/HDFdatasetGetType.c index 93e2570f1..39dcbdbe1 100644 --- a/src/HDFPersist/HDFdatasetGetType.c +++ b/src/HDFPersist/HDFdatasetGetType.c @@ -43,9 +43,9 @@ HDFdatasetGetType(hdf_idt id) case H5T_INTEGER : size = H5Tget_size(type_id); if (size == 4) - type = HDF_INT32; + type = HDF_INT32; else - type = HDF_INT64; + type = HDF_INT64; break; case H5T_FLOAT : diff --git a/src/HDFPersist/HDFdatasetWrite.c b/src/HDFPersist/HDFdatasetWrite.c index 1d7052b83..79dcf526f 100644 --- a/src/HDFPersist/HDFdatasetWrite.c +++ b/src/HDFPersist/HDFdatasetWrite.c @@ -60,7 +60,7 @@ hdf_err HDFdatasetWrite(hdf_idt id, void *val) hdf_size *dim = (hdf_size *) malloc(sizeof(hdf_size)*ndim); if ((ret = HDFdatasetGetDim(id, dim)) < 0) return -1; - + for(i=0; i> File Exploration " ); for (explorer->Init();explorer->More();explorer->Next()) - { - object = explorer->Value(); - MESSAGE( "--> Name of the object : " << object->GetName() ); - switch (object->GetObjectType()) - { - case HDF_FILE : - MESSAGE( "--> Type of the object : HDF_FILE : " ); - break; - - case HDF_GROUP : - MESSAGE( "--> Type of the object : HDF_GROUP : " ); - break; - - case HDF_DATASET : - MESSAGE( "--> Type of the object : HDF_DATASET : " ); - break; - - default : - MESSAGE( "--> PANIC !!! : " ); - } - } + { + object = explorer->Value(); + MESSAGE( "--> Name of the object : " << object->GetName() ); + switch (object->GetObjectType()) + { + case HDF_FILE : + MESSAGE( "--> Type of the object : HDF_FILE : " ); + break; + + case HDF_GROUP : + MESSAGE( "--> Type of the object : HDF_GROUP : " ); + break; + + case HDF_DATASET : + MESSAGE( "--> Type of the object : HDF_DATASET : " ); + break; + + default : + MESSAGE( "--> PANIC !!! : " ); + } + } MESSAGE( ">> Group exploration" ); explorer->Reset(hdf_group); for (explorer->Init();explorer->More();explorer->Next()) - { - object = explorer->Value(); - MESSAGE( "--> Name of the object : " << object->GetName() ); - switch (object->GetObjectType()) - { - case HDF_FILE : - MESSAGE( "--> Type of the object : HDF_FILE : " ); - break; - - case HDF_GROUP : - MESSAGE( "--> Type of the object : HDF_GROUP : " ); - break; - - case HDF_DATASET : - MESSAGE( "--> Type of the object : HDF_DATASET : " ); - break; - - default : - MESSAGE( "--> !!! PANIC !!! : " ); - } - } + { + object = explorer->Value(); + MESSAGE( "--> Name of the object : " << object->GetName() ); + switch (object->GetObjectType()) + { + case HDF_FILE : + MESSAGE( "--> Type of the object : HDF_FILE : " ); + break; + + case HDF_GROUP : + MESSAGE( "--> Type of the object : HDF_GROUP : " ); + break; + + case HDF_DATASET : + MESSAGE( "--> Type of the object : HDF_DATASET : " ); + break; + + default : + MESSAGE( "--> !!! PANIC !!! : " ); + } + } // memory clean MESSAGE( ">> MEMORY CLEAN " ); diff --git a/src/HDFPersist/test4.cxx b/src/HDFPersist/test4.cxx index 80d4072ec..f7423e46b 100644 --- a/src/HDFPersist/test4.cxx +++ b/src/HDFPersist/test4.cxx @@ -54,30 +54,30 @@ int main() // It is possible to read the name of all (objects) sons in the file n = hdf_file->nInternalObjects(); for (i=0;iInternalObjectIndentify(i,name); - MESSAGE( "--> First Level Internal Object Name : " << name ); - } + { + hdf_file->InternalObjectIndentify(i,name); + MESSAGE( "--> First Level Internal Object Name : " << name ); + } // Or it is possible to ask if an object is in the file if (hdf_file->ExistInternalObject("MESH")) - MESSAGE( "--> The object naming 'MESH' is in the file " ); + MESSAGE( "--> The object naming 'MESH' is in the file " ); // it is possible to determine the type of an object type = hdf_file->InternalObjectType("MESH"); switch (type) - { - case HDF_GROUP : - MESSAGE( "--> Its type is HDF_GROUP" ); - break; - - case HDF_DATASET : - MESSAGE( "--> Its type is HDF_DATASET" ); - break; - - default : - MESSAGE( "--> !!!! PANIC !!!" ); - } + { + case HDF_GROUP : + MESSAGE( "--> Its type is HDF_GROUP" ); + break; + + case HDF_DATASET : + MESSAGE( "--> Its type is HDF_DATASET" ); + break; + + default : + MESSAGE( "--> !!!! PANIC !!!" ); + } hdf_group = new HDFgroup(name,hdf_file); MESSAGE( ">> A new HDF group object " << name << " is created in memory") @@ -89,24 +89,24 @@ int main() n = hdf_group->nInternalObjects(); MESSAGE( ">> There are " << n << " objects in this group " ); for (i=0;iInternalObjectIndentify(i,name); - type = hdf_group->InternalObjectType(name); - MESSAGE( "--> First Level Internal Object Name : " << name ); - switch (type) - { - case HDF_GROUP : - MESSAGE( "--> Its type is HDF_GROUP" ); - break; - - case HDF_DATASET : - MESSAGE( "--> Its type is HDF_DATASET" ); - break; - - default : - MESSAGE( "--> !!!! PANIC !!!" ); - } - } + { + hdf_group->InternalObjectIndentify(i,name); + type = hdf_group->InternalObjectType(name); + MESSAGE( "--> First Level Internal Object Name : " << name ); + switch (type) + { + case HDF_GROUP : + MESSAGE( "--> Its type is HDF_GROUP" ); + break; + + case HDF_DATASET : + MESSAGE( "--> Its type is HDF_DATASET" ); + break; + + default : + MESSAGE( "--> !!!! PANIC !!!" ); + } + } // The first dataset object 'COORDINATES' hdf_dataset1 = new HDFdataset("COORDINATES",hdf_group); @@ -117,19 +117,19 @@ int main() data_type = hdf_dataset1->GetType(); switch(data_type) - { - case HDF_INT32 : - MESSAGE( "--> Type of data : HDF_INT32 " ); - break; - case HDF_INT64 : - MESSAGE( "--> Type of data : HDF_INT64 " ); - break; - case HDF_FLOAT64 : - MESSAGE( "--> Type of data : HDF_FLOAT64 " ); - break; - default : - MESSAGE( "--> Type of data : HDF_STRING " ); - } + { + case HDF_INT32 : + MESSAGE( "--> Type of data : HDF_INT32 " ); + break; + case HDF_INT64 : + MESSAGE( "--> Type of data : HDF_INT64 " ); + break; + case HDF_FLOAT64 : + MESSAGE( "--> Type of data : HDF_FLOAT64 " ); + break; + default : + MESSAGE( "--> Type of data : HDF_STRING " ); + } ndim = hdf_dataset1->nDim(); MESSAGE( "--> Number of dimensions : " << ndim ); @@ -137,7 +137,7 @@ int main() dim = new hdf_size[ndim]; hdf_dataset1->GetDim(dim); for (i=0;i Dimension " << i+1 << " of size : " << dim[i] ); + MESSAGE( "--> Dimension " << i+1 << " of size : " << dim[i] ); delete dim; size = hdf_dataset1->GetSize(); @@ -145,7 +145,7 @@ int main() hdf_dataset1->ReadFromDisk(val1); MESSAGE( "--> The values are : "); for (i=0;iGetType(); switch(data_type) - { - case HDF_INT32 : - MESSAGE( "--> Type of data : HDF_INT32 " ); - break; - case HDF_INT64 : - MESSAGE( "--> Type of data : HDF_INT64 " ); - break; - case HDF_FLOAT64 : - MESSAGE( "--> Type of data : HDF_FLOAT64 " ); - break; - default : - MESSAGE( "--> Type of data : HDF_STRING " ); - } + { + case HDF_INT32 : + MESSAGE( "--> Type of data : HDF_INT32 " ); + break; + case HDF_INT64 : + MESSAGE( "--> Type of data : HDF_INT64 " ); + break; + case HDF_FLOAT64 : + MESSAGE( "--> Type of data : HDF_FLOAT64 " ); + break; + default : + MESSAGE( "--> Type of data : HDF_STRING " ); + } ndim = hdf_dataset2->nDim(); MESSAGE( "--> Number of dimensions : " << ndim ); @@ -181,7 +181,7 @@ int main() dim = new hdf_size[ndim]; hdf_dataset2->GetDim(dim); for (i=0;i Dimension " << i+1 << " of size : " << dim[i] ); + MESSAGE( "--> Dimension " << i+1 << " of size : " << dim[i] ); delete dim; size = hdf_dataset2->GetSize(); @@ -189,7 +189,7 @@ int main() hdf_dataset2->ReadFromDisk(val2); MESSAGE( "--> The values are : "); for (i=0;i There are " << m << " objects in the group" ); for (i=0;iInternalObjectIndentify(i,name); - MESSAGE( "--> First Level Internal Object Name : " << name ); - } + { + geom->InternalObjectIndentify(i,name); + MESSAGE( "--> First Level Internal Object Name : " << name ); + } geom1 = new HDFgroup("GEOM_1",geom); MESSAGE( ">> The HDF group object is created for 'GEOM_1' with 'GEOM' as father" ); @@ -116,7 +116,7 @@ int main() MESSAGE( ">> The same operations have been done for the file 'mesh.hdf'" ) MESSAGE( " and the groups MESH_1 and MESH_2" ) MESSAGE( "--> This file has been mounted on the group 'MESH' of the file 'study.hdf' ") - + study->CloseOnDisk(); MESSAGE( ">> The study.hdf file is closed" ); diff --git a/src/KERNEL_PY/salome.py b/src/KERNEL_PY/salome.py index 00371c488..f6afea4d1 100755 --- a/src/KERNEL_PY/salome.py +++ b/src/KERNEL_PY/salome.py @@ -86,6 +86,43 @@ from salome_kernel import * from salome_study import * from salome_iapp import * + +# +# The next block is workaround for the problem of shared symbols loading for the extension modules (e.g. SWIG-generated) +# that causes RTTI unavailable in some cases. To solve this problem, sys.setdlopenflags() function is used. +# Depending on the Python version and platform, the dlopen flags can be defined in the dl, DLFUN or ctypes module. +# +import sys +flags = None +if not flags: + try: + # dl module can be unavailable + import dl + flags = dl.RTLD_NOW | dl.RTLD_GLOBAL + except: + pass + pass +if not flags: + try: + # DLFCN module can be unavailable + import DLFCN + flags = DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL + except: + pass + pass +if not flags: + try: + # ctypes module can be unavailable + import ctypes + flags = ctypes.RTLD_GLOBAL + except: + pass + pass + +if flags: + sys.setdlopenflags(flags) + pass + orb, lcc, naming_service, cm,sg=None,None,None,None,None myStudyManager, myStudyId, myStudy, myStudyName=None,None,None,None diff --git a/src/KERNEL_PY/salome_test.py b/src/KERNEL_PY/salome_test.py index 697feb2cf..88562415b 100755 --- a/src/KERNEL_PY/salome_test.py +++ b/src/KERNEL_PY/salome_test.py @@ -520,7 +520,7 @@ try: med_obj = visu_gui.visu.getMedObjectFromStudy() print "med_obj - ", med_obj - myField1 = visu_gui.visu.getFieldObjectFromStudy(2,1) + myField1 = visu_gui.visu.getFieldObjectFromStudy(3,1) aMeshName = "maa1" anEntity = VISU.NODE aTimeStampId = -1 diff --git a/src/Launcher/BatchTest.cxx b/src/Launcher/BatchTest.cxx index 591db823f..621554796 100644 --- a/src/Launcher/BatchTest.cxx +++ b/src/Launcher/BatchTest.cxx @@ -69,14 +69,14 @@ BatchTest::test() { bool rtn = false; INFOS(std::endl - << "--- Testing batch Machine :" << std::endl - << "--- Name : " << _batch_descr.hostname << std::endl - << "--- hostname : " << _batch_descr.hostname << std::endl - << "--- Protocol : " << _batch_descr.protocol << std::endl - << "--- User Name : " << _batch_descr.username << std::endl - << "--- Batch Type : " << _batch_descr.batch << std::endl - << "--- MPI Impl : " << _batch_descr.mpiImpl << std::endl - << "--- Appli Path : " << _batch_descr.applipath << std::endl + << "--- Testing batch Machine :" << std::endl + << "--- Name : " << _batch_descr.hostname << std::endl + << "--- hostname : " << _batch_descr.hostname << std::endl + << "--- Protocol : " << _batch_descr.protocol << std::endl + << "--- User Name : " << _batch_descr.username << std::endl + << "--- Batch Type : " << _batch_descr.batch << std::endl + << "--- MPI Impl : " << _batch_descr.mpiImpl << std::endl + << "--- Appli Path : " << _batch_descr.applipath << std::endl ); std::string result_connection("Not Tested"); @@ -94,13 +94,13 @@ BatchTest::test() result_appli = test_appli(); INFOS(std::endl - << "--- Test results" << std::endl - << "--- Connection : " << result_connection << std::endl - << "--- File copy : " << result_filecopy << std::endl - << "--- Get results : " << result_getresult << std::endl - << "--- Submit simple job : " << result_jobsubmit_simple << std::endl - << "--- Submit mpi job : " << result_jobsubmit_mpi << std::endl - << "--- Application : " << result_appli << std::endl + << "--- Test results" << std::endl + << "--- Connection : " << result_connection << std::endl + << "--- File copy : " << result_filecopy << std::endl + << "--- Get results : " << result_getresult << std::endl + << "--- Submit simple job : " << result_jobsubmit_simple << std::endl + << "--- Submit mpi job : " << result_jobsubmit_mpi << std::endl + << "--- Application : " << result_appli << std::endl ); if (result_connection == "OK" && @@ -144,8 +144,8 @@ BatchTest::test_connection() // Build command command += protocol - + " " - + username + "@" + hostname; + + " " + + username + "@" + hostname; // Test status = system(command.c_str()); @@ -196,7 +196,7 @@ BatchTest::test_filecopy() if(protocol == "rsh") command = "rcp"; command += " " + _test_filename + " " - + username + "@" + hostname + ":" + home; + + username + "@" + hostname + ":" + home; // Test status = system(command.c_str()); @@ -236,7 +236,7 @@ BatchTest::test_getresult() if(protocol == "rsh") command = "rcp"; command += " " + username + "@" + hostname + ":" + home - + "/" + _base_filename + " " + _test_filename + "_copy"; + + "/" + _base_filename + " " + _test_filename + "_copy"; // Test status = system(command.c_str()); @@ -336,7 +336,7 @@ BatchTest::test_jobsubmit_simple() if(protocol == "rsh") command = "rcp"; command += " " + _test_file_simple + " " - + username + "@" + hostname + ":" + home; + + username + "@" + hostname + ":" + home; status = system(command.c_str()); if(status) { std::ostringstream oss; @@ -396,7 +396,7 @@ BatchTest::test_jobsubmit_simple() if(protocol == "rsh") command = "rcp"; command += " " - + username + "@" + hostname + ":" + home + "/" + _date + "_simple* /tmp"; + + username + "@" + hostname + ":" + home + "/" + _date + "_simple* /tmp"; status = system(command.c_str()); if(status) { std::ostringstream oss; @@ -500,7 +500,7 @@ BatchTest::test_jobsubmit_mpi() std::ofstream file_script; file_script.open(_test_file_script.c_str(), std::ofstream::out); file_script << "#!/bin/bash\n" - << "echo HELLO MPI\n"; + << "echo HELLO MPI\n"; file_script.flush(); file_script.close(); #ifdef WIN32 @@ -514,13 +514,13 @@ BatchTest::test_jobsubmit_mpi() std::ofstream file_mpi; file_mpi.open(_test_file_mpi.c_str(), std::ofstream::out); file_mpi << "#!/bin/bash\n" - << "#PBS -l nodes=1\n" - << "#PBS -l walltime=00:01:00\n" - << "#PBS -o " << home << "/" << _date << "_mpi_output.log\n" - << "#PBS -e " << home << "/" << _date << "_mpi_error.log\n" - << mpiImpl->boot("${PBS_NODEFILE}", 1) - << mpiImpl->run("${PBS_NODEFILE}", 1, _base_filename + "_script") - << mpiImpl->halt(); + << "#PBS -l nodes=1\n" + << "#PBS -l walltime=00:01:00\n" + << "#PBS -o " << home << "/" << _date << "_mpi_output.log\n" + << "#PBS -e " << home << "/" << _date << "_mpi_error.log\n" + << mpiImpl->boot("${PBS_NODEFILE}", 1) + << mpiImpl->run("${PBS_NODEFILE}", 1, _base_filename + "_script") + << mpiImpl->halt(); file_mpi.flush(); file_mpi.close(); @@ -530,7 +530,7 @@ BatchTest::test_jobsubmit_mpi() if(protocol == "rsh") command = "rcp"; command += " " + _test_file_script + " " - + username + "@" + hostname + ":" + home; + + username + "@" + hostname + ":" + home; status = system(command.c_str()); if(status) { std::ostringstream oss; @@ -543,7 +543,7 @@ BatchTest::test_jobsubmit_mpi() if(protocol == "rsh") command = "rcp"; command += " " + _test_file_mpi + " " - + username + "@" + hostname + ":" + home; + + username + "@" + hostname + ":" + home; status = system(command.c_str()); if(status) { std::ostringstream oss; @@ -603,7 +603,7 @@ BatchTest::test_jobsubmit_mpi() if(protocol == "rsh") command = "rcp"; command += " " - + username + "@" + hostname + ":" + home + "/" + _date + "_mpi* /tmp"; + + username + "@" + hostname + ":" + home + "/" + _date + "_mpi* /tmp"; status = system(command.c_str()); if(status) { std::ostringstream oss; @@ -665,12 +665,12 @@ BatchTest::test_appli() std::ofstream file_appli; file_appli.open(_test_file_appli.c_str(), std::ofstream::out); file_appli << "#!/bin/bash\n" - << "if [ -f " << applipath << "/runAppli ]\n" - << "then\n" - << " echo OK\n" - << "else\n" - << " echo NOK\n" - << "fi\n"; + << "if [ -f " << applipath << "/runAppli ]\n" + << "then\n" + << " echo OK\n" + << "else\n" + << " echo NOK\n" + << "fi\n"; file_appli.flush(); file_appli.close(); @@ -679,7 +679,7 @@ BatchTest::test_appli() if(protocol == "rsh") command = "rcp"; command += " " + _test_file_appli + " " - + username + "@" + hostname + ":" + home; + + username + "@" + hostname + ":" + home; status = system(command.c_str()); if(status) { std::ostringstream oss; @@ -691,8 +691,8 @@ BatchTest::test_appli() // Launch test command = protocol + " " + username + "@" + hostname - + " sh " + home + "/" + _base_filename + "_appli_test > " - + _test_filename + "_appli_test_result"; + + " sh " + home + "/" + _base_filename + "_appli_test > " + + _test_filename + "_appli_test_result"; status = system(command.c_str()); if(status) { diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index f2f97aa52..01b224ead 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -297,7 +297,7 @@ Launcher_cpp::removeJob(int job_id) //============================================================================= long Launcher_cpp::createJobWithFile(const std::string xmlExecuteFile, - const std::string clusterName) + const std::string clusterName) { LAUNCHER_MESSAGE("Begin of Launcher_cpp::createJobWithFile"); @@ -473,7 +473,7 @@ long Launcher_cpp::createJobWithFile( const std::string xmlExecuteFile, std::string clusterName) { throw LauncherException("Method Launcher_cpp::createJobWithFile is not available " - "(libBatch was not present at compilation time)"); + "(libBatch was not present at compilation time)"); return 0; } diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index 835d752f7..d8538594a 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -74,12 +74,12 @@ Launcher::Job::~Job() void Launcher::Job::setState(const std::string & state) { - // State of a Job: CREATED, QUEUED, RUNNING, FINISHED, ERROR + // State of a Job: CREATED, QUEUED, RUNNING, FINISHED, FAILED if (state != "CREATED" and state != "QUEUED" and state != "RUNNING" and state != "FINISHED" and - state != "ERROR") + state != "FAILED") { throw LauncherException("Bad state, this state does not exist: " + state); } @@ -353,9 +353,9 @@ Launcher::Job::getLaunchDate() int i = 0 ; for (;i < launch_date.size(); i++) if (launch_date[i] == '/' or - launch_date[i] == '-' or - launch_date[i] == ':' or - launch_date[i] == ' ') + launch_date[i] == '-' or + launch_date[i] == ':' or + launch_date[i] == ' ') launch_date[i] = '_'; launch_date.erase(--launch_date.end()); // Last caracter is a \n @@ -374,9 +374,10 @@ Launcher::Job::updateJobState() LAUNCHER_MESSAGE("State received is: " << par[STATE].str()); + // TODO: Remove this if all tests pass with the new libBatch, otherwise fix the codes in libBatch // Patch until new LIBBATCH version // eSSH Client and ePBS Client and eSGE - if (par[STATE].str() == "Running" or par[STATE].str() == "E" or par[STATE].str() == "R" or par[STATE].str() == "r" or par[STATE].str() == "RUN") +/* if (par[STATE].str() == "Running" or par[STATE].str() == "E" or par[STATE].str() == "R" or par[STATE].str() == "r" or par[STATE].str() == "RUN") _state = "RUNNING"; else if (par[STATE].str() == "Stopped") _state = "PAUSED"; @@ -385,7 +386,8 @@ Launcher::Job::updateJobState() else if (par[STATE].str() == "Dead" or par[STATE].str() == "Eqw") _state = "ERROR"; else if (par[STATE].str() == "Q" or par[STATE].str() == "qw" or par[STATE].str() == "PEN") - _state = "QUEUED"; + _state = "QUEUED";*/ + _state = par[STATE].str(); } #endif return _state; @@ -424,7 +426,7 @@ Launcher::Job::common_job_params() int i = 0 ; while ( i < lend ) { if ( thedate[i] == '/' || thedate[i] == '-' || thedate[i] == ':' ) { - thedate[i] = '_' ; + thedate[i] = '_' ; } i++ ; } diff --git a/src/Launcher/SALOME_Launcher.cxx b/src/Launcher/SALOME_Launcher.cxx index d65f42f7d..fafdc5e0f 100644 --- a/src/Launcher/SALOME_Launcher.cxx +++ b/src/Launcher/SALOME_Launcher.cxx @@ -244,7 +244,7 @@ SALOME_Launcher::removeJob(CORBA::Long job_id) //============================================================================= CORBA::Long SALOME_Launcher::createJobWithFile(const char * xmlExecuteFile, - const char * clusterName) + const char * clusterName) { CORBA::Long jobId; try{ diff --git a/src/Launcher/SALOME_Launcher_Handler.cxx b/src/Launcher/SALOME_Launcher_Handler.cxx index c9861c4e9..0a1040315 100755 --- a/src/Launcher/SALOME_Launcher_Handler.cxx +++ b/src/Launcher/SALOME_Launcher_Handler.cxx @@ -102,26 +102,26 @@ void SALOME_Launcher_Handler::ProcessXmlDocument(xmlDocPtr theDoc) if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_machine_list) ){ xmlNodePtr aCurNode2 = aCurNode->xmlChildrenNode; while(aCurNode2 != NULL){ - if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){ - _machp.Clear(); - xmlChar* name = xmlNodeGetContent(aCurNode2); - string clusterName = (const char*)name; - xmlFree(name); - - if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){ - xmlChar* envfile = xmlGetProp(aCurNode2, (const xmlChar*)test_env_file); - _machp.EnvFile = (const char*)envfile; - xmlFree(envfile); - } - - if (xmlHasProp(aCurNode2, (const xmlChar*)test_work_directory)){ - xmlChar* workdirectory = xmlGetProp(aCurNode2, (const xmlChar*)test_work_directory); - _machp.WorkDirectory = (const char*)workdirectory; - xmlFree(workdirectory); - } - _launch.MachinesList[clusterName]=_machp ; - } - aCurNode2 = aCurNode2->next; + if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){ + _machp.Clear(); + xmlChar* name = xmlNodeGetContent(aCurNode2); + string clusterName = (const char*)name; + xmlFree(name); + + if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){ + xmlChar* envfile = xmlGetProp(aCurNode2, (const xmlChar*)test_env_file); + _machp.EnvFile = (const char*)envfile; + xmlFree(envfile); + } + + if (xmlHasProp(aCurNode2, (const xmlChar*)test_work_directory)){ + xmlChar* workdirectory = xmlGetProp(aCurNode2, (const xmlChar*)test_work_directory); + _machp.WorkDirectory = (const char*)workdirectory; + xmlFree(workdirectory); + } + _launch.MachinesList[clusterName]=_machp ; + } + aCurNode2 = aCurNode2->next; } } @@ -130,31 +130,31 @@ void SALOME_Launcher_Handler::ProcessXmlDocument(xmlDocPtr theDoc) _launch.RefDirectory = (const char*)refdirectory; xmlFree(refdirectory); } - + if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_nb_processes) ){ xmlChar* nbofprocesses = xmlNodeGetContent(aCurNode); _launch.NbOfProcesses = atoi((const char*)nbofprocesses); xmlFree(nbofprocesses); } - + if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_input_file) ){ xmlChar* inputfile = xmlNodeGetContent(aCurNode); _launch.InputFile.push_back((const char*)inputfile); xmlFree(inputfile); } - + if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_output_file) ){ xmlChar* outputfile = xmlNodeGetContent(aCurNode); _launch.OutputFile.push_back((const char*)outputfile); xmlFree(outputfile); } - + if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_command) ){ xmlChar* command = xmlNodeGetContent(aCurNode); _launch.Command = (const char*)command; xmlFree(command); } - + aCurNode = aCurNode->next; } diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx index 6a6f1335b..441cc8943 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx @@ -56,7 +56,7 @@ SALOME_FileTransferCORBA::SALOME_FileTransferCORBA() //============================================================================= SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(Engines::fileRef_ptr - aFileRef) + aFileRef) { MESSAGE("SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(aFileRef)"); _theFileRef = aFileRef; @@ -73,11 +73,11 @@ SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(Engines::fileRef_ptr //============================================================================= SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(string refMachine, - string origFileName, - string containerName) + string origFileName, + string containerName) { MESSAGE("SALOME_FileTransferCORBA::SALOME_FileTransferCORBA" - << refMachine << " " << origFileName << " " << containerName); + << refMachine << " " << origFileName << " " << containerName); _refMachine = refMachine; _origFileName = origFileName; _containerName = containerName; @@ -117,10 +117,10 @@ string SALOME_FileTransferCORBA::getLocalFile(string localFile) if (CORBA::is_nil(_theFileRef)) { if (_refMachine.empty() || _origFileName.empty()) - { - INFOS("not enough parameters: machine and file name must be given"); - return ""; - } + { + INFOS("not enough parameters: machine and file name must be given"); + return ""; + } SALOME_LifeCycleCORBA LCC; Engines::ContainerManager_var contManager = LCC.getContainerManager(); @@ -136,17 +136,17 @@ string SALOME_FileTransferCORBA::getLocalFile(string localFile) new_params.mode = CORBA::string_dup("findorstart"); container = contManager->GiveContainer(new_params); if (CORBA::is_nil(container)) - { - INFOS("machine " << _refMachine << " unreachable"); - return ""; - } + { + INFOS("machine " << _refMachine << " unreachable"); + return ""; + } _theFileRef = container->createFileRef(_origFileName.c_str()); if (CORBA::is_nil(_theFileRef)) - { - INFOS("impossible to create fileRef on " << _refMachine); - return ""; - } + { + INFOS("impossible to create fileRef on " << _refMachine); + return ""; + } } container = _theFileRef->getContainer(); @@ -158,56 +158,56 @@ string SALOME_FileTransferCORBA::getLocalFile(string localFile) if (localCopy.empty()) // no existing copy available { if (localFile.empty()) // no name provided for local copy - { - char bufName[256]; - localCopy = tmpnam(bufName); - localFile = bufName; - SCRUTE(localFile); - } + { + char bufName[256]; + localCopy = tmpnam(bufName); + localFile = bufName; + SCRUTE(localFile); + } FILE* fp; if ((fp = fopen(localFile.c_str(),"wb")) == NULL) - { - INFOS("file " << localFile << " cannot be open for writing"); - return ""; - } + { + INFOS("file " << localFile << " cannot be open for writing"); + return ""; + } Engines::fileTransfer_var fileTransfer = container->getFileTransfer(); ASSERT(! CORBA::is_nil(fileTransfer)); CORBA::Long fileId = fileTransfer->open(_origFileName.c_str()); if (fileId > 0) - { - Engines::fileBlock* aBlock; - int toFollow = 1; - int ctr=0; - while (toFollow) - { - ctr++; - SCRUTE(ctr); - aBlock = fileTransfer->getBlock(fileId); - toFollow = aBlock->length(); - SCRUTE(toFollow); - CORBA::Octet *buf = aBlock->get_buffer(); + { + Engines::fileBlock* aBlock; + int toFollow = 1; + int ctr=0; + while (toFollow) + { + ctr++; + SCRUTE(ctr); + aBlock = fileTransfer->getBlock(fileId); + toFollow = aBlock->length(); + SCRUTE(toFollow); + CORBA::Octet *buf = aBlock->get_buffer(); #if defined(_DEBUG_) || defined(_DEBUG) - int nbWri = fwrite(buf, sizeof(CORBA::Octet), toFollow, fp); - ASSERT(nbWri == toFollow); + int nbWri = fwrite(buf, sizeof(CORBA::Octet), toFollow, fp); + ASSERT(nbWri == toFollow); #else - fwrite(buf, sizeof(CORBA::Octet), toFollow, fp); + fwrite(buf, sizeof(CORBA::Octet), toFollow, fp); #endif delete aBlock; - } - fclose(fp); - MESSAGE("end of transfer"); - fileTransfer->close(fileId); - _theFileRef->addRef(myMachine.c_str(), localFile.c_str()); - localCopy = localFile; - } + } + fclose(fp); + MESSAGE("end of transfer"); + fileTransfer->close(fileId); + _theFileRef->addRef(myMachine.c_str(), localFile.c_str()); + localCopy = localFile; + } else - { - INFOS("open reference file for copy impossible"); - return ""; - } + { + INFOS("open reference file for copy impossible"); + return ""; + } } SCRUTE(localCopy); diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx index 20ba9dcc4..d847bedfc 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.hxx @@ -52,8 +52,8 @@ public: SALOME_FileTransferCORBA(); SALOME_FileTransferCORBA(Engines::fileRef_ptr aFileRef); SALOME_FileTransferCORBA(std::string refMachine, - std::string origFileName, - std::string containerName=""); + std::string origFileName, + std::string containerName=""); virtual ~SALOME_FileTransferCORBA(); diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index c3e25f02e..c1c8b1a57 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -131,8 +131,8 @@ SALOME_LifeCycleCORBA::~SALOME_LifeCycleCORBA() //============================================================================= Engines::Component_ptr SALOME_LifeCycleCORBA::FindComponent(const Engines::MachineParameters& params, - const char *componentName, - int studyId) + const char *componentName, + int studyId) { if (! isKnownComponentClass(componentName)) return Engines::Component::_nil(); @@ -144,9 +144,9 @@ SALOME_LifeCycleCORBA::FindComponent(const Engines::MachineParameters& params, Engines::ResourceList_var listOfResources = _ResManager->GetFittingResources(new_params.resource_params); Engines::Component_var compo = _FindComponent(new_params, - componentName, - studyId, - listOfResources); + componentName, + studyId, + listOfResources); return compo._retn(); } @@ -163,8 +163,8 @@ SALOME_LifeCycleCORBA::FindComponent(const Engines::MachineParameters& params, Engines::Component_ptr SALOME_LifeCycleCORBA::LoadComponent(const Engines::MachineParameters& params, - const char *componentName, - int studyId) + const char *componentName, + int studyId) { // --- Check if Component Name is known in ModuleCatalog @@ -180,8 +180,8 @@ SALOME_LifeCycleCORBA::LoadComponent(const Engines::MachineParameters& params, new_params.resource_params.resList = listOfResources; Engines::Component_var compo = _LoadComponent(new_params, - componentName, - studyId); + componentName, + studyId); return compo._retn(); } @@ -200,8 +200,8 @@ SALOME_LifeCycleCORBA::LoadComponent(const Engines::MachineParameters& params, Engines::Component_ptr SALOME_LifeCycleCORBA:: FindOrLoad_Component(const Engines::MachineParameters& params, - const char *componentName, - int studyId) + const char *componentName, + int studyId) { // --- Check if Component Name is known in ModuleCatalog @@ -223,16 +223,16 @@ FindOrLoad_Component(const Engines::MachineParameters& params, Engines::ResourceList_var listOfResources = _ResManager->GetFittingResources(new_params.resource_params); Engines::Component_var compo = _FindComponent(new_params, - componentName, - studyId, - listOfResources); + componentName, + studyId, + listOfResources); if(CORBA::is_nil(compo)) { new_params.resource_params.resList = listOfResources; compo = _LoadComponent(new_params, - componentName, - studyId); + componentName, + studyId); } return compo._retn(); @@ -241,8 +241,8 @@ FindOrLoad_Component(const Engines::MachineParameters& params, Engines::Component_ptr SALOME_LifeCycleCORBA:: FindOrLoad_Component(const Engines::ContainerParameters& params, - const char *componentName, - int studyId) + const char *componentName, + int studyId) { // --- Check if Component Name is known in ModuleCatalog @@ -256,16 +256,16 @@ FindOrLoad_Component(const Engines::ContainerParameters& params, Engines::ResourceList_var listOfResources = _ResManager->GetFittingResources(new_params.resource_params); Engines::Component_var compo = _FindComponent(new_params, - componentName, - studyId, - listOfResources); + componentName, + studyId, + listOfResources); if(CORBA::is_nil(compo)) { new_params.resource_params.resList = listOfResources; compo = _LoadComponent(new_params, - componentName, - studyId); + componentName, + studyId); } return compo._retn(); @@ -285,7 +285,7 @@ FindOrLoad_Component(const Engines::ContainerParameters& params, Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName, - const char *componentName) + const char *componentName) { MESSAGE("SALOME_LifeCycleCORBA::FindOrLoad_Component INTERACTIF " << containerName << " " << componentName ) ; @@ -339,7 +339,7 @@ bool SALOME_LifeCycleCORBA::isKnownComponentClass(const char *componentName) if (CORBA::is_nil (compoInfo)) { INFOS("Catalog Error: Component not found in the catalog" ); - INFOS( componentName ); + INFOS( componentName ); return false; } else return true; @@ -431,7 +431,7 @@ void SALOME_LifeCycleCORBA::preSet( Engines::ContainerParameters& params) void SALOME_LifeCycleCORBA::convert(const Engines::MachineParameters& params_in, - Engines::ContainerParameters& params_out) + Engines::ContainerParameters& params_out) { SALOME_LifeCycleCORBA::preSet(params_out); @@ -590,7 +590,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() objLog = inc->resolve(name); SALOME_Logger::Logger_var logger = SALOME_Logger::Logger::_narrow(objLog); if ( !CORBA::is_nil(logger) ) - logger->shutdown(); + logger->shutdown(); } catch(...) { @@ -651,9 +651,9 @@ void SALOME_LifeCycleCORBA::killOmniNames() Engines::Component_ptr SALOME_LifeCycleCORBA:: _FindComponent(const Engines::ContainerParameters& params, - const char *componentName, - int studyId, - const Engines::ResourceList& listOfResources) + const char *componentName, + int studyId, + const Engines::ResourceList& listOfResources) { // --- build the list of machines on which the component is already running const char *containerName = params.container_name; @@ -668,9 +668,9 @@ _FindComponent(const Engines::ContainerParameters& params, { const char * currentResource = listOfResources[i]; CORBA::Object_var obj = _NS->ResolveComponent(currentResource, - containerName, - componentName, - nbproc); + containerName, + componentName, + nbproc); if (!CORBA::is_nil(obj)) resourcesOK[lghtOfresourcesOK++] = CORBA::string_dup(currentResource); } @@ -681,9 +681,9 @@ _FindComponent(const Engines::ContainerParameters& params, resourcesOK->length(lghtOfresourcesOK); CORBA::String_var bestResource = _ResManager->FindFirst(resourcesOK); CORBA::Object_var obj = _NS->ResolveComponent(bestResource, - containerName, - componentName, - nbproc); + containerName, + componentName, + nbproc); return Engines::Component::_narrow(obj); } else @@ -707,11 +707,11 @@ _FindComponent(const Engines::ContainerParameters& params, Engines::Component_ptr SALOME_LifeCycleCORBA:: _LoadComponent(const Engines::ContainerParameters& params, - const char *componentName, - int studyId) + const char *componentName, + int studyId) { MESSAGE("_LoadComponent, required " << params.container_name << - " " << componentName << " " << NbProc(params)); + " " << componentName << " " << NbProc(params)); Engines::ContainerParameters local_params(params); local_params.mode = CORBA::string_dup("findorstart"); diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx index 8287139f1..c2d7a825a 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx @@ -68,28 +68,28 @@ public: Engines::Component_ptr FindComponent(const Engines::MachineParameters& params, - const char *componentName, - int studyId=0); + const char *componentName, + int studyId=0); Engines::Component_ptr LoadComponent(const Engines::MachineParameters& params, - const char *componentName, - int studyId=0); + const char *componentName, + int studyId=0); Engines::Component_ptr FindOrLoad_Component(const Engines::MachineParameters& params, - const char *componentName, - int studyId =0); + const char *componentName, + int studyId =0); // SALOME 6 - Interface Engines::Component_ptr FindOrLoad_Component(const Engines::ContainerParameters& params, - const char *componentName, - int studyId =0); + const char *componentName, + int studyId =0); Engines::Component_ptr FindOrLoad_Component(const char *containerName, - const char *componentName); // for compatibility + const char *componentName); // for compatibility // Parallel extension Engines::Component_ptr @@ -120,7 +120,7 @@ public: // For SALOME 5.1.x // Will be deleted on SALOME 6 void convert(const Engines::MachineParameters& params_in, - Engines::ContainerParameters& params_out); + Engines::ContainerParameters& params_out); protected: /*! Establish if a component called "componentName" in a container called @@ -130,14 +130,14 @@ protected: */ Engines::Component_ptr _FindComponent(const Engines::ContainerParameters& params, - const char *componentName, - int studyId, - const Engines::ResourceList& listOfResources); + const char *componentName, + int studyId, + const Engines::ResourceList& listOfResources); Engines::Component_ptr _LoadComponent(const Engines::ContainerParameters& params, - const char *componentName, - int studyId); + const char *componentName, + int studyId); SALOME_NamingService *_NS; SALOME_NamingService *_NSnew; diff --git a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx index 7bf70e8c7..b7a6510e3 100644 --- a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx +++ b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx @@ -388,11 +388,11 @@ LifeCycleCORBATest::testFindOrLoad_Component_UnknownMachine() string containerName = "aFarAwayComputer"; containerName += "/theContainer"; // CPPUNIT_ASSERT_THROW(Engines::Component_var mycompo = -// _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");,SALOME::SALOME_Exception); +// _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent");,SALOME::SALOME_Exception); try { Engines::Component_var mycompo = - _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent"); + _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent"); } catch(const SALOME::SALOME_Exception &ex) { @@ -517,8 +517,8 @@ LifeCycleCORBATest::testFindOrLoad_Component_RemoteComputer() Engines::Component_var mycompo1 = _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent"); CPPUNIT_ASSERT_MESSAGE("Test validity requires connection to remote "\ - "computers from ResourcesCatalog", - !CORBA::is_nil(mycompo1)); + "computers from ResourcesCatalog", + !CORBA::is_nil(mycompo1)); // --- check narrow @@ -555,8 +555,8 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsRemoteComputer() Engines::Component_var mycompo1 = _LCC.FindOrLoad_Component(params,"SalomeTestComponent"); CPPUNIT_ASSERT_MESSAGE("Test validity requires connection to remote "\ - "computers from ResourcesCatalog", - !CORBA::is_nil(mycompo1)); + "computers from ResourcesCatalog", + !CORBA::is_nil(mycompo1)); // --- check narrow @@ -594,8 +594,8 @@ LifeCycleCORBATest::testFindOrLoad_Component_ParamsRemoteComputer2() Engines::Component_var mycompo1 = _LCC.FindOrLoad_Component(params,"SalomeTestComponent"); CPPUNIT_ASSERT_MESSAGE("Test validity requires connection to remote "\ - "computers from ResourcesCatalog", - !CORBA::is_nil(mycompo1)); + "computers from ResourcesCatalog", + !CORBA::is_nil(mycompo1)); // --- check narrow @@ -623,7 +623,7 @@ void LifeCycleCORBATest::testgetLocalFile_localComputer() string origFileName = getenv("KERNEL_ROOT_DIR"); origFileName += "/lib/salome/libSalomeLifeCycleCORBA.so.0.0.0"; SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(), - origFileName); + origFileName); string local = transfer.getLocalFile(); CPPUNIT_ASSERT(!local.empty()); CPPUNIT_ASSERT_EQUAL(local, origFileName); @@ -641,7 +641,7 @@ void LifeCycleCORBATest::testgetLocalFile_remoteComputer() string origFileName = getenv("KERNEL_ROOT_DIR"); origFileName += "/lib/salome/libSalomeContainer.so.0.0.0"; SALOME_FileTransferCORBA transfer( GetRemoteHost(), - origFileName); + origFileName); string local = transfer.getLocalFile(); CPPUNIT_ASSERT(!local.empty()); string local2 = transfer.getLocalFile(); @@ -695,10 +695,10 @@ string LifeCycleCORBATest::GetRemoteHost() Engines::ResourceDefinition_var resource_definition = resourcesManager->GetResourceDefinition(aMachine); string machine(resource_definition->hostname.in()); if (machine != localHost) - { - remoteHost = machine; - break; - } + { + remoteHost = machine; + break; + } } CPPUNIT_ASSERT(remoteHost != ""); return remoteHost; diff --git a/src/LifeCycleCORBA/TestContainerManager.cxx b/src/LifeCycleCORBA/TestContainerManager.cxx index 8ffa25872..0264c88c6 100644 --- a/src/LifeCycleCORBA/TestContainerManager.cxx +++ b/src/LifeCycleCORBA/TestContainerManager.cxx @@ -127,9 +127,9 @@ int main (int argc, char * argv[]) if(!CORBA::is_nil(cont)){ std::string basename = Kernel_Utils::GetBaseName(cont->name()); if(basename.compare(0,4,"cycl")==0) - cycle[cont->getHostName()]++; + cycle[cont->getHostName()]++; if(basename.compare(0,5,"first")==0) - first[cont->getHostName()]++; + first[cont->getHostName()]++; } } _ContManager->ShutdownContainers(); @@ -147,8 +147,8 @@ int main (int argc, char * argv[]) if(cycle[(*iter).first]/nbproc>cmax) cmax=cycle[(*iter).first]/nbproc; if(first[(*iter).first]/nbprocfmax){ - fmax=first[(*iter).first]/nbproc; - nbpmax = nbproc; + fmax=first[(*iter).first]/nbproc; + nbpmax = nbproc; } } } diff --git a/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx index b7d10383f..b3807bde8 100644 --- a/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/Test_LifeCycleCORBA.cxx @@ -66,7 +66,7 @@ int main (int argc, char * argv[]) MESSAGE("FindOrLoadComponent " + containerName + "/" + "SalomeTestComponent" ); Engines::Component_var mycompo = - _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent"); + _LCC.FindOrLoad_Component(containerName.c_str(),"SalomeTestComponent"); ASSERT(!CORBA::is_nil(mycompo)); Engines::TestComponent_var m1; m1 = Engines::TestComponent::_narrow(mycompo); @@ -80,7 +80,7 @@ int main (int argc, char * argv[]) string containerName2 = "otherServer"; Engines::Component_var mycompo2 = - _LCC.FindOrLoad_Component(containerName2.c_str(),"SALOME_TestComponentPy"); + _LCC.FindOrLoad_Component(containerName2.c_str(),"SALOME_TestComponentPy"); ASSERT(!CORBA::is_nil(mycompo2)); Engines::TestComponent_var m2; m2 = Engines::TestComponent::_narrow(mycompo2); @@ -93,7 +93,7 @@ int main (int argc, char * argv[]) // load an engine, and invoque methods on that engine Engines::Component_var mycompo3 = - _LCC.FindOrLoad_Component("totoPy","SALOME_TestComponentPy"); + _LCC.FindOrLoad_Component("totoPy","SALOME_TestComponentPy"); ASSERT(!CORBA::is_nil(mycompo3)); Engines::TestComponent_var m3 = Engines::TestComponent::_narrow(mycompo3); ASSERT(!CORBA::is_nil(m3)); @@ -105,7 +105,7 @@ int main (int argc, char * argv[]) string containerName4 = Kernel_Utils::GetHostname(); containerName4 += "/titiPy"; Engines::Component_var mycompo4 = - _LCC.FindOrLoad_Component(containerName4.c_str(),"SALOME_TestComponentPy"); + _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)); @@ -115,7 +115,7 @@ int main (int argc, char * argv[]) string origFileName = "/home/prascle/petitfichier"; SALOME_FileTransferCORBA transfer( Kernel_Utils::GetHostname(), - origFileName); + origFileName); string local = transfer.getLocalFile(); SCRUTE(local); @@ -123,7 +123,7 @@ int main (int argc, char * argv[]) origFileName = "/home/prascle/occ60.tgz"; SALOME_FileTransferCORBA transfer2( "cli76ce", - origFileName); + origFileName); local = transfer2.getLocalFile(); SCRUTE(local); local = transfer2.getLocalFile(); diff --git a/src/Logger/SALOME_Logger_Server.cxx b/src/Logger/SALOME_Logger_Server.cxx index 24e431c7f..34f42649b 100644 --- a/src/Logger/SALOME_Logger_Server.cxx +++ b/src/Logger/SALOME_Logger_Server.cxx @@ -68,7 +68,7 @@ void Logger::putMessage(const char* message) myLock.lock(); if (m_putIntoFile) - m_outputFile << message << std::flush; + m_outputFile << message << std::flush; else std::cout << message; myLock.unlock(); diff --git a/src/Logger/SALOME_Logger_Server.hxx b/src/Logger/SALOME_Logger_Server.hxx index b7f0b913f..8c9f19d5c 100644 --- a/src/Logger/SALOME_Logger_Server.hxx +++ b/src/Logger/SALOME_Logger_Server.hxx @@ -53,27 +53,27 @@ class LOGGER_EXPORT Logger : public: //constructor w/o parameters //all messages will be put into terminal via cout - Logger(); + Logger(); //constructor with parameter, filename is output file //all messages will be put into special file passed as parameter - Logger(const char *filename); - virtual ~Logger(); - //put message into one special place for all servers - void putMessage(const char* message); + Logger(const char *filename); + virtual ~Logger(); + //put message into one special place for all servers + void putMessage(const char* message); void ping(); void SetOrb( CORBA::ORB_ptr orb ) { _orb = CORBA::ORB::_duplicate(orb); return; } - void shutdown() { if(!CORBA::is_nil(_orb)) _orb->shutdown(0); }; + void shutdown() { if(!CORBA::is_nil(_orb)) _orb->shutdown(0); }; private: - //if m_putIntoFile is true all messages will be put into special - //otherwise all messages will be put into terminal via cout + //if m_putIntoFile is true all messages will be put into special + //otherwise all messages will be put into terminal via cout bool m_putIntoFile; - //ofstream class specialized for disk file output - std::ofstream m_outputFile; + //ofstream class specialized for disk file output + std::ofstream m_outputFile; - //synchronisation object - static omni_mutex myLock; + //synchronisation object + static omni_mutex myLock; - CORBA::ORB_ptr _orb; + CORBA::ORB_ptr _orb; }; #endif // !defined(SALOME_Logger_Server_include) diff --git a/src/Logger/SALOME_Logger_Server_main.cxx b/src/Logger/SALOME_Logger_Server_main.cxx index 8cd5d9025..70d072fa1 100644 --- a/src/Logger/SALOME_Logger_Server_main.cxx +++ b/src/Logger/SALOME_Logger_Server_main.cxx @@ -62,46 +62,46 @@ int main(int argc, char **argv) CORBA::ORB_var orb = CORBA::ORB_init(argc, argv) ; for (i = 1; i <= NumberOfTries; i++) - { + { #ifndef WIN32 - if (i != 1) nanosleep(&ts_req, &ts_rem); + if (i != 1) nanosleep(&ts_req, &ts_rem); #else - if (i != 1) Sleep(TIMESleep / 1000000); + if (i != 1) Sleep(TIMESleep / 1000000); #endif - try - { - obj = orb->resolve_initial_references("RootPOA") ; - if(!CORBA::is_nil(obj)) - poa = PortableServer::POA::_narrow(obj) ; - pman = poa->the_POAManager(); - // NB. You can activate the POA before or after - // activating objects in that POA. - - // This activates the object in the root POA (by default), and - // returns a reference to it. - //NB. You can't use SALOME_NamingService class because it uses MESSAGE macro - //Otherwise, you will get segmentation fault. - //Get initial naming context - if(!CORBA::is_nil(orb)) - theObj = orb->resolve_initial_references("NameService"); - //Narrow to NamingContext - if (!CORBA::is_nil(theObj)) - inc = CosNaming::NamingContext::_narrow(theObj); - } catch(CORBA::COMM_FAILURE&) { - //cout<<"Logger Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service"<resolve_initial_references("RootPOA") ; + if(!CORBA::is_nil(obj)) + poa = PortableServer::POA::_narrow(obj) ; + pman = poa->the_POAManager(); + // NB. You can activate the POA before or after + // activating objects in that POA. + + // This activates the object in the root POA (by default), and + // returns a reference to it. + //NB. You can't use SALOME_NamingService class because it uses MESSAGE macro + //Otherwise, you will get segmentation fault. + //Get initial naming context + if(!CORBA::is_nil(orb)) + theObj = orb->resolve_initial_references("NameService"); + //Narrow to NamingContext + if (!CORBA::is_nil(theObj)) + inc = CosNaming::NamingContext::_narrow(theObj); + } catch(CORBA::COMM_FAILURE&) { + //cout<<"Logger Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service"<SetOrb(orb); myLoggerRef = myLogger->_this(); @@ -115,9 +115,9 @@ int main(int argc, char **argv) orb->destroy() ; } catch(CORBA::COMM_FAILURE& ex) - { + { std::cerr << "Caught system exception COMM_FAILURE -- unable to contact the " - << "object." << std::endl; + << "object." << std::endl; } catch(CORBA::SystemException&) { diff --git a/src/Logger/SALOME_Trace.cxx b/src/Logger/SALOME_Trace.cxx index 3617c6c4b..35039417c 100644 --- a/src/Logger/SALOME_Trace.cxx +++ b/src/Logger/SALOME_Trace.cxx @@ -51,8 +51,8 @@ SALOME_Trace::~SALOME_Trace() SALOME_Trace& SALOME_Trace::Instance() { - static SALOME_Trace instance; - return instance; + static SALOME_Trace instance; + return instance; } int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) { @@ -76,15 +76,15 @@ int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) { #ifndef WIN32 if (i != 1) nanosleep(&ts_req,&ts_rem); #else - if (i != 1) Sleep(TIMESleep / 1000000); + if (i != 1) Sleep(TIMESleep / 1000000); #endif try{ if(CORBA::is_nil(obj)) - obj = theOrb->resolve_initial_references("RootPOA"); + obj = theOrb->resolve_initial_references("RootPOA"); if(CORBA::is_nil(theObj)) - theObj = theOrb->resolve_initial_references("NameService"); + theObj = theOrb->resolve_initial_references("NameService"); if (!CORBA::is_nil(theObj)) - inc = CosNaming::NamingContext::_narrow(theObj); + inc = CosNaming::NamingContext::_narrow(theObj); if (!CORBA::is_nil(inc)) break; } catch( CORBA::SystemException& ) { } catch (...) { @@ -111,18 +111,18 @@ int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) { #ifndef WIN32 if (i != 1) nanosleep(&ts_req, &ts_rem); #else - if (i != 1) Sleep(TIMESleep / 1000000); + if (i != 1) Sleep(TIMESleep / 1000000); #endif try { - obj = inc->resolve(name); - if (!CORBA::is_nil(obj)) m_pInterfaceLogger = SALOME_Logger::Logger::_narrow(obj); + obj = inc->resolve(name); + if (!CORBA::is_nil(obj)) m_pInterfaceLogger = SALOME_Logger::Logger::_narrow(obj); } catch(CosNaming::NamingContext::NotFound) { } catch(...) { } if (!CORBA::is_nil(m_pInterfaceLogger)) { - //cout<<"SALOME_Trace : Logger Server was found"<ping(); - break; + //cout<<"SALOME_Trace : Logger Server was found"<ping(); + break; } } if (CORBA::is_nil(m_pInterfaceLogger)) { diff --git a/src/Logger/SALOME_Trace.hxx b/src/Logger/SALOME_Trace.hxx index 261d27005..3ba8b0ca2 100644 --- a/src/Logger/SALOME_Trace.hxx +++ b/src/Logger/SALOME_Trace.hxx @@ -65,16 +65,16 @@ class SALOME_Trace : public std::ostringstream { public: - virtual ~SALOME_Trace(); + virtual ~SALOME_Trace(); static Standard_EXPORT SALOME_Trace& Instance(); - // initializes Logger (if USE_LOGGER variable is set) and returns true, in case success - int Initialize(CORBA::ORB_ptr theOrb); - Standard_EXPORT void putMessage(std::ostream& msg); + // initializes Logger (if USE_LOGGER variable is set) and returns true, in case success + int Initialize(CORBA::ORB_ptr theOrb); + Standard_EXPORT void putMessage(std::ostream& msg); protected: - //disable creation of instances. It's necessary to use static SALOME_Logger& Instance() - SALOME_Trace(); - SALOME_Logger::Logger_var m_pInterfaceLogger;// object reference on Logger server. - int isInitialized; + //disable creation of instances. It's necessary to use static SALOME_Logger& Instance() + SALOME_Trace(); + SALOME_Logger::Logger_var m_pInterfaceLogger;// object reference on Logger server. + int isInitialized; }; #define GLogger SALOME_Trace::Instance() diff --git a/src/MPIContainer/MPIContainer_i.cxx b/src/MPIContainer/MPIContainer_i.cxx index b127d2a32..441464788 100644 --- a/src/MPIContainer/MPIContainer_i.cxx +++ b/src/MPIContainer/MPIContainer_i.cxx @@ -42,10 +42,10 @@ 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, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - char * containerName, - int argc, char *argv[]) + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + char * containerName, + int argc, char *argv[]) : Engines_Container_i(orb,poa,containerName,argc,argv,false), MPIObject_i(nbproc,numproc) { @@ -191,18 +191,18 @@ bool Engines_MPIContainer_i::Lload_component_Library(const char* componentName) PyObject *globals = PyModule_GetDict(mainmod); PyObject *pyCont = PyDict_GetItemString(globals, "pyCont"); PyObject *result = PyObject_CallMethod(pyCont, - (char*)"import_component", - (char*)"s",componentName); + (char*)"import_component", + (char*)"s",componentName); std::string ret= PyString_AsString(result); SCRUTE(ret); Py_RELEASE_NEW_THREAD; if (ret=="") // import possible: Python component - { - _library_map[aCompName] = (void *)pyCont; // any non O value OK - MESSAGE("[" << _numproc << "] import Python: "<(_poa->reference_to_servant(iobject)); + dynamic_cast(_poa->reference_to_servant(iobject)); ASSERT(servant); //SCRUTE(servant->pd_refCount); servant->_remove_ref(); // compensate previous id_to_reference @@ -381,8 +381,8 @@ Engines_MPIContainer_i::createMPIInstance(string genericRegisterName, // containerName(.dir)/instanceName(.object) if( _numproc == 0 ){ - _NS->Register( iobject , component_registerName.c_str() ) ; - MESSAGE( component_registerName.c_str() << " bound" ) ; + _NS->Register( iobject , component_registerName.c_str() ) ; + MESSAGE( component_registerName.c_str() << " bound" ) ; } // Root recupere les ior des composants des autre process BCastIOR(_orb,pobj,false); @@ -401,7 +401,7 @@ Engines_MPIContainer_i::createMPIInstance(string genericRegisterName, // Load component Engines::Component_ptr Engines_MPIContainer_i::load_impl(const char* nameToRegister, - const char* componentName) + const char* componentName) { pthread_t *th; if(_numproc == 0){ @@ -429,8 +429,8 @@ Engines::Component_ptr Engines_MPIContainer_i::load_impl(const char* nameToRegis // Load component Engines::Component_ptr Engines_MPIContainer_i::Lload_impl( - const char* nameToRegister, - const char* componentName) + const char* nameToRegister, + const char* componentName) { Engines::Component_var iobject; Engines::MPIObject_var pobj; @@ -464,17 +464,17 @@ Engines::Component_ptr Engines_MPIContainer_i::Lload_impl( dlerror(); PortableServer::ObjectId * (*MPIComponent_factory) (int,int, - CORBA::ORB_ptr, - PortableServer::POA_ptr, - PortableServer::ObjectId *, - const char *, - const char *) = + CORBA::ORB_ptr, + PortableServer::POA_ptr, + PortableServer::ObjectId *, + const char *, + const char *) = (PortableServer::ObjectId * (*) (int,int, - CORBA::ORB_ptr, - PortableServer::POA_ptr, - PortableServer::ObjectId *, - const char *, - const char *)) + CORBA::ORB_ptr, + PortableServer::POA_ptr, + PortableServer::ObjectId *, + const char *, + const char *)) dlsym(handle, factory_name.c_str()); char *error ; diff --git a/src/MPIContainer/MPIContainer_i.hxx b/src/MPIContainer/MPIContainer_i.hxx index 58f92aa3e..054f679a8 100644 --- a/src/MPIContainer/MPIContainer_i.hxx +++ b/src/MPIContainer/MPIContainer_i.hxx @@ -47,17 +47,17 @@ typedef struct { } thread_st; class Engines_MPIContainer_i : public POA_Engines::MPIContainer, - public Engines_Container_i, - public MPIObject_i + public Engines_Container_i, + public MPIObject_i { public: // Constructor Engines_MPIContainer_i( int nbproc, int numproc, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - char * containerName, - int argc, char *argv[]); + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + char * containerName, + int argc, char *argv[]); Engines_MPIContainer_i(int nbproc, int numproc); // Destructor ~Engines_MPIContainer_i(); @@ -73,12 +73,12 @@ class Engines_MPIContainer_i : public POA_Engines::MPIContainer, // synchronous version for process 0 Engines::Component_ptr create_component_instance( const char* componentName, - CORBA::Long studyId); // 0 for multiStudy + CORBA::Long studyId); // 0 for multiStudy // Load a component in current MPI container // synchronous version for process 0 Engines::Component_ptr load_impl(const char* nameToRegister, - const char* componentName); + const char* componentName); // Unload a component from current MPI container // synchronous version for process 0 @@ -91,14 +91,14 @@ class Engines_MPIContainer_i : public POA_Engines::MPIContainer, bool Lload_component_Library(const char* componentName); Engines::Component_ptr Lcreate_component_instance( const char* componentName, - CORBA::Long studyId); // 0 for multiStudy + CORBA::Long studyId); // 0 for multiStudy Engines::Component_ptr Lload_impl(const char* nameToRegister, - const char* componentName); + const char* componentName); Engines::Component_ptr createMPIInstance(std::string genericRegisterName, - void *handle, - int studyId); + void *handle, + int studyId); }; #endif diff --git a/src/MPIContainer/MPIObject_i.cxx b/src/MPIContainer/MPIObject_i.cxx index 075a0b16e..13bc533b3 100644 --- a/src/MPIContainer/MPIObject_i.cxx +++ b/src/MPIContainer/MPIObject_i.cxx @@ -82,20 +82,20 @@ void MPIObject_i::BCastIOR(CORBA::ORB_ptr orb, Engines::MPIObject_ptr pobj, bool for(ip=1;ip<_nbproc;ip++){ err = MPI_Recv(&n,1,MPI_INT,ip,ip,MPI_COMM_WORLD,&status); if(err){ - MESSAGE("[" << _numproc << "] MPI_RECV error"); - exit(1); + MESSAGE("[" << _numproc << "] MPI_RECV error"); + exit(1); } // Allocation de la chaine de longueur n ior = new char[n]; err = MPI_Recv(ior,n,MPI_CHAR,ip,2*ip,MPI_COMM_WORLD,&status); if(err){ - MESSAGE("[" << _numproc << "] MPI_RECV error"); - exit(1); + MESSAGE("[" << _numproc << "] MPI_RECV error"); + exit(1); } iort[ip] = orb->string_to_object(ior); delete [] ior; if(CORBA::is_nil(iort[ip])) - throw POException(ip,"MPI Component not loaded"); + throw POException(ip,"MPI Component not loaded"); } // On donne le tableau des ior a l'objet Corba du process 0 if( amiCont ) @@ -169,8 +169,8 @@ void MPIObject_i::remoteMPI2Connect(string service) while ( i != TIMEOUT ) { 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); - break; + MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << endl); + break; } i++; } diff --git a/src/MPIContainer/SALOME_MPIContainer.cxx b/src/MPIContainer/SALOME_MPIContainer.cxx index 7c3b2a672..99b74adce 100644 --- a/src/MPIContainer/SALOME_MPIContainer.cxx +++ b/src/MPIContainer/SALOME_MPIContainer.cxx @@ -53,7 +53,7 @@ int main(int argc, char* argv[]) char *containerName = (char *)""; if (argc >1) { - containerName = argv[1] ; + containerName = argv[1] ; } MESSAGE("[" << numproc << "] MPIContainer: load MPIContainer servant"); diff --git a/src/ModuleCatalog/PathPrefix.hxx b/src/ModuleCatalog/PathPrefix.hxx index bb125c31a..5abf153be 100644 --- a/src/ModuleCatalog/PathPrefix.hxx +++ b/src/ModuleCatalog/PathPrefix.hxx @@ -38,5 +38,5 @@ struct PathPrefix } ; typedef vector ListOfPathPrefix ; - + #endif // PATH_PREFIX_H diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx index fba68af7b..55d4e9a22 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx @@ -91,7 +91,7 @@ SALOME_ModuleCatalog_AcomponentImpl::GetInterfaceList() { _list[ind] = CORBA::string_dup(_Component.interfaces[ind].interfacename); if(MYDEBUG) MESSAGE("The component " << _Component.name - << " contains " << _list[ind] << " as interface"); + << " contains " << _list[ind] << " as interface"); } if(MYDEBUG) END_OF("GetInterfaceList"); @@ -110,7 +110,7 @@ SALOME_ModuleCatalog_AcomponentImpl::GetInterface(const char* interfacename) if(MYDEBUG) SCRUTE(interfacename); SALOME_ModuleCatalog::DefinitionInterface *_interface = - new SALOME_ModuleCatalog::DefinitionInterface; + new SALOME_ModuleCatalog::DefinitionInterface; bool _find = false ; @@ -118,14 +118,14 @@ SALOME_ModuleCatalog_AcomponentImpl::GetInterface(const char* interfacename) for (unsigned int ind = 0; ind < _Component.interfaces.length(); ind++) { SALOME_ModuleCatalog::DefinitionInterface &I - = _Component.interfaces[ind]; + = _Component.interfaces[ind]; if (strcmp(interfacename, I.interfacename) == 0) - { - // wanted interface - _find = true ; - duplicate(*_interface, I); - } + { + // wanted interface + _find = true ; + duplicate(*_interface, I); + } } if(MYDEBUG) SCRUTE(_find); @@ -172,19 +172,19 @@ SALOME_ModuleCatalog_AcomponentImpl::GetServiceList(const char* interfacename) SALOME_ModuleCatalog::DefinitionInterface & I = _Component.interfaces[ind]; if (strcmp(interfacename, I.interfacename) == 0) - { - _find = true ; - // wanted interface - // Get the list of services name for this interface - unsigned int _length_services = I.interfaceservicelist.length(); - _list->length(_length_services); - for (unsigned int ind1 = 0; ind1 < _length_services ; ind1++) - { - _list[ind1] = CORBA::string_dup(I.interfaceservicelist[ind1].ServiceName); - if(MYDEBUG) MESSAGE("The interface " << interfacename << " of the component " - << _Component.name << " contains " << _list[ind1] << " as a service") - } - } + { + _find = true ; + // wanted interface + // Get the list of services name for this interface + unsigned int _length_services = I.interfaceservicelist.length(); + _list->length(_length_services); + for (unsigned int ind1 = 0; ind1 < _length_services ; ind1++) + { + _list[ind1] = CORBA::string_dup(I.interfaceservicelist[ind1].ServiceName); + if(MYDEBUG) MESSAGE("The interface " << interfacename << " of the component " + << _Component.name << " contains " << _list[ind1] << " as a service") + } + } } if (!_find) @@ -210,7 +210,7 @@ SALOME_ModuleCatalog_AcomponentImpl::GetServiceList(const char* interfacename) //---------------------------------------------------------------------- SALOME_ModuleCatalog::Service* SALOME_ModuleCatalog_AcomponentImpl::GetService(const char* interfacename, - const char* servicename) + const char* servicename) throw(SALOME_ModuleCatalog::NotFound) { if(MYDEBUG) BEGIN_OF("GetService"); @@ -232,25 +232,25 @@ SALOME_ModuleCatalog_AcomponentImpl::GetService(const char* interfacename, SALOME_ModuleCatalog::DefinitionInterface &I = _Component.interfaces[ind]; if (strcmp(interfacename, I.interfacename) == 0) - { - // wanted interface - // looking for the specified service - for (unsigned int ind1 = 0; ind1 < I.interfaceservicelist.length() ; ind1++) - { - SALOME_ModuleCatalog::Service &S = I.interfaceservicelist[ind1]; - if(MYDEBUG) SCRUTE(ind1); - if(MYDEBUG) SCRUTE(S.ServiceName); - - if (strcmp(servicename, S.ServiceName) == 0) - { - // Wanted Service - // Affect the service to be returned - _find = true ; - duplicate(*service, S); - } - } - - } + { + // wanted interface + // looking for the specified service + for (unsigned int ind1 = 0; ind1 < I.interfaceservicelist.length() ; ind1++) + { + SALOME_ModuleCatalog::Service &S = I.interfaceservicelist[ind1]; + if(MYDEBUG) SCRUTE(ind1); + if(MYDEBUG) SCRUTE(S.ServiceName); + + if (strcmp(servicename, S.ServiceName) == 0) + { + // Wanted Service + // Affect the service to be returned + _find = true ; + duplicate(*service, S); + } + } + + } } if(MYDEBUG) SCRUTE(_find); @@ -293,21 +293,21 @@ SALOME_ModuleCatalog_AcomponentImpl::GetDefaultService(const char* interfacename for (unsigned int ind = 0; ind < _Component.interfaces.length(); ind++) { if (strcmp(interfacename, _Component.interfaces[ind].interfacename) == 0) - { - // wanted interface - // looking for the defautl service of the wanted interface - for (unsigned int ind1 = 0; ind1 < _Component.interfaces[ind].interfaceservicelist.length() ; ind1++) - { - if (_Component.interfaces[ind].interfaceservicelist[ind1].Servicebydefault) - { - // Default Service - // affect the service to be returned - _find = true ; - duplicate(*_service, _Component.interfaces[ind].interfaceservicelist[ind1]); - } - } - - } + { + // wanted interface + // looking for the defautl service of the wanted interface + for (unsigned int ind1 = 0; ind1 < _Component.interfaces[ind].interfaceservicelist.length() ; ind1++) + { + if (_Component.interfaces[ind].interfaceservicelist[ind1].Servicebydefault) + { + // Default Service + // affect the service to be returned + _find = true ; + duplicate(*_service, _Component.interfaces[ind].interfaceservicelist[ind1]); + } + } + + } } if (!_find) @@ -347,14 +347,14 @@ SALOME_ModuleCatalog_AcomponentImpl::GetPathPrefix(const char* machinename) for (unsigned int ind = 0 ; ind < _Component.paths.length() ; ind++) { if (strcmp(machinename, _Component.paths[ind].machine) == 0) - { - _find = true ; - // Wanted computer - // affect the path to be returned - const char* _temp = _Component.paths[ind].path ; - _path = new char[strlen(_temp)+1]; - strcpy(_path,_temp); - } + { + _find = true ; + // Wanted computer + // affect the path to be returned + const char* _temp = _Component.paths[ind].path ; + _path = new char[strlen(_temp)+1]; + strcpy(_path,_temp); + } } if(MYDEBUG) SCRUTE(_find); @@ -496,7 +496,7 @@ void SALOME_ModuleCatalog_AcomponentImpl::duplicate for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) duplicate(S_out.ServiceinParameter[ind2], - S_in.ServiceinParameter[ind2]); + S_in.ServiceinParameter[ind2]); // duplicate out Parameters _length = S_in.ServiceoutParameter.length(); @@ -504,7 +504,7 @@ void SALOME_ModuleCatalog_AcomponentImpl::duplicate for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) duplicate(S_out.ServiceoutParameter[ind2], - S_in.ServiceoutParameter[ind2]); + S_in.ServiceoutParameter[ind2]); // duplicate in DataStreamParameters _length = S_in.ServiceinDataStreamParameter.length(); @@ -512,7 +512,7 @@ void SALOME_ModuleCatalog_AcomponentImpl::duplicate for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) duplicate(S_out.ServiceinDataStreamParameter[ind2], - S_in.ServiceinDataStreamParameter[ind2]); + S_in.ServiceinDataStreamParameter[ind2]); // duplicate out DataStreamParameters _length = S_in.ServiceoutDataStreamParameter.length(); @@ -521,7 +521,7 @@ void SALOME_ModuleCatalog_AcomponentImpl::duplicate for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) duplicate(S_out.ServiceoutDataStreamParameter[ind2], - S_in.ServiceoutDataStreamParameter[ind2]); + S_in.ServiceoutDataStreamParameter[ind2]); } @@ -539,7 +539,7 @@ void SALOME_ModuleCatalog_AcomponentImpl::duplicate for (unsigned int ind1 = 0; ind1 < _length ; ind1 ++) duplicate(I_out.interfaceservicelist[ind1], - I_in.interfaceservicelist[ind1]); + I_in.interfaceservicelist[ind1]); } diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.hxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.hxx index 144bb2b9e..59a442b2d 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.hxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.hxx @@ -78,7 +78,7 @@ public: */ virtual SALOME_ModuleCatalog::Service* GetService(const char* interfacename, - const char* servicename) + const char* servicename) throw(SALOME_ModuleCatalog::NotFound); //! method to get the default service of an interface of a component @@ -156,7 +156,7 @@ private : \return the interface */ void duplicate(SALOME_ModuleCatalog::DefinitionInterface &I_out, - const SALOME_ModuleCatalog::DefinitionInterface &I_in); + const SALOME_ModuleCatalog::DefinitionInterface &I_in); //! method to duplicate a service /*! @@ -164,7 +164,7 @@ private : \return the service */ void duplicate(SALOME_ModuleCatalog::Service & S_out, - const SALOME_ModuleCatalog::Service &S_in); + const SALOME_ModuleCatalog::Service &S_in); //! method to duplicate a parameter /*! @@ -172,7 +172,7 @@ private : \return the parameter */ void duplicate(SALOME_ModuleCatalog::ServicesParameter & P_out, - const SALOME_ModuleCatalog::ServicesParameter & P_in); + const SALOME_ModuleCatalog::ServicesParameter & P_in); //! method to duplicate a parameter /*! @@ -180,7 +180,7 @@ private : \return the parameter */ void duplicate(SALOME_ModuleCatalog::ServicesDataStreamParameter & P_out, - const SALOME_ModuleCatalog::ServicesDataStreamParameter &P_in); + const SALOME_ModuleCatalog::ServicesDataStreamParameter &P_in); }; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx index 895b05cd9..ab2f3629e 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx @@ -33,11 +33,11 @@ using namespace std; void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C, - const string & InterfaceName, - const string & ServiceName); + const string & InterfaceName, + const string & ServiceName); void PrintInterface(SALOME_ModuleCatalog::Acomponent_ptr C, - const string & InterfaceName); + const string & InterfaceName); void PrintComponent(SALOME_ModuleCatalog::Acomponent_ptr C); @@ -49,7 +49,7 @@ int main(int argc,char **argv) CORBA::Object_var objVar, objVarN; try { - // initialize the ORB + // initialize the ORB orb = CORBA::ORB_init (argc, argv); @@ -167,10 +167,10 @@ void PrintComponent(SALOME_ModuleCatalog::Acomponent_ptr C) void PrintInterface(SALOME_ModuleCatalog::Acomponent_ptr C, - const string & InterfaceName) + const string & InterfaceName) { unsigned int i, n; - + SALOME_ModuleCatalog::DefinitionInterface_var _interf = C->GetInterface(InterfaceName.c_str()); MESSAGE ("Interface : " << _interf->interfacename); @@ -184,8 +184,8 @@ void PrintInterface(SALOME_ModuleCatalog::Acomponent_ptr C, } void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C, - const string & InterfaceName, - const string & ServiceName) + const string & InterfaceName, + const string & ServiceName) { int i, n; @@ -201,9 +201,9 @@ void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C, for (i = 0; iServiceinParameter[i].Parametername); + << Service->ServiceinParameter[i].Parametername); MESSAGE(" Type : " - << Service->ServiceinParameter[i].Parametertype); + << Service->ServiceinParameter[i].Parametertype); } MESSAGE("Out Parameter(s):"); @@ -211,9 +211,9 @@ void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C, for (i = 0; iServiceoutParameter[i].Parametername); + << Service->ServiceoutParameter[i].Parametername); MESSAGE(" Type : " - << Service->ServiceoutParameter[i].Parametertype); + << Service->ServiceoutParameter[i].Parametertype); } MESSAGE("In DataStreamParameter(s):"); @@ -221,11 +221,11 @@ void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C, for (i = 0; iServiceinDataStreamParameter[i].Parametername); + << Service->ServiceinDataStreamParameter[i].Parametername); MESSAGE(" Type : " - << Service->ServiceinDataStreamParameter[i].Parametertype); + << Service->ServiceinDataStreamParameter[i].Parametertype); MESSAGE(" Dependency : " - << Service->ServiceinDataStreamParameter[i].Parametertype); + << Service->ServiceinDataStreamParameter[i].Parametertype); } MESSAGE("Out DataStreamParameter(s):"); @@ -233,11 +233,11 @@ void PrintService(SALOME_ModuleCatalog::Acomponent_ptr C, for (i = 0; iServiceoutDataStreamParameter[i].Parametername); + << Service->ServiceoutDataStreamParameter[i].Parametername); MESSAGE(" Type : " - << Service->ServiceoutDataStreamParameter[i].Parametertype); + << Service->ServiceoutDataStreamParameter[i].Parametertype); MESSAGE(" Dependency : " - << Service->ServiceoutDataStreamParameter[i].Parametertype); + << Service->ServiceoutDataStreamParameter[i].Parametertype); } diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx index a6d0b1258..40ba2302a 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx @@ -40,7 +40,7 @@ std::ostream & operator<< (std::ostream & f, const ParserParameter & P) } std::ostream & operator<< (std::ostream & f, - const ParserDataStreamParameter & P) + const ParserDataStreamParameter & P) { f << " name : " << P.name << std::endl; f << " type : " << P.type << std::endl; @@ -49,7 +49,7 @@ std::ostream & operator<< (std::ostream & f, } std::ostream & operator<< (std::ostream & f, - const ParserService & S) + const ParserService & S) { int i, n; f << " name : " << S.name << std::endl; @@ -84,7 +84,7 @@ std::ostream & operator<< (std::ostream & f, } std::ostream & operator<< (std::ostream & f, - const ParserInterface & I) + const ParserInterface & I) { int j, n; f << " name : " << I.name << std::endl; @@ -100,7 +100,7 @@ std::ostream & operator<< (std::ostream & f, } std::ostream & operator<< (std::ostream & f, - const ParserComponentType & T) + const ParserComponentType & T) { std::string s; switch (T) { @@ -118,7 +118,7 @@ std::ostream & operator<< (std::ostream & f, } std::ostream & operator<< (std::ostream & f, - const ParserComponent & C) + const ParserComponent & C) { int j, n; f << std::endl diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.hxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.hxx index 948b1447a..c44467694 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.hxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.hxx @@ -32,21 +32,21 @@ #include std::ostream & operator<< (std::ostream & f, - const ParserParameter & P); + const ParserParameter & P); std::ostream & operator<< (std::ostream & f, - const ParserDataStreamParameter & P); + const ParserDataStreamParameter & P); std::ostream & operator<< (std::ostream & f, - const ParserService & S); + const ParserService & S); std::ostream & operator<< (std::ostream & f, - const ParserInterface & I); + const ParserInterface & I); std::ostream & operator<< (std::ostream & f, - const ParserComponent & C); + const ParserComponent & C); std::ostream & operator<< (std::ostream & f, - const ParserComponentType & T); + const ParserComponentType & T); #endif diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx index 9e5912f34..34f97a5c5 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx @@ -64,75 +64,75 @@ int main(int argc,char **argv) const char * Env = getenv("USE_LOGGER"); int EnvL =0; if ((Env!=NULL) && (strlen(Env))) - EnvL=1; + EnvL=1; CosNaming::Name name; name.length(1); name[0].id=CORBA::string_dup("Logger"); PortableServer::POAManager_var mgr; for (int i = 1; i<=NumberOfTries; i++) - { - if (i!=1) + { + if (i!=1) #ifndef WIN32 - a=nanosleep(&ts_req,&ts_rem); + a=nanosleep(&ts_req,&ts_rem); #else - Sleep(TIMESleep/1000000); + Sleep(TIMESleep/1000000); #endif - try - { - obj = orb->resolve_initial_references("RootPOA"); - if(!CORBA::is_nil(obj)) - poa = PortableServer::POA::_narrow(obj); - if(!CORBA::is_nil(poa)) - mgr = poa->the_POAManager(); - if(!CORBA::is_nil(orb)) - theObj = orb->resolve_initial_references("NameService"); - } - catch( CORBA::SystemException& ) - { - INFOS( "Module Catalog Server: CORBA::SystemException: Unable to contact the Naming Service" ); - } - if (!CORBA::is_nil(theObj)) - { - inc = CosNaming::NamingContext::_narrow(theObj); - if(!CORBA::is_nil(inc)) - { - INFOS( "Module Catalog Server: Naming Service was found" ); - if(EnvL==1) - { - CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ; - SALOME_NamingService &NS = *SINGLETON_::Instance() ; - NS.init_orb( orb1 ) ; - for(int j=1; j<=NumberOfTries; j++) - { - if (j!=1) + try + { + obj = orb->resolve_initial_references("RootPOA"); + if(!CORBA::is_nil(obj)) + poa = PortableServer::POA::_narrow(obj); + if(!CORBA::is_nil(poa)) + mgr = poa->the_POAManager(); + if(!CORBA::is_nil(orb)) + theObj = orb->resolve_initial_references("NameService"); + } + catch( CORBA::SystemException& ) + { + INFOS( "Module Catalog Server: CORBA::SystemException: Unable to contact the Naming Service" ); + } + if (!CORBA::is_nil(theObj)) + { + inc = CosNaming::NamingContext::_narrow(theObj); + if(!CORBA::is_nil(inc)) + { + INFOS( "Module Catalog Server: Naming Service was found" ); + if(EnvL==1) + { + CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ; + SALOME_NamingService &NS = *SINGLETON_::Instance() ; + NS.init_orb( orb1 ) ; + for(int j=1; j<=NumberOfTries; j++) + { + if (j!=1) #ifndef WIN32 - a=nanosleep(&ts_req, &ts_rem); + a=nanosleep(&ts_req, &ts_rem); #else - Sleep(TIMESleep/1000000); + Sleep(TIMESleep/1000000); #endif - try{ - object = inc->resolve(name);} - catch(CosNaming::NamingContext::NotFound) - { - INFOS( "Logger Server wasn't found" ); - } - catch(...) - { - INFOS( "Module Catalog Server: Unknown exception" ) ; - } - if (!CORBA::is_nil(object)) - { - INFOS( "Module Catalog Server: Logger Server was found" ); - MODULE_CATALOG=1; - break; - } - } - } - } - } - if ((MODULE_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc)))) - break; - } + try{ + object = inc->resolve(name);} + catch(CosNaming::NamingContext::NotFound) + { + INFOS( "Logger Server wasn't found" ); + } + catch(...) + { + INFOS( "Module Catalog Server: Unknown exception" ) ; + } + if (!CORBA::is_nil(object)) + { + INFOS( "Module Catalog Server: Logger Server was found" ); + MODULE_CATALOG=1; + break; + } + } + } + } + } + if ((MODULE_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc)))) + break; + } // Active catalog diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index 621b34c03..d0c2e7bb9 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -63,7 +63,7 @@ list splitStringToList(const string& theString, const string& theSeparat else anItem = theString.substr(startPos); if (anItem.length() > 0) - aList.push_back(anItem); + aList.push_back(anItem); if(sepPos == string::npos) break; startPos = sepPos + sepLen; @@ -151,11 +151,11 @@ SALOME_ModuleCatalogImpl::SALOME_ModuleCatalogImpl(int argc, char** argv, CORBA: string aPath = (*iter); //remove inverted commas from filename while (aPath.find('\"') != string::npos) - aPath.erase(aPath.find('\"'), 1); + aPath.erase(aPath.find('\"'), 1); _parse_xml_file(aPath.c_str(), - _general_module_list, - _general_path_list, + _general_module_list, + _general_path_list, _typeMap, _typeList); } @@ -163,8 +163,8 @@ SALOME_ModuleCatalogImpl::SALOME_ModuleCatalogImpl(int argc, char** argv, CORBA: // Verification of _general_path_list content if (!_verify_path_prefix(_general_path_list)) { if(MYDEBUG) MESSAGE( "Error while parsing the general path list, " - "differents paths are associated to the same computer," - "the first one will be choosen"); + "differents paths are associated to the same computer," + "the first one will be choosen"); } else { if(MYDEBUG) MESSAGE("General path list OK"); } @@ -173,22 +173,22 @@ SALOME_ModuleCatalogImpl::SALOME_ModuleCatalogImpl(int argc, char** argv, CORBA: // Initialize the _personal_module_list and // _personal_path_list members with the personal catalog files _parse_xml_file(_personal_path, - _personal_module_list, - _personal_path_list, + _personal_module_list, + _personal_path_list, _typeMap, _typeList); // Verification of _general_path_list content if(!_verify_path_prefix(_personal_path_list)){ - if(MYDEBUG) MESSAGE("Error while parsing the personal path list, " - "differents paths are associated to the same computer, " - "the first one will be choosen" ); + if(MYDEBUG) MESSAGE("Error while parsing the personal path list, " + "differents paths are associated to the same computer, " + "the first one will be choosen" ); }else { - if(MYDEBUG) MESSAGE("Personal path list OK"); + if(MYDEBUG) MESSAGE("Personal path list OK"); } }else if(MYDEBUG) MESSAGE("No personal catalog indicated or error while " - "opening the personal catalog"); + "opening the personal catalog"); } } @@ -299,17 +299,17 @@ SALOME_ModuleCatalogImpl::GetPathPrefix(const char* machinename) { for (unsigned int ind = 0 ; ind < _personal_path_list.size() ; ind++) { for (unsigned int ind1 = 0 ; ind1 < _personal_path_list[ind].listOfComputer.size() ; ind1++) - { - if (strcmp(machinename, _personal_path_list[ind].listOfComputer[ind1].c_str()) == 0) - { - _find = true ; - // Wanted computer - // affect the path to be returned - const char* _temp = _personal_path_list[ind].path.c_str() ; - _path = new char[strlen(_temp)+1]; - strcpy(_path,_temp); - } - } + { + if (strcmp(machinename, _personal_path_list[ind].listOfComputer[ind1].c_str()) == 0) + { + _find = true ; + // Wanted computer + // affect the path to be returned + const char* _temp = _personal_path_list[ind].path.c_str() ; + _path = new char[strlen(_temp)+1]; + strcpy(_path,_temp); + } + } } if (!_find) @@ -317,17 +317,17 @@ SALOME_ModuleCatalogImpl::GetPathPrefix(const char* machinename) { for (unsigned int ind = 0 ; ind < _general_path_list.size() ; ind++) { for (unsigned int ind1 = 0 ; ind1 < _general_path_list[ind].listOfComputer.size() ; ind1++) - { - if (strcmp(machinename, _general_path_list[ind].listOfComputer[ind1].c_str()) == 0) - { - _find = true ; - // Wanted computer - // affect the path to be returned - const char* _temp = _general_path_list[ind].path.c_str() ; - _path = new char[strlen(_temp)+1]; - strcpy(_path,_temp); - } - } + { + if (strcmp(machinename, _general_path_list[ind].listOfComputer[ind1].c_str()) == 0) + { + _find = true ; + // Wanted computer + // affect the path to be returned + const char* _temp = _general_path_list[ind].path.c_str() ; + _path = new char[strlen(_temp)+1]; + strcpy(_path,_temp); + } + } } } @@ -367,11 +367,11 @@ SALOME_ModuleCatalogImpl::GetComponentList() // searching if the component is already defined in // the personal catalog if ((_general_module_list[ind].name.compare(_personal_module_list[ind1].name)) == 0) - _find = true; + _find = true; } if(!_find){ if(MYDEBUG) MESSAGE("A new component " << _general_module_list[ind].name - << " has to be to added in the list"); + << " has to be to added in the list"); _list_components->length(indice+1); // The component is not already defined => has to be taken _list_components[indice]=(_general_module_list[ind].name).c_str(); @@ -380,7 +380,7 @@ SALOME_ModuleCatalogImpl::GetComponentList() indice++; }else{ if(MYDEBUG) MESSAGE("The component " <<_general_module_list[ind].name - << " was already defined in the personal catalog") ; + << " was already defined in the personal catalog") ; } } @@ -428,10 +428,10 @@ SALOME_ModuleCatalogImpl::GetComponentIconeList() // searching if the component is aleready defined in // the personal catalog if((_general_module_list[ind].name.compare(_personal_module_list[ind1].name)) == 0) - _find = true; + _find = true; } if(!_find){ - // if(MYDEBUG) MESSAGE("A new component " << _general_module_list[ind].name << " has to be to added in the list"); + // if(MYDEBUG) MESSAGE("A new component " << _general_module_list[ind].name << " has to be to added in the list"); _list_components_icone->length(indice+1); // The component is not already defined => has to be taken _list_components_icone[indice].modulename=_general_module_list[ind].name.c_str(); @@ -500,12 +500,12 @@ SALOME_ModuleCatalogImpl::GetTypedComponentList(SALOME_ModuleCatalog::ComponentT for (unsigned int ind=0; ind < _personal_module_list.size();ind++) { if (_personal_module_list[ind].type == _temp_component_type) - { - _list_typed_component->length(_j + 1); + { + _list_typed_component->length(_j + 1); _list_typed_component[_j] = _personal_module_list[ind].name.c_str(); - //if(MYDEBUG) SCRUTE(_list_typed_component[_j]); - _j++; - } + //if(MYDEBUG) SCRUTE(_list_typed_component[_j]); + _j++; + } } int indice = _list_typed_component->length() ; @@ -518,26 +518,26 @@ SALOME_ModuleCatalogImpl::GetTypedComponentList(SALOME_ModuleCatalog::ComponentT _find = false; if(_general_module_list[ind].type == _temp_component_type) - { - for (unsigned int ind1=0; ind1 < _personal_module_list.size();ind1++) - { - // searching if the component is aleready defined in - // the personal catalog - if ((_general_module_list[ind].name.compare(_personal_module_list[ind1].name)) == 0) - _find = true; - } - if (!_find) - { - //if(MYDEBUG) MESSAGE("A new component " << _general_module_list[ind].name << " has to be to added in the list"); + { + for (unsigned int ind1=0; ind1 < _personal_module_list.size();ind1++) + { + // searching if the component is aleready defined in + // the personal catalog + if ((_general_module_list[ind].name.compare(_personal_module_list[ind1].name)) == 0) + _find = true; + } + if (!_find) + { + //if(MYDEBUG) MESSAGE("A new component " << _general_module_list[ind].name << " has to be to added in the list"); _list_typed_component->length(indice+1); - // The component is not already defined => has to be taken - _list_typed_component[indice]=(_general_module_list[ind].name).c_str(); - //if(MYDEBUG) SCRUTE(_list_typed_component[indice]) ; - - indice++; - } - //else - //if(MYDEBUG) MESSAGE("The component " <<_general_module_list[ind].name << " was already defined in the personal catalog") ; + // The component is not already defined => has to be taken + _list_typed_component[indice]=(_general_module_list[ind].name).c_str(); + //if(MYDEBUG) SCRUTE(_list_typed_component[indice]) ; + + indice++; + } + //else + //if(MYDEBUG) MESSAGE("The component " <<_general_module_list[ind].name << " was already defined in the personal catalog") ; } } @@ -586,7 +586,7 @@ SALOME_ModuleCatalogImpl::GetComponent(const char* name) // Not found in the personal catalog and in the general catalog // return NULL object if(MYDEBUG) MESSAGE("Component with name " << name - << " not found in catalog"); + << " not found in catalog"); } return compo; @@ -633,25 +633,25 @@ SALOME_ModuleCatalogImpl::findComponent(const string & name) if (!C_parser) for (unsigned int ind=0; ind < _personal_module_list.size();ind++) { - if (name.compare(_personal_module_list[ind].name) == 0) - { - if(MYDEBUG) MESSAGE("Component named " << name - << " found in the personal catalog"); - C_parser = &(_personal_module_list[ind]); - break; - } + if (name.compare(_personal_module_list[ind].name) == 0) + { + if(MYDEBUG) MESSAGE("Component named " << name + << " found in the personal catalog"); + C_parser = &(_personal_module_list[ind]); + break; + } } if (!C_parser) for (unsigned int ind=0; ind < _general_module_list.size();ind++) { - if (name.compare(_general_module_list[ind].name) == 0) - { - // if(MYDEBUG) MESSAGE("Component named " << name - // << " found in the general catalog"); - C_parser = &(_general_module_list[ind]); - break; - } + if (name.compare(_general_module_list[ind].name) == 0) + { + // if(MYDEBUG) MESSAGE("Component named " << name + // << " found in the general catalog"); + C_parser = &(_general_module_list[ind]); + break; + } } return C_parser; @@ -663,8 +663,8 @@ SALOME_ModuleCatalogImpl::findComponent(const string & name) //---------------------------------------------------------------------- void SALOME_ModuleCatalogImpl::_parse_xml_file(const char* file, - ParserComponents& modulelist, - ParserPathPrefixes& pathList, + ParserComponents& modulelist, + ParserPathPrefixes& pathList, ParserTypes& typeMap, TypeList& typeList) { @@ -684,9 +684,9 @@ SALOME_ModuleCatalogImpl::_parse_xml_file(const char* file, xmlDocPtr aDoc = xmlReadFile(file, NULL, 0); if (aDoc != NULL) - handler->ProcessXmlDocument(aDoc); + handler->ProcessXmlDocument(aDoc); else - MESSAGE("ModuleCatalog: could not parse file "<getIORaddr(); // to wait for naming service - found = 1; - break; // naming service found - } - else - { - CORBA::Object_var obj = NS->Resolve(serverName.c_str()); - if (! CORBA::is_nil(obj)) - { - found =1; - break; // server found, no more try to do - } - MESSAGE("Server "<< serverName <<" not yet ready, waiting..."); + found = 1; + break; // naming service found + } + else + { + CORBA::Object_var obj = NS->Resolve(serverName.c_str()); + if (! CORBA::is_nil(obj)) + { + found =1; + break; // server found, no more try to do + } + MESSAGE("Server "<< serverName <<" not yet ready, waiting..."); #ifndef WIN32 nanosleep(&ts_req,&ts_rem); // wait before retry #else Sleep(TIMESleep/1000000); #endif - } - } + } + } catch( ServiceUnreachable& ) - { - MESSAGE("CORBA::COMM_FAILURE: Naming Service not yet ready, waiting..."); + { + MESSAGE("CORBA::COMM_FAILURE: Naming Service not yet ready, waiting..."); #ifndef WIN32 nanosleep(&ts_req,&ts_rem); // wait before retry #else Sleep(TIMESleep/1000000); #endif - } + } } if (!found) { diff --git a/src/NamingService/NamingService_WaitForServerReadiness.hxx b/src/NamingService/NamingService_WaitForServerReadiness.hxx index baa25e082..2250a5d7e 100644 --- a/src/NamingService/NamingService_WaitForServerReadiness.hxx +++ b/src/NamingService/NamingService_WaitForServerReadiness.hxx @@ -32,6 +32,6 @@ #include void NAMINGSERVICE_EXPORT NamingService_WaitForServerReadiness(SALOME_NamingService* NS, - std::string serverName); + std::string serverName); #endif diff --git a/src/NamingService/SALOME_NamingService.cxx b/src/NamingService/SALOME_NamingService.cxx index 8cf3c9268..ce4986933 100644 --- a/src/NamingService/SALOME_NamingService.cxx +++ b/src/NamingService/SALOME_NamingService.cxx @@ -154,9 +154,9 @@ void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef, CosNaming::Name context_name; vector splitPath; int dimension_resultat = _createContextNameDir(Path, - context_name, - splitPath, - true); + context_name, + splitPath, + true); CORBA::Boolean not_exist = false; @@ -185,73 +185,73 @@ void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef, catch (CORBA::SystemException&){ INFOS("Register() : CORBA::SystemException: " - << "unable to contact the naming service"); + << "unable to contact the naming service"); throw ServiceUnreachable(); } if (not_exist){ try{ - context_name.length(1); - for (int i = 0 ; i < dimension_resultat ;i++){ - context_name[0].id = CORBA::string_dup(splitPath[i].c_str()); - context_name[0].kind = CORBA::string_dup("dir"); - // SCRUTE(_context_name[0].id); - // --- check if the path is created - try{ - // --- if the context is already created, nothing to do - CORBA::Object_var obj = _current_context->resolve(context_name); - _current_context = CosNaming::NamingContext::_narrow(obj); - } - - catch (CosNaming::NamingContext::NotFound &){ - try{ - // --- the context must be created - CosNaming::NamingContext_var temp_context = - _current_context->bind_new_context(context_name); - _current_context = temp_context; - } - catch (CosNaming::NamingContext::AlreadyBound&){ - CORBA::Object_var obj = _current_context->resolve(context_name); - _current_context = CosNaming::NamingContext::_narrow(obj); - } - } - } + context_name.length(1); + for (int i = 0 ; i < dimension_resultat ;i++){ + context_name[0].id = CORBA::string_dup(splitPath[i].c_str()); + context_name[0].kind = CORBA::string_dup("dir"); + // SCRUTE(_context_name[0].id); + // --- check if the path is created + try{ + // --- if the context is already created, nothing to do + CORBA::Object_var obj = _current_context->resolve(context_name); + _current_context = CosNaming::NamingContext::_narrow(obj); + } + + catch (CosNaming::NamingContext::NotFound &){ + try{ + // --- the context must be created + CosNaming::NamingContext_var temp_context = + _current_context->bind_new_context(context_name); + _current_context = temp_context; + } + catch (CosNaming::NamingContext::AlreadyBound&){ + CORBA::Object_var obj = _current_context->resolve(context_name); + _current_context = CosNaming::NamingContext::_narrow(obj); + } + } + } } catch (CosNaming::NamingContext::AlreadyBound&){ - INFOS("Register() : CosNaming::NamingContext::AlreadyBound"); + INFOS("Register() : CosNaming::NamingContext::AlreadyBound"); } catch (CosNaming::NamingContext::NotFound& ex){ - CosNaming::Name n = ex.rest_of_name; + CosNaming::Name n = ex.rest_of_name; - if (ex.why == CosNaming::NamingContext::missing_node) - INFOS("Register() : " << (char *) n[0].id - << " (" << (char *) n[0].kind << ") not found"); + if (ex.why == CosNaming::NamingContext::missing_node) + INFOS("Register() : " << (char *) n[0].id + << " (" << (char *) n[0].kind << ") not found"); - if (ex.why == CosNaming::NamingContext::not_context) - INFOS("Register() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not a context"); + if (ex.why == CosNaming::NamingContext::not_context) + INFOS("Register() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not a context"); - if (ex.why == CosNaming::NamingContext::not_object) - INFOS("Register() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not an object"); + if (ex.why == CosNaming::NamingContext::not_object) + INFOS("Register() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not an object"); } catch (CosNaming::NamingContext::CannotProceed&){ - INFOS("Register(): CosNaming::NamingContext::CannotProceed"); + INFOS("Register(): CosNaming::NamingContext::CannotProceed"); } catch (CosNaming::NamingContext::InvalidName&){ - INFOS("Register(): CosNaming::NamingContext::InvalidName"); + INFOS("Register(): CosNaming::NamingContext::InvalidName"); } catch (CORBA::SystemException&){ - INFOS("Register():CORBA::SystemException: " - << "unable to contact the naming service"); - throw ServiceUnreachable(); + INFOS("Register():CORBA::SystemException: " + << "unable to contact the naming service"); + throw ServiceUnreachable(); } } } @@ -278,18 +278,18 @@ void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef, CosNaming::Name n = ex.rest_of_name; if (ex.why == CosNaming::NamingContext::missing_node) - INFOS("Register() : " << (char *) n[0].id - << " (" << (char *) n[0].kind << ") not found"); + INFOS("Register() : " << (char *) n[0].id + << " (" << (char *) n[0].kind << ") not found"); if (ex.why == CosNaming::NamingContext::not_context) - INFOS("Register() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not a context"); + INFOS("Register() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not a context"); if (ex.why == CosNaming::NamingContext::not_object) - INFOS("Register() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not an object"); + INFOS("Register() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not an object"); } catch (CosNaming::NamingContext::CannotProceed&){ @@ -302,13 +302,13 @@ void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef, catch (CosNaming::NamingContext::AlreadyBound&){ INFOS("Register(): CosNaming::NamingContext::AlreadyBound, " - << "object will be rebind"); + << "object will be rebind"); _current_context->rebind(context_name, ObjRef); } catch (CORBA::SystemException&){ INFOS("!!!Register(): CORBA::SystemException: " - << "unable to contact the naming service"); + << "unable to contact the naming service"); throw ServiceUnreachable(); } } @@ -352,9 +352,9 @@ CORBA::Object_ptr SALOME_NamingService::Resolve(const char* Path) CosNaming::Name context_name; vector splitPath; _createContextNameDir(Path, - context_name, - splitPath, - false); + context_name, + splitPath, + false); ASSERT(!CORBA::is_nil(_current_context)); @@ -453,16 +453,16 @@ CORBA::Object_ptr SALOME_NamingService::ResolveFirst(const char* Path) vector::iterator its = listElem.begin(); while (its != listElem.end()) - { - MESSAGE(*its); - - if ((*its).find(name) == 0) - { - return Resolve((*its).c_str()); - } - - its++; - } + { + MESSAGE(*its); + + if ((*its).find(name) == 0) + { + return Resolve((*its).c_str()); + } + + its++; + } } return obj._retn(); @@ -488,9 +488,9 @@ CORBA::Object_ptr SALOME_NamingService::ResolveFirst(const char* Path) CORBA::Object_ptr SALOME_NamingService::ResolveComponent(const char* hostname, - const char* containerName, - const char* componentName, - const int nbproc) + const char* containerName, + const char* componentName, + const int nbproc) throw(ServiceUnreachable) { // MESSAGE("ResolveComponent"); @@ -510,7 +510,7 @@ SALOME_NamingService::ResolveComponent(const char* hostname, char *newContainerName = new char[strlen(containerName) + 8]; sprintf(newContainerName, "%s_%d", containerName, nbproc); name += newContainerName; - delete [] newContainerName; + delete [] newContainerName; } else @@ -528,33 +528,33 @@ SALOME_NamingService::ResolveComponent(const char* hostname, SCRUTE(name); string basename = name; if (Change_Directory(basename.c_str())) - { - vector contList = list_subdirs(); - - for (unsigned int ind = 0; ind < contList.size(); ind++) - { - name = contList[ind].c_str(); - - if ( nbproc >= 1 ) - { - char *str_nbproc = new char[8]; - sprintf(str_nbproc, "_%d", nbproc); - if( strstr(name.c_str(),str_nbproc) == NULL) - continue; // check only containers with _%d in name - delete [] str_nbproc; - } - - name += "/"; - name += componentName; - SCRUTE(name); - CORBA::Object_ptr obj = ResolveFirst(name.c_str()); - - if ( !CORBA::is_nil(obj) ) - return obj; + { + vector contList = list_subdirs(); + + for (unsigned int ind = 0; ind < contList.size(); ind++) + { + name = contList[ind].c_str(); + + if ( nbproc >= 1 ) + { + char *str_nbproc = new char[8]; + sprintf(str_nbproc, "_%d", nbproc); + if( strstr(name.c_str(),str_nbproc) == NULL) + continue; // check only containers with _%d in name + delete [] str_nbproc; + } + + name += "/"; + name += componentName; + SCRUTE(name); + CORBA::Object_ptr obj = ResolveFirst(name.c_str()); + + if ( !CORBA::is_nil(obj) ) + return obj; else Change_Directory(basename.c_str()); - } - } + } + } return CORBA::Object::_nil(); } @@ -669,7 +669,7 @@ SALOME_NamingService::ContainerName(const Engines::ContainerParameters& params) // ============================================================================ string SALOME_NamingService::BuildContainerNameForNS(const char *containerName, - const char *hostname) + const char *hostname) { string ret = "/Containers/"; ret += hostname; @@ -694,7 +694,7 @@ string SALOME_NamingService::BuildContainerNameForNS(const char *containerName, string SALOME_NamingService:: BuildContainerNameForNS(const Engines::MachineParameters& params, - const char *hostname) + const char *hostname) { string ret = "/Containers/"; ret += hostname; @@ -707,7 +707,7 @@ BuildContainerNameForNS(const Engines::MachineParameters& params, string SALOME_NamingService:: BuildContainerNameForNS(const Engines::ContainerParameters& params, - const char *hostname) + const char *hostname) { string ret = "/Containers/"; ret += hostname; @@ -860,9 +860,9 @@ throw(ServiceUnreachable) CosNaming::Name context_name; vector splitPath; _createContextNameDir(path.c_str(), - context_name, - splitPath, - true); + context_name, + splitPath, + true); // --- Context creation @@ -880,16 +880,16 @@ throw(ServiceUnreachable) CosNaming::Name n = ex.rest_of_name; if (ex.why == CosNaming::NamingContext::missing_node) - MESSAGE( "Change_Directory() : " << (char *) n[0].id - << " (" << (char *) n[0].kind << ") not found"); + MESSAGE( "Change_Directory() : " << (char *) n[0].id + << " (" << (char *) n[0].kind << ") not found"); if (ex.why == CosNaming::NamingContext::not_context) - INFOS("Change_Directory() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not a context" ); + INFOS("Change_Directory() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not a context" ); if (ex.why == CosNaming::NamingContext::not_object) - INFOS( "Change_Directory() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not an object" ); + INFOS( "Change_Directory() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not an object" ); } catch (CosNaming::NamingContext::CannotProceed&) @@ -905,7 +905,7 @@ throw(ServiceUnreachable) catch (CORBA::SystemException&) { INFOS("Change_Directory():CORBA::SystemException : unable to contact" - << "the naming service"); + << "the naming service"); throw ServiceUnreachable(); } @@ -997,33 +997,33 @@ throw(ServiceUnreachable) if (! CORBA::is_nil(binding_iterator)) { while (binding_iterator->next_one(binding)) - { - CosNaming::Name bindingName = binding->binding_name; - - if (binding->binding_type == CosNaming::ncontext) - { - MESSAGE( "Context : " << bindingName[0].id ); - - try - { - Change_Directory(bindingName[0].id); - } - - catch (ServiceUnreachable&) - { - INFOS( "list(): ServiceUnreachable" ) - throw ServiceUnreachable(); - } - - list(); - _current_context = ref_context ; - } - - else if (binding->binding_type == CosNaming::nobject) - { - MESSAGE( "Object : " << bindingName[0].id ); - } - } + { + CosNaming::Name bindingName = binding->binding_name; + + if (binding->binding_type == CosNaming::ncontext) + { + MESSAGE( "Context : " << bindingName[0].id ); + + try + { + Change_Directory(bindingName[0].id); + } + + catch (ServiceUnreachable&) + { + INFOS( "list(): ServiceUnreachable" ) + throw ServiceUnreachable(); + } + + list(); + _current_context = ref_context ; + } + + else if (binding->binding_type == CosNaming::nobject) + { + MESSAGE( "Object : " << bindingName[0].id ); + } + } binding_iterator->destroy(); } @@ -1200,9 +1200,9 @@ throw(ServiceUnreachable) CosNaming::Name context_name; vector splitPath; int dimension_resultat = _createContextNameDir(path.c_str(), - context_name, - splitPath, - true); + context_name, + splitPath, + true); bool exist = false; @@ -1215,7 +1215,7 @@ throw(ServiceUnreachable) { CORBA::Object_var obj = _current_context->resolve(context_name); _current_context = CosNaming::NamingContext::_narrow(obj); - exist = true; + exist = true; } catch (CosNaming::NamingContext::NotFound &ex) @@ -1228,14 +1228,14 @@ throw(ServiceUnreachable) if (ex.why == CosNaming::NamingContext::missing_node) INFOS( "Destroy_Name(): " << (char *) n[0].id << " (" << (char *) n[0].kind << ") not found" ); - if (ex.why == CosNaming::NamingContext::not_context) - INFOS( "Destroy_Name() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not a context" ); - if (ex.why == CosNaming::NamingContext::not_object) - INFOS( "Destroy_Name() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not an object" ); + if (ex.why == CosNaming::NamingContext::not_context) + INFOS( "Destroy_Name() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not a context" ); + if (ex.why == CosNaming::NamingContext::not_object) + INFOS( "Destroy_Name() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not an object" ); } catch (CosNaming::NamingContext::InvalidName &) @@ -1270,29 +1270,29 @@ throw(ServiceUnreachable) context_name.length(1); try - { - // --- the last element is an object and not a directory + { + // --- the last element is an object and not a directory - context_name[0].id = - CORBA::string_dup(splitPath[dimension_resultat].c_str()); - context_name[0].kind = CORBA::string_dup("object"); - SCRUTE(context_name[0].id); + context_name[0].id = + CORBA::string_dup(splitPath[dimension_resultat].c_str()); + context_name[0].kind = CORBA::string_dup("object"); + SCRUTE(context_name[0].id); - _current_context->unbind(context_name); - MESSAGE("The object " << context_name[0].id << " has been deleted"); - } + _current_context->unbind(context_name); + MESSAGE("The object " << context_name[0].id << " has been deleted"); + } catch (CosNaming::NamingContext::NotFound& ex) - { - CosNaming::Name n = ex.rest_of_name; - - if (ex.why == CosNaming::NamingContext::missing_node) - INFOS( "Destroy_Name() : " << (char *) n[0].id - << " (" << (char *) n[0].kind << ") not found" ); - if (ex.why == CosNaming::NamingContext::not_context) - INFOS( "Destroy_Name() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not a context" ); + { + CosNaming::Name n = ex.rest_of_name; + + if (ex.why == CosNaming::NamingContext::missing_node) + INFOS( "Destroy_Name() : " << (char *) n[0].id + << " (" << (char *) n[0].kind << ") not found" ); + if (ex.why == CosNaming::NamingContext::not_context) + INFOS( "Destroy_Name() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not a context" ); if (ex.why == CosNaming::NamingContext::not_object) INFOS( "Destroy_Name() : " << (char *) n[0].id << " (" << (char *) n[0].kind @@ -1300,21 +1300,21 @@ throw(ServiceUnreachable) } catch (CosNaming::NamingContext::CannotProceed&) - { - INFOS( "Destroy_Name(): CosNaming::NamingContext::CannotProceed"); - } + { + INFOS( "Destroy_Name(): CosNaming::NamingContext::CannotProceed"); + } catch (CosNaming::NamingContext::InvalidName&) - { - INFOS( "Destroy_Name(): CosNaming::NamingContext::InvalidName"); - } + { + INFOS( "Destroy_Name(): CosNaming::NamingContext::InvalidName"); + } catch (CORBA::SystemException&) - { - INFOS( "Destroy_Name(): CORBA::SystemException: unable to contact" - << " the naming service"); - throw ServiceUnreachable(); - } + { + INFOS( "Destroy_Name(): CORBA::SystemException: unable to contact" + << " the naming service"); + throw ServiceUnreachable(); + } } } @@ -1358,9 +1358,9 @@ throw(ServiceUnreachable) CosNaming::Name context_name; vector splitPath; int dimension_resultat = _createContextNameDir(path.c_str(), - context_name, - splitPath, - true); + context_name, + splitPath, + true); bool exist = false; if (dimension_resultat > 0) @@ -1372,7 +1372,7 @@ throw(ServiceUnreachable) { CORBA::Object_var obj = _current_context->resolve(context_name); _current_context = CosNaming::NamingContext::_narrow(obj); - exist = true; + exist = true; } catch (CosNaming::NamingContext::NotFound &ex) @@ -1385,14 +1385,14 @@ throw(ServiceUnreachable) if (ex.why == CosNaming::NamingContext::missing_node) INFOS( "Destroy_Directory(): " << (char *) n[0].id << " (" << (char *) n[0].kind << ") not found" ); - if (ex.why == CosNaming::NamingContext::not_context) - INFOS( "Destroy_Directory() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not a context" ); - if (ex.why == CosNaming::NamingContext::not_object) - INFOS( "Destroy_Directory() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not an object" ); + if (ex.why == CosNaming::NamingContext::not_context) + INFOS( "Destroy_Directory() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not a context" ); + if (ex.why == CosNaming::NamingContext::not_object) + INFOS( "Destroy_Directory() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not an object" ); } catch (CosNaming::NamingContext::InvalidName &) @@ -1449,46 +1449,46 @@ throw(ServiceUnreachable) if (isContextDestroyed) { try - { - _current_context->unbind(context_name); - MESSAGE( "The bind to the context " - << context_name[0].id - << " has been deleted" ); - } + { + _current_context->unbind(context_name); + MESSAGE( "The bind to the context " + << context_name[0].id + << " has been deleted" ); + } catch (CosNaming::NamingContext::NotFound& ex) - { - CosNaming::Name n = ex.rest_of_name; - - if (ex.why == CosNaming::NamingContext::missing_node) - INFOS( "Destroy_Directory() : " << (char *) n[0].id - << " (" << (char *) n[0].kind << ") not found" ); - if (ex.why == CosNaming::NamingContext::not_context) - INFOS( "Destroy_Directory() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not a context" ); - if (ex.why == CosNaming::NamingContext::not_object) - INFOS( "Destroy_Directory() : " << (char *) n[0].id - << " (" << (char *) n[0].kind - << ") is not an object" ); - } + { + CosNaming::Name n = ex.rest_of_name; + + if (ex.why == CosNaming::NamingContext::missing_node) + INFOS( "Destroy_Directory() : " << (char *) n[0].id + << " (" << (char *) n[0].kind << ") not found" ); + if (ex.why == CosNaming::NamingContext::not_context) + INFOS( "Destroy_Directory() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not a context" ); + if (ex.why == CosNaming::NamingContext::not_object) + INFOS( "Destroy_Directory() : " << (char *) n[0].id + << " (" << (char *) n[0].kind + << ") is not an object" ); + } catch (CosNaming::NamingContext::CannotProceed&) - { - INFOS("Destroy_Directory: CosNaming::NamingContext::CannotProceed"); - } + { + INFOS("Destroy_Directory: CosNaming::NamingContext::CannotProceed"); + } catch (CosNaming::NamingContext::InvalidName&) - { - INFOS("Destroy_Directory: CosNaming::NamingContext::InvalidName"); - } + { + INFOS("Destroy_Directory: CosNaming::NamingContext::InvalidName"); + } catch (CORBA::SystemException&) - { - INFOS("Destroy_Directory:CORBA::SystemException : unable to contact" - << " the naming service"); - throw ServiceUnreachable(); - } + { + INFOS("Destroy_Directory:CORBA::SystemException : unable to contact" + << " the naming service"); + throw ServiceUnreachable(); + } } } @@ -1511,7 +1511,7 @@ throw(ServiceUnreachable) vector contList = list_directory(); for (unsigned int ind = 0; ind < contList.size(); ind++) - Destroy_Name(contList[ind].c_str()); + Destroy_Name(contList[ind].c_str()); Destroy_Directory(Path); } @@ -1570,9 +1570,9 @@ void SALOME_NamingService::_initialize_root_context() int SALOME_NamingService::_createContextNameDir(string path, - CosNaming::Name& context_name, - vector& splitPath, - bool onlyDir) + CosNaming::Name& context_name, + vector& splitPath, + bool onlyDir) { if (path.empty()) return 0; @@ -1587,12 +1587,12 @@ SALOME_NamingService::_createContextNameDir(string path, { endIdx = path.find_first_of(delims, begIdx); if (endIdx == path.length()-1) - endWithDelim = true; + endWithDelim = true; if (endIdx == string::npos) - endIdx = path.length(); + endIdx = path.length(); int lsub = endIdx - begIdx; if (lsub >= 1) - splitPath.push_back(path.substr(begIdx, lsub)); + splitPath.push_back(path.substr(begIdx, lsub)); begIdx = path.find_first_not_of(delims, endIdx); } @@ -1601,7 +1601,7 @@ SALOME_NamingService::_createContextNameDir(string path, { dim = splitPath.size()-1; // omit final object if (endWithDelim) // unless the path ends with a delimiter - dim++; + dim++; endWithDelim = true; } else @@ -1613,15 +1613,15 @@ SALOME_NamingService::_createContextNameDir(string path, // SCRUTE(splitPath[i]); context_name[i].id = CORBA::string_dup(splitPath[i].c_str()); if (!endWithDelim && (i == dim-1)) // here, the last string is an object - { - context_name[i].kind = CORBA::string_dup("object"); -// MESSAGE("--- " <next_one(binding)) - { - CosNaming::Name bindingName = binding->binding_name; - - if (binding->binding_type == CosNaming::ncontext) - { - // --- We work on a directory, - // the search should be done in this directory - - Change_Directory(bindingName[0].id); - _Find(name, occurence_number); - - // --- We'll go back to the initial context - - _current_context = ref_context ; - } - - else if (binding->binding_type == CosNaming::nobject) - { - // --- We work on an object... - - if (!strcmp( bindingName[0].id, name)) - { - //MESSAGE("One occurence was found"); - occurence_number++; - - // --- We keep in memory the directory where - // one occurence was found - - found_context = _current_context ; - } - } - } + { + CosNaming::Name bindingName = binding->binding_name; + + if (binding->binding_type == CosNaming::ncontext) + { + // --- We work on a directory, + // the search should be done in this directory + + Change_Directory(bindingName[0].id); + _Find(name, occurence_number); + + // --- We'll go back to the initial context + + _current_context = ref_context ; + } + + else if (binding->binding_type == CosNaming::nobject) + { + // --- We work on an object... + + if (!strcmp( bindingName[0].id, name)) + { + //MESSAGE("One occurence was found"); + occurence_number++; + + // --- We keep in memory the directory where + // one occurence was found + + found_context = _current_context ; + } + } + } binding_iterator->destroy(); } @@ -1716,9 +1716,9 @@ void SALOME_NamingService::_Find(const char* name, void SALOME_NamingService:: _current_directory(vector& splitPath, - int& lengthResult, - CosNaming::NamingContext_var contextToFind, - bool& notFound) + int& lengthResult, + CosNaming::NamingContext_var contextToFind, + bool& notFound) { MESSAGE("BEGIN OF _current_Directory"); @@ -1745,7 +1745,7 @@ _current_directory(vector& splitPath, // --- directory, search in it const char* bindingNameid=bindingName[0].id; - splitPath.push_back(bindingNameid); + splitPath.push_back(bindingNameid); lengthResult++; CORBA::Object_var obj = _current_context->resolve(bindingName); @@ -1763,9 +1763,9 @@ _current_directory(vector& splitPath, SCRUTE(bindingName[0].id); Change_Directory(bindingName[0].id); _current_directory(splitPath, - lengthResult, + lengthResult, contextToFind, - notFound); + notFound); if (notFound) { @@ -1774,8 +1774,8 @@ _current_directory(vector& splitPath, _current_context = ref_context; MESSAGE("Just before the delete of " - << splitPath[lengthResult-1]); - splitPath.pop_back(); + << splitPath[lengthResult-1]); + splitPath.pop_back(); lengthResult--; } } @@ -1807,8 +1807,8 @@ _current_directory(vector& splitPath, // ============================================================================ void SALOME_NamingService::_list_directory_recurs(vector& myList, - string relativeSubDir, - string absCurDirectory) + string relativeSubDir, + string absCurDirectory) { CosNaming::BindingList_var binding_list; CosNaming::BindingIterator_var binding_iterator; @@ -1836,23 +1836,23 @@ void SALOME_NamingService::_list_directory_recurs(vector& myList, if (! CORBA::is_nil(binding_iterator)) { while (binding_iterator->next_one(binding)) - { - CosNaming::Name bindingName = binding->binding_name; - - if (binding->binding_type == CosNaming::ncontext) - { - 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; - SCRUTE(elt); - myList.push_back(elt); - } - } + { + CosNaming::Name bindingName = binding->binding_name; + + if (binding->binding_type == CosNaming::ncontext) + { + 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; + SCRUTE(elt); + myList.push_back(elt); + } + } binding_iterator->destroy(); } diff --git a/src/NamingService/SALOME_NamingService.hxx b/src/NamingService/SALOME_NamingService.hxx index cadc0530b..fbbc3601d 100644 --- a/src/NamingService/SALOME_NamingService.hxx +++ b/src/NamingService/SALOME_NamingService.hxx @@ -50,30 +50,30 @@ public: void init_orb(CORBA::ORB_ptr orb=0); void Register(CORBA::Object_ptr ObjRef, - const char* Path) + const char* Path) throw(ServiceUnreachable); CORBA::Object_ptr Resolve(const char* Path) throw( ServiceUnreachable); CORBA::Object_ptr ResolveFirst(const char* Path) throw( ServiceUnreachable); CORBA::Object_ptr ResolveComponent(const char* hostname, - const char* containerName, - const char* componentName, - const int nbproc=0) + const char* containerName, + const char* componentName, + const int nbproc=0) throw(ServiceUnreachable); std::string ContainerName(const char *ContainerName); std::string ContainerName(const Engines::ContainerParameters& params); std::string BuildContainerNameForNS(const char *ContainerName, - const char *hostname); + const char *hostname); std::string BuildContainerNameForNS(const Engines::ContainerParameters& params, - const char *hostname); + const char *hostname); // Will Be deleted on SALOME 6 std::string ContainerName(const Engines::MachineParameters& params); std::string BuildContainerNameForNS(const Engines::MachineParameters& params, - const char *hostname); + const char *hostname); int Find(const char* name) throw(ServiceUnreachable); bool Create_Directory(const char* Path) @@ -106,17 +106,17 @@ protected: void _initialize_root_context(); int _createContextNameDir(std::string path, - CosNaming::Name& context_name, - std::vector& splitPath, - bool onlyDir); + CosNaming::Name& context_name, + std::vector& splitPath, + bool onlyDir); void _Find(const char* name, CORBA::Long& occurence_number); void _current_directory(std::vector& splitPath, - int& lengthResult, - CosNaming::NamingContext_var contextToFind, - bool& notFound); + int& lengthResult, + CosNaming::NamingContext_var contextToFind, + bool& notFound); void _list_directory_recurs(std::vector& myList, - std::string relativeSubDir, - std::string absCurDirectory); + std::string relativeSubDir, + std::string absCurDirectory); }; diff --git a/src/NamingService/ServiceUnreachable.cxx b/src/NamingService/ServiceUnreachable.cxx index e25928aac..26e6e295e 100644 --- a/src/NamingService/ServiceUnreachable.cxx +++ b/src/NamingService/ServiceUnreachable.cxx @@ -28,9 +28,9 @@ using namespace std; ServiceUnreachable::ServiceUnreachable( void ): SALOME_Exception( "ServiceUnreachable" ) { - ; + ; } ServiceUnreachable::ServiceUnreachable( const ServiceUnreachable &ex ): SALOME_Exception( ex ) { - ; + ; } diff --git a/src/NamingService/ServiceUnreachable.hxx b/src/NamingService/ServiceUnreachable.hxx index 8e2fa2b8e..a7b4972e2 100644 --- a/src/NamingService/ServiceUnreachable.hxx +++ b/src/NamingService/ServiceUnreachable.hxx @@ -36,8 +36,8 @@ class NAMINGSERVICE_EXPORT ServiceUnreachable : public SALOME_Exception { public : - ServiceUnreachable( void ); - ServiceUnreachable( const ServiceUnreachable &ex ); + ServiceUnreachable( void ); + ServiceUnreachable( const ServiceUnreachable &ex ); } ; -#endif /* #if ( !defined SERVICEUNREACHABLE_H ) */ +#endif /* #if ( !defined SERVICEUNREACHABLE_H ) */ diff --git a/src/NamingService/Test/NamingServiceTest.cxx b/src/NamingService/Test/NamingServiceTest.cxx index eb3e3a5de..3b2782fc9 100644 --- a/src/NamingService/Test/NamingServiceTest.cxx +++ b/src/NamingService/Test/NamingServiceTest.cxx @@ -558,11 +558,11 @@ NamingServiceTest::testResolveComponentOK() NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, - "/Containers/theHostName/theContainerName/theComponentName"); + "/Containers/theHostName/theContainerName/theComponentName"); obj = _NS.ResolveComponent("theHostName", - "theContainerName", - "theComponentName"); + "theContainerName", + "theComponentName"); CPPUNIT_ASSERT(!CORBA::is_nil(obj)); NSTEST::echo_var anEchoRefa = NSTEST::echo::_narrow(obj); CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRefa)); @@ -571,12 +571,12 @@ NamingServiceTest::testResolveComponentOK() NSTEST::echo_var anEchoRef2 = myFactory->createInstance(); _NS.Register(anEchoRef2, - "/Containers/theHostName/theContainerName_2/theComponentName"); + "/Containers/theHostName/theContainerName_2/theComponentName"); obj = _NS.ResolveComponent("theHostName", - "theContainerName", - "theComponentName", - 2); + "theContainerName", + "theComponentName", + 2); CPPUNIT_ASSERT(!CORBA::is_nil(obj)); NSTEST::echo_var anEchoRefb = NSTEST::echo::_narrow(obj); CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRefb)); @@ -599,11 +599,11 @@ NamingServiceTest::testResolveComponentEmptyHostname() NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, - "/Containers/theHostName/theContainerName/theComponentName"); + "/Containers/theHostName/theContainerName/theComponentName"); obj = _NS.ResolveComponent("", - "theContainerName", - "theComponentName"); + "theContainerName", + "theComponentName"); CPPUNIT_ASSERT(CORBA::is_nil(obj)); } @@ -623,11 +623,11 @@ NamingServiceTest::testResolveComponentUnknownHostname() NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, - "/Containers/theHostName/theContainerName/theComponentName"); + "/Containers/theHostName/theContainerName/theComponentName"); obj = _NS.ResolveComponent("anUnknownHostName", - "theContainerName", - "theComponentName"); + "theContainerName", + "theComponentName"); CPPUNIT_ASSERT(CORBA::is_nil(obj)); } @@ -651,24 +651,24 @@ NamingServiceTest::testResolveComponentEmptyContainerName() NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, - "/Containers/theHostName/theContainerName/theComponentName"); + "/Containers/theHostName/theContainerName/theComponentName"); NSTEST::echo_var anEchoRef2 = myFactory->createInstance(); _NS.Register(anEchoRef2, - "/Containers/theHostName/aContainerName/aComponentName"); + "/Containers/theHostName/aContainerName/aComponentName"); NSTEST::echo_var anEchoRef3 = myFactory->createInstance(); _NS.Register(anEchoRef3, - "/Containers/theHostName/otherContainerName/theComponentName"); + "/Containers/theHostName/otherContainerName/theComponentName"); obj = _NS.ResolveComponent("anUnknownHostName", - "", - "theComponentName"); + "", + "theComponentName"); CPPUNIT_ASSERT(CORBA::is_nil(obj)); obj = _NS.ResolveComponent("theHostName", - "", - "theComponentName"); + "", + "theComponentName"); CPPUNIT_ASSERT(!CORBA::is_nil(obj)); NSTEST::echo_var anEchoRefa = NSTEST::echo::_narrow(obj); CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRefa)); @@ -691,19 +691,19 @@ NamingServiceTest::testResolveComponentUnknownContainerName() NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, - "/Containers/theHostName/theContainerName/theComponentName"); + "/Containers/theHostName/theContainerName/theComponentName"); NSTEST::echo_var anEchoRef2 = myFactory->createInstance(); _NS.Register(anEchoRef2, - "/Containers/theHostName/aContainerName/aComponentName"); + "/Containers/theHostName/aContainerName/aComponentName"); NSTEST::echo_var anEchoRef3 = myFactory->createInstance(); _NS.Register(anEchoRef3, - "/Containers/theHostName/otherContainerName/theComponentName"); + "/Containers/theHostName/otherContainerName/theComponentName"); obj = _NS.ResolveComponent("theHostName", - "anUnknownContainerName", - "theComponentName"); + "anUnknownContainerName", + "theComponentName"); CPPUNIT_ASSERT(CORBA::is_nil(obj)); } @@ -723,15 +723,15 @@ NamingServiceTest::testResolveComponentEmptyComponentName() NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, - "/Containers/theHostName/theContainerName/theComponentName"); + "/Containers/theHostName/theContainerName/theComponentName"); NSTEST::echo_var anEchoRef2 = myFactory->createInstance(); _NS.Register(anEchoRef2, - "/Containers/theHostName/EmptyContainerName/"); + "/Containers/theHostName/EmptyContainerName/"); obj = _NS.ResolveComponent("theHostName", - "EmptyContainerName", - ""); + "EmptyContainerName", + ""); CPPUNIT_ASSERT(CORBA::is_nil(obj)); } @@ -751,11 +751,11 @@ NamingServiceTest::testResolveComponentUnknownComponentName() NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, - "/Containers/theHostName/theContainerName/theComponentName"); + "/Containers/theHostName/theContainerName/theComponentName"); obj = _NS.ResolveComponent("theHostName", - "theContainerName", - "anUnknownComponentName"); + "theContainerName", + "anUnknownComponentName"); CPPUNIT_ASSERT(CORBA::is_nil(obj)); } @@ -777,18 +777,18 @@ NamingServiceTest::testResolveComponentFalseNbproc() NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, - "/Containers/theHostName/theContainerName/theComponentName"); + "/Containers/theHostName/theContainerName/theComponentName"); obj = _NS.ResolveComponent("theHostName", - "theContainerName", - "theComponentName", - 25); + "theContainerName", + "theComponentName", + 25); CPPUNIT_ASSERT(CORBA::is_nil(obj)); obj = _NS.ResolveComponent("theHostName", - "theContainerName", - "theComponentName", - -25); + "theContainerName", + "theComponentName", + -25); CPPUNIT_ASSERT(! CORBA::is_nil(obj)); } @@ -903,19 +903,19 @@ NamingServiceTest::testFind() NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, - "/Containers/theHostName/theContainerName/theComponentName"); + "/Containers/theHostName/theContainerName/theComponentName"); NSTEST::echo_var anEchoRef2 = myFactory->createInstance(); _NS.Register(anEchoRef2, - "/Containers/theHostName/aContainerName/aComponentName"); + "/Containers/theHostName/aContainerName/aComponentName"); NSTEST::echo_var anEchoRef3 = myFactory->createInstance(); _NS.Register(anEchoRef3, - "/Containers/theHostName/otherContainerName/theComponentName"); + "/Containers/theHostName/otherContainerName/theComponentName"); NSTEST::echo_var anEchoRef4 = myFactory->createInstance(); _NS.Register(anEchoRef4, - "/Containers/anHostName/oneContainerName/theComponentName"); + "/Containers/anHostName/oneContainerName/theComponentName"); _NS.Change_Directory("/Containers"); int occ= _NS.Find("theComponentName"); @@ -993,19 +993,19 @@ NamingServiceTest::testChangeDirectory() NSTEST::echo_var anEchoRef = myFactory->createInstance(); _NS.Register(anEchoRef, - "/Containers/theHostName/theContainerName/theComponentName"); + "/Containers/theHostName/theContainerName/theComponentName"); NSTEST::echo_var anEchoRef2 = myFactory->createInstance(); _NS.Register(anEchoRef2, - "/Containers/theHostName/aContainerName/aComponentName"); + "/Containers/theHostName/aContainerName/aComponentName"); NSTEST::echo_var anEchoRef3 = myFactory->createInstance(); _NS.Register(anEchoRef3, - "/Containers/theHostName/otherContainerName/theComponentName"); + "/Containers/theHostName/otherContainerName/theComponentName"); NSTEST::echo_var anEchoRef4 = myFactory->createInstance(); _NS.Register(anEchoRef4, - "/Containers/anHostName/oneContainerName/theComponentName"); + "/Containers/anHostName/oneContainerName/theComponentName"); _NS.Change_Directory("/Containers/theHostName/otherContainerName"); obj = _NS.Resolve("theComponentName"); @@ -1171,14 +1171,14 @@ void NamingServiceTest::_destroyDirectoryRecurs(string path) { vector subdirs = _NS.list_subdirs(); for (int i=0; ifilterable_data[0].value >>= Asender; event->filterable_data[1].value >>= Agraph; event->filterable_data[2].value >>= Atype; diff --git a/src/ParallelContainer/Parallel_Salome_file_i.cxx b/src/ParallelContainer/Parallel_Salome_file_i.cxx index 5ca8ec0c6..19c9fd7a7 100644 --- a/src/ParallelContainer/Parallel_Salome_file_i.cxx +++ b/src/ParallelContainer/Parallel_Salome_file_i.cxx @@ -28,8 +28,8 @@ #include "utilities.h" Parallel_Salome_file_i::Parallel_Salome_file_i(CORBA::ORB_ptr orb, - const char * ior, - int rank) : + const char * ior, + int rank) : InterfaceParallel_impl(orb,ior,rank), Engines::Salome_file_serv(orb,ior,rank), Engines::Salome_file_base_serv(orb,ior,rank), @@ -85,7 +85,7 @@ Parallel_Salome_file_i::connect(Engines::Salome_file_ptr source_Salome_file) { std::string file_name = begin->first; if (_fileManaged[file_name].node > 0 && getMyRank() == 0) { if (parallel_file == NULL) - parallel_file = Engines::PaCO_Parallel_Salome_file::PaCO_narrow(proxy, _orb); + parallel_file = Engines::PaCO_Parallel_Salome_file::PaCO_narrow(proxy, _orb); parallel_file->connect(source_Salome_file, _fileManaged[file_name].node); } } @@ -93,7 +93,7 @@ Parallel_Salome_file_i::connect(Engines::Salome_file_ptr source_Salome_file) { void Parallel_Salome_file_i::connectDistributedFile(const char * file_name, - Engines::Salome_file_ptr source_Salome_file) { + Engines::Salome_file_ptr source_Salome_file) { Salome_file_i::connectDistributedFile(file_name, source_Salome_file); // Test if the file is managed in an another node @@ -108,7 +108,7 @@ Parallel_Salome_file_i::connectDistributedFile(const char * file_name, void Parallel_Salome_file_i::setDistributedSourceFile(const char* file_name, - const char * source_file_name) { + const char * source_file_name) { Salome_file_i::setDistributedSourceFile(file_name, source_file_name); // Test if the file is managed in an another node // If yes, node is updated @@ -165,29 +165,29 @@ Parallel_Salome_file_i::recvFiles_node() { // Test if the file is local or distributed if (std::string(file_infos.type.in()) == "local") { - if (std::string(file_infos.status.in()) == "not_ok") - result = checkLocalFile(file_infos.file_name.in()); + if (std::string(file_infos.status.in()) == "not_ok") + result = checkLocalFile(file_infos.file_name.in()); } else { - if (std::string(file_infos.status.in()) == "not_ok") { - // 2 cases : - // Source file is a Salome_file - // Source file is a Parallel_Salome_file - PaCO::InterfaceManager_var interface_manager = - PaCO::InterfaceManager::_narrow(_fileDistributedSource[file_infos.file_name.in()]); - if (CORBA::is_nil(interface_manager)) - result = getDistributedFile(file_infos.file_name.in()); - else - result = getParallelDistributedFile(file_infos.file_name.in()); - } + if (std::string(file_infos.status.in()) == "not_ok") { + // 2 cases : + // Source file is a Salome_file + // Source file is a Parallel_Salome_file + PaCO::InterfaceManager_var interface_manager = + PaCO::InterfaceManager::_narrow(_fileDistributedSource[file_infos.file_name.in()]); + if (CORBA::is_nil(interface_manager)) + result = getDistributedFile(file_infos.file_name.in()); + else + result = getParallelDistributedFile(file_infos.file_name.in()); + } } // if the result is false // we add this file to files_not_ok if (!result) { - files_not_ok.append(" "); - files_not_ok.append(file_infos.file_name.in()); + files_not_ok.append(" "); + files_not_ok.append(file_infos.file_name.in()); } } } @@ -307,8 +307,8 @@ Parallel_Salome_file_i::setFileNode(const char* file_name, CORBA::Long node) { Engines::Container_ptr cont = parallel_file->updateFile(_fileManaged[fname], node); parallel_file->connectDistributedFile(fname.c_str(), - _fileDistributedSource[fname], - node); + _fileDistributedSource[fname], + node); // Update file infos with the new reference of the container _fileManaged[fname].container = Engines::Container::_duplicate(cont); diff --git a/src/ParallelContainer/Parallel_Salome_file_i.hxx b/src/ParallelContainer/Parallel_Salome_file_i.hxx index ee7ec3f04..fa7529ffa 100644 --- a/src/ParallelContainer/Parallel_Salome_file_i.hxx +++ b/src/ParallelContainer/Parallel_Salome_file_i.hxx @@ -41,8 +41,8 @@ class CONTAINER_EXPORT Parallel_Salome_file_i: { public: Parallel_Salome_file_i(CORBA::ORB_ptr orb, - const char * ior, - int rank); + const char * ior, + int rank); virtual ~Parallel_Salome_file_i(); virtual void setFileNode(const char* file_name, CORBA::Long node); @@ -56,9 +56,9 @@ class CONTAINER_EXPORT Parallel_Salome_file_i: virtual void save_all(const char* hdf5_file); virtual void connect(Engines::Salome_file_ptr source_Salome_file); virtual void connectDistributedFile(const char * file_name, - Engines::Salome_file_ptr source_Salome_file); + Engines::Salome_file_ptr source_Salome_file); virtual void setDistributedSourceFile(const char* file_name, - const char * source_file_name); + const char * source_file_name); virtual void recvFiles(); virtual void recvFiles_node(); virtual void setContainer(Engines::Container_ptr container); diff --git a/src/ParallelContainer/SALOME_ParallelComponent_i.cxx b/src/ParallelContainer/SALOME_ParallelComponent_i.cxx index 80dbc354a..87ab4c475 100644 --- a/src/ParallelContainer/SALOME_ParallelComponent_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelComponent_i.cxx @@ -70,12 +70,12 @@ bool Engines_Parallel_Component_i::_isMultiInstance = false; //============================================================================= Engines_Parallel_Component_i::Engines_Parallel_Component_i(CORBA::ORB_ptr orb, char * ior, int rank, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName, bool notif, - bool regist) : + bool regist) : InterfaceParallel_impl(orb,ior,rank), Engines::Component_serv(orb,ior,rank), Engines::Component_base_serv(orb,ior,rank), @@ -105,7 +105,7 @@ Engines_Parallel_Component_i::Engines_Parallel_Component_i(CORBA::ORB_ptr orb, c { CORBA::String_var the_ior = _orb->object_to_string(o); _myConnexionToRegistry = new RegistryConnexion(0, 0, the_ior,"theSession", - _instanceName.c_str()); + _instanceName.c_str()); } _notifSupplier = new NOTIFICATION_Supplier(instanceName, notif); @@ -283,7 +283,7 @@ void Engines_Parallel_Component_i::Names( const char * graphName , _graphName = graphName; _nodeName = nodeName; MESSAGE("Engines_Parallel_Component_i::Names( '" << _graphName << "' , '" - << _nodeName << "' )"); + << _nodeName << "' )"); } //============================================================================= @@ -390,17 +390,17 @@ bool Engines_Parallel_Component_i::Suspend_impl() #endif { if ( _Sleeping ) - { - return false ; - } + { + return false ; + } else { #ifndef WIN32 - RetVal = Killer( _ThreadId ,SIGINT ) ; + RetVal = Killer( _ThreadId ,SIGINT ) ; #else - RetVal = Killer( *_ThreadId ,SIGINT ) ; + RetVal = Killer( *_ThreadId ,SIGINT ) ; #endif - //if ( RetVal ) _Sleeping = true; + //if ( RetVal ) _Sleeping = true; } } @@ -437,12 +437,12 @@ bool Engines_Parallel_Component_i::Resume_impl() { if ( _Sleeping ) { - _Sleeping = false ; - RetVal = true ; + _Sleeping = false ; + RetVal = true ; } else { - RetVal = false ; + RetVal = false ; } } return RetVal ; @@ -466,35 +466,35 @@ CORBA::Long Engines_Parallel_Component_i::CpuUsed_impl() #else if ( pthread_self().p != _ThreadId->p ) #endif - { + { if ( _Sleeping ) - { - } + { + } else - { - // Get Cpu in the appropriate thread with that object !... - theEngines_Component = this ; + { + // Get Cpu in the appropriate thread with that object !... + theEngines_Component = this ; #ifndef WIN32 - Killer( _ThreadId ,SIGUSR1 ) ; + Killer( _ThreadId ,SIGUSR1 ) ; #else - Killer( *_ThreadId ,SIGUSR11 ) ; + Killer( *_ThreadId ,SIGUSR11 ) ; #endif - } + } cpu = _ThreadCpuUsed ; - } + } else - { - _ThreadCpuUsed = CpuUsed() ; - cpu = _ThreadCpuUsed ; - // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl " - // << _serviceName << " " << cpu << endl ; + { + _ThreadCpuUsed = CpuUsed() ; + cpu = _ThreadCpuUsed ; + // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl " + // << _serviceName << " " << cpu << endl ; } } else { - cpu = _ThreadCpuUsed ; - // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl " - // << _serviceName << " " << cpu<< endl ; + cpu = _ThreadCpuUsed ; + // cout << pthread_self() << " Engines_Parallel_Component_i::CpuUsed_impl " + // << _serviceName << " " << cpu<< endl ; } } else @@ -565,10 +565,10 @@ void Engines_Parallel_Component_i::beginService(const char *serviceName) { #ifndef WIN32 MESSAGE(pthread_self() << "Send BeginService notification for " <kind() == CORBA::tk_string) - { - const char* value; - (*it).second >>= value; - // ---todo: replace __GNUC__ test by an autoconf macro AC_CHECK_FUNC. + { + const char* value; + (*it).second >>= value; + // ---todo: replace __GNUC__ test by an autoconf macro AC_CHECK_FUNC. #if defined __GNUC__ - //int ret = setenv(cle.c_str(), value, overwrite); - setenv(cle.c_str(), value, overwrite); + //int ret = setenv(cle.c_str(), value, overwrite); + setenv(cle.c_str(), value, overwrite); #else - //CCRT porting : setenv not defined in stdlib.h - std::string s(cle); - s+='='; - s+=value; - // char* cast because 1st arg of linux putenv function - // is not a const char* ! - //int ret=putenv((char *)s.c_str()); - putenv((char *)s.c_str()); - //End of CCRT porting + //CCRT porting : setenv not defined in stdlib.h + std::string s(cle); + s+='='; + s+=value; + // char* cast because 1st arg of linux putenv function + // is not a const char* ! + //int ret=putenv((char *)s.c_str()); + putenv((char *)s.c_str()); + //End of CCRT porting #endif - MESSAGE("--- setenv: "<Send(graphName(), nodeName(), event_type, message); } @@ -838,8 +838,8 @@ string Engines_Parallel_Component_i::GetDynLibraryName(const char *componentName //============================================================================= Engines::TMPFile* Engines_Parallel_Component_i::DumpPython(CORBA::Object_ptr theStudy, - CORBA::Boolean isPublished, - CORBA::Boolean& isValidScript) + CORBA::Boolean isPublished, + CORBA::Boolean& isValidScript) { const char* aScript = "def RebuildData(theStudy): pass"; char* aBuffer = new char[strlen(aScript)+1]; @@ -854,7 +854,7 @@ Engines::TMPFile* Engines_Parallel_Component_i::DumpPython(CORBA::Object_ptr the Engines::Salome_file_ptr Engines_Parallel_Component_i::setInputFileToService(const char* service_name, - const char* Salome_file_name) + const char* Salome_file_name) { // Try to find the service, if it doesn't exist, we add it. _Service_file_map_it = _Input_Service_file_map.find(service_name); @@ -887,7 +887,7 @@ Engines_Parallel_Component_i::setInputFileToService(const char* service_name, Engines::Parallel_Salome_file_proxy_impl * proxy = NULL; if (getMyRank() == 0) { proxy = new Engines::Parallel_Salome_file_proxy_impl(CORBA::ORB::_duplicate(_orb), - new paco_omni_fabrique()); + new paco_omni_fabrique()); proxy->copyGlobalContext(this); PaCO::PacoTopology_t serveur_topo; serveur_topo.total = getTotalNode(); @@ -898,7 +898,7 @@ Engines_Parallel_Component_i::setInputFileToService(const char* service_name, // We send the reference to all the nodes... Engines::Parallel_Component_var component_proxy = - Engines::Parallel_Component::_narrow(InterfaceParallel_impl::_proxy); + Engines::Parallel_Component::_narrow(InterfaceParallel_impl::_proxy); component_proxy->send_parallel_proxy_object(proxy_ref); // Adding proxy into the map @@ -915,30 +915,30 @@ Engines_Parallel_Component_i::setInputFileToService(const char* service_name, // into the proxy. for (int i = 0; i < getTotalNode(); i++) { if (i == getMyRank()) { - Parallel_Salome_file_i * servant = - new Parallel_Salome_file_i(CORBA::ORB::_duplicate(_orb), - proxy_ior.c_str(), - i); - servant->copyGlobalContext(this); - - // We register the CORBA objet into the POA - servant->POA_PaCO::InterfaceParallel::_this(); - - // Register the servant - servant->deploy(); - - // Adding servant to the map - (*_map)[Salome_file_name] = servant; + Parallel_Salome_file_i * servant = + new Parallel_Salome_file_i(CORBA::ORB::_duplicate(_orb), + proxy_ior.c_str(), + i); + servant->copyGlobalContext(this); + + // We register the CORBA objet into the POA + servant->POA_PaCO::InterfaceParallel::_this(); + + // Register the servant + servant->deploy(); + + // Adding servant to the map + (*_map)[Salome_file_name] = servant; } _my_com->paco_barrier(); // start parallel object if (getMyRank() == 0) { - proxy->start(); - _my_com->paco_barrier(); + proxy->start(); + _my_com->paco_barrier(); } else - _my_com->paco_barrier(); + _my_com->paco_barrier(); } // Parallel_Salome_file is created and deployed delete _proxy; @@ -953,7 +953,7 @@ Engines_Parallel_Component_i::setInputFileToService(const char* service_name, Engines::Salome_file_ptr Engines_Parallel_Component_i::setOutputFileToService(const char* service_name, - const char* Salome_file_name) + const char* Salome_file_name) { // Try to find the service, if it doesn't exist, we add it. _Service_file_map_it = _Output_Service_file_map.find(service_name); @@ -985,8 +985,8 @@ Engines_Parallel_Component_i::setOutputFileToService(const char* service_name, // of the Salome_file and transmit his // reference to the other nodes. if (getMyRank() == 0) { - proxy = new Engines::Parallel_Salome_file_proxy_impl(CORBA::ORB::_duplicate(_orb), - new paco_omni_fabrique()); + proxy = new Engines::Parallel_Salome_file_proxy_impl(CORBA::ORB::_duplicate(_orb), + new paco_omni_fabrique()); proxy->copyGlobalContext(this); PaCO::PacoTopology_t serveur_topo; serveur_topo.total = getTotalNode(); @@ -997,7 +997,7 @@ Engines_Parallel_Component_i::setOutputFileToService(const char* service_name, // We send the reference to all the nodes... Engines::Parallel_Component_var component_proxy = - Engines::Parallel_Component::_narrow(InterfaceParallel_impl::_proxy); + Engines::Parallel_Component::_narrow(InterfaceParallel_impl::_proxy); component_proxy->send_parallel_proxy_object(proxy_ref); // Adding proxy into the map @@ -1014,30 +1014,30 @@ Engines_Parallel_Component_i::setOutputFileToService(const char* service_name, // into the proxy. for (int i = 0; i < getTotalNode(); i++) { if (i == getMyRank()) { - Parallel_Salome_file_i * servant = - new Parallel_Salome_file_i(CORBA::ORB::_duplicate(_orb), - proxy_ior.c_str(), - i); - servant->copyGlobalContext(this); - - // We register the CORBA objet into the POA - servant->POA_PaCO::InterfaceParallel::_this(); - - // Register the servant - servant->deploy(); - - // Adding servant to the map - (*_map)[Salome_file_name] = servant; + Parallel_Salome_file_i * servant = + new Parallel_Salome_file_i(CORBA::ORB::_duplicate(_orb), + proxy_ior.c_str(), + i); + servant->copyGlobalContext(this); + + // We register the CORBA objet into the POA + servant->POA_PaCO::InterfaceParallel::_this(); + + // Register the servant + servant->deploy(); + + // Adding servant to the map + (*_map)[Salome_file_name] = servant; } _my_com->paco_barrier(); // start parallel object if (getMyRank() == 0) { - proxy->start(); - _my_com->paco_barrier(); + proxy->start(); + _my_com->paco_barrier(); } else - _my_com->paco_barrier(); + _my_com->paco_barrier(); } // Parallel_Salome_file is created and deployed @@ -1052,7 +1052,7 @@ Engines_Parallel_Component_i::setOutputFileToService(const char* service_name, Engines::Salome_file_ptr Engines_Parallel_Component_i::getInputFileToService(const char* service_name, - const char* Salome_file_name) + const char* Salome_file_name) { // Try to find the service, if it doesn't exist, we throw an exception. _Proxy_Service_file_map_it = _Proxy_Input_Service_file_map.find(service_name); @@ -1080,7 +1080,7 @@ Engines_Parallel_Component_i::getInputFileToService(const char* service_name, Engines::Salome_file_ptr Engines_Parallel_Component_i::getOutputFileToService(const char* service_name, - const char* Salome_file_name) + const char* Salome_file_name) { // Try to find the service, if it doesn't exist, we throw an exception. _Proxy_Service_file_map_it = _Proxy_Output_Service_file_map.find(service_name); @@ -1193,8 +1193,8 @@ Engines_Parallel_Component_i::get_parallel_proxy_object() { //============================================================================= void Engines_Parallel_Component_i::configureSalome_file(std::string service_name, - std::string file_port_name, - Engines::Parallel_Salome_file_proxy_impl * file) + std::string file_port_name, + Engines::Parallel_Salome_file_proxy_impl * file) { // By default this method does nothing } diff --git a/src/ParallelContainer/SALOME_ParallelComponent_i.hxx b/src/ParallelContainer/SALOME_ParallelComponent_i.hxx index 530a66d88..d39810ccb 100644 --- a/src/ParallelContainer/SALOME_ParallelComponent_i.hxx +++ b/src/ParallelContainer/SALOME_ParallelComponent_i.hxx @@ -62,12 +62,12 @@ class CONTAINER_EXPORT Engines_Parallel_Component_i: { public: Engines_Parallel_Component_i(CORBA::ORB_ptr orb, char * ior, int rank, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, - bool notif = false, - bool regist = true); + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName, + bool notif = false, + bool regist = true); virtual ~Engines_Parallel_Component_i(); @@ -93,22 +93,22 @@ public: CORBA::Long CpuUsed_impl() ; virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, - CORBA::Boolean isPublished, - CORBA::Boolean& isValidScript); + CORBA::Boolean isPublished, + CORBA::Boolean& isValidScript); // CORBA operations for Salome_file virtual Engines::Salome_file_ptr getInputFileToService(const char* service_name, - const char* Salome_file_name); + const char* Salome_file_name); virtual Engines::Salome_file_ptr getOutputFileToService(const char* service_name, - const char* Salome_file_name); + const char* Salome_file_name); virtual void checkInputFilesToService(const char* service_name); virtual Engines::Salome_file_ptr setInputFileToService(const char* service_name, - const char* Salome_file_name); + const char* Salome_file_name); virtual void checkOutputFilesToService(const char* service_name); virtual Engines::Salome_file_ptr setOutputFileToService(const char* service_name, - const char* Salome_file_name); + const char* Salome_file_name); void send_parallel_proxy_object(CORBA::Object_ptr proxy_ref); @@ -140,8 +140,8 @@ public: char * get_parallel_proxy_object(); virtual void configureSalome_file(std::string service_name, - std::string file_port_name, - Engines::Parallel_Salome_file_proxy_impl * file); + std::string file_port_name, + Engines::Parallel_Salome_file_proxy_impl * file); protected: int _studyId; // -1: not initialised; 0: multiStudy; >0: study @@ -202,7 +202,7 @@ private: long _ThreadCpuUsed ; bool _Executed ; bool _CanceledThread ; - bool _destroyed; + bool _destroyed; }; #endif diff --git a/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx b/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx index e33ba9833..4d3a2602e 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerNodeDummy.cxx @@ -151,17 +151,17 @@ int main(int argc, char* argv[]) SALOME_NamingService * ns = new SALOME_NamingService(orb); // Get the proxy string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(), - proxy_hostname.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"; Engines_Parallel_Container_i * servant = new Engines_Parallel_Container_i(CORBA::ORB::_duplicate(orb), - proxy_ior, - myid, - root_poa, - node_name); + proxy_ior, + myid, + root_poa, + node_name); // PaCO++ init paco_fabrique_manager * pfm = paco_getFabriqueManager(); pfm->register_com("dummy", new paco_dummy_fabrique()); @@ -178,7 +178,7 @@ int main(int argc, char* argv[]) snprintf(buffer, 5, "%d", myid); node_name = node_name + buffer; string _containerName = ns->BuildContainerNameForNS((char*) node_name.c_str(), - hostname.c_str()); + hostname.c_str()); cerr << "---------" << _containerName << "----------" << endl; ns->Register(obj, _containerName.c_str()); pman->activate(); diff --git a/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx b/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx index 6ac427213..bfe8e6474 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerNodeMpi.cxx @@ -143,18 +143,18 @@ int main(int argc, char* argv[]) KERNEL_PYTHON::init_python(argc,argv); // Code pour choisir le reseau infiniband ..... - /* string hostname_temp = GetHostname(); - hostent * t = gethostbyname(hostname_temp.c_str()); - cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << t->h_addr << " " << hostname_temp << endl; - cerr << t->h_addr << 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 + ":"; - const char* options[][2] = { { "endPoint", com.c_str() }, { 0, 0 } }; - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB4", options); - */ + /* string hostname_temp = GetHostname(); + hostent * t = gethostbyname(hostname_temp.c_str()); + cerr << " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " << t->h_addr << " " << hostname_temp << endl; + cerr << t->h_addr << 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 + ":"; + const char* options[][2] = { { "endPoint", com.c_str() }, { 0, 0 } }; + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB4", options); + */ std::string containerName(""); containerName = argv[1]; @@ -178,17 +178,17 @@ int main(int argc, char* argv[]) SALOME_NamingService * ns = new SALOME_NamingService(CORBA::ORB::_duplicate(orb)); // On récupère le proxy string proxyNameInNS = ns->BuildContainerNameForNS(containerName.c_str(), - proxy_hostname.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"; Engines_Parallel_Container_i * servant = new Engines_Parallel_Container_i(CORBA::ORB::_duplicate(orb), - proxy_ior, - myid, - root_poa, - node_name); + proxy_ior, + myid, + root_poa, + node_name); // PaCO++ init paco_fabrique_manager * pfm = paco_getFabriqueManager(); pfm->register_com("mpi", new paco_mpi_fabrique()); @@ -211,9 +211,9 @@ int main(int argc, char* argv[]) // We register nodes in two different parts // In the real machine name and in the proxy machine string _containerName = ns->BuildContainerNameForNS(node_name.c_str(), - hostname.c_str()); + hostname.c_str()); string _proxymachine_containerName = ns->BuildContainerNameForNS(node_name.c_str(), - proxy_hostname.c_str()); + proxy_hostname.c_str()); cerr << "Register container node : " << _containerName << endl; cerr << "Register container node : " << _proxymachine_containerName << endl; ns->Register(obj, _containerName.c_str()); diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx index 3521a46d8..716fdeed9 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxyDummy.cxx @@ -107,9 +107,9 @@ int main(int argc, char* argv[]) Container_proxy_impl_final * proxy = new Container_proxy_impl_final(orb, - pfm->get_thread("omnithread"), - root_poa, - containerName); + pfm->get_thread("omnithread"), + root_poa, + containerName); proxy->setLibCom("dummy", proxy); proxy->setLibThread("omnithread"); // Topo of the parallel object @@ -125,7 +125,7 @@ int main(int argc, char* argv[]) string hostname = Kernel_Utils::GetHostname(); Engines::Container_var pCont = Engines::Container::_narrow(obj); string _containerName = ns->BuildContainerNameForNS(containerName.c_str(), - hostname.c_str()); + hostname.c_str()); cerr << "---------" << _containerName << "----------" << endl; ns->Register(pCont, _containerName.c_str()); pman->activate(); diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx index f3029370e..96558509e 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxyMpi.cxx @@ -161,9 +161,9 @@ int main(int argc, char* argv[]) pfm->register_thread("omnithread", new paco_omni_fabrique()); Container_proxy_impl_final * proxy = new Container_proxy_impl_final(orb, - pfm->get_thread("omnithread"), - root_poa, - containerName); + pfm->get_thread("omnithread"), + root_poa, + containerName); // PaCO++ code proxy->setLibCom("dummy", proxy); @@ -181,7 +181,7 @@ int main(int argc, char* argv[]) string hostname = Kernel_Utils::GetHostname(); Engines::Container_var pCont = Engines::Container::_narrow(obj); string _containerName = ns->BuildContainerNameForNS(containerName.c_str(), - hostname.c_str()); + hostname.c_str()); cerr << "---------" << _containerName << "----------" << endl; ns->Register(pCont, _containerName.c_str()); pman->activate(); diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx index 74d4edfe1..4f191ed5f 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.cxx @@ -26,10 +26,10 @@ #include "SALOME_ParallelContainerProxy_i.hxx" Container_proxy_impl_final::Container_proxy_impl_final(CORBA::ORB_ptr orb, - paco_fabrique_thread * fab_thread, - PortableServer::POA_ptr poa, - std::string containerName, - bool is_a_return_proxy) : + paco_fabrique_thread * fab_thread, + PortableServer::POA_ptr poa, + std::string containerName, + bool is_a_return_proxy) : Engines::PACO_Container_proxy_impl(orb, fab_thread, is_a_return_proxy), Engines::Container_proxy_impl(orb, fab_thread, is_a_return_proxy), InterfaceManager_impl(orb, fab_thread, is_a_return_proxy) @@ -111,12 +111,12 @@ Container_proxy_impl_final::Shutdown() { try { - node->Shutdown(); - MESSAGE("Shutdown done node : " << i); + node->Shutdown(); + MESSAGE("Shutdown done node : " << i); } catch (...) { - INFOS("Exception catch during Shutdown of node : " << i); + INFOS("Exception catch during Shutdown of node : " << i); } } else @@ -182,15 +182,15 @@ Container_proxy_impl_final::load_component_Library(const char* componentName) #endif if (paco_test_fct) { - // PaCO Component found - MESSAGE("PACO LIB FOUND"); - _libtype_map[aCompName] = "par"; + // PaCO Component found + MESSAGE("PACO LIB FOUND"); + _libtype_map[aCompName] = "par"; } else { - MESSAGE("SEQ LIB FOUND"); + MESSAGE("SEQ LIB FOUND"); #ifndef WIN32 - MESSAGE("dlerror() result is : " << dlerror()); + MESSAGE("dlerror() result is : " << dlerror()); #endif } } @@ -207,20 +207,20 @@ Container_proxy_impl_final::load_component_Library(const char* componentName) PyObject *globals = PyModule_GetDict(mainmod); PyObject *pyCont = PyDict_GetItemString(globals, "pyCont"); PyObject *result = PyObject_CallMethod(pyCont, - (char*)"import_component", - (char*)"s",componentName); + (char*)"import_component", + (char*)"s",componentName); std::string ret_p= PyString_AsString(result); Py_XDECREF(result); Py_RELEASE_NEW_THREAD; if (ret_p=="") // import possible: Python component { - MESSAGE("import Python: " << aCompName <<" OK"); + MESSAGE("import Python: " << aCompName <<" OK"); } else { - MESSAGE("Error in importing Python component : " << aCompName); - ret = false; + MESSAGE("Error in importing Python component : " << aCompName); + ret = false; } } _numInstanceMutex.unlock(); @@ -236,21 +236,21 @@ Container_proxy_impl_final::load_component_Library(const char* componentName) Engines::Container_var node = Engines::Container::_narrow(object); if (!CORBA::is_nil(node)) { - try - { - node->load_component_Library(componentName); - MESSAGE("Call load_component_Library done node : " << i); - } - catch (...) - { - INFOS("Exception catch during load_component_Library of node : " << i); - ret = false; - } + try + { + node->load_component_Library(componentName); + MESSAGE("Call load_component_Library done node : " << i); + } + catch (...) + { + INFOS("Exception catch during load_component_Library of node : " << i); + ret = false; + } } else { - INFOS("Cannot call load_component_Library node " << i << " ref is nil !"); - ret = false; + INFOS("Cannot call load_component_Library node " << i << " ref is nil !"); + ret = false; } } } @@ -327,12 +327,12 @@ Container_proxy_impl_final::create_component_instance(const char* componentName, Container_proxy_impl_final::proxy_object * proxy = new Container_proxy_impl_final::proxy_object(); proxy->proxy_id = (component_proxy_factory) (_orb, - _fab_thread, - _poa, - _id, - &(proxy->proxy_regist), - instanceName.c_str(), - _parallel_object_topology.total); + _fab_thread, + _poa, + _id, + &(proxy->proxy_regist), + instanceName.c_str(), + _parallel_object_topology.total); // --- get reference & servant from id CORBA::Object_var obj = _poa->id_to_reference(*(proxy->proxy_id)); @@ -373,18 +373,18 @@ Container_proxy_impl_final::create_component_instance(const char* componentName, { try { - node->create_paco_component_node_instance(componentName, _containerName.c_str(), studyId); - MESSAGE("Call create_paco_component_node_instance done on node : " << i); + node->create_paco_component_node_instance(componentName, _containerName.c_str(), studyId); + MESSAGE("Call create_paco_component_node_instance done on node : " << i); } catch (SALOME::SALOME_Exception & ex) { - INFOS("SALOME_EXCEPTION : " << ex.details.text); - return Engines::Component::_nil(); + INFOS("SALOME_EXCEPTION : " << ex.details.text); + return Engines::Component::_nil(); } catch (...) { - INFOS("Unknown Exception catch during create_paco_component_node_instance on node : " << i); - return Engines::Component::_nil(); + INFOS("Unknown Exception catch during create_paco_component_node_instance on node : " << i); + return Engines::Component::_nil(); } } else diff --git a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx index 6e4c56db4..5750cde7e 100644 --- a/src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx +++ b/src/ParallelContainer/SALOME_ParallelContainerProxy_i.hxx @@ -45,10 +45,10 @@ class Container_proxy_impl_final : { public: Container_proxy_impl_final(CORBA::ORB_ptr orb, - paco_fabrique_thread * fab_thread, - PortableServer::POA_ptr poa, - std::string containerName, - bool is_a_return_proxy = false); + paco_fabrique_thread * fab_thread, + PortableServer::POA_ptr poa, + std::string containerName, + bool is_a_return_proxy = false); virtual ~Container_proxy_impl_final(); @@ -64,7 +64,7 @@ class Container_proxy_impl_final : { Engines::Component_var proxy_corba_ref; PortableServer::ObjectId * proxy_id; - RegistryConnexion * proxy_regist; + RegistryConnexion * proxy_regist; }; // Cette liste contient les references vers les différentes @@ -75,12 +75,12 @@ class Container_proxy_impl_final : // parallèles ou sequentiels typedef void (*PACO_TEST_FUNCTION) (); typedef PortableServer::ObjectId * (*FACTORY_FUNCTION) (CORBA::ORB_ptr, - paco_fabrique_thread *, - PortableServer::POA_ptr, - PortableServer::ObjectId *, - RegistryConnexion **, - const char *, - int); + paco_fabrique_thread *, + PortableServer::POA_ptr, + PortableServer::ObjectId *, + RegistryConnexion **, + const char *, + int); int _numInstance; std::string _hostname; std::string _containerName; diff --git a/src/ParallelContainer/SALOME_ParallelContainer_i.cxx b/src/ParallelContainer/SALOME_ParallelContainer_i.cxx index d39f0a799..a7e60031d 100644 --- a/src/ParallelContainer/SALOME_ParallelContainer_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelContainer_i.cxx @@ -73,11 +73,11 @@ extern "C" {void SigIntHandler( int ) ; } //============================================================================= Engines_Parallel_Container_i::Engines_Parallel_Container_i (CORBA::ORB_ptr orb, - char * ior, - int rank, - PortableServer::POA_ptr poa, - std::string containerName, - bool isServantAloneInProcess) : + char * ior, + int rank, + PortableServer::POA_ptr poa, + std::string containerName, + bool isServantAloneInProcess) : InterfaceParallel_impl(orb,ior,rank), Engines::PACO_Container_serv(orb,ior,rank), Engines::PACO_Container_base_serv(orb,ior,rank), @@ -347,8 +347,8 @@ Engines_Parallel_Container_i::load_component_Library(const char* componentName) PyObject *globals = PyModule_GetDict(mainmod); PyObject *pyCont = PyDict_GetItemString(globals, "pyCont"); PyObject *result = PyObject_CallMethod(pyCont, - (char*)"import_component", - (char*)"s",componentName); + (char*)"import_component", + (char*)"s",componentName); std::string ret_p= PyString_AsString(result); Py_XDECREF(result); Py_RELEASE_NEW_THREAD; @@ -384,7 +384,7 @@ Engines_Parallel_Container_i::load_component_Library(const char* componentName) Engines::Component_ptr Engines_Parallel_Container_i::create_component_instance(const char*genericRegisterName, - CORBA::Long studyId) + CORBA::Long studyId) { MESSAGE("Begin of create_component_instance in node : " << getMyRank()); @@ -442,7 +442,7 @@ Engines_Parallel_Container_i::create_component_instance(const char*genericRegist //============================================================================= Engines::Component_ptr Engines_Parallel_Container_i::find_component_instance( const char* registeredName, - CORBA::Long studyId) + CORBA::Long studyId) { Engines::Component_var anEngine = Engines::Component::_nil(); map::iterator itm =_listInstances_map.begin(); @@ -455,7 +455,7 @@ Engines::Component_ptr Engines_Parallel_Container_i::find_component_instance( co anEngine = (*itm).second; if (studyId == anEngine->getStudyId()) { - return anEngine._retn(); + return anEngine._retn(); } } itm++; @@ -479,7 +479,7 @@ Engines::Component_ptr Engines_Parallel_Container_i::find_component_instance( co //============================================================================= Engines::Component_ptr Engines_Parallel_Container_i::load_impl( const char* genericRegisterName, - const char* componentName ) + const char* componentName ) { Engines::Component_var iobject = Engines::Component::_nil(); if (load_component_Library(genericRegisterName)) @@ -559,8 +559,8 @@ void Engines_Parallel_Container_i::finalize_removal() bool Engines_Parallel_Container_i::Kill_impl() { MESSAGE("Engines_Parallel_Container_i::Kill() my pid is "<< _pid - << " my containerName is " << _containerName.c_str() - << " my machineName is " << _hostname.c_str()); + << " my containerName is " << _containerName.c_str() + << " my machineName is " << _hostname.c_str()); INFOS("==============================================================="); INFOS("= REMOVE calls to Kill_impl in C++ container ="); INFOS("==============================================================="); @@ -693,7 +693,7 @@ Engines_Parallel_Container_i::find_or_create_instance(string genericRegisterName if (CORBA::is_nil( obj )) { iobject = create_component_instance(genericRegisterName.c_str(), - 0); // force multiStudy instance here ! + 0); // force multiStudy instance here ! } else { @@ -704,9 +704,9 @@ Engines_Parallel_Container_i::find_or_create_instance(string genericRegisterName ASSERT (studyId >= 0); if (studyId != 0) // monoStudy instance: NOK { - iobject = Engines::Component::_nil(); - INFOS("load_impl & find_component_instance methods " - << "NOT SUITABLE for mono study components"); + iobject = Engines::Component::_nil(); + INFOS("load_impl & find_component_instance methods " + << "NOT SUITABLE for mono study components"); } } } @@ -755,11 +755,11 @@ Engines_Parallel_Container_i::createPythonInstance(string genericRegisterName, i PyObject *globals = PyModule_GetDict(mainmod); PyObject *pyCont = PyDict_GetItemString(globals, "pyCont"); PyObject *result = PyObject_CallMethod(pyCont, - (char*)"create_component_instance", - (char*)"ssl", - genericRegisterName.c_str(), - instanceName.c_str(), - studyId); + (char*)"create_component_instance", + (char*)"ssl", + genericRegisterName.c_str(), + instanceName.c_str(), + studyId); std::string iors = PyString_AsString(result); Py_DECREF(result); Py_RELEASE_NEW_THREAD; @@ -799,8 +799,8 @@ Engines_Parallel_Container_i::createPythonInstance(string genericRegisterName, i //============================================================================= Engines::Component_ptr Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName, - void *handle, - int studyId) + void *handle, + int studyId) { MESSAGE("Entering Engines_Parallel_Container_i::createCPPInstance"); @@ -847,7 +847,7 @@ Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName, PortableServer::ObjectId *id; //not owner, do not delete (nore use var) id = (Component_factory) ( _orb, _poa, _id, instanceName.c_str(), - aGenRegisterName.c_str() ); + aGenRegisterName.c_str() ); if (id == NULL) { INFOS("Factory function returns NULL !"); @@ -885,8 +885,8 @@ Engines_Parallel_Container_i::createCPPInstance(string genericRegisterName, void Engines_Parallel_Container_i::create_paco_component_node_instance(const char* componentName, - const char* proxy_containerName, - CORBA::Long studyId) + const char* proxy_containerName, + CORBA::Long studyId) { // Init de la méthode char * proxy_ior; @@ -998,7 +998,7 @@ void Engines_Parallel_Container_i::decInstanceCnt(string genericRegisterName) if (_cntInstances_map[aGenRegisterName] == 0) { string impl_name = - Engines_Component_i::GetDynLibraryName(aGenRegisterName.c_str()); + Engines_Component_i::GetDynLibraryName(aGenRegisterName.c_str()); SCRUTE(impl_name); void* handle = _library_map[impl_name]; ASSERT(handle); @@ -1135,7 +1135,7 @@ void CallCancelThread(); #ifndef WIN32 void SigIntHandler(int what , siginfo_t * siginfo , - void * toto ) { + void * toto ) { //PAL9042 JR : during the execution of a Signal Handler (and of methods called through Signal Handlers) // use of streams (and so on) should never be used because : // streams of C++ are naturally thread-safe and use pthread_mutex_lock ===> @@ -1165,8 +1165,8 @@ void SigIntHandler(int what , siginfo_t * siginfo , // MESSAGE("SigIntHandler BEGIN sleeping.") ; int count = 0 ; while( _Sleeping ) { - sleep( 1 ) ; - count += 1 ; + sleep( 1 ) ; + count += 1 ; } // MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ; } @@ -1191,8 +1191,8 @@ void SigIntHandler( int what ) { MESSAGE("SigIntHandler BEGIN sleeping.") ; int count = 0 ; while( _Sleeping ) { - Sleep( 1000 ) ; - count += 1 ; + Sleep( 1000 ) ; + count += 1 ; } MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ; } diff --git a/src/ParallelContainer/SALOME_ParallelContainer_i.hxx b/src/ParallelContainer/SALOME_ParallelContainer_i.hxx index ba014d458..008af82a9 100644 --- a/src/ParallelContainer/SALOME_ParallelContainer_i.hxx +++ b/src/ParallelContainer/SALOME_ParallelContainer_i.hxx @@ -61,11 +61,11 @@ class CONTAINER_EXPORT Engines_Parallel_Container_i: { public: Engines_Parallel_Container_i(CORBA::ORB_ptr orb, - char * ior, - int rank, - PortableServer::POA_ptr poa, - std::string containerName , - bool isServantAloneInProcess = true); + char * ior, + int rank, + PortableServer::POA_ptr poa, + std::string containerName , + bool isServantAloneInProcess = true); virtual ~Engines_Parallel_Container_i(); @@ -75,20 +75,20 @@ public: virtual Engines::Component_ptr create_component_instance( const char* componentName, - CORBA::Long studyId); // 0 for multiStudy + CORBA::Long studyId); // 0 for multiStudy Engines::Component_ptr find_component_instance( const char* registeredName, - CORBA::Long studyId); // 0 for multiStudy + CORBA::Long studyId); // 0 for multiStudy Engines::Component_ptr load_impl(const char* nameToRegister, - const char* componentName); + const char* componentName); void create_paco_component_node_instance(const char* componentName, - const char* proxy_containerName, - CORBA::Long studyId); // 0 for multiStudy + const char* proxy_containerName, + CORBA::Long studyId); // 0 for multiStudy void updateInstanceNumber(); @@ -114,12 +114,12 @@ public: Engines::Component_ptr createCPPInstance(std::string genericRegisterName, - void *handle, - int studyId); + void *handle, + int studyId); Engines::Component_ptr createPythonInstance(std::string genericRegisterName, - int studyId); + int studyId); static bool isPythonContainer(const char* ContainerName); static void decInstanceCnt(std::string genericRegisterName); @@ -160,10 +160,10 @@ protected: std::map _par_obj_inst_map; typedef PortableServer::ObjectId * (*FACTORY_FUNCTION) (CORBA::ORB_ptr, char *, int, - PortableServer::POA_ptr, - PortableServer::ObjectId *, - const char *, - const char *); + PortableServer::POA_ptr, + PortableServer::ObjectId *, + const char *, + const char *); }; #endif diff --git a/src/Registry/RegistryConnexion.hxx b/src/Registry/RegistryConnexion.hxx index d91c7c664..856deafd9 100644 --- a/src/Registry/RegistryConnexion.hxx +++ b/src/Registry/RegistryConnexion.hxx @@ -26,7 +26,7 @@ // $Header$ // /* - RegistryConnexion should be used by an engine to add or to remove a component. + RegistryConnexion should be used by an engine to add or to remove a component. */ # if !defined( __RegistryConnexion_HXX__ ) @@ -41,18 +41,18 @@ class REGISTRY_EXPORT RegistryConnexion { protected : - const char* _Ior ; // engine ior - Registry::Components_var _VarComponents ; // RegistryService reference - std::string _SessionName ; - std::string _Name ; // code name - int _Id ; // code identity returned by RegistryService - void add( const char *aName ); - void remove( void ); - RegistryConnexion( void ); + const char* _Ior ; // engine ior + Registry::Components_var _VarComponents ; // RegistryService reference + std::string _SessionName ; + std::string _Name ; // code name + int _Id ; // code identity returned by RegistryService + void add( const char *aName ); + void remove( void ); + RegistryConnexion( void ); public : - RegistryConnexion( int argc , char **argv , const char *ior , const char *ptrSessionName, const char *componentName ); - ~RegistryConnexion(); + RegistryConnexion( int argc , char **argv , const char *ior , const char *ptrSessionName, const char *componentName ); + ~RegistryConnexion(); } ; -# endif /* # if !defined( __RegistryConnexion_H__ ) */ +# endif /* # if !defined( __RegistryConnexion_H__ ) */ diff --git a/src/Registry/RegistryService.hxx b/src/Registry/RegistryService.hxx index de22e1fa1..89a5a733e 100644 --- a/src/Registry/RegistryService.hxx +++ b/src/Registry/RegistryService.hxx @@ -39,54 +39,54 @@ class REGISTRY_EXPORT RegistryService : public POA_Registry::Components //, pub { public : - enum Status { UNDEF=-1 , TERMINATED=0 , RUNNING=1 } ; - - class client_infos - { - protected : - const char* const _ior; - const char* const _name; - const long _pid ; - const char* const _machine; - const char* const _adip; - const long _uid; - const char* const _pwname; - const long _ts_start ; - const long _difftime; - const char* const _cdir ; - long _ts_hello ; - long _ts_end ; - Status _status; - public : - friend class RegistryService ; - - client_infos( const Registry::Infos &infos ); - ~client_infos(); - }; + enum Status { UNDEF=-1 , TERMINATED=0 , RUNNING=1 } ; + + class client_infos + { + protected : + const char* const _ior; + const char* const _name; + const long _pid ; + const char* const _machine; + const char* const _adip; + const long _uid; + const char* const _pwname; + const long _ts_start ; + const long _difftime; + const char* const _cdir ; + long _ts_hello ; + long _ts_end ; + Status _status; + public : + friend class RegistryService ; + + client_infos( const Registry::Infos &infos ); + ~client_infos(); + }; public : - RegistryService(void); - virtual ~RegistryService(void); + RegistryService(void); + virtual ~RegistryService(void); void ping(); CORBA::Long getPID(); - virtual CORBA::ULong add (const Registry::Infos & infos); - virtual CORBA::ULong size ( void ); + virtual CORBA::ULong add (const Registry::Infos & infos); + virtual CORBA::ULong size ( void ); #ifndef WIN32 - virtual void remove( const CORBA::ULong id ); - virtual void hello( const CORBA::ULong id ); + virtual void remove( const CORBA::ULong id ); + virtual void hello( const CORBA::ULong id ); #else - virtual void remove( CORBA::ULong id ); - virtual void hello( CORBA::ULong id ); + virtual void remove( CORBA::ULong id ); + virtual void hello( CORBA::ULong id ); #endif - virtual void end(void); + virtual void end(void); - virtual Registry::AllInfos *getall(void); - virtual Registry::AllInfos *history(void); + virtual Registry::AllInfos *getall(void); + virtual Registry::AllInfos *history(void); - void SessionName( const char *sessionName ) ; + void SessionName( const char *sessionName ) ; void SetOrb( CORBA::ORB_ptr orb ) { _orb = CORBA::ORB::_duplicate(orb); return; } @@ -95,12 +95,12 @@ public : protected : CORBA::ORB_var _orb; - const char *_SessionName ; - int _Compteur ; - std::map _reg ; - std::map _fin ; + const char *_SessionName ; + int _Compteur ; + std::map _reg ; + std::map _fin ; - Registry::AllInfos* makeseq(std::map &mymap ); + Registry::AllInfos* makeseq(std::map &mymap ); } ; diff --git a/src/Registry/SALOME_Registry_Server.cxx b/src/Registry/SALOME_Registry_Server.cxx index 766e379db..cf637665e 100644 --- a/src/Registry/SALOME_Registry_Server.cxx +++ b/src/Registry/SALOME_Registry_Server.cxx @@ -58,8 +58,8 @@ int main( int argc , char **argv ) SCRUTE(argc) if( argc<3 ) { - MESSAGE("you must provide the Salome session name when you call SALOME_Registry_Server") ; - throw CommException("you must provide the Salome session name when you call SALOME_Registry_Server") ; + MESSAGE("you must provide the Salome session name when you call SALOME_Registry_Server") ; + throw CommException("you must provide the Salome session name when you call SALOME_Registry_Server") ; } const char *ptrSessionName=0 ; @@ -67,10 +67,10 @@ int main( int argc , char **argv ) for ( k=1 ; k0) ; @@ -104,62 +104,62 @@ int main( int argc , char **argv ) { if (i!=1) #ifndef WIN32 - a=nanosleep(&ts_req,&ts_rem); + a=nanosleep(&ts_req,&ts_rem); #else Sleep(TIMESleep/1000000); #endif try - { - obj = orb->resolve_initial_references("RootPOA"); - if(!CORBA::is_nil(obj)) - poa = PortableServer::POA::_narrow(obj); - if(!CORBA::is_nil(poa)) - manager = poa->the_POAManager(); - if(!CORBA::is_nil(orb)) - theObj = orb->resolve_initial_references("NameService"); - if (!CORBA::is_nil(theObj)) - inc = CosNaming::NamingContext::_narrow(theObj); - } + { + obj = orb->resolve_initial_references("RootPOA"); + if(!CORBA::is_nil(obj)) + poa = PortableServer::POA::_narrow(obj); + if(!CORBA::is_nil(poa)) + manager = poa->the_POAManager(); + if(!CORBA::is_nil(orb)) + theObj = orb->resolve_initial_references("NameService"); + if (!CORBA::is_nil(theObj)) + inc = CosNaming::NamingContext::_narrow(theObj); + } catch( CORBA::SystemException& ) - { - MESSAGE( "Registry Server: CORBA::SystemException: Unable to contact the Naming Service" ); - } + { + MESSAGE( "Registry Server: CORBA::SystemException: Unable to contact the Naming Service" ); + } if(!CORBA::is_nil(inc)) - { - MESSAGE( "Registry Server: Naming Service was found" ); - if(EnvL==1) - { - for(int j=1; j<=NumberOfTries; j++) - { - if (j!=1) + { + MESSAGE( "Registry Server: Naming Service was found" ); + if(EnvL==1) + { + for(int j=1; j<=NumberOfTries; j++) + { + if (j!=1) #ifndef WIN32 - a=nanosleep(&ts_req, &ts_rem); + a=nanosleep(&ts_req, &ts_rem); #else - Sleep(TIMESleep/1000000); + Sleep(TIMESleep/1000000); #endif - try - { - object = inc->resolve(name); - } - catch(CosNaming::NamingContext::NotFound) - { - MESSAGE( "Registry Server: Logger Server wasn't found" ); - } - catch(...) - { - MESSAGE( "Registry Server: Unknown exception" ); - } - if (!CORBA::is_nil(object)) - { - MESSAGE( "Module Catalog Server: Logger Server was found" ); - REGISTRY=1; - break; - } - } - } - } + try + { + object = inc->resolve(name); + } + catch(CosNaming::NamingContext::NotFound) + { + MESSAGE( "Registry Server: Logger Server wasn't found" ); + } + catch(...) + { + MESSAGE( "Registry Server: Unknown exception" ); + } + if (!CORBA::is_nil(object)) + { + MESSAGE( "Module Catalog Server: Logger Server was found" ); + REGISTRY=1; + break; + } + } + } + } if ((REGISTRY==1)||((EnvL==0)&&(!CORBA::is_nil(inc)))) - break; + break; } try @@ -171,53 +171,53 @@ int main( int argc , char **argv ) varComponents = ptrRegistry->_this() ; ptrRegistry->_remove_ref(); //let poa manage registryservice deletion // The RegistryService must not already exist. - + try - { - CORBA::Object_var pipo = naming.Resolve( registryName ) ; - if (CORBA::is_nil(pipo) ) throw ServiceUnreachable() ; - MESSAGE("RegistryService servant already existing" ) ; - exit( EXIT_FAILURE ) ; - } + { + CORBA::Object_var pipo = naming.Resolve( registryName ) ; + if (CORBA::is_nil(pipo) ) throw ServiceUnreachable() ; + MESSAGE("RegistryService servant already existing" ) ; + exit( EXIT_FAILURE ) ; + } catch( const ServiceUnreachable &ex ) - { - } + { + } catch( const CORBA::Exception &exx ) - { - } + { + } string absoluteName = string("/") + registryName; naming.Register( varComponents , absoluteName.c_str() ) ; MESSAGE("Wait client requests") ; try - { - // Activation du POA - MESSAGE("POA activation") ; - manager->activate() ; - - // Lancement de l'ORB - MESSAGE("ORB launching") ; + { + // Activation du POA + MESSAGE("POA activation") ; + manager->activate() ; + + // Lancement de l'ORB + MESSAGE("ORB launching") ; #ifdef CHECKTIME - Utils_Timer timer; - timer.Start(); - timer.Stop(); - MESSAGE("SALOME_Registry_Server.cxx - orb->run()"); - timer.ShowAbsolute(); + Utils_Timer timer; + timer.Start(); + timer.Stop(); + MESSAGE("SALOME_Registry_Server.cxx - orb->run()"); + timer.ShowAbsolute(); #endif - orb->run() ; - } + orb->run() ; + } catch( const CORBA::Exception &ex ) - { - MESSAGE("System error") ; - return EXIT_FAILURE ; - } - + { + MESSAGE("System error") ; + return EXIT_FAILURE ; + } + } catch( const SALOME_Exception &ex ) { MESSAGE( "Communication Error : " << ex.what() ) - return EXIT_FAILURE ; + return EXIT_FAILURE ; } - + END_OF( argv[0] ) ; // delete myThreadTrace; return 0 ; diff --git a/src/ResourcesManager/ResourcesManager.cxx b/src/ResourcesManager/ResourcesManager.cxx index dc3edc2df..fe92bda97 100644 --- a/src/ResourcesManager/ResourcesManager.cxx +++ b/src/ResourcesManager/ResourcesManager.cxx @@ -105,7 +105,7 @@ ResourcesManager_cpp::ResourcesManager_cpp() throw(ResourcesException) else { if(!getenv("KERNEL_ROOT_DIR")) - throw ResourcesException("you must define KERNEL_ROOT_DIR environment variable!! -> cannot load a CatalogResources.xml"); + throw ResourcesException("you must define KERNEL_ROOT_DIR environment variable!! -> cannot load a CatalogResources.xml"); default_file = getenv("KERNEL_ROOT_DIR"); default_file += "/share/salome/resources/kernel/CatalogResources.xml"; _path_resources.push_back(default_file); @@ -175,7 +175,7 @@ ResourcesManager_cpp::GetFittingResources(const resourceParams& params) throw(Re for (unsigned int i=0; i < sz; i++) { if (_resourcesList.find(params.resourceList[i]) != _resourcesList.end()) - local_resourcesList[params.resourceList[i]] = _resourcesList[params.resourceList[i]]; + local_resourcesList[params.resourceList[i]] = _resourcesList[params.resourceList[i]]; } } @@ -204,7 +204,7 @@ ResourcesManager_cpp::GetFittingResources(const resourceParams& params) throw(Re for (; iter != _resourcesList.end(); iter++) { if ((*iter).second.HostName == hostname) - vec.push_back((*iter).first); + vec.push_back((*iter).first); } } @@ -223,7 +223,7 @@ ResourcesManager_cpp::GetFittingResources(const resourceParams& params) throw(Re ResourceDataToSort::_CPUFreqMHzWanted = params.cpu_clock; ResourceDataToSort::_memInMBWanted = params.mem_mb; // --- end of set - + // Sort std::list li; std::vector::iterator iter = vec.begin(); @@ -265,15 +265,15 @@ ResourcesManager_cpp::GetFittingResources(const resourceParams& params) throw(Re int ResourcesManager_cpp::AddResourceInCatalog(const resourceParams& paramsOfNewResources, - const vector& componentsOnNewResources, - const char *userName, - AccessModeType mode, - AccessProtocolType prot, - AccessProtocolType iprot) throw(ResourcesException) + const vector& componentsOnNewResources, + const char *userName, + AccessModeType mode, + AccessProtocolType prot, + AccessProtocolType iprot) throw(ResourcesException) { vector::const_iterator iter = find(componentsOnNewResources.begin(), - componentsOnNewResources.end(), - "KERNEL"); + componentsOnNewResources.end(), + "KERNEL"); if (iter != componentsOnNewResources.end()) { @@ -382,39 +382,39 @@ const MapOfParserResourcesType& ResourcesManager_cpp::ParseXmlFiles() MapOfParserResourcesType _resourcesList_tmp; MapOfParserResourcesType _resourcesBatchList_tmp; SALOME_ResourcesCatalog_Handler* handler = - new SALOME_ResourcesCatalog_Handler(_resourcesList_tmp); + new SALOME_ResourcesCatalog_Handler(_resourcesList_tmp); const char* aFilePath = (*_path_resources_it).c_str(); FILE* aFile = fopen(aFilePath, "r"); if (aFile != NULL) { - xmlDocPtr aDoc = xmlReadFile(aFilePath, NULL, 0); - if (aDoc != NULL) - { - handler->ProcessXmlDocument(aDoc); - - // adding new resources to the file - for (MapOfParserResourcesType_it i = _resourcesList_tmp.begin(); i != _resourcesList_tmp.end(); ++i) - { - MapOfParserResourcesType_it j = _resourcesList.find(i->first); - if (j == _resourcesList.end()) - { - _resourcesList[i->first] = i->second; - } - else - { - std::cerr << "ParseXmlFiles Warning, to resource with the same name was found, taking the first declaration : " << i->first << std::endl; - } - } - } - else - std::cerr << "ResourcesManager_cpp: could not parse file " << aFilePath << std::endl; - // Free the document - xmlFreeDoc(aDoc); - fclose(aFile); + xmlDocPtr aDoc = xmlReadFile(aFilePath, NULL, 0); + if (aDoc != NULL) + { + handler->ProcessXmlDocument(aDoc); + + // adding new resources to the file + for (MapOfParserResourcesType_it i = _resourcesList_tmp.begin(); i != _resourcesList_tmp.end(); ++i) + { + MapOfParserResourcesType_it j = _resourcesList.find(i->first); + if (j == _resourcesList.end()) + { + _resourcesList[i->first] = i->second; + } + else + { + std::cerr << "ParseXmlFiles Warning, to resource with the same name was found, taking the first declaration : " << i->first << std::endl; + } + } + } + else + std::cerr << "ResourcesManager_cpp: could not parse file " << aFilePath << std::endl; + // Free the document + xmlFreeDoc(aDoc); + fclose(aFile); } else - std::cerr << "ResourcesManager_cpp: file " << aFilePath << " is not readable." << std::endl; + std::cerr << "ResourcesManager_cpp: file " << aFilePath << " is not readable." << std::endl; delete handler; } @@ -459,8 +459,8 @@ ResourcesManager_cpp::SelectOnlyResourcesWithOS(std::vector& resour { MapOfParserResourcesType::const_iterator it = _resourcesList.find(*iter); if(it != _resourcesList.end()) - if ( (*it).second.OS == OS) - resources.push_back(*iter); + if ( (*it).second.OS == OS) + resources.push_back(*iter); } } } @@ -473,7 +473,7 @@ ResourcesManager_cpp::SelectOnlyResourcesWithOS(std::vector& resour //============================================================================= void ResourcesManager_cpp::KeepOnlyResourcesWithComponent(std::vector& resources, - const vector& componentList) + const vector& componentList) { std::vector::iterator iter = resources.begin(); for (; iter != resources.end(); iter++) @@ -486,15 +486,15 @@ ResourcesManager_cpp::KeepOnlyResourcesWithComponent(std::vector& r { for(unsigned int i=0; i::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(), - mapOfComponentsOfCurrentHost.end(), - compoi); - if (itt == mapOfComponentsOfCurrentHost.end()) - { - erasedHost = true; - break; - } + const char* compoi = componentList[i].c_str(); + vector::const_iterator itt = find(mapOfComponentsOfCurrentHost.begin(), + mapOfComponentsOfCurrentHost.end(), + compoi); + if (itt == mapOfComponentsOfCurrentHost.end()) + { + erasedHost = true; + break; + } } } if(erasedHost) diff --git a/src/ResourcesManager/ResourcesManager.hxx b/src/ResourcesManager/ResourcesManager.hxx index c5ce0f2c8..9d1e42921 100644 --- a/src/ResourcesManager/ResourcesManager.hxx +++ b/src/ResourcesManager/ResourcesManager.hxx @@ -79,14 +79,14 @@ class RESOURCESMANAGER_EXPORT ResourcesManager_cpp GetFittingResources(const resourceParams& params) throw(ResourcesException); std::string Find(const std::string& policy, - const std::vector& listOfResources); + const std::vector& listOfResources); int AddResourceInCatalog (const resourceParams& paramsOfNewResources, - const std::vector& componentsOnNewResources, - const char *userName, - AccessModeType mode, - AccessProtocolType prot, - AccessProtocolType iprot) throw(ResourcesException); + const std::vector& componentsOnNewResources, + const char *userName, + AccessModeType mode, + AccessProtocolType prot, + AccessProtocolType iprot) throw(ResourcesException); void DeleteResourceInCatalog(const char * name); @@ -103,7 +103,7 @@ class RESOURCESMANAGER_EXPORT ResourcesManager_cpp void SelectOnlyResourcesWithOS(std::vector& resources, std::string OS); void KeepOnlyResourcesWithComponent(std::vector& resources, - const std::vector& componentList); + const std::vector& componentList); //! will contain the path to the ressources catalog std::list _path_resources; diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index b5c52eba1..2cf3e8b72 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -260,14 +260,14 @@ SALOME_ResourcesCatalog_Handler::ProcessCluster(xmlNodePtr cluster_descr, Parser xmlNodePtr members = aCurSubNode->xmlChildrenNode; while (members != NULL) { - // Process members - if (!xmlStrcmp(members->name, (const xmlChar*)test_machine)) - { - ParserResourcesClusterMembersType new_member; - if (ProcessMember(members, new_member)) - resource.ClusterMembersList.push_back(new_member); - } - members = members->next; + // Process members + if (!xmlStrcmp(members->name, (const xmlChar*)test_machine)) + { + ParserResourcesClusterMembersType new_member; + if (ProcessMember(members, new_member)) + resource.ClusterMembersList.push_back(new_member); + } + members = members->next; } } aCurSubNode = aCurSubNode->next; @@ -305,15 +305,15 @@ SALOME_ResourcesCatalog_Handler::ProcessMember(xmlNodePtr member_descr, ParserRe switch (protocol[0]) { case 'r': - resource.Protocol = rsh; - break; + resource.Protocol = rsh; + break; case 's': - resource.Protocol = ssh; - break; + resource.Protocol = ssh; + break; default: - std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl; - std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl; - return false; + std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl; + std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl; + return false; } xmlFree(protocol); } @@ -330,15 +330,15 @@ SALOME_ResourcesCatalog_Handler::ProcessMember(xmlNodePtr member_descr, ParserRe switch (iprotocol[0]) { case 'r': - resource.ClusterInternalProtocol = rsh; - break; + resource.ClusterInternalProtocol = rsh; + break; case 's': - resource.ClusterInternalProtocol = ssh; - break; + resource.ClusterInternalProtocol = ssh; + break; default: - std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl; - std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl; - return false; + std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl; + std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl; + return false; } xmlFree(iprotocol); } @@ -457,15 +457,15 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser switch ( protocol[0]) { case 'r': - resource.Protocol = rsh; - break; + resource.Protocol = rsh; + break; case 's': - resource.Protocol = ssh; - break; + resource.Protocol = ssh; + break; default: - // If it'not in all theses cases, the protocol is affected to rsh - resource.Protocol = rsh; - break; + // If it'not in all theses cases, the protocol is affected to rsh + resource.Protocol = rsh; + break; } xmlFree(protocol); } @@ -478,15 +478,15 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser switch ( iprotocol[0]) { case 'r': - resource.ClusterInternalProtocol = rsh; - break; + resource.ClusterInternalProtocol = rsh; + break; case 's': - resource.ClusterInternalProtocol = ssh; - break; + resource.ClusterInternalProtocol = ssh; + break; default: - // If it'not in all theses cases, the protocol is affected to rsh - resource.ClusterInternalProtocol = rsh; - break; + // If it'not in all theses cases, the protocol is affected to rsh + resource.ClusterInternalProtocol = rsh; + break; } xmlFree(iprotocol); } @@ -499,15 +499,15 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser switch ( mode[0] ) { case 'i': - resource.Mode = interactive; - break; + resource.Mode = interactive; + break; case 'b': - resource.Mode = batch; - break; + resource.Mode = batch; + break; default: - // If it'not in all theses cases, the mode is affected to interactive - resource.Mode = interactive; - break; + // If it'not in all theses cases, the mode is affected to interactive + resource.Mode = interactive; + break; } xmlFree(mode); } @@ -612,19 +612,19 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser //except if the module name is given if (xmlHasProp(aCurSubNode, (const xmlChar*)test_component_name)) { - xmlChar* component_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_component_name); - std::string aComponentName = (const char*)component_name; - _resource.ComponentsList.push_back(aComponentName); - if (xmlHasProp(aCurSubNode, (const xmlChar*)test_module_name)) - { - xmlChar* module_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_module_name); - std::string aModuleName = (const char*)module_name; - _resource.ModulesList.push_back(aModuleName); - xmlFree(module_name); - } - else - _resource.ModulesList.push_back(aComponentName); - xmlFree(component_name); + xmlChar* component_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_component_name); + std::string aComponentName = (const char*)component_name; + _resource.ComponentsList.push_back(aComponentName); + if (xmlHasProp(aCurSubNode, (const xmlChar*)test_module_name)) + { + xmlChar* module_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_module_name); + std::string aModuleName = (const char*)module_name; + _resource.ModulesList.push_back(aModuleName); + xmlFree(module_name); + } + else + _resource.ModulesList.push_back(aComponentName); + xmlFree(component_name); } } // Process modules @@ -674,79 +674,79 @@ void SALOME_ResourcesCatalog_Handler::PrepareDocToXmlFile(xmlDocPtr theDoc) switch ((*iter).second.Protocol) { case rsh: - xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "rsh"); - break; + xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "rsh"); + break; case ssh: - xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "ssh"); - break; + xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "ssh"); + break; default: - xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "rsh"); + xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "rsh"); } switch ((*iter).second.ClusterInternalProtocol) { case rsh: - xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh"); - break; + xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh"); + break; case ssh: - xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "ssh"); - break; + xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "ssh"); + break; default: - xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh"); + xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh"); } switch ((*iter).second.Mode) { case interactive: - xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "interactive"); - break; + xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "interactive"); + break; case batch: - xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "batch"); - break; + xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "batch"); + break; default: - xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "interactive"); + xmlNewProp(node, BAD_CAST test_mode, BAD_CAST "interactive"); } switch ((*iter).second.Batch) { case pbs: - xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "pbs"); - break; + xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "pbs"); + break; case lsf: - xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "lsf"); - break; + xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "lsf"); + break; case sge: - xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "sge"); - break; + xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "sge"); + break; case ssh_batch: - xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "ssh_batch"); - break; + xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "ssh_batch"); + break; default: - xmlNewProp(node, BAD_CAST test_batch, BAD_CAST ""); + xmlNewProp(node, BAD_CAST test_batch, BAD_CAST ""); } switch ((*iter).second.mpi) { case lam: - xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "lam"); - break; + xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "lam"); + break; case mpich1: - xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "mpich1"); - break; + xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "mpich1"); + break; case mpich2: - xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "mpich2"); - break; + xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "mpich2"); + break; case openmpi: - xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "openmpi"); - break; + xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "openmpi"); + break; case slurm: - xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "slurm"); - break; + xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "slurm"); + break; case prun: - xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "prun"); - break; + xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "prun"); + break; default: - xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST ""); + xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST ""); } xmlNewProp(node, BAD_CAST test_user_name, BAD_CAST (*iter).second.UserName.c_str()); diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx index aedbcbe72..ae1d56ffe 100644 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx @@ -62,7 +62,7 @@ unsigned int ResourceDataToSort::GetNumberOfPoints() const if (_nbOfProcWanted != NULL_VALUE) { - unsigned int nb_proc = _nbOfNodes * _nbOfProcPerNode; + unsigned int nb_proc = _nbOfNodes * _nbOfProcPerNode; if (nb_proc == _nbOfProcWanted) ret += 30000; else if (nb_proc > _nbOfProcWanted) diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 9232cc1a6..a84eca4d1 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -57,8 +57,8 @@ const char *SALOME_ResourcesManager::_ResourcesManagerNameInNS = "/ResourcesMana SALOME_ResourcesManager:: SALOME_ResourcesManager(CORBA::ORB_ptr orb, - PortableServer::POA_var poa, - SALOME_NamingService *ns, + PortableServer::POA_var poa, + SALOME_NamingService *ns, const char *xmlFilePath) : _rm(xmlFilePath) { MESSAGE("SALOME_ResourcesManager constructor"); @@ -84,8 +84,8 @@ SALOME_ResourcesManager(CORBA::ORB_ptr orb, //============================================================================= SALOME_ResourcesManager::SALOME_ResourcesManager(CORBA::ORB_ptr orb, - PortableServer::POA_var poa, - SALOME_NamingService *ns) : _rm() + PortableServer::POA_var poa, + SALOME_NamingService *ns) : _rm() { MESSAGE("SALOME_ResourcesManager constructor"); _NS = ns; @@ -261,8 +261,8 @@ SALOME_ResourcesManager::GetResourceDefinition(const char * name) std::string SALOME_ResourcesManager::getMachineFile(std::string hostname, - CORBA::Long nb_procs, - std::string parallelLib) + CORBA::Long nb_procs, + std::string parallelLib) { std::string machine_file_name(""); @@ -277,30 +277,30 @@ SALOME_ResourcesManager::getMachineFile(std::string hostname, // Check if resource is cluster or not if (resource.ClusterMembersList.empty()) { - //It is not a cluster so we create a cluster with one machine - ParserResourcesClusterMembersType fake_node; - fake_node.HostName = resource.HostName; - fake_node.Protocol = resource.Protocol; - fake_node.ClusterInternalProtocol = resource.ClusterInternalProtocol; - fake_node.UserName = resource.UserName; - fake_node.AppliPath = resource.AppliPath; - fake_node.DataForSort = resource.DataForSort; - - resource.ClusterMembersList.push_front(fake_node); + //It is not a cluster so we create a cluster with one machine + ParserResourcesClusterMembersType fake_node; + fake_node.HostName = resource.HostName; + fake_node.Protocol = resource.Protocol; + fake_node.ClusterInternalProtocol = resource.ClusterInternalProtocol; + fake_node.UserName = resource.UserName; + fake_node.AppliPath = resource.AppliPath; + fake_node.DataForSort = resource.DataForSort; + + resource.ClusterMembersList.push_front(fake_node); } // Creating list of machines for creating the machine file std::list list_of_machines; std::list::iterator cluster_it = - resource.ClusterMembersList.begin(); + resource.ClusterMembersList.begin(); while (cluster_it != resource.ClusterMembersList.end()) { - // For each member of the cluster we add a nbOfNodes * nbOfProcPerNode in the list - unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes * - (*cluster_it).DataForSort._nbOfProcPerNode; - for (unsigned int i = 0; i < number_of_proc; i++) - list_of_machines.push_back((*cluster_it).HostName); - cluster_it++; + // For each member of the cluster we add a nbOfNodes * nbOfProcPerNode in the list + unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes * + (*cluster_it).DataForSort._nbOfProcPerNode; + for (unsigned int i = 0; i < number_of_proc; i++) + list_of_machines.push_back((*cluster_it).HostName); + cluster_it++; } // Creating machine file @@ -311,14 +311,14 @@ SALOME_ResourcesManager::getMachineFile(std::string hostname, std::list::iterator it = list_of_machines.begin(); while (machine_number != nb_procs) { - // Adding a new node to the machine file - machine_file << *it << endl; - - // counting... - it++; - if (it == list_of_machines.end()) - it = list_of_machines.begin(); - machine_number++; + // Adding a new node to the machine file + machine_file << *it << endl; + + // counting... + it++; + if (it == list_of_machines.end()) + it = list_of_machines.begin(); + machine_number++; } } else @@ -335,42 +335,42 @@ SALOME_ResourcesManager::getMachineFile(std::string hostname, // Check if resource is cluster or not if (resource.ClusterMembersList.empty()) { - //It is not a cluster so we create a cluster with one machine - ParserResourcesClusterMembersType fake_node; - fake_node.HostName = resource.HostName; - fake_node.Protocol = resource.Protocol; - fake_node.ClusterInternalProtocol = resource.ClusterInternalProtocol; - fake_node.UserName = resource.UserName; - fake_node.AppliPath = resource.AppliPath; - fake_node.DataForSort = resource.DataForSort; - - resource.ClusterMembersList.push_front(fake_node); + //It is not a cluster so we create a cluster with one machine + ParserResourcesClusterMembersType fake_node; + fake_node.HostName = resource.HostName; + fake_node.Protocol = resource.Protocol; + fake_node.ClusterInternalProtocol = resource.ClusterInternalProtocol; + fake_node.UserName = resource.UserName; + fake_node.AppliPath = resource.AppliPath; + fake_node.DataForSort = resource.DataForSort; + + resource.ClusterMembersList.push_front(fake_node); } // Choose mpi implementation -> each MPI implementation has is own machinefile... if (resource.mpi == lam) { - // Creating machine file - machine_file_name = tmpnam(NULL); - std::ofstream machine_file(machine_file_name.c_str(), ios_base::out); - - // We add all cluster machines to the file - std::list::iterator cluster_it = - resource.ClusterMembersList.begin(); - while (cluster_it != resource.ClusterMembersList.end()) - { - unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes * - (*cluster_it).DataForSort._nbOfProcPerNode; - machine_file << (*cluster_it).HostName << " cpu=" << number_of_proc << endl; - cluster_it++; - } + // Creating machine file + machine_file_name = tmpnam(NULL); + std::ofstream machine_file(machine_file_name.c_str(), ios_base::out); + + // We add all cluster machines to the file + std::list::iterator cluster_it = + resource.ClusterMembersList.begin(); + while (cluster_it != resource.ClusterMembersList.end()) + { + unsigned int number_of_proc = (*cluster_it).DataForSort._nbOfNodes * + (*cluster_it).DataForSort._nbOfProcPerNode; + machine_file << (*cluster_it).HostName << " cpu=" << number_of_proc << endl; + cluster_it++; + } } else if (resource.mpi == nompi) { - INFOS("[getMachineFile] Error hostname MPI implementation was defined for " << hostname); + INFOS("[getMachineFile] Error hostname MPI implementation was defined for " << hostname); } else - INFOS("[getMachineFile] Error hostname MPI implementation not currenly handled for " << hostname); + INFOS("[getMachineFile] Error hostname MPI implementation not currenly handled for " << hostname); } else INFOS("[getMachineFile] Error hostname not found in resourcesList -> " << hostname); diff --git a/src/ResourcesManager/SALOME_ResourcesManager.hxx b/src/ResourcesManager/SALOME_ResourcesManager.hxx index f186718c6..5fd4e7145 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.hxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.hxx @@ -73,8 +73,8 @@ class SALOMERESOURCESMANAGER_EXPORT SALOME_ResourcesManager: void Shutdown(); ResourcesManager_cpp *GetImpl() { return &_rm; } std::string getMachineFile(std::string hostname, - CORBA::Long nb_procs, - std::string parallelLib); + CORBA::Long nb_procs, + std::string parallelLib); static const char *_ResourcesManagerNameInNS; diff --git a/src/SALOMEDS/SALOMEDS_AttLong_i.hxx b/src/SALOMEDS/SALOMEDS_AttLong_i.hxx index ad7084b20..e4b52713a 100644 --- a/src/SALOMEDS/SALOMEDS_AttLong_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttLong_i.hxx @@ -34,7 +34,7 @@ #include "SALOMEDS_BasicAttribute_i.hxx" class SALOMEDS_AttLong_i: public POA_SALOMEDS::AttLong, - public SALOMEDS_BasicAttribute_i { + public SALOMEDS_BasicAttribute_i { protected: char * _type; diff --git a/src/SALOMEDS/SALOMEDS_AttReal_i.hxx b/src/SALOMEDS/SALOMEDS_AttReal_i.hxx index 4eeb13ed8..997bcd63e 100644 --- a/src/SALOMEDS/SALOMEDS_AttReal_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttReal_i.hxx @@ -34,7 +34,7 @@ #include "SALOMEDS_BasicAttribute_i.hxx" class SALOMEDS_AttReal_i: public POA_SALOMEDS::AttReal, - public SALOMEDS_BasicAttribute_i { + public SALOMEDS_BasicAttribute_i { protected: char * _type; diff --git a/src/SALOMEDS/SALOMEDS_AttributeComment_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeComment_i.hxx index 070ccbbb9..f0c9f7d3f 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeComment_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeComment_i.hxx @@ -34,7 +34,7 @@ #include "SALOMEDSImpl_AttributeComment.hxx" class SALOMEDS_AttributeComment_i: public virtual POA_SALOMEDS::AttributeComment, - public virtual SALOMEDS_GenericAttribute_i + public virtual SALOMEDS_GenericAttribute_i { public: SALOMEDS_AttributeComment_i(SALOMEDSImpl_AttributeComment* theAttr, CORBA::ORB_ptr orb) diff --git a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx index 492f62811..5458181b4 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeExternalFileDef_i.hxx @@ -34,7 +34,7 @@ #include "SALOMEDSImpl_AttributeExternalFileDef.hxx" class SALOMEDS_AttributeExternalFileDef_i: public virtual POA_SALOMEDS::AttributeExternalFileDef, - public virtual SALOMEDS_GenericAttribute_i + public virtual SALOMEDS_GenericAttribute_i { public: diff --git a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx index f80fb8988..85ad5e578 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFileType_i.hxx @@ -34,7 +34,7 @@ #include "SALOMEDSImpl_AttributeFileType.hxx" class SALOMEDS_AttributeFileType_i: public virtual POA_SALOMEDS::AttributeFileType, - public virtual SALOMEDS_GenericAttribute_i { + public virtual SALOMEDS_GenericAttribute_i { public: SALOMEDS_AttributeFileType_i(SALOMEDSImpl_AttributeFileType* theAttr, CORBA::ORB_ptr orb) diff --git a/src/SALOMEDS/SALOMEDS_AttributeFlags_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeFlags_i.hxx index 16c193925..45a687375 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeFlags_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeFlags_i.hxx @@ -52,7 +52,7 @@ class SALOMEDS_AttributeFlags_i: public virtual POA_SALOMEDS::AttributeFlags, public: SALOMEDS_AttributeFlags_i( SALOMEDSImpl_AttributeFlags* theAttr, CORBA::ORB_ptr orb ) - :SALOMEDS_GenericAttribute_i(theAttr, orb) {}; + :SALOMEDS_GenericAttribute_i(theAttr, orb) {}; virtual ~SALOMEDS_AttributeFlags_i() {}; diff --git a/src/SALOMEDS/SALOMEDS_AttributeIOR_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeIOR_i.hxx index a1c415c3d..eb4b74fea 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeIOR_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeIOR_i.hxx @@ -33,7 +33,7 @@ #include "SALOMEDSImpl_AttributeIOR.hxx" class SALOMEDS_AttributeIOR_i: public virtual POA_SALOMEDS::AttributeIOR, - public virtual SALOMEDS_GenericAttribute_i { + public virtual SALOMEDS_GenericAttribute_i { public: SALOMEDS_AttributeIOR_i(SALOMEDSImpl_AttributeIOR* theAttr, CORBA::ORB_ptr orb) diff --git a/src/SALOMEDS/SALOMEDS_AttributeInteger_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeInteger_i.hxx index 8ddaf37a1..a710c4267 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeInteger_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeInteger_i.hxx @@ -36,7 +36,7 @@ #include "SALOMEDSImpl_AttributeInteger.hxx" class SALOMEDS_AttributeInteger_i: public virtual POA_SALOMEDS::AttributeInteger, - public virtual SALOMEDS_GenericAttribute_i { + public virtual SALOMEDS_GenericAttribute_i { public: SALOMEDS_AttributeInteger_i(SALOMEDSImpl_AttributeInteger* theAttr, CORBA::ORB_ptr orb) diff --git a/src/SALOMEDS/SALOMEDS_AttributeName_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeName_i.hxx index 978301c70..7683e0403 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeName_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeName_i.hxx @@ -35,7 +35,7 @@ #include "SALOMEDSImpl_AttributeName.hxx" class SALOMEDS_AttributeName_i: public virtual POA_SALOMEDS::AttributeName, - public virtual SALOMEDS_GenericAttribute_i + public virtual SALOMEDS_GenericAttribute_i { public: diff --git a/src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx index 0ae2e1be4..a47b4c880 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx @@ -40,7 +40,7 @@ */ class SALOMEDS_AttributeParameter_i: public virtual POA_SALOMEDS::AttributeParameter, - public virtual SALOMEDS_GenericAttribute_i + public virtual SALOMEDS_GenericAttribute_i { public: diff --git a/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.hxx b/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.hxx index f1aea71bc..a9114080b 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributePersistentRef_i.hxx @@ -33,7 +33,7 @@ #include "SALOMEDSImpl_AttributePersistentRef.hxx" class SALOMEDS_AttributePersistentRef_i: public virtual POA_SALOMEDS::AttributePersistentRef, - public virtual SALOMEDS_GenericAttribute_i { + public virtual SALOMEDS_GenericAttribute_i { public: SALOMEDS_AttributePersistentRef_i(SALOMEDSImpl_AttributePersistentRef* theAttr, CORBA::ORB_ptr orb) diff --git a/src/SALOMEDS/SALOMEDS_AttributePixMap_i.hxx b/src/SALOMEDS/SALOMEDS_AttributePixMap_i.hxx index 65a0ddd00..8a533e189 100644 --- a/src/SALOMEDS/SALOMEDS_AttributePixMap_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributePixMap_i.hxx @@ -34,7 +34,7 @@ #include "SALOMEDSImpl_AttributePixMap.hxx" class SALOMEDS_AttributePixMap_i: public virtual POA_SALOMEDS::AttributePixMap, - public virtual SALOMEDS_GenericAttribute_i + public virtual SALOMEDS_GenericAttribute_i { public: diff --git a/src/SALOMEDS/SALOMEDS_AttributeReal_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeReal_i.hxx index ef5d0363f..a661f28db 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeReal_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeReal_i.hxx @@ -34,7 +34,7 @@ #include "SALOMEDSImpl_AttributeReal.hxx" class SALOMEDS_AttributeReal_i: public virtual POA_SALOMEDS::AttributeReal, - public virtual SALOMEDS_GenericAttribute_i { + public virtual SALOMEDS_GenericAttribute_i { public: SALOMEDS_AttributeReal_i(SALOMEDSImpl_AttributeReal* theAttr, CORBA::ORB_ptr orb) diff --git a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.hxx index 1d68ee7cf..0c23824e6 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.hxx @@ -34,7 +34,7 @@ #include "SALOMEDSImpl_AttributeSequenceOfReal.hxx" class SALOMEDS_AttributeSequenceOfReal_i: public virtual POA_SALOMEDS::AttributeSequenceOfReal, - public virtual SALOMEDS_GenericAttribute_i { + public virtual SALOMEDS_GenericAttribute_i { public: SALOMEDS_AttributeSequenceOfReal_i(SALOMEDSImpl_AttributeSequenceOfReal* theAttr, CORBA::ORB_ptr orb) diff --git a/src/SALOMEDS/SALOMEDS_AttributeString_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeString_i.hxx index 798462d1d..731a3f152 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeString_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeString_i.hxx @@ -34,7 +34,7 @@ #include "SALOMEDSImpl_AttributeString.hxx" class SALOMEDS_AttributeString_i: public virtual POA_SALOMEDS::AttributeString, - public virtual SALOMEDS_GenericAttribute_i + public virtual SALOMEDS_GenericAttribute_i { public: SALOMEDS_AttributeString_i(SALOMEDSImpl_AttributeString* theAttr, CORBA::ORB_ptr orb) diff --git a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx index 111ea32c7..c4aaf86f6 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx @@ -83,18 +83,18 @@ void SALOMEDS_AttributeStudyProperties::SetCreationDate anImpl->SetModification(S, theMinute, theHour, theDay, theMonth, theYear); } else { ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->SetCreationDate(theMinute, - theHour, - theDay, - theMonth, - theYear); + theHour, + theDay, + theMonth, + theYear); } } bool SALOMEDS_AttributeStudyProperties::GetCreationDate(int& theMinute, - int& theHour, - int& theDay, - int& theMonth, - int& theYear) + int& theHour, + int& theDay, + int& theMonth, + int& theYear) { bool ret; if (_isLocal) { @@ -104,10 +104,10 @@ bool SALOMEDS_AttributeStudyProperties::GetCreationDate(int& theMinute, } else { CORBA::Long aMinute, anHour, aDay, aMonth, anYear; ret = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetCreationDate(aMinute, - anHour, - aDay, - aMonth, - anYear); + anHour, + aDay, + aMonth, + anYear); theMinute = (int)aMinute; theHour = (int)anHour; theDay = (int)aDay; @@ -203,11 +203,11 @@ bool SALOMEDS_AttributeStudyProperties::IsLocked() } void SALOMEDS_AttributeStudyProperties::SetModification(const std::string& theName, - int theMinute, - int theHour, - int theDay, - int theMonth, - int theYear) + int theMinute, + int theHour, + int theDay, + int theMonth, + int theYear) { if (_isLocal) { CheckLocked(); @@ -224,12 +224,12 @@ void SALOMEDS_AttributeStudyProperties::SetModification(const std::string& theNa } void SALOMEDS_AttributeStudyProperties::GetModificationsList(std::vector& theNames, - std::vector& theMinutes, - std::vector& theHours, - std::vector& theDays, - std::vector& theMonths, - std::vector& theYears, - bool theWithCreator) + std::vector& theMinutes, + std::vector& theHours, + std::vector& theDays, + std::vector& theMonths, + std::vector& theYears, + bool theWithCreator) { int i, aLength; @@ -253,12 +253,12 @@ void SALOMEDS_AttributeStudyProperties::GetModificationsList(std::vectorGetModificationsList(aNames.out(), - aMinutes.out(), - aHours.out(), - aDays.out(), - aMonths.out(), - aYears.out(), - theWithCreator); + aMinutes.out(), + aHours.out(), + aDays.out(), + aMonths.out(), + aYears.out(), + theWithCreator); aLength = aNames->length(); for (i = 0; i& theNames, - std::vector& theMinutes, - std::vector& theHours, - std::vector& theDays, - std::vector& theMonths, - std::vector& theYears, - bool theWithCreator); + std::vector& theMinutes, + std::vector& theHours, + std::vector& theDays, + std::vector& theMonths, + std::vector& theYears, + bool theWithCreator); }; diff --git a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx index b1415aab8..47c67d1b4 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx @@ -47,10 +47,10 @@ char* SALOMEDS_AttributeStudyProperties_i::GetUserName() } void SALOMEDS_AttributeStudyProperties_i::SetCreationDate(CORBA::Long theMinute, - CORBA::Long theHour, - CORBA::Long theDay, - CORBA::Long theMonth, - CORBA::Long theYear) + CORBA::Long theHour, + CORBA::Long theDay, + CORBA::Long theMonth, + CORBA::Long theYear) { SALOMEDS::Locker lock; CheckLocked(); @@ -62,10 +62,10 @@ void SALOMEDS_AttributeStudyProperties_i::SetCreationDate(CORBA::Long theMinute, } CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::GetCreationDate(CORBA::Long& theMinute, - CORBA::Long& theHour, - CORBA::Long& theDay, - CORBA::Long& theMonth, - CORBA::Long& theYear) + CORBA::Long& theHour, + CORBA::Long& theDay, + CORBA::Long& theMonth, + CORBA::Long& theYear) { SALOMEDS::Locker lock; int aMinute; @@ -137,11 +137,11 @@ CORBA::Boolean SALOMEDS_AttributeStudyProperties_i::IsLocked() } void SALOMEDS_AttributeStudyProperties_i::SetModification(const char* theName, - CORBA::Long theMinute, - CORBA::Long theHour, - CORBA::Long theDay, - CORBA::Long theMonth, - CORBA::Long theYear) + CORBA::Long theMinute, + CORBA::Long theHour, + CORBA::Long theDay, + CORBA::Long theMonth, + CORBA::Long theYear) { SALOMEDS::Locker lock; CheckLocked(); @@ -151,12 +151,12 @@ void SALOMEDS_AttributeStudyProperties_i::SetModification(const char* theName, } void SALOMEDS_AttributeStudyProperties_i::GetModificationsList(SALOMEDS::StringSeq_out theNames, - SALOMEDS::LongSeq_out theMinutes, - SALOMEDS::LongSeq_out theHours, - SALOMEDS::LongSeq_out theDays, - SALOMEDS::LongSeq_out theMonths, - SALOMEDS::LongSeq_out theYears, - CORBA::Boolean theWithCreator) + SALOMEDS::LongSeq_out theMinutes, + SALOMEDS::LongSeq_out theHours, + SALOMEDS::LongSeq_out theDays, + SALOMEDS::LongSeq_out theMonths, + SALOMEDS::LongSeq_out theYears, + CORBA::Boolean theWithCreator) { SALOMEDS::Locker lock; vector aNames; diff --git a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.hxx index 1b53e3a12..e6a460ba7 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.hxx @@ -54,18 +54,18 @@ public: virtual void SetLocked(CORBA::Boolean theLocked); virtual CORBA::Boolean IsLocked(); virtual void SetModification(const char* theName, - CORBA::Long theMinute, - CORBA::Long theHour, - CORBA::Long theDay, - CORBA::Long theMonth, - CORBA::Long theYear); + CORBA::Long theMinute, + CORBA::Long theHour, + CORBA::Long theDay, + CORBA::Long theMonth, + CORBA::Long theYear); virtual void GetModificationsList(SALOMEDS::StringSeq_out theNames, - SALOMEDS::LongSeq_out theMinutes, - SALOMEDS::LongSeq_out theHours, - SALOMEDS::LongSeq_out theDays, - SALOMEDS::LongSeq_out theMonths, - SALOMEDS::LongSeq_out theYears, - CORBA::Boolean theWithCreator); + SALOMEDS::LongSeq_out theMinutes, + SALOMEDS::LongSeq_out theHours, + SALOMEDS::LongSeq_out theDays, + SALOMEDS::LongSeq_out theMonths, + SALOMEDS::LongSeq_out theYears, + CORBA::Boolean theWithCreator); }; diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx b/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx index 88165807d..76edbef91 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx @@ -50,7 +50,7 @@ STextColor SALOMEDS_AttributeTextColor::TextColor() vector aSeq = dynamic_cast(_local_impl)->TextColor(); aColor.R = aSeq[0]; aColor.G = aSeq[1]; - aColor.B = aSeq[2]; + aColor.B = aSeq[2]; } else { SALOMEDS::Color anImplColor = SALOMEDS::AttributeTextColor::_narrow(_corba_impl)->TextColor(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.hxx index ffe6a8c93..14a0e2326 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextColor_i.hxx @@ -35,7 +35,7 @@ #include "SALOMEDSImpl_AttributeTextColor.hxx" class SALOMEDS_AttributeTextColor_i: public virtual POA_SALOMEDS::AttributeTextColor, - public virtual SALOMEDS_GenericAttribute_i + public virtual SALOMEDS_GenericAttribute_i { public: diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx index de50af1d1..a6192565f 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx @@ -52,7 +52,7 @@ STextColor SALOMEDS_AttributeTextHighlightColor::TextHighlightColor() vector aSeq = dynamic_cast(_local_impl)->TextHighlightColor(); aColor.R = aSeq[0]; aColor.G = aSeq[1]; - aColor.B = aSeq[2]; + aColor.B = aSeq[2]; } else { SALOMEDS::Color anImplColor = diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.hxx index 6cba2928e..348e687ed 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor_i.hxx @@ -34,7 +34,7 @@ #include "SALOMEDSImpl_AttributeTextHighlightColor.hxx" class SALOMEDS_AttributeTextHighlightColor_i: public virtual POA_SALOMEDS::AttributeTextHighlightColor, - public virtual SALOMEDS_GenericAttribute_i + public virtual SALOMEDS_GenericAttribute_i { public: diff --git a/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx index d98808daf..7c17764b6 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTreeNode_i.cxx @@ -30,7 +30,7 @@ using namespace std; static SALOMEDSImpl_AttributeTreeNode* GetNode(SALOMEDS::AttributeTreeNode_ptr value, - SALOMEDSImpl_AttributeTreeNode* aNode) + SALOMEDSImpl_AttributeTreeNode* aNode) { SALOMEDSImpl_AttributeTreeNode* aResult = NULL; DF_Label aLabel = DF_Label::Label(aNode->Label(), value->Label()); diff --git a/src/SALOMEDS/SALOMEDS_BasicAttributeFactory.cxx b/src/SALOMEDS/SALOMEDS_BasicAttributeFactory.cxx index 58ee4137c..cfca4db2d 100644 --- a/src/SALOMEDS/SALOMEDS_BasicAttributeFactory.cxx +++ b/src/SALOMEDS/SALOMEDS_BasicAttributeFactory.cxx @@ -40,13 +40,13 @@ SALOMEDS_BasicAttribute_i* BasicAttributeFactory::Create(const char* type) try { if (!strcmp(type,"AttReal")) { - SALOMEDS_AttReal_i *A = new SALOMEDS_AttReal_i(); - return A; + SALOMEDS_AttReal_i *A = new SALOMEDS_AttReal_i(); + return A; } else if(!strcmp(type,"AttLong")) { - SALOMEDS_AttLong_i *A = new SALOMEDS_AttLong_i(); - return A; + SALOMEDS_AttLong_i *A = new SALOMEDS_AttLong_i(); + return A; } else throw(SALOME_Exception(LOCALIZED("bad attribute type name"))); } catch (...) {throw(SALOME_Exception(LOCALIZED("Unexpected exception was caught")));} diff --git a/src/SALOMEDS/SALOMEDS_BasicAttribute_i.hxx b/src/SALOMEDS/SALOMEDS_BasicAttribute_i.hxx index 237cd1123..8e615018e 100644 --- a/src/SALOMEDS/SALOMEDS_BasicAttribute_i.hxx +++ b/src/SALOMEDS/SALOMEDS_BasicAttribute_i.hxx @@ -34,7 +34,7 @@ #include class SALOMEDS_BasicAttribute_i: public POA_SALOMEDS::BasicAttribute, - public PortableServer::ServantBase { + public PortableServer::ServantBase { protected: DF_Label _Lab; diff --git a/src/SALOMEDS/SALOMEDS_Callback_i.hxx b/src/SALOMEDS/SALOMEDS_Callback_i.hxx index de95e492b..5f6a7cb94 100644 --- a/src/SALOMEDS/SALOMEDS_Callback_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Callback_i.hxx @@ -32,7 +32,7 @@ #include CORBA_SERVER_HEADER(SALOMEDS) class SALOMEDS_Callback_i: public virtual POA_SALOMEDS::Callback, - public virtual PortableServer::ServantBase + public virtual PortableServer::ServantBase { private: SALOMEDS::UseCaseBuilder_var _builder; diff --git a/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx b/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx index 40ccf2034..4375ea04d 100644 --- a/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx +++ b/src/SALOMEDS/SALOMEDS_ChildIterator_i.cxx @@ -38,7 +38,7 @@ using namespace std; */ //============================================================================ SALOMEDS_ChildIterator_i::SALOMEDS_ChildIterator_i(const SALOMEDSImpl_ChildIterator& theImpl, - CORBA::ORB_ptr orb) + CORBA::ORB_ptr orb) : _it(theImpl.GetPersistentCopy()) { SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_ChildIterator_i.hxx b/src/SALOMEDS/SALOMEDS_ChildIterator_i.hxx index 09ac451e5..264772c1e 100644 --- a/src/SALOMEDS/SALOMEDS_ChildIterator_i.hxx +++ b/src/SALOMEDS/SALOMEDS_ChildIterator_i.hxx @@ -39,8 +39,8 @@ #include class SALOMEDS_ChildIterator_i: public virtual POA_SALOMEDS::ChildIterator, - public virtual PortableServer::ServantBase, - public virtual SALOME::GenericObj_i + public virtual PortableServer::ServantBase, + public virtual SALOME::GenericObj_i { private: CORBA::ORB_var _orb; diff --git a/src/SALOMEDS/SALOMEDS_Client.cxx b/src/SALOMEDS/SALOMEDS_Client.cxx index d0ffb0e88..79d01a83f 100644 --- a/src/SALOMEDS/SALOMEDS_Client.cxx +++ b/src/SALOMEDS/SALOMEDS_Client.cxx @@ -50,12 +50,12 @@ static void DumpComponent(SALOMEDS::Study_ptr Study,SALOMEDS::SObject_ptr SO, in SALOMEDS::AttributeName_var Name = SALOMEDS::AttributeName::_narrow(anAttr); CORBA::String_var Val = Name->Value(); for (int i = 1; i <= offset ; i++) - MESSAGE("--"); + MESSAGE("--"); MESSAGE(">"<GetID()<ReferencedObject(RefSO)) { for (int i = 1; i <= offset ; i++) - MESSAGE(" "); + MESSAGE(" "); MESSAGE("*Reference"<GetID()); } DumpComponent(Study,CSO,offset+2); diff --git a/src/SALOMEDS/SALOMEDS_Driver_i.cxx b/src/SALOMEDS/SALOMEDS_Driver_i.cxx index 4d851194c..9d482fd5d 100644 --- a/src/SALOMEDS/SALOMEDS_Driver_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Driver_i.cxx @@ -35,9 +35,9 @@ SALOMEDS_Driver_i::~SALOMEDS_Driver_i() } SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::Save(const SALOMEDSImpl_SComponent& theComponent, - const string& theURL, - long& theStreamLength, - bool isMultiFile) + const string& theURL, + long& theStreamLength, + bool isMultiFile) { SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb); CORBA::String_var url = CORBA::string_dup(theURL.c_str()); @@ -52,9 +52,9 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::Save(const SALOMEDSImpl_SComponent& the } SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::SaveASCII(const SALOMEDSImpl_SComponent& theComponent, - const string& theURL, - long& theStreamLength, - bool isMultiFile) + const string& theURL, + long& theStreamLength, + bool isMultiFile) { SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb); CORBA::String_var url = CORBA::string_dup(theURL.c_str()); @@ -69,10 +69,10 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::SaveASCII(const SALOMEDSImpl_SComponent } bool SALOMEDS_Driver_i::Load(const SALOMEDSImpl_SComponent& theComponent, - const unsigned char* theStream, - const long theStreamLength, - const string& theURL, - bool isMultiFile) + const unsigned char* theStream, + const long theStreamLength, + const string& theURL, + bool isMultiFile) { SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb); CORBA::String_var url = CORBA::string_dup(theURL.c_str()); @@ -92,10 +92,10 @@ bool SALOMEDS_Driver_i::Load(const SALOMEDSImpl_SComponent& theComponent, } bool SALOMEDS_Driver_i::LoadASCII(const SALOMEDSImpl_SComponent& theComponent, - const unsigned char* theStream, - const long theStreamLength, - const string& theURL, - bool isMultiFile) + const unsigned char* theStream, + const long theStreamLength, + const string& theURL, + bool isMultiFile) { SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb); CORBA::String_var url = CORBA::string_dup(theURL.c_str()); @@ -126,9 +126,9 @@ void SALOMEDS_Driver_i::Close(const SALOMEDSImpl_SComponent& theComponent) string SALOMEDS_Driver_i::IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject, - const string& IORString, - bool isMultiFile, - bool isASCII) + const string& IORString, + bool isMultiFile, + bool isASCII) { SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theSObject, _orb); CORBA::String_var ior = CORBA::string_dup(IORString.c_str()); @@ -142,9 +142,9 @@ string SALOMEDS_Driver_i::IORToLocalPersistentID(const SALOMEDSImpl_SObject& the string SALOMEDS_Driver_i::LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theObject, - const string& aLocalPersistentID, - bool isMultiFile, - bool isASCII) + const string& aLocalPersistentID, + bool isMultiFile, + bool isASCII) { SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb); CORBA::String_var pers_string = CORBA::string_dup(aLocalPersistentID.c_str()); @@ -168,8 +168,8 @@ bool SALOMEDS_Driver_i::CanCopy(const SALOMEDSImpl_SObject& theObject) SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::CopyFrom(const SALOMEDSImpl_SObject& theObject, - int& theObjectID, - long& theStreamLength) + int& theObjectID, + long& theStreamLength) { SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb); @@ -193,9 +193,9 @@ bool SALOMEDS_Driver_i::CanPaste(const string& theComponentName, int theObjectID } string SALOMEDS_Driver_i::PasteInto(const unsigned char* theStream, - const long theStreamLength, - int theObjectID, - const SALOMEDSImpl_SObject& theObject) + const long theStreamLength, + int theObjectID, + const SALOMEDSImpl_SObject& theObject) { SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (theObject, _orb); CORBA::Octet* anOctetBuf = (CORBA::Octet*)theStream; @@ -214,9 +214,9 @@ string SALOMEDS_Driver_i::PasteInto(const unsigned char* theStream, } SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::DumpPython(SALOMEDSImpl_Study* theStudy, - bool isPublished, - bool& isValidScript, - long& theStreamLength) + bool isPublished, + bool& isValidScript, + long& theStreamLength) { SALOMEDS_Study_i * st_servant = new SALOMEDS_Study_i (theStudy, _orb); SALOMEDS::Study_var st = SALOMEDS::Study::_narrow(st_servant->_this()); diff --git a/src/SALOMEDS/SALOMEDS_Driver_i.hxx b/src/SALOMEDS/SALOMEDS_Driver_i.hxx index 369174fc6..32238aa87 100644 --- a/src/SALOMEDS/SALOMEDS_Driver_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Driver_i.hxx @@ -55,26 +55,26 @@ public: } virtual SALOMEDSImpl_TMPFile* Save(const SALOMEDSImpl_SComponent& theComponent, - const std::string& theURL, - long& theStreamLength, - bool isMultiFile); + const std::string& theURL, + long& theStreamLength, + bool isMultiFile); virtual SALOMEDSImpl_TMPFile* SaveASCII(const SALOMEDSImpl_SComponent& theComponent, - const std::string& theURL, - long& theStreamLength, - bool isMultiFile); + const std::string& theURL, + long& theStreamLength, + bool isMultiFile); virtual bool Load(const SALOMEDSImpl_SComponent& theComponent, - const unsigned char* theStream, - const long theStreamLength, - const std::string& theURL, - bool isMultiFile); + const unsigned char* theStream, + const long theStreamLength, + const std::string& theURL, + bool isMultiFile); virtual bool LoadASCII(const SALOMEDSImpl_SComponent& theComponent, - const unsigned char* theStream, - const long theStreamLength, - const std::string& theURL, - bool isMultiFile); + const unsigned char* theStream, + const long theStreamLength, + const std::string& theURL, + bool isMultiFile); virtual void Close(const SALOMEDSImpl_SComponent& theComponent); @@ -86,32 +86,32 @@ public: virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject, - const std::string& IORString, - bool isMultiFile, - bool isASCII); + const std::string& IORString, + bool isMultiFile, + bool isASCII); virtual std::string LocalPersistentIDToIOR(const SALOMEDSImpl_SObject& theSObject, - const std::string& aLocalPersistentID, - bool isMultiFile, - bool isASCII); + const std::string& aLocalPersistentID, + bool isMultiFile, + bool isASCII); virtual bool CanCopy(const SALOMEDSImpl_SObject& theObject); virtual SALOMEDSImpl_TMPFile* CopyFrom(const SALOMEDSImpl_SObject& theObject, - int& theObjectID, - long& theStreamLength); + int& theObjectID, + long& theStreamLength); virtual bool CanPaste(const std::string& theComponentName, int theObjectID); virtual std::string PasteInto(const unsigned char* theStream, - const long theStreamLength, - int theObjectID, - const SALOMEDSImpl_SObject& theObject); + const long theStreamLength, + int theObjectID, + const SALOMEDSImpl_SObject& theObject); virtual SALOMEDSImpl_TMPFile* DumpPython(SALOMEDSImpl_Study* theStudy, - bool isPublished, - bool& isValidScript, - long& theStreamLength); + bool isPublished, + bool& isValidScript, + long& theStreamLength); }; #include "SALOME_NamingService.hxx" diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.hxx b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.hxx index 69fc111fb..0387ebb7e 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.hxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.hxx @@ -35,8 +35,8 @@ #include "SALOMEDSImpl_GenericAttribute.hxx" class Standard_EXPORT SALOMEDS_GenericAttribute_i: public virtual POA_SALOMEDS::GenericAttribute, - public virtual PortableServer::ServantBase, - public virtual SALOME::GenericObj_i + public virtual PortableServer::ServantBase, + public virtual SALOME::GenericObj_i { protected: diff --git a/src/SALOMEDS/SALOMEDS_SComponent.cxx b/src/SALOMEDS/SALOMEDS_SComponent.cxx index 30edcb280..e79f15eed 100644 --- a/src/SALOMEDS/SALOMEDS_SComponent.cxx +++ b/src/SALOMEDS/SALOMEDS_SComponent.cxx @@ -70,7 +70,7 @@ bool SALOMEDS_SComponent::ComponentIOR(std::string& theID) else { CORBA::String_var anIOR; ret = (SALOMEDS::SComponent::_narrow(GetCORBAImpl()))->ComponentIOR(anIOR.out()); - theID = std::string(anIOR.in()); + theID = std::string(anIOR.in()); } return ret; diff --git a/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx b/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx index 32ba53b3e..1d70da008 100644 --- a/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SComponentIterator_i.cxx @@ -36,7 +36,7 @@ using namespace std; //============================================================================ SALOMEDS_SComponentIterator_i::SALOMEDS_SComponentIterator_i(const SALOMEDSImpl_SComponentIterator& theImpl, - CORBA::ORB_ptr orb) + CORBA::ORB_ptr orb) { _orb = CORBA::ORB::_duplicate(orb); _impl = theImpl.GetPersistentCopy(); diff --git a/src/SALOMEDS/SALOMEDS_SComponentIterator_i.hxx b/src/SALOMEDS/SALOMEDS_SComponentIterator_i.hxx index 1b9e1680c..d14b07cf3 100644 --- a/src/SALOMEDS/SALOMEDS_SComponentIterator_i.hxx +++ b/src/SALOMEDS/SALOMEDS_SComponentIterator_i.hxx @@ -39,8 +39,8 @@ #include "SALOMEDSImpl_SComponentIterator.hxx" class SALOMEDS_SComponentIterator_i:public virtual POA_SALOMEDS::SComponentIterator, - public virtual PortableServer::ServantBase, - public virtual SALOME::GenericObj_i + public virtual PortableServer::ServantBase, + public virtual SALOME::GenericObj_i { private: diff --git a/src/SALOMEDS/SALOMEDS_SComponent_i.hxx b/src/SALOMEDS/SALOMEDS_SComponent_i.hxx index 9b4a8e577..f0b1282c5 100644 --- a/src/SALOMEDS/SALOMEDS_SComponent_i.hxx +++ b/src/SALOMEDS/SALOMEDS_SComponent_i.hxx @@ -40,7 +40,7 @@ #include "SALOMEDSImpl_SComponent.hxx" class Standard_EXPORT SALOMEDS_SComponent_i: public POA_SALOMEDS::SComponent, - public SALOMEDS_SObject_i + public SALOMEDS_SObject_i { public: diff --git a/src/SALOMEDS/SALOMEDS_SObject_i.cxx b/src/SALOMEDS/SALOMEDS_SObject_i.cxx index 6398b8a6e..9f355a397 100644 --- a/src/SALOMEDS/SALOMEDS_SObject_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject_i.cxx @@ -64,7 +64,7 @@ SALOMEDS_SObject_i::SALOMEDS_SObject_i(const SALOMEDSImpl_SObject& impl, CORBA:: if(!impl.IsNull()) { if(impl.IsComponent()) { SALOMEDSImpl_SComponent sco = impl; - _impl = sco.GetPersistentCopy(); + _impl = sco.GetPersistentCopy(); } else { _impl = impl.GetPersistentCopy(); @@ -148,7 +148,7 @@ SALOMEDS::Study_ptr SALOMEDS_SObject_i::GetStudy() */ //============================================================================ CORBA::Boolean SALOMEDS_SObject_i::FindAttribute (SALOMEDS::GenericAttribute_out anAttribute, - const char* aTypeOfAttribute) + const char* aTypeOfAttribute) { SALOMEDS::Locker lock; DF_Attribute* anAttr = NULL; @@ -181,7 +181,7 @@ SALOMEDS::ListOfAttributes* SALOMEDS_SObject_i::GetAllAttributes() SALOMEDS::GenericAttribute_var anAttribute; anAttribute = SALOMEDS_GenericAttribute_i::CreateAttribute(anAttr, _orb); if (!CORBA::is_nil(anAttribute)) { - SeqOfAttr[i] = anAttribute; + SeqOfAttr[i] = anAttribute; } } } diff --git a/src/SALOMEDS/SALOMEDS_SObject_i.hxx b/src/SALOMEDS/SALOMEDS_SObject_i.hxx index 7190778f3..07cbfabf6 100644 --- a/src/SALOMEDS/SALOMEDS_SObject_i.hxx +++ b/src/SALOMEDS/SALOMEDS_SObject_i.hxx @@ -38,8 +38,8 @@ #include "SALOMEDSImpl_SObject.hxx" class Standard_EXPORT SALOMEDS_SObject_i: public virtual POA_SALOMEDS::SObject, - public virtual PortableServer::ServantBase, - public virtual SALOME::GenericObj_i + public virtual PortableServer::ServantBase, + public virtual SALOME::GenericObj_i { protected: CORBA::ORB_var _orb; diff --git a/src/SALOMEDS/SALOMEDS_Server.cxx b/src/SALOMEDS/SALOMEDS_Server.cxx index 2a5ea5c3e..26e9474e7 100644 --- a/src/SALOMEDS/SALOMEDS_Server.cxx +++ b/src/SALOMEDS/SALOMEDS_Server.cxx @@ -78,78 +78,78 @@ int main(int argc, char** argv) const char * Env = getenv("USE_LOGGER"); int EnvL =0; if ((Env!=NULL) && (strlen(Env))) - EnvL=1; + EnvL=1; CosNaming::Name name; name.length(1); name[0].id=CORBA::string_dup("Logger"); PortableServer::POAManager_var pman; for (int i = 1; i<=NumberOfTries; i++) - { - if (i!=1) + { + if (i!=1) #ifndef WIN32 - a=nanosleep(&ts_req,&ts_rem); + a=nanosleep(&ts_req,&ts_rem); #else - Sleep(TIMESleep/1000000); + Sleep(TIMESleep/1000000); #endif - try - { - obj = orb->resolve_initial_references("RootPOA"); - if(!CORBA::is_nil(obj)) - poa = PortableServer::POA::_narrow(obj); - if(!CORBA::is_nil(poa)) - pman = poa->the_POAManager(); - if(!CORBA::is_nil(orb)) - theObj = orb->resolve_initial_references("NameService"); - if (!CORBA::is_nil(theObj)){ - inc = CosNaming::NamingContext::_narrow(theObj); - if(!CORBA::is_nil(inc)) - { - MESSAGE( "SalomeDS Server: Naming Service was found" ); - if(EnvL==1) - { - CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ; - SALOME_NamingService &NS = *SINGLETON_::Instance() ; - NS.init_orb( orb1 ) ; - for(int j=1; j<=NumberOfTries; j++) - { - if (j!=1) + try + { + obj = orb->resolve_initial_references("RootPOA"); + if(!CORBA::is_nil(obj)) + poa = PortableServer::POA::_narrow(obj); + if(!CORBA::is_nil(poa)) + pman = poa->the_POAManager(); + if(!CORBA::is_nil(orb)) + theObj = orb->resolve_initial_references("NameService"); + if (!CORBA::is_nil(theObj)){ + inc = CosNaming::NamingContext::_narrow(theObj); + if(!CORBA::is_nil(inc)) + { + MESSAGE( "SalomeDS Server: Naming Service was found" ); + if(EnvL==1) + { + CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ; + SALOME_NamingService &NS = *SINGLETON_::Instance() ; + NS.init_orb( orb1 ) ; + for(int j=1; j<=NumberOfTries; j++) + { + if (j!=1) #ifndef WIN32 - a=nanosleep(&ts_req, &ts_rem); + a=nanosleep(&ts_req, &ts_rem); #else - Sleep(TIMESleep/1000000); + Sleep(TIMESleep/1000000); #endif - try - { - object = inc->resolve(name); - } - catch(CosNaming::NamingContext::NotFound) - { - MESSAGE( "SalomeDS Server: Logger Server wasn't found" ); } + try + { + object = inc->resolve(name); + } + catch(CosNaming::NamingContext::NotFound) + { + MESSAGE( "SalomeDS Server: Logger Server wasn't found" ); } - catch(...) - { - MESSAGE( "SalomeDS Server: Unknown exception" ); - } - if (!CORBA::is_nil(object)) - { - MESSAGE( "SalomeDS Server: Logger Server was found" ); - SALOMEDS=1; - break; - } - } - } - } - } - - } - catch( const SALOME_Exception &ex ) - { - MESSAGE( "Communication Error : " << ex.what() ); - return EXIT_FAILURE ; - } - if ((SALOMEDS==1)||((EnvL==0)&&(!CORBA::is_nil(inc)))) - break; - } + catch(...) + { + MESSAGE( "SalomeDS Server: Unknown exception" ); + } + if (!CORBA::is_nil(object)) + { + MESSAGE( "SalomeDS Server: Logger Server was found" ); + SALOMEDS=1; + break; + } + } + } + } + } + + } + catch( const SALOME_Exception &ex ) + { + MESSAGE( "Communication Error : " << ex.what() ); + return EXIT_FAILURE ; + } + if ((SALOMEDS==1)||((EnvL==0)&&(!CORBA::is_nil(inc)))) + break; + } // We allocate the objects on the heap. Since these are reference // counted objects, they will be deleted by the POA when they are no diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index d25086e27..eeb4c5d33 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -176,9 +176,9 @@ _PTR(SObject) SALOMEDS_Study::FindObject(const std::string& anObjectName) SALOMEDSImpl_SObject aSO_impl = _local_impl->FindObject(anObjectName); if (!aSO_impl) return _PTR(SObject)(aSO); if(aSO_impl.IsComponent()) { - SALOMEDSImpl_SComponent aSCO_impl = aSO_impl; + SALOMEDSImpl_SComponent aSCO_impl = aSO_impl; return _PTR(SObject)(new SALOMEDS_SComponent(aSCO_impl)); - } + } aSO = new SALOMEDS_SObject(aSO_impl); } else { @@ -208,7 +208,7 @@ std::vector<_PTR(SObject)> SALOMEDS_Study::FindObjectByName(const std::string& a } else { SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindObjectByName((char*)anObjectName.c_str(), - (char*)aComponentName.c_str()); + (char*)aComponentName.c_str()); aLength = aSeq->length(); for (i = 0; i< aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i]))); } @@ -722,8 +722,8 @@ void SALOMEDS_Study::SetString(const string& theVarName, const string& theValue) if (_isLocal) { SALOMEDS::Locker lock; _local_impl->SetStringVariable(theVarName, - theValue, - SALOMEDSImpl_GenericVariable::STRING_VAR); + theValue, + SALOMEDSImpl_GenericVariable::STRING_VAR); } else _corba_impl->SetString((char*)theVarName.c_str(),(char*)theValue.c_str()); @@ -734,8 +734,8 @@ void SALOMEDS_Study::SetStringAsDouble(const string& theVarName, const double th if (_isLocal) { SALOMEDS::Locker lock; _local_impl->SetStringVariableAsDouble(theVarName, - theValue, - SALOMEDSImpl_GenericVariable::STRING_VAR); + theValue, + SALOMEDSImpl_GenericVariable::STRING_VAR); } else _corba_impl->SetStringAsDouble((char*)theVarName.c_str(),theValue); @@ -834,7 +834,7 @@ bool SALOMEDS_Study::IsString(const string& theVarName) if (_isLocal) { SALOMEDS::Locker lock; aResult = _local_impl->IsTypeOf(theVarName, - SALOMEDSImpl_GenericVariable::STRING_VAR); + SALOMEDSImpl_GenericVariable::STRING_VAR); } else aResult = _corba_impl->IsString((char*)theVarName.c_str()); @@ -918,7 +918,7 @@ vector< vector > SALOMEDS_Study::ParseVariables(const string& theVars) vector aVector; SALOMEDS::ListOfStrings aSection = aSeq[i]; for (int j = 0, m = aSection.length(); j < m; j++) { - aVector.push_back( string(aSection[j].in()) ); + aVector.push_back( string(aSection[j].in()) ); } aResult.push_back( aVector ); } @@ -986,7 +986,7 @@ _PTR(AttributeParameter) SALOMEDS_Study::GetCommonParameters(const string& theID } _PTR(AttributeParameter) SALOMEDS_Study::GetModuleParameters(const string& theID, - const string& theModuleName, int theSavePoint) + const string& theModuleName, int theSavePoint) { SALOMEDSClient_AttributeParameter* AP = NULL; if(theSavePoint > 0) { diff --git a/src/SALOMEDS/SALOMEDS_Study.hxx b/src/SALOMEDS/SALOMEDS_Study.hxx index 91ae9d64c..d99a6c460 100644 --- a/src/SALOMEDS/SALOMEDS_Study.hxx +++ b/src/SALOMEDS/SALOMEDS_Study.hxx @@ -92,7 +92,7 @@ public: virtual bool DumpStudy(const std::string& thePath,const std::string& theBaseName,bool isPublished); virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint); virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID, - const std::string& theModuleName, int theSavePoint); + const std::string& theModuleName, int theSavePoint); virtual void SetStudyLock(const std::string& theLockerID); virtual bool IsStudyLocked(); virtual void UnLockStudy(const std::string& theLockerID); diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx b/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx index 49670e54c..0ce032547 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx @@ -95,7 +95,7 @@ _PTR(SComponent) SALOMEDS_StudyBuilder::NewComponent(const std::string& Componen } void SALOMEDS_StudyBuilder::DefineComponentInstance (const _PTR(SComponent)& theSCO, - const std::string& ComponentIOR) + const std::string& ComponentIOR) { if(!theSCO) return; @@ -248,7 +248,7 @@ void SALOMEDS_StudyBuilder::RemoveObjectWithChildren(const _PTR(SObject)& theSO) } _PTR(GenericAttribute) SALOMEDS_StudyBuilder::FindOrCreateAttribute(const _PTR(SObject)& theSO, - const std::string& aTypeOfAttribute) + const std::string& aTypeOfAttribute) { SALOMEDSClient_GenericAttribute* anAttr = NULL; if(!theSO) return _PTR(GenericAttribute)(anAttr); @@ -276,8 +276,8 @@ _PTR(GenericAttribute) SALOMEDS_StudyBuilder::FindOrCreateAttribute(const _PTR(S } bool SALOMEDS_StudyBuilder::FindAttribute(const _PTR(SObject)& theSO, - _PTR(GenericAttribute)& anAttribute, - const std::string& aTypeOfAttribute) + _PTR(GenericAttribute)& anAttribute, + const std::string& aTypeOfAttribute) { bool ret; diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx b/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx index 5af81a374..d2b3455c4 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx @@ -60,10 +60,10 @@ public: virtual void RemoveObject(const _PTR(SObject)& theSO); virtual void RemoveObjectWithChildren(const _PTR(SObject)& theSO); virtual _PTR(GenericAttribute) FindOrCreateAttribute(const _PTR(SObject)& theSO, - const std::string& aTypeOfAttribute); + const std::string& aTypeOfAttribute); virtual bool FindAttribute(const _PTR(SObject)& theSO, _PTR(GenericAttribute)& theAttribute, - const std::string& aTypeOfAttribute); + const std::string& aTypeOfAttribute); virtual void RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute); virtual void Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject); virtual void RemoveReference(const _PTR(SObject)& me); diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx index 7ffd82dd7..3609befb9 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx @@ -54,7 +54,7 @@ UNEXPECT_CATCH(SBLockProtection, SALOMEDS::StudyBuilder::LockProtection); */ //============================================================================ SALOMEDS_StudyBuilder_i::SALOMEDS_StudyBuilder_i(SALOMEDSImpl_StudyBuilder* theImpl, - CORBA::ORB_ptr orb) + CORBA::ORB_ptr orb) { _orb = CORBA::ORB::_duplicate(orb); _impl = theImpl; @@ -92,7 +92,7 @@ SALOMEDS::SComponent_ptr SALOMEDS_StudyBuilder_i::NewComponent(const char* DataT */ //============================================================================ void SALOMEDS_StudyBuilder_i::DefineComponentInstance(SALOMEDS::SComponent_ptr aComponent, - CORBA::Object_ptr IOR) + CORBA::Object_ptr IOR) { SALOMEDS::Locker lock; CheckLocked(); @@ -144,7 +144,7 @@ SALOMEDS::SObject_ptr SALOMEDS_StudyBuilder_i::NewObject(SALOMEDS::SObject_ptr t */ //============================================================================ SALOMEDS::SObject_ptr SALOMEDS_StudyBuilder_i::NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject, - CORBA::Long atag) + CORBA::Long atag) { SALOMEDS::Locker lock; CheckLocked(); @@ -190,7 +190,7 @@ void SALOMEDS_StudyBuilder_i::RemoveObjectWithChildren(SALOMEDS::SObject_ptr anO */ //============================================================================ void SALOMEDS_StudyBuilder_i::LoadWith(SALOMEDS::SComponent_ptr anSCO, - SALOMEDS::Driver_ptr aDriver) throw(SALOME::SALOME_Exception) + SALOMEDS::Driver_ptr aDriver) throw(SALOME::SALOME_Exception) { SALOMEDS::Locker lock; Unexpect aCatch(SBSalomeException); @@ -224,7 +224,7 @@ void SALOMEDS_StudyBuilder_i::Load(SALOMEDS::SObject_ptr sco) */ //============================================================================ SALOMEDS::GenericAttribute_ptr SALOMEDS_StudyBuilder_i::FindOrCreateAttribute(SALOMEDS::SObject_ptr anObject, - const char* aTypeOfAttribute) + const char* aTypeOfAttribute) { SALOMEDS::Locker lock; CORBA::String_var anID = anObject->GetID(); @@ -252,8 +252,8 @@ SALOMEDS::GenericAttribute_ptr SALOMEDS_StudyBuilder_i::FindOrCreateAttribute(SA //============================================================================ CORBA::Boolean SALOMEDS_StudyBuilder_i::FindAttribute(SALOMEDS::SObject_ptr anObject, - SALOMEDS::GenericAttribute_out anAttribute, - const char* aTypeOfAttribute) + SALOMEDS::GenericAttribute_out anAttribute, + const char* aTypeOfAttribute) { SALOMEDS::Locker lock; ASSERT(!CORBA::is_nil(anObject)); @@ -274,7 +274,7 @@ CORBA::Boolean SALOMEDS_StudyBuilder_i::FindAttribute(SALOMEDS::SObject_ptr anOb //============================================================================ void SALOMEDS_StudyBuilder_i::RemoveAttribute(SALOMEDS::SObject_ptr anObject, - const char* aTypeOfAttribute) + const char* aTypeOfAttribute) { SALOMEDS::Locker lock; CheckLocked(); @@ -290,7 +290,7 @@ void SALOMEDS_StudyBuilder_i::RemoveAttribute(SALOMEDS::SObject_ptr anObject, */ //============================================================================ void SALOMEDS_StudyBuilder_i::Addreference(SALOMEDS::SObject_ptr me, - SALOMEDS::SObject_ptr theReferencedObject) + SALOMEDS::SObject_ptr theReferencedObject) { SALOMEDS::Locker lock; CheckLocked(); diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.hxx b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.hxx index caa92dea9..f4a788edd 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.hxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.hxx @@ -57,7 +57,7 @@ public: //! DefineComponentInstance /*! \param SComponent_ptr - \param ComponentIOR + \param ComponentIOR */ virtual void DefineComponentInstance (SALOMEDS::SComponent_ptr, CORBA::Object_ptr ComponentIOR); @@ -65,7 +65,7 @@ public: /*! - \param aComponent + \param aComponent */ virtual void RemoveComponent(SALOMEDS::SComponent_ptr aComponent); diff --git a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx index 7a09d7a49..efb6564ad 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx @@ -300,10 +300,10 @@ SALOMEDS::ListOfOpenStudies* SALOMEDS_StudyManager_i::GetOpenStudies() else { for (unsigned int ind=0; ind < aLength; ind++) - { - _list_open_studies[ind] = CORBA::string_dup(anOpened[ind]->Name().c_str()); - SCRUTE(_list_open_studies[ind]) ; - } + { + _list_open_studies[ind] = CORBA::string_dup(anOpened[ind]->Name().c_str()); + SCRUTE(_list_open_studies[ind]) ; + } } return _list_open_studies._retn(); } diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index bbb4855a6..bf3f7660a 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -64,7 +64,7 @@ std::map SALOMEDS_Study_i::_mapOfStudie */ //============================================================================ SALOMEDS_Study_i::SALOMEDS_Study_i(SALOMEDSImpl_Study* theImpl, - CORBA::ORB_ptr orb) + CORBA::ORB_ptr orb) { _orb = CORBA::ORB::_duplicate(orb); _impl = theImpl; @@ -217,12 +217,12 @@ SALOMEDS::SObject_ptr SALOMEDS_Study_i::CreateObjectID(const char* anObjectID) */ //============================================================================ SALOMEDS::Study::ListOfSObject* SALOMEDS_Study_i::FindObjectByName( const char* anObjectName, - const char* aComponentName ) + const char* aComponentName ) { SALOMEDS::Locker lock; vector aSeq = _impl->FindObjectByName(string((char*)anObjectName), - string((char*)aComponentName)); + string((char*)aComponentName)); int aLength = aSeq.size(); SALOMEDS::Study::ListOfSObject_var listSO = new SALOMEDS::Study::ListOfSObject ; listSO->length(aLength); @@ -786,8 +786,8 @@ void SALOMEDS_Study_i::UndoPostponed(CORBA::Long theWay) */ //============================================================================ CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath, - const char* theBaseName, - CORBA::Boolean isPublished) + const char* theBaseName, + CORBA::Boolean isPublished) { SALOMEDS::Locker lock; @@ -818,8 +818,8 @@ SALOMEDS::AttributeParameter_ptr SALOMEDS_Study_i::GetCommonParameters(const cha */ //============================================================================ SALOMEDS::AttributeParameter_ptr SALOMEDS_Study_i::GetModuleParameters(const char* theID, - const char* theModuleName, - CORBA::Long theSavePoint) + const char* theModuleName, + CORBA::Long theSavePoint) { SALOMEDS::Locker lock; @@ -925,8 +925,8 @@ void SALOMEDS_Study_i::SetBoolean(const char* theVarName, CORBA::Boolean theValu void SALOMEDS_Study_i::SetString(const char* theVarName, const char* theValue) { _impl->SetStringVariable(string(theVarName), - theValue, - SALOMEDSImpl_GenericVariable::STRING_VAR); + theValue, + SALOMEDSImpl_GenericVariable::STRING_VAR); } //============================================================================ @@ -937,8 +937,8 @@ void SALOMEDS_Study_i::SetString(const char* theVarName, const char* theValue) void SALOMEDS_Study_i::SetStringAsDouble(const char* theVarName, CORBA::Double theValue) { _impl->SetStringVariableAsDouble(string(theVarName), - theValue, - SALOMEDSImpl_GenericVariable::STRING_VAR); + theValue, + SALOMEDSImpl_GenericVariable::STRING_VAR); } //============================================================================ diff --git a/src/SALOMEDS/SALOMEDS_Study_i.hxx b/src/SALOMEDS/SALOMEDS_Study_i.hxx index bd8fd2b5a..9934e0cde 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.hxx @@ -287,8 +287,8 @@ public: virtual SALOMEDS::AttributeParameter_ptr GetCommonParameters(const char* theID, CORBA::Long theSavePoint); virtual SALOMEDS::AttributeParameter_ptr GetModuleParameters(const char* theID, - const char* theModuleName, - CORBA::Long theSavePoint); + const char* theModuleName, + CORBA::Long theSavePoint); virtual void SetStudyLock(const char* theLockerID); diff --git a/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.cxx b/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.cxx index c97cc1265..ecc1152a9 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.cxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.cxx @@ -38,7 +38,7 @@ using namespace std; */ //============================================================================ SALOMEDS_UseCaseBuilder_i::SALOMEDS_UseCaseBuilder_i(SALOMEDSImpl_UseCaseBuilder* theImpl, - CORBA::ORB_ptr orb) + CORBA::ORB_ptr orb) { _orb = CORBA::ORB::_duplicate(orb); _impl = theImpl; @@ -85,7 +85,7 @@ CORBA::Boolean SALOMEDS_UseCaseBuilder_i::Remove(SALOMEDS::SObject_ptr theObject */ //============================================================================ CORBA::Boolean SALOMEDS_UseCaseBuilder_i::AppendTo(SALOMEDS::SObject_ptr theFather, - SALOMEDS::SObject_ptr theObject) + SALOMEDS::SObject_ptr theObject) { SALOMEDS::Locker lock; if(!_impl || theFather->_is_nil() || theObject->_is_nil()) return 0; @@ -98,7 +98,7 @@ CORBA::Boolean SALOMEDS_UseCaseBuilder_i::AppendTo(SALOMEDS::SObject_ptr theFath */ //============================================================================ CORBA::Boolean SALOMEDS_UseCaseBuilder_i::InsertBefore(SALOMEDS::SObject_ptr theFirst, - SALOMEDS::SObject_ptr theNext) + SALOMEDS::SObject_ptr theNext) { SALOMEDS::Locker lock; if(!_impl || theFirst->_is_nil() || theNext->_is_nil()) return 0; diff --git a/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.hxx b/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.hxx index af1e5bbed..bf75eba54 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.hxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseBuilder_i.hxx @@ -41,8 +41,8 @@ #include "SALOMEDSImpl_UseCaseBuilder.hxx" class SALOMEDS_UseCaseBuilder_i: public virtual POA_SALOMEDS::UseCaseBuilder, - public virtual PortableServer::ServantBase, - public virtual SALOME::GenericObj_i + public virtual PortableServer::ServantBase, + public virtual SALOME::GenericObj_i { private: @@ -53,7 +53,7 @@ public: //! standard constructor SALOMEDS_UseCaseBuilder_i(SALOMEDSImpl_UseCaseBuilder* theDocument, - CORBA::ORB_ptr); + CORBA::ORB_ptr); //! standard destructor ~SALOMEDS_UseCaseBuilder_i(); diff --git a/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx b/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx index 3fd6ced61..bff53cc8b 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.cxx @@ -38,7 +38,7 @@ using namespace std; */ //============================================================================ SALOMEDS_UseCaseIterator_i::SALOMEDS_UseCaseIterator_i(const SALOMEDSImpl_UseCaseIterator& theImpl, - CORBA::ORB_ptr orb) + CORBA::ORB_ptr orb) { _orb = CORBA::ORB::_duplicate(orb); _impl = theImpl.GetPersistentCopy(); diff --git a/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.hxx b/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.hxx index 0c935f9ea..9899dea0e 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.hxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseIterator_i.hxx @@ -37,8 +37,8 @@ #include "SALOMEDSImpl_UseCaseIterator.hxx" class SALOMEDS_UseCaseIterator_i: public virtual POA_SALOMEDS::UseCaseIterator, - public virtual PortableServer::ServantBase, - public virtual SALOME::GenericObj_i + public virtual PortableServer::ServantBase, + public virtual SALOME::GenericObj_i { private: CORBA::ORB_var _orb; @@ -48,7 +48,7 @@ public: //! standard constructor SALOMEDS_UseCaseIterator_i(const SALOMEDSImpl_UseCaseIterator& theImpl, - CORBA::ORB_ptr); + CORBA::ORB_ptr); //! standard destructor ~SALOMEDS_UseCaseIterator_i(); diff --git a/src/SALOMEDS/Test/TestSALOMEDS.cxx b/src/SALOMEDS/Test/TestSALOMEDS.cxx index 4d1d7ac4e..f861bf780 100644 --- a/src/SALOMEDS/Test/TestSALOMEDS.cxx +++ b/src/SALOMEDS/Test/TestSALOMEDS.cxx @@ -112,7 +112,7 @@ int main(int argc, char* argv[]) CORBA::Object_var poaObj = orb->resolve_initial_references("RootPOA"); if(!CORBA::is_nil(poaObj)) { - PortableServer::POA_var poa = PortableServer::POA::_narrow(poaObj); + PortableServer::POA_var poa = PortableServer::POA::_narrow(poaObj); SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, poa); // Activate the objects. This tells the POA that the objects are ready to accept requests. diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx index 03420a3e3..6fa8b40b5 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx @@ -47,18 +47,18 @@ public: virtual void SetLocked(bool theLocked) = 0; virtual bool IsLocked() = 0; virtual void SetModification(const std::string& theName, - int theMinute, - int theHour, - int theDay, - int theMonth, - int theYear) = 0; + int theMinute, + int theHour, + int theDay, + int theMonth, + int theYear) = 0; virtual void GetModificationsList(std::vector& theNames, - std::vector& theMinutes, - std::vector& theHours, - std::vector& theDays, - std::vector& theMonths, - std::vector& theYears, - bool theWithCreator) = 0; + std::vector& theMinutes, + std::vector& theHours, + std::vector& theDays, + std::vector& theMonths, + std::vector& theYears, + bool theWithCreator) = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_Study.hxx b/src/SALOMEDSClient/SALOMEDSClient_Study.hxx index c63e258c9..20f525eb6 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_Study.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_Study.hxx @@ -84,11 +84,11 @@ public: virtual void Close() = 0; virtual void EnableUseCaseAutoFilling(bool isEnabled) = 0; virtual bool DumpStudy(const std::string& thePath, - const std::string& theBaseName, - bool isPublished) = 0; + const std::string& theBaseName, + bool isPublished) = 0; virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint) = 0; virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID, - const std::string& theModuleName, int theSavePoint) = 0; + const std::string& theModuleName, int theSavePoint) = 0; virtual void SetStudyLock(const std::string& theLockerID) = 0; virtual bool IsStudyLocked() = 0; virtual void UnLockStudy(const std::string& theLockerID) = 0; @@ -115,7 +115,7 @@ public: virtual bool RemoveVariable(const std::string& theVarName) = 0; virtual bool RenameVariable(const std::string& theVarName, - const std::string& theNewVarName) = 0; + const std::string& theNewVarName) = 0; virtual bool IsVariableUsed(const std::string& theVarName) = 0; virtual std::vector< std::vector > ParseVariables(const std::string& theVars) = 0; diff --git a/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx b/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx index ae02f303b..85dc58d29 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx @@ -50,7 +50,7 @@ public: virtual _PTR(GenericAttribute) FindOrCreateAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute) = 0; virtual bool FindAttribute(const _PTR(SObject)& theSO, _PTR(GenericAttribute)& theAttribute, - const std::string& aTypeOfAttribute) = 0; + const std::string& aTypeOfAttribute) = 0; virtual void RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute) = 0; virtual void Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject) = 0; virtual void RemoveReference(const _PTR(SObject)& me) = 0; diff --git a/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx b/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx index 2d63937ba..9d3dc8144 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx @@ -42,27 +42,27 @@ public: template explicit clt_shared_ptr(Y * p) { - boost::shared_ptr::reset(p); + boost::shared_ptr::reset(p); } template clt_shared_ptr(clt_shared_ptr const & r): boost::shared_ptr(r,boost::detail::dynamic_cast_tag()) - {} + {} template clt_shared_ptr & operator=(clt_shared_ptr const & r) { - clt_shared_ptr(r).swap(*this); - return *this; + clt_shared_ptr(r).swap(*this); + return *this; } template clt_shared_ptr& operator()(Y * p) // Y must be complete { if(T* pt = dynamic_cast(p)) - boost::shared_ptr::reset(pt); + boost::shared_ptr::reset(pt); else - boost::throw_exception(std::bad_cast()); + boost::throw_exception(std::bad_cast()); return *this; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx index 62d14a11e..2c7be685c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeComment.cxx @@ -38,7 +38,7 @@ const string& SALOMEDSImpl_AttributeComment::GetID () } SALOMEDSImpl_AttributeComment* SALOMEDSImpl_AttributeComment::Set (const DF_Label& L, - const string& Val) + const string& Val) { SALOMEDSImpl_AttributeComment* A = NULL; if (!(A=(SALOMEDSImpl_AttributeComment*)L.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx index 6cc4efba8..ddc1556aa 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeDrawable.cxx @@ -44,7 +44,7 @@ const std::string& SALOMEDSImpl_AttributeDrawable::GetID () //======================================================================= SALOMEDSImpl_AttributeDrawable* SALOMEDSImpl_AttributeDrawable::Set (const DF_Label& L, - const int value) + const int value) { SALOMEDSImpl_AttributeDrawable* A = NULL; if (!(A=(SALOMEDSImpl_AttributeDrawable*)L.FindAttribute(SALOMEDSImpl_AttributeDrawable::GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx index c5a0dc094..809e308d6 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeExpandable.cxx @@ -44,7 +44,7 @@ const std::string& SALOMEDSImpl_AttributeExpandable::GetID () //purpose : //======================================================================= SALOMEDSImpl_AttributeExpandable* SALOMEDSImpl_AttributeExpandable::Set (const DF_Label& L, - const int value) + const int value) { SALOMEDSImpl_AttributeExpandable* A = NULL; if (!(A=(SALOMEDSImpl_AttributeExpandable*)L.FindAttribute(SALOMEDSImpl_AttributeExpandable::GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx index 11398d01d..a51012378 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFileType.cxx @@ -46,7 +46,7 @@ const std::string& SALOMEDSImpl_AttributeFileType::GetID () //======================================================================= SALOMEDSImpl_AttributeFileType* SALOMEDSImpl_AttributeFileType::Set (const DF_Label& L, - const std::string& S) + const std::string& S) { SALOMEDSImpl_AttributeFileType* A = NULL; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.cxx index 1c568fd5e..aca376d5f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeFlags.cxx @@ -49,7 +49,7 @@ const std::string& SALOMEDSImpl_AttributeFlags::GetID () //purpose : Set value of the attribute //======================================================================= SALOMEDSImpl_AttributeFlags* SALOMEDSImpl_AttributeFlags::Set(const DF_Label& L, - const int value ) + const int value ) { SALOMEDSImpl_AttributeFlags* A = NULL; if ( !(A=(SALOMEDSImpl_AttributeFlags*)L.FindAttribute(SALOMEDSImpl_AttributeFlags::GetID())) ) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.cxx index 5a67dc488..f3ca6d7f9 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeGraphic.cxx @@ -66,7 +66,7 @@ SALOMEDSImpl_AttributeGraphic::~SALOMEDSImpl_AttributeGraphic() //purpose : Set visibility of object in given view //======================================================================= void SALOMEDSImpl_AttributeGraphic::SetVisibility(const int theViewId, - const bool theValue ) + const bool theValue ) { if ( myVisibility.find( theViewId ) != myVisibility.end() && myVisibility[theViewId] == theValue ) return; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx index df25c39a8..e3ccfd140 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeLocalID.cxx @@ -46,7 +46,7 @@ const std::string& SALOMEDSImpl_AttributeLocalID::GetID () //======================================================================= SALOMEDSImpl_AttributeLocalID* SALOMEDSImpl_AttributeLocalID::Set (const DF_Label& L, - const int value) + const int value) { SALOMEDSImpl_AttributeLocalID* A = NULL; if (!(A=(SALOMEDSImpl_AttributeLocalID*)L.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx index 2bff84705..12488a8e0 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeName.cxx @@ -38,7 +38,7 @@ const std::string& SALOMEDSImpl_AttributeName::GetID () } SALOMEDSImpl_AttributeName* SALOMEDSImpl_AttributeName::Set (const DF_Label& L, - const std::string& Val) + const std::string& Val) { SALOMEDSImpl_AttributeName* A = NULL; if (!(A=(SALOMEDSImpl_AttributeName*)L.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx index bf1313f63..83c13f06b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx @@ -46,7 +46,7 @@ const std::string& SALOMEDSImpl_AttributeOpened::GetID () //======================================================================= SALOMEDSImpl_AttributeOpened* SALOMEDSImpl_AttributeOpened::Set (const DF_Label& L, - const int value) + const int value) { SALOMEDSImpl_AttributeOpened* A = NULL; if (!(A=(SALOMEDSImpl_AttributeOpened*)L.FindAttribute(SALOMEDSImpl_AttributeOpened::GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx index 9f012789c..d5dfd926c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.cxx @@ -505,7 +505,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the if(_ints.size()) { anArray.resize(_ints.size()); for(map::const_iterator p = _ints.begin(); p != _ints.end(); p++, i++) - anArray[i] = p->first; + anArray[i] = p->first; } break; } @@ -513,7 +513,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the if(_reals.size()) { anArray.resize(_reals.size()); for(map::const_iterator p = _reals.begin(); p != _reals.end(); p++, i++) - anArray[i] = p->first; + anArray[i] = p->first; } break; } @@ -521,7 +521,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the if(_bools.size()) { anArray.resize(_bools.size()); for(map::const_iterator p = _bools.begin(); p != _bools.end(); p++, i++) - anArray[i] = p->first; + anArray[i] = p->first; } break; } @@ -529,7 +529,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the if(_strings.size()) { anArray.resize(_strings.size()); for(map::const_iterator p = _strings.begin(); p!= _strings.end(); p++) - anArray[i] = p->first; + anArray[i] = p->first; } break; } @@ -537,7 +537,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the if(_realarrays.size()) { anArray.resize(_realarrays.size()); for(map< string, vector >::const_iterator p = _realarrays.begin(); p!= _realarrays.end(); p++) - anArray[i] = p->first; + anArray[i] = p->first; } break; } @@ -545,7 +545,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the if(_intarrays.size()) { anArray.resize(_intarrays.size()); for(map< string, vector >::const_iterator p = _intarrays.begin(); p!= _intarrays.end(); p++) - anArray[i] = p->first; + anArray[i] = p->first; } break; } @@ -553,7 +553,7 @@ vector SALOMEDSImpl_AttributeParameter::GetIDs(const Parameter_Types the if(_strarrays.size()) { anArray.resize(_strarrays.size()); for(map< string, vector >::const_iterator p = _strarrays.begin(); p!= _strarrays.end(); p++) - anArray[i] = p->first; + anArray[i] = p->first; } break; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx index f23ccff67..05ab1e0aa 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeParameter.hxx @@ -65,45 +65,45 @@ public: void SetInt(const std::string& theID, const int& theValue); int GetInt(const std::string& theID); - + void SetReal(const std::string& theID, const double& theValue); double GetReal(const std::string& theID); - + void SetString(const std::string& theID, const std::string& theValue); std::string GetString(const std::string& theID); - + void SetBool(const std::string& theID, const bool& theValue); bool GetBool(const std::string& theID); - + void SetRealArray(const std::string& theID, const std::vector& theArray); std::vector GetRealArray(const std::string& theID); - + void SetIntArray(const std::string& theID, const std::vector& theArray); std::vector GetIntArray(const std::string& theID); - + void SetStrArray(const std::string& theID, const std::vector& theArray); std::vector GetStrArray(const std::string& theID); - + bool IsSet(const std::string& theID, const Parameter_Types theType); bool RemoveID(const std::string& theID, const Parameter_Types theType); - + SALOMEDSImpl_AttributeParameter* GetFather(); bool HasFather(); bool IsRoot(); - + std::vector GetIDs(const Parameter_Types theType); - + void Clear(); - + virtual std::string Save(); virtual void Load(const std::string& theValue); - + const std::string& ID() const; void Restore(DF_Attribute* with) ; DF_Attribute* NewEmpty() const; void Paste(DF_Attribute* into); - + ~SALOMEDSImpl_AttributeParameter() {} }; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx index 6bf8eb76b..288f82e54 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePersistentRef.cxx @@ -46,7 +46,7 @@ const std::string& SALOMEDSImpl_AttributePersistentRef::GetID () //======================================================================= SALOMEDSImpl_AttributePersistentRef* SALOMEDSImpl_AttributePersistentRef::Set (const DF_Label& L, - const std::string& S) + const std::string& S) { SALOMEDSImpl_AttributePersistentRef* A = NULL; if (!(A=(SALOMEDSImpl_AttributePersistentRef*)L.FindAttribute(SALOMEDSImpl_AttributePersistentRef::GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx index a244cc3a5..2c6e82cf9 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePixMap.cxx @@ -46,7 +46,7 @@ const std::string& SALOMEDSImpl_AttributePixMap::GetID () //======================================================================= SALOMEDSImpl_AttributePixMap* SALOMEDSImpl_AttributePixMap::Set (const DF_Label& L, - const std::string& S) + const std::string& S) { SALOMEDSImpl_AttributePixMap* A = NULL; if (!(A=(SALOMEDSImpl_AttributePixMap*)L.FindAttribute(SALOMEDSImpl_AttributePixMap::GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx index 3de92728f..36af91a00 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributePythonObject.cxx @@ -50,7 +50,7 @@ SALOMEDSImpl_AttributePythonObject::SALOMEDSImpl_AttributePythonObject() } void SALOMEDSImpl_AttributePythonObject::SetObject(const string& theSequence, - const bool theScript) + const bool theScript) { CheckLocked(); Backup(); @@ -106,7 +106,7 @@ string SALOMEDSImpl_AttributePythonObject::Save() return aResult; } - + void SALOMEDSImpl_AttributePythonObject::Load(const string& value) { char* aString = (char*)value.c_str(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx index cad6685cc..45ad9a695 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeReference.cxx @@ -38,7 +38,7 @@ const std::string& SALOMEDSImpl_AttributeReference::GetID () } SALOMEDSImpl_AttributeReference* SALOMEDSImpl_AttributeReference::Set(const DF_Label& theLabel, - const DF_Label& theRefLabel) + const DF_Label& theRefLabel) { SALOMEDSImpl_AttributeReference* A = NULL; if (!(A=(SALOMEDSImpl_AttributeReference*)theLabel.FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx index a96614055..3d4015792 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSelectable.cxx @@ -46,7 +46,7 @@ const std::string& SALOMEDSImpl_AttributeSelectable::GetID () //======================================================================= SALOMEDSImpl_AttributeSelectable* SALOMEDSImpl_AttributeSelectable::Set (const DF_Label& L, - const int value) + const int value) { SALOMEDSImpl_AttributeSelectable* A = NULL; if (!(A=(SALOMEDSImpl_AttributeSelectable*)L.FindAttribute(SALOMEDSImpl_AttributeSelectable::GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx index 4120d20b6..c90a5196a 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfInteger.cxx @@ -184,7 +184,7 @@ string SALOMEDSImpl_AttributeSequenceOfInteger::Save() return ret; } - + void SALOMEDSImpl_AttributeSequenceOfInteger::Load(const string& value) { char* aCopy = (char*)value.c_str(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx index 6e4fc6f6c..286fc044b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx @@ -182,13 +182,13 @@ string SALOMEDSImpl_AttributeSequenceOfReal::Save() } string ret(aResult); delete aResult; - + return ret; } - + void SALOMEDSImpl_AttributeSequenceOfReal::Load(const string& value) { - + char* aCopy = (char*)value.c_str(); char* adr = strtok(aCopy, " "); char *err = NULL; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.cxx index 71cccedaa..e3110c40c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeString.cxx @@ -38,7 +38,7 @@ const std::string& SALOMEDSImpl_AttributeString::GetID () } SALOMEDSImpl_AttributeString* SALOMEDSImpl_AttributeString::Set (const DF_Label& L, - const std::string& Val) + const std::string& Val) { SALOMEDSImpl_AttributeString* A = NULL; if (!(A=(SALOMEDSImpl_AttributeString*)L.FindAttribute(SALOMEDSImpl_AttributeString::GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx index d0a564c89..ad5f1cfa2 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx @@ -254,12 +254,12 @@ string SALOMEDSImpl_AttributeStudyProperties::Save() int a = 2; for (anIndex = 0; anIndex < aLength; anIndex++) { sprintf(&(aProperty[a]),"%2d%2d%2d%2d%4d%s", - (int)(aMinutes[anIndex]), - (int)(aHours[anIndex]), - (int)(aDays[anIndex]), - (int)(aMonths[anIndex]), - (int)(aYears[anIndex]), - (char*)(aNames[anIndex].c_str())); + (int)(aMinutes[anIndex]), + (int)(aHours[anIndex]), + (int)(aDays[anIndex]), + (int)(aMonths[anIndex]), + (int)(aYears[anIndex]), + (char*)(aNames[anIndex].c_str())); a = strlen(aProperty); aProperty[a++] = 1; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx index 24a21d772..422c84e08 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx @@ -115,7 +115,7 @@ std::string SALOMEDSImpl_AttributeTableOfInteger::GetTitle() const } void SALOMEDSImpl_AttributeTableOfInteger::SetRowData(const int theRow, - const vector& theData) + const vector& theData) { CheckLocked(); if(theData.size() > myNbColumns) SetNbColumns(theData.size()); @@ -151,7 +151,7 @@ vector SALOMEDSImpl_AttributeTableOfInteger::GetRowData(const int theRow) } void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitle(const int theRow, - const std::string& theTitle) + const std::string& theTitle) { CheckLocked(); Backup(); @@ -166,7 +166,7 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitle(const int theRow, } void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnit(const int theRow, - const std::string& theUnit) + const std::string& theUnit) { CheckLocked(); Backup(); @@ -227,7 +227,7 @@ std::string SALOMEDSImpl_AttributeTableOfInteger::GetRowUnit(const int theRow) c void SALOMEDSImpl_AttributeTableOfInteger::SetColumnData(const int theColumn, - const vector& theData) + const vector& theData) { CheckLocked(); if(theColumn > myNbColumns) SetNbColumns(theColumn); @@ -266,9 +266,9 @@ vector SALOMEDSImpl_AttributeTableOfInteger::GetColumnData(const int theCol } void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitle(const int theColumn, - const std::string& theTitle) + const std::string& theTitle) { - CheckLocked(); + CheckLocked(); Backup(); while(myCols.size() < theColumn) myCols.push_back(std::string("")); myCols[theColumn-1] = theTitle; @@ -311,8 +311,8 @@ int SALOMEDSImpl_AttributeTableOfInteger::GetNbColumns() const } void SALOMEDSImpl_AttributeTableOfInteger::PutValue(const int theValue, - const int theRow, - const int theColumn) + const int theRow, + const int theColumn) { CheckLocked(); if(theColumn > myNbColumns) SetNbColumns(theColumn); @@ -331,7 +331,7 @@ void SALOMEDSImpl_AttributeTableOfInteger::PutValue(const int theValue, } bool SALOMEDSImpl_AttributeTableOfInteger::HasValue(const int theRow, - const int theColumn) + const int theColumn) { if(theRow > myNbRows || theRow < 1) return false; if(theColumn > myNbColumns || theColumn < 1) return false; @@ -340,7 +340,7 @@ bool SALOMEDSImpl_AttributeTableOfInteger::HasValue(const int theRow, } int SALOMEDSImpl_AttributeTableOfInteger::GetValue(const int theRow, - const int theColumn) + const int theColumn) { if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index"); if(theColumn > myNbColumns || theColumn < 1) DFexception("Invalid cell index"); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx index af1baaacd..cc52043b4 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx @@ -115,7 +115,7 @@ std::string SALOMEDSImpl_AttributeTableOfReal::GetTitle() const } void SALOMEDSImpl_AttributeTableOfReal::SetRowData(const int theRow, - const vector& theData) + const vector& theData) { CheckLocked(); if(theData.size() > myNbColumns) SetNbColumns(theData.size()); @@ -152,7 +152,7 @@ vector SALOMEDSImpl_AttributeTableOfReal::GetRowData(const int theRow) void SALOMEDSImpl_AttributeTableOfReal::SetRowTitle(const int theRow, - const std::string& theTitle) + const std::string& theTitle) { CheckLocked(); Backup(); @@ -167,7 +167,7 @@ void SALOMEDSImpl_AttributeTableOfReal::SetRowTitle(const int theRow, } void SALOMEDSImpl_AttributeTableOfReal::SetRowUnit(const int theRow, - const std::string& theUnit) + const std::string& theUnit) { CheckLocked(); Backup(); @@ -227,7 +227,7 @@ std::string SALOMEDSImpl_AttributeTableOfReal::GetRowUnit(const int theRow) cons } void SALOMEDSImpl_AttributeTableOfReal::SetColumnData(const int theColumn, - const vector& theData) + const vector& theData) { CheckLocked(); if(theColumn > myNbColumns) SetNbColumns(theColumn); @@ -267,7 +267,7 @@ vector SALOMEDSImpl_AttributeTableOfReal::GetColumnData(const int theCol } void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitle(const int theColumn, - const std::string& theTitle) + const std::string& theTitle) { CheckLocked(); Backup(); @@ -312,8 +312,8 @@ int SALOMEDSImpl_AttributeTableOfReal::GetNbColumns() const } void SALOMEDSImpl_AttributeTableOfReal::PutValue(const double& theValue, - const int theRow, - const int theColumn) + const int theRow, + const int theColumn) { CheckLocked(); if(theColumn > myNbColumns) SetNbColumns(theColumn); @@ -332,7 +332,7 @@ void SALOMEDSImpl_AttributeTableOfReal::PutValue(const double& theValue, } bool SALOMEDSImpl_AttributeTableOfReal::HasValue(const int theRow, - const int theColumn) + const int theColumn) { if(theRow > myNbRows || theRow < 1) return false; if(theColumn > myNbColumns || theColumn < 1) return false; @@ -341,7 +341,7 @@ bool SALOMEDSImpl_AttributeTableOfReal::HasValue(const int theRow, } double SALOMEDSImpl_AttributeTableOfReal::GetValue(const int theRow, - const int theColumn) + const int theColumn) { if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index"); if(theColumn > myNbColumns || theColumn < 1) throw DFexception("Invalid cell index"); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx index c73f7c730..1644f41bc 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx @@ -102,7 +102,7 @@ void SALOMEDSImpl_AttributeTableOfString::SetNbColumns(const int theNbColumns) } void SALOMEDSImpl_AttributeTableOfString::SetRowTitle(const int theRow, - const std::string& theTitle) + const std::string& theTitle) { CheckLocked(); Backup(); @@ -117,7 +117,7 @@ void SALOMEDSImpl_AttributeTableOfString::SetRowTitle(const int theRow, } void SALOMEDSImpl_AttributeTableOfString::SetRowUnit(const int theRow, - const std::string& theUnit) + const std::string& theUnit) { CheckLocked(); Backup(); @@ -175,7 +175,7 @@ std::string SALOMEDSImpl_AttributeTableOfString::GetRowUnit(const int theRow) co } void SALOMEDSImpl_AttributeTableOfString::SetRowData(const int theRow, - const vector& theData) + const vector& theData) { CheckLocked(); if(theData.size() > myNbColumns) SetNbColumns(theData.size()); @@ -225,7 +225,7 @@ vector SALOMEDSImpl_AttributeTableOfString::GetRowData(const int theRow) } void SALOMEDSImpl_AttributeTableOfString::SetColumnData(const int theColumn, - const vector& theData) + const vector& theData) { CheckLocked(); if(theColumn > myNbColumns) SetNbColumns(theColumn); @@ -265,7 +265,7 @@ vector SALOMEDSImpl_AttributeTableOfString::GetColumnData(const int theC } void SALOMEDSImpl_AttributeTableOfString::SetColumnTitle(const int theColumn, - const std::string& theTitle) + const std::string& theTitle) { CheckLocked(); Backup(); @@ -312,8 +312,8 @@ int SALOMEDSImpl_AttributeTableOfString::GetNbColumns() const } void SALOMEDSImpl_AttributeTableOfString::PutValue(const std::string& theValue, - const int theRow, - const int theColumn) + const int theRow, + const int theColumn) { CheckLocked(); if(theColumn > myNbColumns) SetNbColumns(theColumn); @@ -332,7 +332,7 @@ void SALOMEDSImpl_AttributeTableOfString::PutValue(const std::string& theValue, } bool SALOMEDSImpl_AttributeTableOfString::HasValue(const int theRow, - const int theColumn) + const int theColumn) { if(theRow > myNbRows || theRow < 1) return false; if(theColumn > myNbColumns || theColumn < 1) return false; @@ -342,7 +342,7 @@ bool SALOMEDSImpl_AttributeTableOfString::HasValue(const int theRow, } std::string SALOMEDSImpl_AttributeTableOfString::GetValue(const int theRow, - const int theColumn) + const int theColumn) { if(theRow > myNbRows || theRow < 1) throw DFexception("Invalid cell index"); if(theColumn > myNbColumns || theColumn < 1) throw DFexception("Invalid cell index"); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx index 36272891b..972cebd65 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTarget.cxx @@ -122,7 +122,7 @@ void SALOMEDSImpl_AttributeTarget::Remove(const SALOMEDSImpl_SObject& theSO) for(int i = 0, len = myVariables.size(); iLabel(); if(myVariables[i]->Label() == aRefLabel) continue; - va.push_back(myVariables[i]); + va.push_back(myVariables[i]); } myVariables.clear(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx index d46c0fb5c..e3a3b7539 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextColor.cxx @@ -138,7 +138,7 @@ string SALOMEDSImpl_AttributeTextColor::Save() char *Val = new char[75]; sprintf(Val, "%f %f %f", (float)myValue[0], (float)myValue[1], - (float)myValue[2]); + (float)myValue[2]); string ret(Val); delete Val; return ret; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx index 8624d52f6..37309ad5b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTextHighlightColor.cxx @@ -66,8 +66,8 @@ const std::string& SALOMEDSImpl_AttributeTextHighlightColor::ID () const { retur //purpose : //======================================================================= void SALOMEDSImpl_AttributeTextHighlightColor::SetTextHighlightColor(const double& R, - const double& G, - const double& B) + const double& G, + const double& B) { CheckLocked(); Backup(); @@ -78,7 +78,7 @@ void SALOMEDSImpl_AttributeTextHighlightColor::SetTextHighlightColor(const doubl SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } - + //======================================================================= //function : TextHighlightColor //purpose : @@ -138,7 +138,7 @@ string SALOMEDSImpl_AttributeTextHighlightColor::Save() char *Val = new char[75]; sprintf(Val, "%f %f %f", (float)myValue[0], (float)myValue[1], - (float)myValue[2]); + (float)myValue[2]); string ret(Val); delete Val; return ret; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx index 77b44d821..3e1cc892b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Attributes.hxx @@ -72,35 +72,35 @@ public : #define __AttributeTypeToGUIDForSObject \ - if(theType == "AttributeReal") return SALOMEDSImpl_AttributeReal::GetID(); \ - if(theType == "AttributeInteger") return SALOMEDSImpl_AttributeInteger::GetID(); \ - if(theType == "AttributeSequenceOfReal") return SALOMEDSImpl_AttributeSequenceOfReal::GetID(); \ - if(theType == "AttributeSequenceOfInteger") return SALOMEDSImpl_AttributeSequenceOfInteger::GetID(); \ - if(theType == "AttributeName") return SALOMEDSImpl_AttributeName::GetID(); \ + if(theType == "AttributeReal") return SALOMEDSImpl_AttributeReal::GetID(); \ + if(theType == "AttributeInteger") return SALOMEDSImpl_AttributeInteger::GetID(); \ + if(theType == "AttributeSequenceOfReal") return SALOMEDSImpl_AttributeSequenceOfReal::GetID(); \ + if(theType == "AttributeSequenceOfInteger") return SALOMEDSImpl_AttributeSequenceOfInteger::GetID(); \ + if(theType == "AttributeName") return SALOMEDSImpl_AttributeName::GetID(); \ if(theType == "AttributeComment") return SALOMEDSImpl_AttributeComment::GetID(); \ if(theType == "AttributeIOR") return SALOMEDSImpl_AttributeIOR::GetID(); \ if(theType == "AttributePersistentRef") return SALOMEDSImpl_AttributePersistentRef::GetID(); \ if(theType == "AttributeDrawable") return SALOMEDSImpl_AttributeDrawable::GetID(); \ if(theType == "AttributeSelectable") return SALOMEDSImpl_AttributeSelectable::GetID(); \ - if(theType == "AttributeExpandable") return SALOMEDSImpl_AttributeExpandable::GetID(); \ - if(theType == "AttributeOpened") return SALOMEDSImpl_AttributeOpened::GetID(); \ - if(theType == "AttributeTextColor") return SALOMEDSImpl_AttributeTextColor::GetID(); \ - if(theType == "AttributeTextHighlightColor") return SALOMEDSImpl_AttributeTextHighlightColor::GetID(); \ - if(theType == "AttributePixMap") return SALOMEDSImpl_AttributePixMap::GetID(); \ - if(theType == "AttributeLocalID") return SALOMEDSImpl_AttributeLocalID::GetID(); \ - if(theType == "AttributeTarget") return SALOMEDSImpl_AttributeTarget::GetID(); \ - if(theType == "AttributeTableOfInteger") return SALOMEDSImpl_AttributeTableOfInteger::GetID(); \ - if(theType == "AttributeTableOfReal") return SALOMEDSImpl_AttributeTableOfReal::GetID(); \ + if(theType == "AttributeExpandable") return SALOMEDSImpl_AttributeExpandable::GetID(); \ + if(theType == "AttributeOpened") return SALOMEDSImpl_AttributeOpened::GetID(); \ + if(theType == "AttributeTextColor") return SALOMEDSImpl_AttributeTextColor::GetID(); \ + if(theType == "AttributeTextHighlightColor") return SALOMEDSImpl_AttributeTextHighlightColor::GetID(); \ + if(theType == "AttributePixMap") return SALOMEDSImpl_AttributePixMap::GetID(); \ + if(theType == "AttributeLocalID") return SALOMEDSImpl_AttributeLocalID::GetID(); \ + if(theType == "AttributeTarget") return SALOMEDSImpl_AttributeTarget::GetID(); \ + if(theType == "AttributeTableOfInteger") return SALOMEDSImpl_AttributeTableOfInteger::GetID(); \ + if(theType == "AttributeTableOfReal") return SALOMEDSImpl_AttributeTableOfReal::GetID(); \ if(theType == "AttributeTableOfString") return SALOMEDSImpl_AttributeTableOfString::GetID(); \ - if(theType == "AttributeStudyProperties") return SALOMEDSImpl_AttributeStudyProperties::GetID(); \ - if(theType == "AttributePythonObject") return SALOMEDSImpl_AttributePythonObject::GetID(); \ - if(theType == "AttributeUserID") return std::string("FFFFFFFF-D9CD-11d6-945D-1050DA506788"); \ - if(theType == "AttributeExternalFileDef") return SALOMEDSImpl_AttributeExternalFileDef::GetID(); \ - if(theType == "AttributeFileType") return SALOMEDSImpl_AttributeFileType::GetID(); \ - if(theType == "AttributeFlags") return SALOMEDSImpl_AttributeFlags::GetID(); \ + if(theType == "AttributeStudyProperties") return SALOMEDSImpl_AttributeStudyProperties::GetID(); \ + if(theType == "AttributePythonObject") return SALOMEDSImpl_AttributePythonObject::GetID(); \ + if(theType == "AttributeUserID") return std::string("FFFFFFFF-D9CD-11d6-945D-1050DA506788"); \ + if(theType == "AttributeExternalFileDef") return SALOMEDSImpl_AttributeExternalFileDef::GetID(); \ + if(theType == "AttributeFileType") return SALOMEDSImpl_AttributeFileType::GetID(); \ + if(theType == "AttributeFlags") return SALOMEDSImpl_AttributeFlags::GetID(); \ if(theType == "AttributeGraphic") return SALOMEDSImpl_AttributeGraphic::GetID(); \ - if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID(); \ - if(theType == "AttributeParameter") return SALOMEDSImpl_AttributeParameter::GetID(); \ + if(theType == "AttributeReference") return SALOMEDSImpl_AttributeReference::GetID(); \ + if(theType == "AttributeParameter") return SALOMEDSImpl_AttributeParameter::GetID(); \ if(theType == "AttributeString") return SALOMEDSImpl_AttributeString::GetID(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.cxx index 11cffe9e1..d5da6bb32 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ChildNodeIterator.cxx @@ -19,10 +19,10 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File: SALOMEDSImpl_ChildNodeIterator.cxx -// Created: Wed Jan 26 16:43:08 2000 -// Author: Denis PASCAL -// +// File: SALOMEDSImpl_ChildNodeIterator.cxx +// Created: Wed Jan 26 16:43:08 2000 +// Author: Denis PASCAL +// // #include "SALOMEDSImpl_ChildNodeIterator.hxx" @@ -30,10 +30,10 @@ { \ while (myNode && (myNode->Depth() > myFirstLevel) && myNode->myNext == NULL) \ myNode = myNode->myFather; \ - if (myNode && (myNode->Depth() > myFirstLevel) && myNode->myFather != NULL) \ - myNode = myNode->myNext; \ - else \ - myNode = NULL; \ + if (myNode && (myNode->Depth() > myFirstLevel) && myNode->myFather != NULL) \ + myNode = myNode->myNext; \ + else \ + myNode = NULL; \ } //======================================================================= @@ -50,7 +50,7 @@ SALOMEDSImpl_ChildNodeIterator::SALOMEDSImpl_ChildNodeIterator() //======================================================================= SALOMEDSImpl_ChildNodeIterator::SALOMEDSImpl_ChildNodeIterator (const SALOMEDSImpl_AttributeTreeNode* aNode, - const bool allLevels) + const bool allLevels) : myNode(aNode->myFirst), myFirstLevel(allLevels ? aNode->Depth() : -1) {} @@ -61,7 +61,7 @@ SALOMEDSImpl_ChildNodeIterator::SALOMEDSImpl_ChildNodeIterator (const SALOMEDSIm //======================================================================= void SALOMEDSImpl_ChildNodeIterator::Initialize(const SALOMEDSImpl_AttributeTreeNode* aNode, - const bool allLevels) + const bool allLevels) { myNode = aNode->myFirst; myFirstLevel = allLevels ? aNode->Depth() : -1; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx index ff5cae558..0fa42cd69 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx @@ -284,10 +284,10 @@ string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, int s vector lst = ip.getValues(v[i]); dump += "# fill list "+v[i]+"\n"; for(int j = 0; j < lst.size(); j++) { - if (lst[j].find('\"') == -1) - dump += "ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n"; - else - dump += "ipar.append(\""+v[i]+"\", \"\"\""+lst[j]+"\"\"\")\n"; + if (lst[j].find('\"') == -1) + dump += "ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n"; + else + dump += "ipar.append(\""+v[i]+"\", \"\"\""+lst[j]+"\"\"\")\n"; } } } @@ -296,9 +296,9 @@ string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, int s } string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study, - const string& moduleName, - const string& shift, - const string& theID) + const string& moduleName, + const string& shift, + const string& theID) { string anID; if(theID == "") anID = getDefaultVisualComponent(); @@ -334,7 +334,7 @@ string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study, vector lst = ip.getValues(v[i]); dump += shift +"# fill list "+v[i]+"\n"; for(int j = 0; j < lst.size(); j++) - dump += shift +"ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n"; + dump += shift +"ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n"; } } @@ -350,7 +350,7 @@ string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study, 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++) - dump += shift + "ipar.setParameter(\"" + v[i] + "\", \"" + names[j] + "\", \"" + values[j] + "\")\n"; + dump += shift + "ipar.setParameter(\"" + v[i] + "\", \"" + names[j] + "\", \"" + values[j] + "\")\n"; } } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx index b34f8f02b..68fa75f94 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx @@ -135,7 +135,7 @@ SALOMEDSImpl_Study* SALOMEDSImpl_SObject::GetStudy() const */ //============================================================================ bool SALOMEDSImpl_SObject::FindAttribute(DF_Attribute*& theAttribute, - const string& theTypeOfAttribute) const + const string& theTypeOfAttribute) const { if(_lab.IsNull()) return false; std::string aGUID = GetGUID(theTypeOfAttribute); @@ -156,7 +156,7 @@ vector SALOMEDSImpl_SObject::GetAllAttributes() const for(int i = 0, len = va.size(); i(va[i]); if(ga && ga->Type() != string("AttributeReference")) - va1.push_back(va[i]); + va1.push_back(va[i]); } return va1; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 2b24641ad..d3f93e848 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -1602,8 +1602,8 @@ void SALOMEDSImpl_Study::SetVariable(const string& theVarName, */ //============================================================================ void SALOMEDSImpl_Study::SetStringVariable(const string& theVarName, - const string& theValue, - const SALOMEDSImpl_GenericVariable::VariableTypes theType) + const string& theValue, + const SALOMEDSImpl_GenericVariable::VariableTypes theType) { bool modified = false; SALOMEDSImpl_GenericVariable* aGVar = GetVariable(theVarName); @@ -1632,8 +1632,8 @@ void SALOMEDSImpl_Study::SetStringVariable(const string& theVarName, */ //============================================================================ void SALOMEDSImpl_Study::SetStringVariableAsDouble(const string& theVarName, - const double theValue, - const SALOMEDSImpl_GenericVariable::VariableTypes theType) + const double theValue, + const SALOMEDSImpl_GenericVariable::VariableTypes theType) { SALOMEDSImpl_GenericVariable* aGVar = GetVariable(theVarName); if(SALOMEDSImpl_ScalarVariable* aSVar = dynamic_cast(aGVar)) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx index f9833cb23..8730cff42 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx @@ -221,14 +221,14 @@ public: virtual SALOMEDSImpl_SObject GetSObject(const std::string& theEntry); virtual SALOMEDSImpl_SObject GetSObject(const DF_Label& theEntryLabel); virtual DF_Attribute* GetAttribute(const std::string& theEntry, - const std::string& theType); + const std::string& theType); virtual bool HasCurrentContext() { return !_current.IsNull(); } virtual bool DumpStudy(const std::string& thePath, - const std::string& theBaseName, - bool isPublished, - SALOMEDSImpl_DriverFactory* theFactory); + const std::string& theBaseName, + bool isPublished, + SALOMEDSImpl_DriverFactory* theFactory); static std::string GetDumpStudyComment(const char* theComponentName = 0); @@ -243,8 +243,8 @@ public: SALOMEDSImpl_AttributeParameter* GetCommonParameters(const char* theID, int theSavePoint); SALOMEDSImpl_AttributeParameter* GetModuleParameters(const char* theID, - const char* theModuleName, - int theSavePoint); + const char* theModuleName, + int theSavePoint); //Locks the study, theLockerID is identificator of the of the one who locked the study for ex. IOR void SetStudyLock(const char* theLockerID); @@ -264,12 +264,12 @@ public: const SALOMEDSImpl_GenericVariable::VariableTypes); void SetStringVariable(const std::string& theVarName, - const std::string& theValue, - const SALOMEDSImpl_GenericVariable::VariableTypes); + const std::string& theValue, + const SALOMEDSImpl_GenericVariable::VariableTypes); void SetStringVariableAsDouble(const std::string& theVarName, - const double theValue, - const SALOMEDSImpl_GenericVariable::VariableTypes); + const double theValue, + const SALOMEDSImpl_GenericVariable::VariableTypes); double GetVariableValue(const std::string& theVarName); @@ -294,14 +294,14 @@ public: bool IsVariableUsed(const std::string& theVarName); bool FindVariableAttribute(SALOMEDSImpl_StudyBuilder* theStudyBuilder, - SALOMEDSImpl_SObject theSObject, - const std::string& theName); + SALOMEDSImpl_SObject theSObject, + const std::string& theName); bool FindVariableAttribute(const std::string& theName); void ReplaceVariableAttribute(SALOMEDSImpl_StudyBuilder* theStudyBuilder, - SALOMEDSImpl_SObject theSObject, - const std::string& theSource, - const std::string& theDest); + SALOMEDSImpl_SObject theSObject, + const std::string& theSource, + const std::string& theDest); void ReplaceVariableAttribute(const std::string& theSource, const std::string& theDest); std::vector< std::vector > ParseVariables(const std::string& theVariables) const; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index 4ec0d3b39..d09c10e25 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -104,7 +104,7 @@ SALOMEDSImpl_SComponent SALOMEDSImpl_StudyBuilder::NewComponent(const string& Da */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::DefineComponentInstance(const SALOMEDSImpl_SComponent& aComponent, - const string& IOR) + const string& IOR) { _errorCode = ""; @@ -160,7 +160,7 @@ SALOMEDSImpl_SObject SALOMEDSImpl_StudyBuilder::NewObject(const SALOMEDSImpl_SOb */ //============================================================================ SALOMEDSImpl_SObject SALOMEDSImpl_StudyBuilder::NewObjectToTag(const SALOMEDSImpl_SObject& theFatherObject, - const int theTag) + const int theTag) { _errorCode = ""; CheckLocked(); @@ -250,7 +250,7 @@ bool SALOMEDSImpl_StudyBuilder::RemoveObjectWithChildren(const SALOMEDSImpl_SObj if ((aReference=(SALOMEDSImpl_AttributeReference*)aLabel.FindAttribute(SALOMEDSImpl_AttributeReference::GetID()))) { SALOMEDSImpl_AttributeTarget* aTarget = NULL; if ((aTarget=(SALOMEDSImpl_AttributeTarget*)aReference->Get().FindAttribute(SALOMEDSImpl_AttributeTarget::GetID()))) - aTarget->Remove(SALOMEDSImpl_Study::SObject(aLabel)); + aTarget->Remove(SALOMEDSImpl_Study::SObject(aLabel)); } SALOMEDSImpl_AttributeIOR* anAttr = NULL; //Remove from IORLabel map if ((anAttr=(SALOMEDSImpl_AttributeIOR*)aLabel.FindAttribute(SALOMEDSImpl_AttributeIOR::GetID()))) { @@ -333,14 +333,14 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, int aStreamSize = 0; if (hdf_sco_group->ExistInternalObject("FILE_STREAM")) { - HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group); - hdf_dataset->OpenOnDisk(); - aStreamSize = hdf_dataset->GetSize(); - aStreamFile = new unsigned char[aStreamSize]; - if(aStreamFile == NULL) throw HDFexception("Unable to open dataset FILE_STREAM"); - hdf_dataset->ReadFromDisk(aStreamFile); - hdf_dataset->CloseOnDisk(); - hdf_dataset = 0; + HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group); + hdf_dataset->OpenOnDisk(); + aStreamSize = hdf_dataset->GetSize(); + aStreamFile = new unsigned char[aStreamSize]; + if(aStreamFile == NULL) throw HDFexception("Unable to open dataset FILE_STREAM"); + hdf_dataset->ReadFromDisk(aStreamFile); + hdf_dataset->CloseOnDisk(); + hdf_dataset = 0; } else aStreamFile = NULL; @@ -355,16 +355,16 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, string aDir = SALOMEDSImpl_Tool::GetDirFromPath(Res); bool aResult = (ASCIIfileState[0]=='A')? - aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'): - aDriver->Load(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'); + aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'): + aDriver->Load(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'); if(aStreamFile != NULL) delete []aStreamFile; if(!aResult) { - RemoveAttribute( anSCO, "AttributeIOR" ); + RemoveAttribute( anSCO, "AttributeIOR" ); - _errorCode = "Can't load component"; - throw HDFexception("Unable to load component"); + _errorCode = "Can't load component"; + throw HDFexception("Unable to load component"); } //if(aDir != NULL) delete []aDir; @@ -382,9 +382,9 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, delete hdf_file; if (isASCII) { - vector aFilesToRemove; - aFilesToRemove.push_back("hdf_from_ascii.hdf"); - SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), + vector aFilesToRemove; + aFilesToRemove.push_back("hdf_from_ascii.hdf"); + SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true); } } @@ -392,9 +392,9 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, delete hdf_file; if (isASCII) { - vector aFilesToRemove; - aFilesToRemove.push_back(aHDFUrl); - SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true); + vector aFilesToRemove; + aFilesToRemove.push_back(aHDFUrl); + SALOMEDSImpl_Tool::RemoveTemporaryFiles(SALOMEDSImpl_Tool::GetDirFromPath(aHDFUrl), aFilesToRemove, true); } if (aLocked) _study->GetProperties()->SetLocked(true); @@ -436,7 +436,7 @@ bool SALOMEDSImpl_StudyBuilder::Load(const SALOMEDSImpl_SObject& sco) */ //============================================================================ DF_Attribute* SALOMEDSImpl_StudyBuilder::FindOrCreateAttribute(const SALOMEDSImpl_SObject& anObject, - const string& aTypeOfAttribute) + const string& aTypeOfAttribute) { _errorCode = ""; if(!anObject) { @@ -499,8 +499,8 @@ DF_Attribute* SALOMEDSImpl_StudyBuilder::FindOrCreateAttribute(const SALOMEDSImp //============================================================================ bool SALOMEDSImpl_StudyBuilder::FindAttribute(const SALOMEDSImpl_SObject& anObject, - DF_Attribute*& anAttribute, - const string& aTypeOfAttribute) + DF_Attribute*& anAttribute, + const string& aTypeOfAttribute) { _errorCode = ""; if(!anObject) { @@ -523,7 +523,7 @@ bool SALOMEDSImpl_StudyBuilder::FindAttribute(const SALOMEDSImpl_SObject& anObje //============================================================================ bool SALOMEDSImpl_StudyBuilder::RemoveAttribute(const SALOMEDSImpl_SObject& anObject, - const string& aTypeOfAttribute) + const string& aTypeOfAttribute) { _errorCode = ""; CheckLocked(); @@ -553,7 +553,7 @@ bool SALOMEDSImpl_StudyBuilder::RemoveAttribute(const SALOMEDSImpl_SObject& anOb */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::Addreference(const SALOMEDSImpl_SObject& me, - const SALOMEDSImpl_SObject& theReferencedObject) + const SALOMEDSImpl_SObject& theReferencedObject) { _errorCode = ""; if(!me || !theReferencedObject) { @@ -681,7 +681,7 @@ bool SALOMEDSImpl_StudyBuilder::AddDirectory(const string& thePath) */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::SetGUID(const SALOMEDSImpl_SObject& anObject, - const string& theGUID) + const string& theGUID) { _errorCode = ""; CheckLocked(); @@ -704,7 +704,7 @@ bool SALOMEDSImpl_StudyBuilder::SetGUID(const SALOMEDSImpl_SObject& anObject, */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::IsGUID(const SALOMEDSImpl_SObject& anObject, - const string& theGUID) + const string& theGUID) { _errorCode = ""; if(!anObject) { @@ -914,7 +914,7 @@ void SALOMEDSImpl_StudyBuilder::CheckLocked() */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::SetName(const SALOMEDSImpl_SObject& theSO, - const string& theValue) + const string& theValue) { _errorCode = ""; CheckLocked(); @@ -935,7 +935,7 @@ bool SALOMEDSImpl_StudyBuilder::SetName(const SALOMEDSImpl_SObject& theSO, */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::SetComment(const SALOMEDSImpl_SObject& theSO, - const string& theValue) + const string& theValue) { _errorCode = ""; CheckLocked(); @@ -956,7 +956,7 @@ bool SALOMEDSImpl_StudyBuilder::SetComment(const SALOMEDSImpl_SObject& theSO, */ //============================================================================ bool SALOMEDSImpl_StudyBuilder::SetIOR(const SALOMEDSImpl_SObject& theSO, - const string& theValue) + const string& theValue) { _errorCode = ""; CheckLocked(); @@ -989,14 +989,14 @@ static void Translate_persistentID_to_IOR(DF_Label& Lab, SALOMEDSImpl_Driver* dr SALOMEDSImpl_AttributeLocalID* anID = NULL; if ((anID=(SALOMEDSImpl_AttributeLocalID*)current.FindAttribute(SALOMEDSImpl_AttributeLocalID::GetID()))) - if (anID->Value() == FILELOCALID) continue; //SRN: This attribute store a file name, skip it + if (anID->Value() == FILELOCALID) continue; //SRN: This attribute store a file name, skip it string persist_ref = Att->Value(); SALOMEDSImpl_SObject so = SALOMEDSImpl_Study::SObject(current); string ior_string = driver->LocalPersistentIDToIOR(so, - persist_ref, - isMultiFile, - isASCII); + persist_ref, + isMultiFile, + isASCII); SALOMEDSImpl_AttributeIOR::Set (current, ior_string); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.cxx index a3d37afc6..22b55c7e6 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyHandle.cxx @@ -56,7 +56,7 @@ SALOMEDSImpl_StudyHandle::SALOMEDSImpl_StudyHandle() //purpose : //======================================================================= SALOMEDSImpl_StudyHandle* SALOMEDSImpl_StudyHandle::Set(const DF_Label& theLabel, - SALOMEDSImpl_Study* theStudy) + SALOMEDSImpl_Study* theStudy) { SALOMEDSImpl_StudyHandle* A = NULL; if (!(A=(SALOMEDSImpl_StudyHandle*)theLabel.FindAttribute(GetID()))) { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx index cef6ad2b8..cfeca4916 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -57,7 +57,7 @@ static void SaveAttributes(const SALOMEDSImpl_SObject& SO, HDFgroup *hdf_group_s static void ReadAttributes(SALOMEDSImpl_Study*, const SALOMEDSImpl_SObject&, HDFdataset* ); static void BuildTree (SALOMEDSImpl_Study*, HDFgroup*); static void Translate_IOR_to_persistentID (const SALOMEDSImpl_SObject&, - SALOMEDSImpl_Driver*, bool isMultiFile, bool isASCII); + SALOMEDSImpl_Driver*, bool isMultiFile, bool isASCII); static void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup); //============================================================================ @@ -150,10 +150,10 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const string& aUrl) } catch (HDFexception) { - char *eStr; - eStr = new char[strlen(aUrl.c_str())+17]; + char *eStr; + eStr = new char[strlen(aUrl.c_str())+17]; sprintf(eStr,"Can't open file %s",aUrl.c_str()); - delete [] eStr; + delete [] eStr; _errorCode = string(eStr); return NULL; } @@ -241,8 +241,8 @@ void SALOMEDSImpl_StudyManager::Close(SALOMEDSImpl_Study* aStudy) */ //============================================================================ bool SALOMEDSImpl_StudyManager::Save(SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile) + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile) { _errorCode = ""; @@ -259,8 +259,8 @@ bool SALOMEDSImpl_StudyManager::Save(SALOMEDSImpl_Study* aStudy, } bool SALOMEDSImpl_StudyManager::SaveASCII(SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile) + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile) { _errorCode = ""; @@ -282,18 +282,18 @@ bool SALOMEDSImpl_StudyManager::SaveASCII(SALOMEDSImpl_Study* aStudy, */ //============================================================================ bool SALOMEDSImpl_StudyManager::SaveAs(const string& aUrl, - SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile) + SALOMEDSImpl_Study* aStudy, + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile) { _errorCode = ""; return Impl_SaveAs(aUrl,aStudy, aFactory, theMultiFile, false); } bool SALOMEDSImpl_StudyManager::SaveAsASCII(const string& aUrl, - SALOMEDSImpl_Study* aStudy, - SALOMEDSImpl_DriverFactory* aFactory, - bool theMultiFile) + SALOMEDSImpl_Study* aStudy, + SALOMEDSImpl_DriverFactory* aFactory, + bool theMultiFile) { _errorCode = ""; return Impl_SaveAs(aUrl,aStudy, aFactory, theMultiFile, true); @@ -426,12 +426,12 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveProperties(SALOMEDSImpl_Study* aStudy, int a = 2; for(anIndex = 0; anIndexNewComponentIterator(); for (; itcomponent1.More(); itcomponent1.Next()) - { - SALOMEDSImpl_SComponent sco = itcomponent1.Value(); - // if there is an associated Engine call its method for saving - string IOREngine; - try { - if (!sco.ComponentIOR(IOREngine)) { - string aCompType = sco.GetComment(); - if (!aCompType.empty()) { - - SALOMEDSImpl_Driver* aDriver = aFactory->GetDriverByType(aCompType); - aMapTypeDriver[aCompType] = aDriver; - - if (aDriver != NULL) { - if(!SB->LoadWith(sco, aDriver)) { - _errorCode = SB->GetErrorCode(); - return false; - } - } - } - } - } catch(...) { - _errorCode = "Can not restore information to resave it"; - return false; - } - } + { + SALOMEDSImpl_SComponent sco = itcomponent1.Value(); + // if there is an associated Engine call its method for saving + string IOREngine; + try { + if (!sco.ComponentIOR(IOREngine)) { + string aCompType = sco.GetComment(); + if (!aCompType.empty()) { + + SALOMEDSImpl_Driver* aDriver = aFactory->GetDriverByType(aCompType); + aMapTypeDriver[aCompType] = aDriver; + + if (aDriver != NULL) { + if(!SB->LoadWith(sco, aDriver)) { + _errorCode = SB->GetErrorCode(); + return false; + } + } + } + } + } catch(...) { + _errorCode = "Can not restore information to resave it"; + return false; + } + } string anOldName = aStudy->Name(); aStudy->URL(aStudyUrl); @@ -544,74 +544,74 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, SALOMEDSImpl_SComponentIterator itcomponent = aStudy->NewComponentIterator(); for (; itcomponent.More(); itcomponent.Next()) - { - SALOMEDSImpl_SComponent sco = itcomponent.Value(); - - 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; - if (sco.ComponentIOR(IOREngine)) - { - SALOMEDSImpl_Driver* Engine = NULL; - if(aMapTypeDriver.find(componentDataType) != aMapTypeDriver.end()) { - // we have found the associated engine to write the data - Engine = aMapTypeDriver[componentDataType]; - } - else { - Engine = aFactory->GetDriverByIOR(IOREngine); - } - - if (Engine != NULL) - { - SALOMEDSImpl_TMPFile* aStream = NULL; - long length = 0; + { + SALOMEDSImpl_SComponent sco = itcomponent.Value(); + + 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; + if (sco.ComponentIOR(IOREngine)) + { + SALOMEDSImpl_Driver* Engine = NULL; + if(aMapTypeDriver.find(componentDataType) != aMapTypeDriver.end()) { + // we have found the associated engine to write the data + Engine = aMapTypeDriver[componentDataType]; + } + else { + Engine = aFactory->GetDriverByIOR(IOREngine); + } + + if (Engine != NULL) + { + SALOMEDSImpl_TMPFile* aStream = NULL; + long length = 0; if (theASCII) aStream = Engine->SaveASCII(sco, - SALOMEDSImpl_Tool::GetDirFromPath(aUrl), - length, - theMultiFile); - else aStream = Engine->Save(sco, - SALOMEDSImpl_Tool::GetDirFromPath(aUrl), - length, - theMultiFile); - HDFdataset *hdf_dataset; - hdf_size aHDFSize[1]; - if(length > 0) { //The component saved some auxiliary files, then put them into HDF file - - aHDFSize[0] = length; - - HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group, HDF_STRING, aHDFSize, 1); - hdf_dataset->CreateOnDisk(); - hdf_dataset->WriteOnDisk(aStream->Data()); //Save the stream in the HDF file - hdf_dataset->CloseOnDisk(); - } - - if(aStream) delete aStream; - - // store multifile state - aHDFSize[0] = 2; - hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1); - hdf_dataset->CreateOnDisk(); - hdf_dataset->WriteOnDisk((void*)(theMultiFile?"M":"S")); // save: multi or single - hdf_dataset->CloseOnDisk(); - hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor - // store ASCII state - aHDFSize[0] = 2; - hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1); - hdf_dataset->CreateOnDisk(); - hdf_dataset->WriteOnDisk((void*)(theASCII?"A":"B")); // save: ASCII or BINARY - hdf_dataset->CloseOnDisk(); - hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor - // Creation of the persistance reference attribute - Translate_IOR_to_persistentID (sco, Engine, theMultiFile, theASCII); - } - } - hdf_sco_group->CloseOnDisk(); - hdf_sco_group=0; // will be deleted by hdf_group_datacomponent destructor - } + SALOMEDSImpl_Tool::GetDirFromPath(aUrl), + length, + theMultiFile); + else aStream = Engine->Save(sco, + SALOMEDSImpl_Tool::GetDirFromPath(aUrl), + length, + theMultiFile); + HDFdataset *hdf_dataset; + hdf_size aHDFSize[1]; + if(length > 0) { //The component saved some auxiliary files, then put them into HDF file + + aHDFSize[0] = length; + + HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group, HDF_STRING, aHDFSize, 1); + hdf_dataset->CreateOnDisk(); + hdf_dataset->WriteOnDisk(aStream->Data()); //Save the stream in the HDF file + hdf_dataset->CloseOnDisk(); + } + + if(aStream) delete aStream; + + // store multifile state + aHDFSize[0] = 2; + hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1); + hdf_dataset->CreateOnDisk(); + hdf_dataset->WriteOnDisk((void*)(theMultiFile?"M":"S")); // save: multi or single + hdf_dataset->CloseOnDisk(); + hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor + // store ASCII state + aHDFSize[0] = 2; + hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group, HDF_STRING, aHDFSize, 1); + hdf_dataset->CreateOnDisk(); + hdf_dataset->WriteOnDisk((void*)(theASCII?"A":"B")); // save: ASCII or BINARY + hdf_dataset->CloseOnDisk(); + hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor + // Creation of the persistance reference attribute + Translate_IOR_to_persistentID (sco, Engine, theMultiFile, theASCII); + } + } + hdf_sco_group->CloseOnDisk(); + hdf_sco_group=0; // will be deleted by hdf_group_datacomponent destructor + } hdf_group_datacomponent->CloseOnDisk(); hdf_group_datacomponent =0; // will be deleted by hdf_file destructor @@ -623,36 +623,36 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, // save component attributes SALOMEDSImpl_SComponentIterator itcomp = aStudy->NewComponentIterator(); for (; itcomp.More(); itcomp.Next()) - { - SALOMEDSImpl_SComponent SC = itcomp.Value(); - string scid = SC.GetID(); - hdf_sco_group2 = new HDFgroup((char*)scid.c_str(), hdf_group_study_structure); - hdf_sco_group2->CreateOnDisk(); + { + SALOMEDSImpl_SComponent SC = itcomp.Value(); + 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); - // ComponentDataType treatment - component_name = SC.ComponentDataType(); - name_len = (hdf_int32)component_name.length(); - size[0] = name_len +1 ; - hdf_dataset = new HDFdataset("COMPONENTDATATYPE",hdf_sco_group2,HDF_STRING,size,1); - hdf_dataset->CreateOnDisk(); - hdf_dataset->WriteOnDisk((char*)component_name.c_str()); - hdf_dataset->CloseOnDisk(); - hdf_dataset=0; //will be deleted by hdf_sco_group destructor - Impl_SaveObject(SC, hdf_sco_group2); - hdf_sco_group2->CloseOnDisk(); - hdf_sco_group2=0; // will be deleted by hdf_group_study_structure destructor - } + // ComponentDataType treatment + component_name = SC.ComponentDataType(); + name_len = (hdf_int32)component_name.length(); + size[0] = name_len +1 ; + hdf_dataset = new HDFdataset("COMPONENTDATATYPE",hdf_sco_group2,HDF_STRING,size,1); + hdf_dataset->CreateOnDisk(); + hdf_dataset->WriteOnDisk((char*)component_name.c_str()); + hdf_dataset->CloseOnDisk(); + hdf_dataset=0; //will be deleted by hdf_sco_group destructor + Impl_SaveObject(SC, hdf_sco_group2); + hdf_sco_group2->CloseOnDisk(); + hdf_sco_group2=0; // will be deleted by hdf_group_study_structure destructor + } //----------------------------------------------------------------------- //4 - Write the Study UseCases Structure //----------------------------------------------------------------------- SALOMEDSImpl_SObject aSO = aStudy->FindObjectID(USE_CASE_LABEL_ID); if (aSO) { - HDFgroup *hdf_soo_group = new HDFgroup(USE_CASE_LABEL_ID,hdf_group_study_structure); - hdf_soo_group->CreateOnDisk(); - SaveAttributes(aSO, hdf_soo_group); - Impl_SaveObject(aSO, hdf_soo_group); - hdf_soo_group->CloseOnDisk(); - hdf_soo_group=0; // will be deleted by hdf_group_study_structure destructor + HDFgroup *hdf_soo_group = new HDFgroup(USE_CASE_LABEL_ID,hdf_group_study_structure); + hdf_soo_group->CreateOnDisk(); + SaveAttributes(aSO, hdf_soo_group); + Impl_SaveObject(aSO, hdf_soo_group); + hdf_soo_group->CloseOnDisk(); + hdf_soo_group=0; // will be deleted by hdf_group_study_structure destructor } //----------------------------------------------------------------------- //5 - Write the NoteBook Variables @@ -806,7 +806,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const string& aStudyUrl, */ //============================================================================ bool SALOMEDSImpl_StudyManager::Impl_SaveObject(const SALOMEDSImpl_SObject& SC, - HDFgroup *hdf_group_datatype) + HDFgroup *hdf_group_datatype) { _errorCode = ""; @@ -822,20 +822,20 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveObject(const SALOMEDSImpl_SObject& SC, // mpv: don't save empty labels vector attr = itchild.Value().GetAttributes(); if (attr.size() == 0) { //No attributes on the label - DF_ChildIterator subchild(itchild.Value()); - if (!subchild.More()) { - continue; - } - subchild.Init(itchild.Value(), true); - bool anEmpty = true; - for (; subchild.More() && anEmpty; subchild.Next()) { - vector attr2 = subchild.Value().GetAttributes(); - if (attr2.size()) { - anEmpty = false; //There are attributes on the child label - break; - } - } - if (anEmpty) continue; + DF_ChildIterator subchild(itchild.Value()); + if (!subchild.More()) { + continue; + } + subchild.Init(itchild.Value(), true); + bool anEmpty = true; + for (; subchild.More() && anEmpty; subchild.Next()) { + vector attr2 = subchild.Value().GetAttributes(); + if (attr2.size()) { + anEmpty = false; //There are attributes on the child label + break; + } + } + if (anEmpty) continue; } SALOMEDSImpl_SObject SO = SALOMEDSImpl_Study::SObject(itchild.Value()); @@ -884,7 +884,7 @@ DF_Document* SALOMEDSImpl_StudyManager::GetDocumentOfStudy(SALOMEDSImpl_Study* t */ //============================================================================ bool SALOMEDSImpl_StudyManager::CanCopy(const SALOMEDSImpl_SObject& theObject, - SALOMEDSImpl_Driver* theEngine) + SALOMEDSImpl_Driver* theEngine) { _errorCode = ""; SALOMEDSImpl_SComponent aComponent = theObject.GetFatherComponent(); @@ -902,10 +902,10 @@ bool SALOMEDSImpl_StudyManager::CanCopy(const SALOMEDSImpl_SObject& theObject, */ //============================================================================ bool SALOMEDSImpl_StudyManager::CopyLabel(SALOMEDSImpl_Study* theSourceStudy, - SALOMEDSImpl_Driver* theEngine, - const int theSourceStartDepth, - const DF_Label& theSource, - const DF_Label& theDestinationMain) + SALOMEDSImpl_Driver* theEngine, + const int theSourceStartDepth, + const DF_Label& theSource, + const DF_Label& theDestinationMain) { _errorCode = ""; @@ -932,8 +932,8 @@ bool SALOMEDSImpl_StudyManager::CopyLabel(SALOMEDSImpl_Study* theSourceStudy, // store the value of name attribute of referenced label SALOMEDSImpl_AttributeName* aNameAttribute; if ((aNameAttribute=(SALOMEDSImpl_AttributeName*)aReferenced.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) { - anEntry += " "; - anEntry += aNameAttribute->Value(); + anEntry += " "; + anEntry += aNameAttribute->Value(); } SALOMEDSImpl_AttributeComment::Set(aAuxTargetLabel, anEntry); continue; @@ -947,7 +947,7 @@ bool SALOMEDSImpl_StudyManager::CopyLabel(SALOMEDSImpl_Study* theSourceStudy, SALOMEDSImpl_TMPFile* aStream = theEngine->CopyFrom(aSO, anObjID, aLen); string aResStr(""); for(a = 0; a < aLen; a++) { - aResStr += (char)(aStream->Get(a)); + aResStr += (char)(aStream->Get(a)); } if(aStream) delete aStream; @@ -970,7 +970,7 @@ bool SALOMEDSImpl_StudyManager::CopyLabel(SALOMEDSImpl_Study* theSourceStudy, */ //============================================================================ bool SALOMEDSImpl_StudyManager::Copy(const SALOMEDSImpl_SObject& theObject, - SALOMEDSImpl_Driver* theEngine) + SALOMEDSImpl_Driver* theEngine) { _errorCode = ""; @@ -996,7 +996,7 @@ bool SALOMEDSImpl_StudyManager::Copy(const SALOMEDSImpl_SObject& theObject, // set component data type to the name attribute of root label if (!aStructureOnly) { SALOMEDSImpl_AttributeComment::Set(_clipboard->Main().Root(), - theEngine->ComponentDataType()); + theEngine->ComponentDataType()); } // set to the Root label integer attribute: study id SALOMEDSImpl_AttributeInteger::Set(_clipboard->Main().Root(), aStudy->StudyId()); @@ -1021,7 +1021,7 @@ bool SALOMEDSImpl_StudyManager::Copy(const SALOMEDSImpl_SObject& theObject, */ //============================================================================ bool SALOMEDSImpl_StudyManager::CanPaste(const SALOMEDSImpl_SObject& theObject, - SALOMEDSImpl_Driver* theEngine) + SALOMEDSImpl_Driver* theEngine) { _errorCode = ""; @@ -1060,11 +1060,11 @@ bool SALOMEDSImpl_StudyManager::CanPaste(const SALOMEDSImpl_SObject& theObject, */ //============================================================================ DF_Label SALOMEDSImpl_StudyManager::PasteLabel(SALOMEDSImpl_Study* theDestinationStudy, - SALOMEDSImpl_Driver* theEngine, - const DF_Label& theSource, - const DF_Label& theDestinationStart, - const int theCopiedStudyID, - const bool isFirstElement) + SALOMEDSImpl_Driver* theEngine, + const DF_Label& theSource, + const DF_Label& theDestinationStart, + const int theCopiedStudyID, + const bool isFirstElement) { _errorCode = ""; @@ -1094,23 +1094,23 @@ DF_Label SALOMEDSImpl_StudyManager::PasteLabel(SALOMEDSImpl_Study* theDestinatio int aLen = aTMPStr.size(); unsigned char* aStream = NULL; if(aLen > 0) { - aStream = new unsigned char[aLen+10]; - for(a = 0; a < aLen; a++) { - aStream[a] = aTMPStr[a]; - } + aStream = new unsigned char[aLen+10]; + for(a = 0; a < aLen; a++) { + aStream[a] = aTMPStr[a]; + } } string anEntry = aTargetLabel.Entry(); SALOMEDSImpl_SObject aPastedSO = theDestinationStudy->FindObjectID(anEntry); if (isFirstElement) { - string aDestEntry = theEngine->PasteInto(aStream, - aLen, - anObjID->Value(), - aPastedSO.GetFatherComponent()); - aTargetLabel = DF_Label::Label(theDestinationStart, aDestEntry); + string aDestEntry = theEngine->PasteInto(aStream, + aLen, + anObjID->Value(), + aPastedSO.GetFatherComponent()); + aTargetLabel = DF_Label::Label(theDestinationStart, aDestEntry); } else - theEngine->PasteInto(aStream, aLen, anObjID->Value(), aPastedSO); + theEngine->PasteInto(aStream, aLen, anObjID->Value(), aPastedSO); if(aStream != NULL) delete []aStream; } @@ -1159,7 +1159,7 @@ DF_Label SALOMEDSImpl_StudyManager::PasteLabel(SALOMEDSImpl_Study* theDestinatio */ //============================================================================ SALOMEDSImpl_SObject SALOMEDSImpl_StudyManager::Paste(const SALOMEDSImpl_SObject& theObject, - SALOMEDSImpl_Driver* theEngine) + SALOMEDSImpl_Driver* theEngine) { _errorCode = ""; @@ -1246,8 +1246,8 @@ static void SaveAttributes(const SALOMEDSImpl_SObject& aSO, HDFgroup *hdf_group_ //Function : ReadAttributes //=========================================================================== static void ReadAttributes(SALOMEDSImpl_Study* theStudy, - const SALOMEDSImpl_SObject& aSO, - HDFdataset* hdf_dataset) + const SALOMEDSImpl_SObject& aSO, + HDFdataset* hdf_dataset) { hdf_dataset->OpenOnDisk(); @@ -1317,9 +1317,9 @@ static void BuildTree (SALOMEDSImpl_Study* theStudy, HDFgroup* hdf_current_group //Function : Translate_IOR_to_persistentID //============================================================================ static void Translate_IOR_to_persistentID (const SALOMEDSImpl_SObject& so, - SALOMEDSImpl_Driver* engine, - bool isMultiFile, - bool isASCII) + SALOMEDSImpl_Driver* engine, + bool isMultiFile, + bool isASCII) { DF_ChildIterator itchild(so.GetLabel()); string ior_string, persistent_string, curid; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx index a77876658..974eb69b7 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx @@ -134,8 +134,8 @@ string SALOMEDSImpl_Tool::GetTmpDir() // purpose : Removes files listed in theFileList //============================================================================ void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const string& theDirectory, - const vector& theFiles, - const bool IsDirDeleted) + const vector& theFiles, + const bool IsDirDeleted) { string aDirName = theDirectory; @@ -233,7 +233,7 @@ vector SALOMEDSImpl_Tool::splitString(const string& theValue, char separ vs.push_back(s.substr(0, pos)); s = s.substr(pos+1, s.size()); } - + if(!s.empty() && s[0] != separator) vs.push_back(s); return vs; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.hxx index cf43ddff3..5c6bac1c6 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.hxx @@ -47,8 +47,8 @@ public: // Removes files which are in , the files for deletion are listed in // if is true is also deleted if it is empty static void RemoveTemporaryFiles(const std::string& theDirectory, - const std::vector& theFiles, - const bool IsDirDeleted); + const std::vector& theFiles, + const bool IsDirDeleted); // Returns the name by the path // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1" @@ -68,8 +68,8 @@ public: //The functions returns a list of substring of initial string divided by given separator, //include empty strings static std::vector< std::vector > splitStringWithEmpty(const std::string& theValue, - char separator1, - char separator2); + char separator1, + char separator2); //Returns a system date diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx index 3ac8bb728..566846962 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx @@ -151,7 +151,7 @@ bool SALOMEDSImpl_UseCaseBuilder::Remove(const SALOMEDSImpl_SObject& theObject) */ //============================================================================ bool SALOMEDSImpl_UseCaseBuilder::AppendTo(const SALOMEDSImpl_SObject& theFather, - const SALOMEDSImpl_SObject& theObject) + const SALOMEDSImpl_SObject& theObject) { if(!_root || !theFather || !theObject) return false; @@ -179,7 +179,7 @@ bool SALOMEDSImpl_UseCaseBuilder::AppendTo(const SALOMEDSImpl_SObject& theFather */ //============================================================================ bool SALOMEDSImpl_UseCaseBuilder::InsertBefore(const SALOMEDSImpl_SObject& theFirst, - const SALOMEDSImpl_SObject& theNext) + const SALOMEDSImpl_SObject& theNext) { if(!_root || !theFirst || !theNext) return false; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx index 804797821..1ce3207e0 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.cxx @@ -46,8 +46,8 @@ SALOMEDSImpl_UseCaseIterator::SALOMEDSImpl_UseCaseIterator() */ //============================================================================ SALOMEDSImpl_UseCaseIterator::SALOMEDSImpl_UseCaseIterator(const DF_Label& theLabel, - const string& theGUID, - const bool allLevels) + const string& theGUID, + const bool allLevels) :_guid(theGUID), _levels(allLevels) { if((_node = (SALOMEDSImpl_AttributeTreeNode*)theLabel.FindAttribute(_guid))) { diff --git a/src/SALOMELocalTrace/FileTraceCollector.cxx b/src/SALOMELocalTrace/FileTraceCollector.cxx index 4bf7c3356..6255da956 100644 --- a/src/SALOMELocalTrace/FileTraceCollector.cxx +++ b/src/SALOMELocalTrace/FileTraceCollector.cxx @@ -56,21 +56,21 @@ BaseTraceCollector* FileTraceCollector::instance(const char *fileName) int ret; ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone if (_singleton == 0) // another thread may have got - { // the lock after the first test - DEVTRACE("FileTraceCollector:: instance()"); - BaseTraceCollector* myInstance = new FileTraceCollector(); - _fileName = fileName; - DEVTRACE(" _fileName: " << _fileName); - - sem_init(&_sem,0,0); // to wait until run thread is initialized - pthread_t traceThread; - int bid = 0; - pthread_create(&traceThread, NULL, - FileTraceCollector::run, (void *)bid); - sem_wait(&_sem); - _singleton = myInstance; // _singleton known only when init done - DEVTRACE("FileTraceCollector:: instance()-end"); - } + { // the lock after the first test + DEVTRACE("FileTraceCollector:: instance()"); + BaseTraceCollector* myInstance = new FileTraceCollector(); + _fileName = fileName; + DEVTRACE(" _fileName: " << _fileName); + + sem_init(&_sem,0,0); // to wait until run thread is initialized + pthread_t traceThread; + int bid = 0; + pthread_create(&traceThread, NULL, + FileTraceCollector::run, (void *)bid); + sem_wait(&_sem); + _singleton = myInstance; // _singleton known only when init done + DEVTRACE("FileTraceCollector:: instance()-end"); + } ret = pthread_mutex_unlock(&_singletonMutex); // release lock } return _singleton; @@ -116,44 +116,44 @@ void* FileTraceCollector::run(void *bid) while ((!_threadToClose) || myTraceBuffer->toCollect() ) { if (_threadToClose) - { - DEVTRACE("FileTraceCollector _threadToClose"); - //break; - } + { + DEVTRACE("FileTraceCollector _threadToClose"); + //break; + } myTraceBuffer->retrieve(myTrace); if (myTrace.traceType == ABORT_MESS) - { + { #ifndef WIN32 - traceFile << "INTERRUPTION from thread " << myTrace.threadId - << " : " << myTrace.trace; + traceFile << "INTERRUPTION from thread " << myTrace.threadId + << " : " << myTrace.trace; #else - traceFile << "INTERRUPTION from thread " - << (void*)(&myTrace.threadId) - << " : " << myTrace.trace; + traceFile << "INTERRUPTION from thread " + << (void*)(&myTrace.threadId) + << " : " << myTrace.trace; #endif - traceFile.close(); - cout << flush ; + traceFile.close(); + cout << flush ; #ifndef WIN32 - cerr << "INTERRUPTION from thread " << myTrace.threadId - << " : " << myTrace.trace; + cerr << "INTERRUPTION from thread " << myTrace.threadId + << " : " << myTrace.trace; #else - cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId) - << " : " << myTrace.trace; + cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId) + << " : " << myTrace.trace; #endif - cerr << flush ; - exit(1); - } + cerr << flush ; + exit(1); + } else - { + { #ifndef WIN32 - traceFile << "th. " << myTrace.threadId - << " " << myTrace.trace; + traceFile << "th. " << myTrace.threadId + << " " << myTrace.trace; #else - traceFile << "th. " << (void*)(&myTrace.threadId) - << " " << myTrace.trace; + traceFile << "th. " << (void*)(&myTrace.threadId) + << " " << myTrace.trace; #endif - } + } } DEVTRACE("traceFile.close()"); traceFile.close(); @@ -178,14 +178,14 @@ FileTraceCollector:: ~FileTraceCollector() _threadToClose = 1; myTraceBuffer->insert(NORMAL_MESS,"end of trace\n"); // to wake up thread if (_threadId) - { - int ret = pthread_join(*_threadId, NULL); - if (ret) cerr << "error close FileTraceCollector : "<< ret << endl; - else DEVTRACE("FileTraceCollector destruction OK"); + { + int ret = pthread_join(*_threadId, NULL); + if (ret) cerr << "error close FileTraceCollector : "<< ret << endl; + else DEVTRACE("FileTraceCollector destruction OK"); delete _threadId; - _threadId = 0; - _threadToClose = 0; - } + _threadId = 0; + _threadToClose = 0; + } _singleton = 0; } ret = pthread_mutex_unlock(&_singletonMutex); // release lock diff --git a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx index ac1712a44..e5ca216d7 100644 --- a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx +++ b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx @@ -84,72 +84,72 @@ LocalTraceBufferPool* LocalTraceBufferPool::instance() int ret; ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone if (_singleton == 0) // another thread may have got - { // the lock after the first test - DEVTRACE("New buffer pool"); - LocalTraceBufferPool* myInstance = new LocalTraceBufferPool(); - - new DESTRUCTOR_OF (*myInstance); - _singleton = myInstance; - - // --- start a trace Collector - - char* traceKind = getenv("SALOME_trace"); - - if ( !traceKind || strcmp(traceKind,"local")==0 ) // mkr : 27.11.2006 : PAL13967 - Distributed supervision graphs - Problem with "SALOME_trace" - { - _myThreadTrace = LocalTraceCollector::instance(); - } - else if (strncmp(traceKind,"file",strlen("file"))==0) - { - const char *fileName; - if (strlen(traceKind) > strlen("file")) - fileName = &traceKind[strlen("file")+1]; - else - fileName = "/tmp/tracetest.log"; - - _myThreadTrace = FileTraceCollector::instance(fileName); - } - else // --- try a dynamic library - { + { // the lock after the first test + DEVTRACE("New buffer pool"); + LocalTraceBufferPool* myInstance = new LocalTraceBufferPool(); + + new DESTRUCTOR_OF (*myInstance); + _singleton = myInstance; + + // --- start a trace Collector + + char* traceKind = getenv("SALOME_trace"); + + if ( !traceKind || strcmp(traceKind,"local")==0 ) // mkr : 27.11.2006 : PAL13967 - Distributed supervision graphs - Problem with "SALOME_trace" + { + _myThreadTrace = LocalTraceCollector::instance(); + } + else if (strncmp(traceKind,"file",strlen("file"))==0) + { + const char *fileName; + if (strlen(traceKind) > strlen("file")) + fileName = &traceKind[strlen("file")+1]; + else + fileName = "/tmp/tracetest.log"; + + _myThreadTrace = FileTraceCollector::instance(fileName); + } + else // --- try a dynamic library + { #ifndef WIN32 - void* handle; - string impl_name = string ("lib") + traceKind - + string("TraceCollector.so"); - handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ; + void* handle; + string impl_name = string ("lib") + traceKind + + string("TraceCollector.so"); + handle = dlopen( impl_name.c_str() , RTLD_LAZY ) ; #else - HINSTANCE handle; - string impl_name = string ("lib") + traceKind + string(".dll"); - handle = LoadLibrary( impl_name.c_str() ); + HINSTANCE handle; + string impl_name = string ("lib") + traceKind + string(".dll"); + handle = LoadLibrary( impl_name.c_str() ); #endif - if ( handle ) - { - typedef BaseTraceCollector * (*FACTORY_FUNCTION) (void); + if ( handle ) + { + typedef BaseTraceCollector * (*FACTORY_FUNCTION) (void); #ifndef WIN32 - FACTORY_FUNCTION TraceCollectorFactory = - (FACTORY_FUNCTION) dlsym(handle, "SingletonInstance"); + FACTORY_FUNCTION TraceCollectorFactory = + (FACTORY_FUNCTION) dlsym(handle, "SingletonInstance"); #else - FACTORY_FUNCTION TraceCollectorFactory = - (FACTORY_FUNCTION)GetProcAddress(handle, "SingletonInstance"); + FACTORY_FUNCTION TraceCollectorFactory = + (FACTORY_FUNCTION)GetProcAddress(handle, "SingletonInstance"); #endif - if ( !TraceCollectorFactory ) - { - cerr << "Can't resolve symbol: SingletonInstance" <toCollect() ) { if (_threadToClose) - { - DEVTRACE("FileTraceCollector _threadToClose"); - //break; - } + { + DEVTRACE("FileTraceCollector _threadToClose"); + //break; + } myTraceBuffer->retrieve(myTrace); if (myTrace.traceType == ABORT_MESS) - { - cout << flush ; + { + cout << flush ; #ifndef WIN32 - cerr << "INTERRUPTION from thread " << myTrace.threadId - << " : " << myTrace.trace; + cerr << "INTERRUPTION from thread " << myTrace.threadId + << " : " << myTrace.trace; #else - cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId) - << " : " << myTrace.trace; + cerr << "INTERRUPTION from thread " << (void*)(&myTrace.threadId) + << " : " << myTrace.trace; #endif - cerr << flush ; - exit(1); - } + cerr << flush ; + exit(1); + } else - { - cout << flush ; + { + cout << flush ; #ifndef WIN32 - cerr << "th. " << myTrace.threadId << " " << myTrace.trace; + cerr << "th. " << myTrace.threadId << " " << myTrace.trace; #else - cerr << "th. " << (void*)(&myTrace.threadId) - << " " << myTrace.trace; + cerr << "th. " << (void*)(&myTrace.threadId) + << " " << myTrace.trace; #endif - cerr << flush ; - } + cerr << flush ; + } } pthread_exit(NULL); return NULL; @@ -144,14 +144,14 @@ LocalTraceCollector:: ~LocalTraceCollector() _threadToClose = 1; myTraceBuffer->insert(NORMAL_MESS,"end of trace\n"); // to wake up thread if (_threadId) - { - int ret = pthread_join(*_threadId, NULL); - if (ret) cerr << "error close LocalTraceCollector : "<< ret << endl; - else DEVTRACE("LocalTraceCollector destruction OK"); + { + int ret = pthread_join(*_threadId, NULL); + if (ret) cerr << "error close LocalTraceCollector : "<< ret << endl; + else DEVTRACE("LocalTraceCollector destruction OK"); delete _threadId; - _threadId = 0; - _threadToClose = 0; - } + _threadId = 0; + _threadToClose = 0; + } _singleton = 0; } ret = pthread_mutex_unlock(&_singletonMutex); // release lock diff --git a/src/SALOMELocalTrace/utilities.h b/src/SALOMELocalTrace/utilities.h index 80255a9e2..3a7691ead 100644 --- a/src/SALOMELocalTrace/utilities.h +++ b/src/SALOMELocalTrace/utilities.h @@ -80,17 +80,17 @@ /* --- To print date and time of compilation of current source --- */ #if defined ( __GNUC__ ) -#define COMPILER "g++" +#define COMPILER "g++" #elif defined ( __sun ) -#define COMPILER "CC" +#define COMPILER "CC" #elif defined ( __KCC ) -#define COMPILER "KCC" +#define COMPILER "KCC" #elif defined ( __PGI ) -#define COMPILER "pgCC" +#define COMPILER "pgCC" #elif defined ( __alpha ) -#define COMPILER "cxx" +#define COMPILER "cxx" #else -#define COMPILER "undefined" +#define COMPILER "undefined" #endif #ifdef INFOS_COMPILATION @@ -102,8 +102,8 @@ // --- the following MACROS are useful at debug time #define INFOS_COMPILATION { MESS_BEGIN("COMPILED with ") << COMPILER \ - << ", " << __DATE__ \ - << " at " << __TIME__ << MESS_END } + << ", " << __DATE__ \ + << " at " << __TIME__ << MESS_END } #define MESSAGE(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END} #define SCRUTE(var) {MESS_BEGIN("- Trace ") << #var << "=" << var <putMessage(LogMsg); DEVTRACE("Logger server found"); } @@ -126,44 +126,44 @@ void* SALOMETraceCollector::run(void *bid) while ((!_threadToClose) || myTraceBuffer->toCollect() ) { if (_threadToClose) - { - DEVTRACE("SALOMETraceCollector _threadToClose"); - //break; - } + { + DEVTRACE("SALOMETraceCollector _threadToClose"); + //break; + } myTraceBuffer->retrieve(myTrace); if (!CORBA::is_nil(_orb)) - { - if (myTrace.traceType == ABORT_MESS) - { - stringstream abortMessage(""); + { + if (myTrace.traceType == ABORT_MESS) + { + stringstream abortMessage(""); #ifndef WIN32 - abortMessage << "INTERRUPTION from thread " - << myTrace.threadId << " : " << myTrace.trace; + abortMessage << "INTERRUPTION from thread " + << myTrace.threadId << " : " << myTrace.trace; #else - abortMessage << "INTERRUPTION from thread " - << (void*)&myTrace.threadId - << " : " << myTrace.trace; + abortMessage << "INTERRUPTION from thread " + << (void*)&myTrace.threadId + << " : " << myTrace.trace; #endif - CORBA::String_var LogMsg = - CORBA::string_dup(abortMessage.str().c_str()); - m_pInterfaceLogger->putMessage(LogMsg); - exit(1); - } - else - { - stringstream aMessage(""); + CORBA::String_var LogMsg = + CORBA::string_dup(abortMessage.str().c_str()); + m_pInterfaceLogger->putMessage(LogMsg); + exit(1); + } + else + { + stringstream aMessage(""); #ifndef WIN32 - aMessage << "th. " << myTrace.threadId + aMessage << "th. " << myTrace.threadId #else - aMessage << "th. " << (void*)&myTrace.threadId + aMessage << "th. " << (void*)&myTrace.threadId #endif - << " " << myTrace.trace; - CORBA::String_var LogMsg = - CORBA::string_dup(aMessage.str().c_str()); - m_pInterfaceLogger->putMessage(LogMsg); - } - } + << " " << myTrace.trace; + CORBA::String_var LogMsg = + CORBA::string_dup(aMessage.str().c_str()); + m_pInterfaceLogger->putMessage(LogMsg); + } + } } pthread_exit(NULL); return NULL; @@ -186,14 +186,14 @@ SALOMETraceCollector:: ~SALOMETraceCollector() _threadToClose = 1; myTraceBuffer->insert(NORMAL_MESS,"end of trace\n"); // to wake up thread if (_threadId) - { - int ret = pthread_join(*_threadId, NULL); - if (ret) cerr << "error close SALOMETraceCollector : "<< ret << endl; - else DEVTRACE("SALOMETraceCollector destruction OK"); + { + int ret = pthread_join(*_threadId, NULL); + if (ret) cerr << "error close SALOMETraceCollector : "<< ret << endl; + else DEVTRACE("SALOMETraceCollector destruction OK"); delete _threadId; - _threadId = 0; - _threadToClose = 0; - } + _threadId = 0; + _threadToClose = 0; + } _singleton = 0; } ret = pthread_mutex_unlock(&_singletonMutex); // release lock diff --git a/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx b/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx index 5b202ee2c..5deb13cf0 100644 --- a/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx +++ b/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx @@ -104,9 +104,9 @@ void *PrintHello(void *threadid) { #if defined(_DEBUG_) || defined(_DEBUG) long id_thread = (long)threadid; - for (int i=0; iresolve_initial_references("NameService"); - if (!CORBA::is_nil(theObj)) - inc = CosNaming::NamingContext::_narrow(theObj); - } - catch( CORBA::SystemException& ) - { - cout << "TraceCollector_WaitForServerReadiness: " - << "CORBA::SystemException: " - << "Unable to contact the Naming Service" << endl; - } + { + try + { + if(!CORBA::is_nil(orb)) + theObj = orb->resolve_initial_references("NameService"); + if (!CORBA::is_nil(theObj)) + inc = CosNaming::NamingContext::_narrow(theObj); + } + catch( CORBA::SystemException& ) + { + cout << "TraceCollector_WaitForServerReadiness: " + << "CORBA::SystemException: " + << "Unable to contact the Naming Service" << endl; + } catch(...) - { - cout << "TraceCollector_WaitForServerReadiness: " - << "Unknown exception dealing with Naming Service" << endl; - } - - obj=CORBA::Object::_nil(); - if(!CORBA::is_nil(inc)) - { - try - { - obj = inc->resolve(name); - if (!CORBA::is_nil(obj)) - { - //cout << "TraceCollector_WaitForServerReadiness: " - // << serverName << " found in CORBA Name Service" << endl; - break; - } - } - catch (const CosNaming::NamingContext::NotFound&) - { - cout << "Caught exception: Naming Service can't found Logger"; - } - } + { + cout << "TraceCollector_WaitForServerReadiness: " + << "Unknown exception dealing with Naming Service" << endl; + } + + obj=CORBA::Object::_nil(); + if(!CORBA::is_nil(inc)) + { + try + { + obj = inc->resolve(name); + if (!CORBA::is_nil(obj)) + { + //cout << "TraceCollector_WaitForServerReadiness: " + // << serverName << " found in CORBA Name Service" << endl; + break; + } + } + catch (const CosNaming::NamingContext::NotFound&) + { + cout << "Caught exception: Naming Service can't found Logger"; + } + } #ifndef WIN32 - nanosleep(&ts_req,&ts_rem); + nanosleep(&ts_req,&ts_rem); #else - Sleep(TIMESleep / 1000000); + Sleep(TIMESleep / 1000000); #endif - cout << "TraceCollector_WaitForServerReadiness: retry look for" - << serverName << endl; - } + cout << "TraceCollector_WaitForServerReadiness: retry look for" + << serverName << endl; + } } catch (const CosNaming::NamingContext::NotFound&) { diff --git a/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.hxx b/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.hxx index 2c4741001..9489495b4 100644 --- a/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.hxx +++ b/src/SALOMETraceCollector/TraceCollector_WaitForServerReadiness.hxx @@ -32,6 +32,6 @@ #include CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr theOrb, - std::string serverName); + std::string serverName); #endif diff --git a/src/TOOLSDS/SALOMEDS_Tool.cxx b/src/TOOLSDS/SALOMEDS_Tool.cxx index 6cbb46ca9..5b234d22b 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.cxx +++ b/src/TOOLSDS/SALOMEDS_Tool.cxx @@ -133,8 +133,8 @@ std::string SALOMEDS_Tool::GetTmpDir() // purpose : Removes files listed in theFileList //============================================================================ void SALOMEDS_Tool::RemoveTemporaryFiles(const std::string& theDirectory, - const SALOMEDS::ListOfFileNames& theFiles, - const bool IsDirDeleted) + const SALOMEDS::ListOfFileNames& theFiles, + const bool IsDirDeleted) { string aDirName = theDirectory; @@ -171,9 +171,9 @@ namespace { SALOMEDS::TMPFile* PutFilesToStream(const std::string& theFromDirectory, - const SALOMEDS::ListOfFileNames& theFiles, - const SALOMEDS::ListOfFileNames& theFileNames, - const int theNamesOnly) + const SALOMEDS::ListOfFileNames& theFiles, + const SALOMEDS::ListOfFileNames& theFileNames, + const int theNamesOnly) { int i, aLength = theFiles.length(); if(aLength == 0) @@ -196,16 +196,16 @@ namespace //Check if the file exists if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero - string aFullPath = aTmpDir + const_cast(theFiles[i].in()); - if(!Exists(aFullPath)) continue; + string aFullPath = aTmpDir + const_cast(theFiles[i].in()); + if(!Exists(aFullPath)) continue; #ifdef WIN32 - ifstream aFile(aFullPath.c_str(), ios::binary); + ifstream aFile(aFullPath.c_str(), ios::binary); #else - ifstream aFile(aFullPath.c_str()); + ifstream aFile(aFullPath.c_str()); #endif - aFile.seekg(0, ios::end); - aFileSize[i] = aFile.tellg(); - aBufferSize += aFileSize[i]; //Add a space to store the file + aFile.seekg(0, ios::end); + aFileSize[i] = aFile.tellg(); + aBufferSize += aFileSize[i]; //Add a space to store the file } aFileNameSize[i] = strlen(theFileNames[i])+1; aBufferSize += aFileNameSize[i]; //Add a space to store the file name @@ -230,12 +230,12 @@ namespace for(i=0; i(theFiles[i].in()); - if(!Exists(aFullPath)) continue; + string aFullPath = aTmpDir + const_cast(theFiles[i].in()); + if(!Exists(aFullPath)) continue; #ifdef WIN32 - aFile = new ifstream(aFullPath.c_str(), ios::binary); + aFile = new ifstream(aFullPath.c_str(), ios::binary); #else - aFile = new ifstream(aFullPath.c_str()); + aFile = new ifstream(aFullPath.c_str()); #endif } //Initialize 4 bytes of the buffer by 0 @@ -249,17 +249,17 @@ namespace aCurrentPos += aFileNameSize[i]; if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly - //Initialize 8 bytes of the buffer by 0 - memset((aBuffer + aCurrentPos), 0, 8); - //Copy the length of the file to the buffer - memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long))); - aCurrentPos += 8; - - aFile->seekg(0, ios::beg); - aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]); - aFile->close(); - delete(aFile); - aCurrentPos += aFileSize[i]; + //Initialize 8 bytes of the buffer by 0 + memset((aBuffer + aCurrentPos), 0, 8); + //Copy the length of the file to the buffer + memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long))); + aCurrentPos += 8; + + aFile->seekg(0, ios::beg); + aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]); + aFile->close(); + delete(aFile); + aCurrentPos += aFileSize[i]; } } @@ -277,8 +277,8 @@ namespace SALOMEDS::TMPFile* SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory, - const SALOMEDS::ListOfFileNames& theFiles, - const int theNamesOnly) + const SALOMEDS::ListOfFileNames& theFiles, + const int theNamesOnly) { SALOMEDS::ListOfFileNames aFileNames(theFiles); return ::PutFilesToStream(theFromDirectory,theFiles,aFileNames,theNamesOnly); @@ -287,7 +287,7 @@ SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory, SALOMEDS::TMPFile* SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles, - const SALOMEDS::ListOfFileNames& theFileNames) + const SALOMEDS::ListOfFileNames& theFileNames) { return ::PutFilesToStream("",theFiles,theFileNames,0); } @@ -298,8 +298,8 @@ SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles, //============================================================================ SALOMEDS::ListOfFileNames_var SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream, - const std::string& theToDirectory, - const int theNamesOnly) + const std::string& theToDirectory, + const int theNamesOnly) { SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames; diff --git a/src/TOOLSDS/SALOMEDS_Tool.hxx b/src/TOOLSDS/SALOMEDS_Tool.hxx index 427762d6d..b5ee2cd86 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.hxx +++ b/src/TOOLSDS/SALOMEDS_Tool.hxx @@ -58,22 +58,22 @@ public: // Removes files which are in , the files for deletion are listed in // if is true is also deleted if it is empty static void RemoveTemporaryFiles(const std::string& theDirectory, - const SALOMEDS::ListOfFileNames& theFiles, - const bool IsDirDeleted); + const SALOMEDS::ListOfFileNames& theFiles, + const bool IsDirDeleted); // Converts files listed in which are in into a byte sequence TMPFile static SALOMEDS::TMPFile* PutFilesToStream(const std::string& theFromDirectory, - const SALOMEDS::ListOfFileNames& theFiles, - const int theNamesOnly = 0); + const SALOMEDS::ListOfFileNames& theFiles, + const int theNamesOnly = 0); // Converts files listed in which will be named as pointed in the into a byte sequence TMPFile static SALOMEDS::TMPFile* PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles, - const SALOMEDS::ListOfFileNames& theFileNames); + const SALOMEDS::ListOfFileNames& theFileNames); // Converts a byte sequence to files and places them in static SALOMEDS::ListOfFileNames_var PutStreamToFiles(const SALOMEDS::TMPFile& theStream, - const std::string& theToDirectory, - const int theNamesOnly = 0); + const std::string& theToDirectory, + const int theNamesOnly = 0); // Returns the name by the path // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1" diff --git a/src/TestContainer/SALOME_TestComponent_i.cxx b/src/TestContainer/SALOME_TestComponent_i.cxx index 2fab66235..3ffd39037 100644 --- a/src/TestContainer/SALOME_TestComponent_i.cxx +++ b/src/TestContainer/SALOME_TestComponent_i.cxx @@ -36,10 +36,10 @@ using namespace std; Engines_TestComponent_i::Engines_TestComponent_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName) : + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName) : Engines_Component_i(orb, poa, contId, instanceName, interfaceName) { MESSAGE("activate object"); @@ -79,19 +79,19 @@ void Engines_TestComponent_i::Setenv() { std::string cle((*it).first); if ((*it).second.type()->kind() == CORBA::tk_string) - { - const char* value; - (*it).second >>= value; - //CCRT porting : setenv not defined in stdlib.h - std::string s(cle); - s+='='; - s+=value; - //char* cast because 1st arg of linux putenv function is not a const char* !!! - putenv((char *)s.c_str()); - //End of CCRT porting - //int ret = setenv(cle.c_str(), value, overwrite); - MESSAGE("--- setenv: "<>= value; + //CCRT porting : setenv not defined in stdlib.h + std::string s(cle); + s+='='; + s+=value; + //char* cast because 1st arg of linux putenv function is not a const char* !!! + putenv((char *)s.c_str()); + //End of CCRT porting + //int ret = setenv(cle.c_str(), value, overwrite); + MESSAGE("--- setenv: "<create_component_instance("SalomeTestComponent", iGenFact->create_component_instance(componenttName.c_str(), - 0); + 0); Engines::TestComponent_var anInstance = Engines::TestComponent::_narrow(obj); MESSAGE("create anInstance"); SCRUTE(anInstance->instanceName()); @@ -105,80 +105,80 @@ int main (int argc, char * argv[]) MESSAGE("------------------------------- create instances "); for (int iter = 0; iter < nbInstances ; iter++) - { - instances[iter] = create_instance(iGenFact,"SalomeTestComponent"); - } + { + instances[iter] = create_instance(iGenFact,"SalomeTestComponent"); + } MESSAGE("------------------------------ set env instances "); for (int iter = 0; iter < nbInstances ; iter++) - { - Engines::TestComponent_var anInstance = instances[iter]; - SCRUTE(anInstance->instanceName()); - Engines::FieldsDict_var dico = new Engines::FieldsDict; - dico->length(3); - dico[0].key=CORBA::string_dup("key_0"); - dico[0].value <<="value_0"; - dico[1].key=CORBA::string_dup("key_1"); - dico[1].value <<=(CORBA::UShort)72; - dico[2].key=CORBA::string_dup("key_2"); - dico[2].value <<=(CORBA::ULong)iter; - anInstance->setProperties(dico); - MESSAGE("Coucou " << anInstance->Coucou(iter)); - anInstance->Setenv(); - } + { + Engines::TestComponent_var anInstance = instances[iter]; + SCRUTE(anInstance->instanceName()); + Engines::FieldsDict_var dico = new Engines::FieldsDict; + dico->length(3); + dico[0].key=CORBA::string_dup("key_0"); + dico[0].value <<="value_0"; + dico[1].key=CORBA::string_dup("key_1"); + dico[1].value <<=(CORBA::UShort)72; + dico[2].key=CORBA::string_dup("key_2"); + dico[2].value <<=(CORBA::ULong)iter; + anInstance->setProperties(dico); + MESSAGE("Coucou " << anInstance->Coucou(iter)); + anInstance->Setenv(); + } MESSAGE("---------------------------------- get instances "); for (int iter = 0; iter < nbInstances ; iter++) - { - Engines::TestComponent_var anInstance = instances[iter]; - SCRUTE(anInstance->instanceName()); - Engines::FieldsDict_var dico2 = anInstance->getProperties(); - for (CORBA::ULong i=0; ilength(); i++) - { - MESSAGE("dico2["<instanceName()); - iGenFact->remove_impl(anInstance) ; - //iGenFact->finalize_removal() ; // unpredictable results ... - } + { + Engines::TestComponent_var anInstance = instances[iter]; + SCRUTE(anInstance->instanceName()); + iGenFact->remove_impl(anInstance) ; + //iGenFact->finalize_removal() ; // unpredictable results ... + } MESSAGE("------------------------------- PYTHON "); { -// bool isLib = -// iGenFact->load_component_Library("SALOME_TestComponentPy"); -// ASSERT(isLib); -// CORBA::Object_var obj = -// iGenFact->create_component_instance("SALOME_TestComponentPy", -// 0); -// Engines::TestComponent_var anInstance = -// Engines::TestComponent::_narrow(obj); -// MESSAGE("create anInstance"); -// SCRUTE(anInstance->instanceName()); +// bool isLib = +// iGenFact->load_component_Library("SALOME_TestComponentPy"); +// ASSERT(isLib); +// CORBA::Object_var obj = +// iGenFact->create_component_instance("SALOME_TestComponentPy", +// 0); +// Engines::TestComponent_var anInstance = +// Engines::TestComponent::_narrow(obj); +// MESSAGE("create anInstance"); +// SCRUTE(anInstance->instanceName()); MESSAGE("------------------------------- create instances "); for (int iter = 0; iter < nbInstances ; iter++) - { - instances[iter] = create_instance(iGenFact,"SALOME_TestComponentPy"); - } + { + instances[iter] = create_instance(iGenFact,"SALOME_TestComponentPy"); + } MESSAGE("---------------------------------- get instances "); for (int iter = 0; iter < nbInstances ; iter++) - { - Engines::TestComponent_var anInstance = instances[iter]; - SCRUTE(anInstance->instanceName()); - MESSAGE("Coucou " << anInstance->Coucou(iter)); - } + { + Engines::TestComponent_var anInstance = instances[iter]; + SCRUTE(anInstance->instanceName()); + MESSAGE("Coucou " << anInstance->Coucou(iter)); + } } // Clean-up. diff --git a/src/TestMPIContainer/TestMPIComponentEngine.cxx b/src/TestMPIContainer/TestMPIComponentEngine.cxx index fab2366ff..7a154b75f 100644 --- a/src/TestMPIContainer/TestMPIComponentEngine.cxx +++ b/src/TestMPIContainer/TestMPIComponentEngine.cxx @@ -33,12 +33,12 @@ using namespace std; TestMPIComponentEngine::TestMPIComponentEngine(int nbproc, int numproc, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, - bool regist) : + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName, + bool regist) : Engines_Component_i(orb, poa, contId, instanceName, interfaceName,true,regist), MPIObject_i(nbproc,numproc) { MESSAGE("activate object") @@ -73,12 +73,12 @@ void TestMPIComponentEngine::SPCoucou(CORBA::Long L) extern "C" { PortableServer::ObjectId * TestMPIComponentEngine_factory( - int nbproc, int numproc, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName) + int nbproc, int numproc, + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName) { bool regist; TestMPIComponentEngine * myTestMPIComponent; diff --git a/src/TestMPIContainer/TestMPIComponentEngine.hxx b/src/TestMPIContainer/TestMPIComponentEngine.hxx index ac82d4321..542b8d303 100644 --- a/src/TestMPIContainer/TestMPIComponentEngine.hxx +++ b/src/TestMPIContainer/TestMPIComponentEngine.hxx @@ -43,12 +43,12 @@ class TestMPIComponentEngine: public: TestMPIComponentEngine(); TestMPIComponentEngine(int nbproc, int numproc, - CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, - bool regist); + CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName, + bool regist); virtual ~TestMPIComponentEngine(); diff --git a/src/TestMPIContainer/TestMPIContainer.cxx b/src/TestMPIContainer/TestMPIContainer.cxx index e3e8c27e4..c6c5a2f95 100644 --- a/src/TestMPIContainer/TestMPIContainer.cxx +++ b/src/TestMPIContainer/TestMPIContainer.cxx @@ -91,19 +91,19 @@ int main (int argc, char * argv[]) MESSAGE(cmd); status = system(cmd.c_str()); if (status == -1) { - INFOS("TestMPIContainer launch MPI Container failed (system command status -1)") ; + INFOS("TestMPIContainer launch MPI Container failed (system command status -1)") ; } else if (status == 217) { - INFOS("TestMPIContainer launch MPI Container failed (system command status 217)") ; + INFOS("TestMPIContainer launch MPI Container failed (system command status 217)") ; } // Try to resolve MPI Container int it = 0; do{ - sleep(1); - obj = NS.Resolve(containerName.c_str()) ; - iGenFact = Engines::MPIContainer::_narrow(obj); - MESSAGE("Waiting for MPI Container " << containerName << " : it = " << it ); + sleep(1); + obj = NS.Resolve(containerName.c_str()) ; + iGenFact = Engines::MPIContainer::_narrow(obj); + MESSAGE("Waiting for MPI Container " << containerName << " : it = " << it ); }while( CORBA::is_nil(iGenFact) && (it++<15) ); } @@ -127,7 +127,7 @@ int main (int argc, char * argv[]) } else{ m1->Coucou(1L); -// // sleep(5); +// // sleep(5); INFOS("Unload MPI Component"); iGenFact->remove_impl(m1) ; } diff --git a/src/Utils/OpUtil.cxx b/src/Utils/OpUtil.cxx index 3d50327ab..b15053090 100644 --- a/src/Utils/OpUtil.cxx +++ b/src/Utils/OpUtil.cxx @@ -48,7 +48,7 @@ std::string GetHostname() switch (r) { case 0: - break; + break; default: #ifdef EINVAL case EINVAL: @@ -57,7 +57,7 @@ std::string GetHostname() case ENAMETOOLONG: #endif delete [] s; - continue; + continue; } } diff --git a/src/Utils/Utils_CommException.hxx b/src/Utils/Utils_CommException.hxx index 34ea011aa..5b05ca315 100644 --- a/src/Utils/Utils_CommException.hxx +++ b/src/Utils/Utils_CommException.hxx @@ -35,10 +35,10 @@ class UTILS_EXPORT CommException : public SALOME_Exception { public : - CommException( void ); - CommException( const char *texte ); - CommException( const CommException &ex ); - ~CommException() throw (); + CommException( void ); + CommException( const char *texte ); + CommException( const CommException &ex ); + ~CommException() throw (); } ; -# endif /* # if ( !defined __Utils_CommException_H__ ) */ +# endif /* # if ( !defined __Utils_CommException_H__ ) */ diff --git a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx index 18db18974..0db4277a5 100644 --- a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx +++ b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx @@ -65,41 +65,41 @@ static bool ATEXIT_Done = false ; class ATEXIT_ { public : - /*! - * Allocation dynamique de Destructeurs, une liste chainee de DESTRUCTEUR_GENERIQUE_* et enregistrement - * de la fonction Nettoyage() par atexit(). - * - * La liste chainee Destructeurs est detruite dans la fonction Nettoyage. - */ + /*! + * Allocation dynamique de Destructeurs, une liste chainee de DESTRUCTEUR_GENERIQUE_* et enregistrement + * de la fonction Nettoyage() par atexit(). + * + * La liste chainee Destructeurs est detruite dans la fonction Nettoyage. + */ //CCRT ATEXIT_( void ) ATEXIT_( bool Make_ATEXIT ) - { - //CCRT - if ( Make_ATEXIT && !ATEXIT_Done ) { - //CCRT - assert (DESTRUCTEUR_GENERIQUE_::Destructeurs==0); - //cerr << "ATEXIT_::ATEXIT_ Construction ATEXIT" << endl;// message necessaire pour utiliser logger dans Nettoyage (cf.BUG KERNEL4561) - DESTRUCTEUR_GENERIQUE_::Destructeurs = + { + //CCRT + if ( Make_ATEXIT && !ATEXIT_Done ) { + //CCRT + assert (DESTRUCTEUR_GENERIQUE_::Destructeurs==0); + //cerr << "ATEXIT_::ATEXIT_ Construction ATEXIT" << endl;// message necessaire pour utiliser logger dans Nettoyage (cf.BUG KERNEL4561) + DESTRUCTEUR_GENERIQUE_::Destructeurs = new std::list ; // Destructeur alloue dynamiquement (cf. ci-dessous) , - // il est utilise puis detruit par la fonction Nettoyage + // il est utilise puis detruit par la fonction Nettoyage //To be sure the trace singleton will be the last one to be destroyed initialize it here before calling atexit LocalTraceBufferPool::instance(); - int cr = atexit( Nettoyage ); // execute Nettoyage lors de exit, aprs la destruction des donnees statiques ! - assert(cr==0) ; - ATEXIT_Done = true ; - } - } - - ~ATEXIT_( ) - { - //cerr << "ATEXIT_::~ATEXIT_ Destruction ATEXIT" << endl; - } + int cr = atexit( Nettoyage ); // execute Nettoyage lors de exit, aprs la destruction des donnees statiques ! + assert(cr==0) ; + ATEXIT_Done = true ; + } + } + + ~ATEXIT_( ) + { + //cerr << "ATEXIT_::~ATEXIT_ Destruction ATEXIT" << endl; + } }; -static ATEXIT_ nettoyage = ATEXIT_( false ); /* singleton statique */ +static ATEXIT_ nettoyage = ATEXIT_( false ); /* singleton statique */ /*! @@ -114,32 +114,32 @@ void Nettoyage( void ) { //cerr << "Nettoyage()" << endl; //if(MYDEBUG) BEGIN_OF("Nettoyage( void )") ; - assert(DESTRUCTEUR_GENERIQUE_::Destructeurs) ; - //if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ; - if( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) - { - std::list::iterator it = DESTRUCTEUR_GENERIQUE_::Destructeurs->end() ; - - do - { - //if(MYDEBUG) MESSAGE( "DESTRUCTION d'un SINGLETON"); - it-- ; - DESTRUCTEUR_GENERIQUE_* ptr = *it ; - //DESTRUCTEUR_GENERIQUE_::Destructeurs->remove( *it ) ; - (*ptr)() ; - delete ptr ; - }while( it!= DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ) ; - - DESTRUCTEUR_GENERIQUE_::Destructeurs->clear() ; - //if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ; - assert( DESTRUCTEUR_GENERIQUE_::Destructeurs->size()==0 ) ; - assert( DESTRUCTEUR_GENERIQUE_::Destructeurs->empty() ) ; - } - - delete DESTRUCTEUR_GENERIQUE_::Destructeurs; - DESTRUCTEUR_GENERIQUE_::Destructeurs=0; - //if(MYDEBUG) END_OF("Nettoyage( void )") ; - return ; + assert(DESTRUCTEUR_GENERIQUE_::Destructeurs) ; + //if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ; + if( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) + { + std::list::iterator it = DESTRUCTEUR_GENERIQUE_::Destructeurs->end() ; + + do + { + //if(MYDEBUG) MESSAGE( "DESTRUCTION d'un SINGLETON"); + it-- ; + DESTRUCTEUR_GENERIQUE_* ptr = *it ; + //DESTRUCTEUR_GENERIQUE_::Destructeurs->remove( *it ) ; + (*ptr)() ; + delete ptr ; + }while( it!= DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ) ; + + DESTRUCTEUR_GENERIQUE_::Destructeurs->clear() ; + //if(MYDEBUG) SCRUTE( DESTRUCTEUR_GENERIQUE_::Destructeurs->size() ) ; + assert( DESTRUCTEUR_GENERIQUE_::Destructeurs->size()==0 ) ; + assert( DESTRUCTEUR_GENERIQUE_::Destructeurs->empty() ) ; + } + + delete DESTRUCTEUR_GENERIQUE_::Destructeurs; + DESTRUCTEUR_GENERIQUE_::Destructeurs=0; + //if(MYDEBUG) END_OF("Nettoyage( void )") ; + return ; } @@ -149,16 +149,16 @@ void Nettoyage( void ) */ const int DESTRUCTEUR_GENERIQUE_::Ajout( DESTRUCTEUR_GENERIQUE_ &objet ) { - // N.B. : l'ordre de creation des SINGLETON etant important - // on n'utilise pas deux fois la meme position pour - // les stocker dans la pile des objets. + // N.B. : l'ordre de creation des SINGLETON etant important + // on n'utilise pas deux fois la meme position pour + // les stocker dans la pile des objets. //CCRT if ( !ATEXIT_Done ) { nettoyage = ATEXIT_( true ) ; - } - //CCRT - assert(Destructeurs) ; - Destructeurs->push_back( &objet ) ; - return Destructeurs->size() ; + } + //CCRT + assert(Destructeurs) ; + Destructeurs->push_back( &objet ) ; + return Destructeurs->size() ; } diff --git a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx index 6e71ad7b9..8b06fc0aa 100644 --- a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx +++ b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx @@ -48,15 +48,15 @@ * Usage * * The only way to use the DESTRUCTEUR_GENERIQUE_ class is inheritance : - * class DESTRUCTEUR_SPECIFIQUE_ : public DESTRUCTEUR_GENERIQUE_ + * class DESTRUCTEUR_SPECIFIQUE_ : public DESTRUCTEUR_GENERIQUE_ * * Design description * - * A generic destructor supply two functionalities : - * -# a static method to add a destruction (objetct) to be performed DESTRUCTEUR_GENERIQUE_::Ajout( - * DESTRUCTEUR_GENERIQUE_ &objet) ; - * The Destruction object is stored in a list of pointer to DESTRUCTEUR_GENERIQUE_ objects. - * -# an object method to execute the destruction : operator()(). + * A generic destructor supply two functionalities : + * -# a static method to add a destruction (objetct) to be performed DESTRUCTEUR_GENERIQUE_::Ajout( + * DESTRUCTEUR_GENERIQUE_ &objet) ; + * The Destruction object is stored in a list of pointer to DESTRUCTEUR_GENERIQUE_ objects. + * -# an object method to execute the destruction : operator()(). */ class UTILS_EXPORT DESTRUCTEUR_GENERIQUE_ @@ -79,17 +79,17 @@ public : * * Usage * - * In this example the POINT_ ptrPoint will be destroyed at the end of the process (atexit). + * In this example the POINT_ ptrPoint will be destroyed at the end of the process (atexit). * * POINT_ *ptrPoint = new POINT_ ;
- * DESTRUCTEUR_DE_ *ptrDestruction = new DESTRUCTEUR_DE_( *ptrPoint ) ; + * DESTRUCTEUR_DE_ *ptrDestruction = new DESTRUCTEUR_DE_( *ptrPoint ) ; * - * Note that neither ptrPoint, nor ptrDestruction should be destroyed by the user. + * Note that neither ptrPoint, nor ptrDestruction should be destroyed by the user. * * Design description * - * The destruction object must be created dynamicaly because it suscribes himself in the list of - * destruction to be performed at the end of the process. + * The destruction object must be created dynamicaly because it suscribes himself in the list of + * destruction to be performed at the end of the process. * */ template class DESTRUCTEUR_DE_ : public DESTRUCTEUR_GENERIQUE_ @@ -116,15 +116,15 @@ public : // std::cerr << "WARNING: automatic destruction for servant is no more used. It's too late in exit. Use explicit call" << std::endl; /* if(TServant* aServant = dynamic_cast(_PtrObjet)){ - PortableServer::POA_var aPOA = aServant->_default_POA(); - PortableServer::ObjectId_var anObjectId = aPOA->servant_to_id(aServant); - aPOA->deactivate_object(anObjectId.in()); - aServant->_remove_ref(); + PortableServer::POA_var aPOA = aServant->_default_POA(); + PortableServer::ObjectId_var anObjectId = aPOA->servant_to_id(aServant); + aPOA->deactivate_object(anObjectId.in()); + aServant->_remove_ref(); */ }else{ - //cerr << "DESTRUCTEUR_GENERIQUE_::operator() deleting _PtrObjet" << endl; - TYPE* aPtr = static_cast(_PtrObjet); - delete aPtr; + //cerr << "DESTRUCTEUR_GENERIQUE_::operator() deleting _PtrObjet" << endl; + TYPE* aPtr = static_cast(_PtrObjet); + delete aPtr; } _PtrObjet = NULL ; } @@ -139,4 +139,4 @@ private : }; -# endif /* # if !defined( __DESTRUCTEUR_GENERIQUE__H__ ) */ +# endif /* # if !defined( __DESTRUCTEUR_GENERIQUE__H__ ) */ diff --git a/src/Utils/Utils_ExceptHandlers.cxx b/src/Utils/Utils_ExceptHandlers.cxx index 7f70311e9..cac47ee15 100644 --- a/src/Utils/Utils_ExceptHandlers.cxx +++ b/src/Utils/Utils_ExceptHandlers.cxx @@ -19,10 +19,10 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File: Utils_ExceptHandler.cxx -// Created: Mon Mar 15 10:23:41 2004 -// Author: Oksana TCHEBANOVA -// +// File: Utils_ExceptHandler.cxx +// Created: Mon Mar 15 10:23:41 2004 +// Author: Oksana TCHEBANOVA +// // #include "Utils_ExceptHandlers.hxx" #include "Utils_CorbaException.hxx" diff --git a/src/Utils/Utils_Identity.cxx b/src/Utils/Utils_Identity.cxx index c0404abd3..83d5e41d8 100644 --- a/src/Utils/Utils_Identity.cxx +++ b/src/Utils/Utils_Identity.cxx @@ -49,35 +49,35 @@ const char* duplicate( const char *const str ) ; const struct utsname get_uname( void ) { - struct utsname hostid; + struct utsname hostid; #if defined(_DEBUG_) || defined(_DEBUG) - const int retour=uname(&hostid); - ASSERT(retour>=0); + const int retour=uname(&hostid); + ASSERT(retour>=0); #else - uname(&hostid); + uname(&hostid); #endif - return hostid ; + return hostid ; } const char* get_adip( void ) { - struct utsname hostid; + struct utsname hostid; #if defined(_DEBUG_) || defined(_DEBUG) - const int retour=uname(&hostid); - ASSERT(retour>=0); + const int retour=uname(&hostid); + ASSERT(retour>=0); #else - uname(&hostid); + uname(&hostid); #endif - const hostent* pour_adip=gethostbyname(hostid.nodename); - ASSERT(pour_adip!=NULL); - const in_addr ip_addr=*(struct in_addr*)(pour_adip->h_addr) ; - return duplicate(inet_ntoa(ip_addr)); + const hostent* pour_adip=gethostbyname(hostid.nodename); + ASSERT(pour_adip!=NULL); + const in_addr ip_addr=*(struct in_addr*)(pour_adip->h_addr) ; + return duplicate(inet_ntoa(ip_addr)); } const char* const get_pwname( void ) { - struct passwd *papa = getpwuid(getuid()); - return papa->pw_name ; + struct passwd *papa = getpwuid(getuid()); + return papa->pw_name ; } #else /* Windows functionality */ @@ -90,36 +90,36 @@ const char* duplicate( const char *const str ) ; const char* get_uname( void ) { - static std::string hostName(256, 0); - static DWORD nSize = hostName.length(); - static int res = ::GetComputerNameEx(ComputerNameDnsFullyQualified, &hostName[0], &nSize); - ASSERT( res ); - return hostName.c_str(); + static std::string hostName(256, 0); + static DWORD nSize = hostName.length(); + static int res = ::GetComputerNameEx(ComputerNameDnsFullyQualified, &hostName[0], &nSize); + ASSERT( res ); + return hostName.c_str(); } const char* get_adip( void ) { - //#include - //#include - //static GUID sType = SVCID_HOSTNAME; - //static CSADDR_INFO* ips = new CSADDR_INFO[8]; // in case multiple IP addresses are returned - //static DWORD nSize = 1024; - //static std::string uname = get_uname(); - //static int res = ::GetAddressByName( NS_DEFAULT, &sType, &uname[0], 0, 0, 0, ips, &nSize, 0, 0 ); - //if ( res ) - // return ips[0].LocalAddr.lpSockaddr->sa_data; - - static hostent* he = ::gethostbyname( get_uname() ); - if ( he && he->h_addr_list && he->h_length >0 ) { - static char str[16]; + //#include + //#include + //static GUID sType = SVCID_HOSTNAME; + //static CSADDR_INFO* ips = new CSADDR_INFO[8]; // in case multiple IP addresses are returned + //static DWORD nSize = 1024; + //static std::string uname = get_uname(); + //static int res = ::GetAddressByName( NS_DEFAULT, &sType, &uname[0], 0, 0, 0, ips, &nSize, 0, 0 ); + //if ( res ) + // return ips[0].LocalAddr.lpSockaddr->sa_data; + + static hostent* he = ::gethostbyname( get_uname() ); + if ( he && he->h_addr_list && he->h_length >0 ) { + static char str[16]; unsigned i1 = (unsigned char)he->h_addr_list[0][0]; unsigned i2 = (unsigned char)he->h_addr_list[0][1]; unsigned i3 = (unsigned char)he->h_addr_list[0][2]; unsigned i4 = (unsigned char)he->h_addr_list[0][3]; sprintf ( str, "%03u.%03u.%03u.%03u", i1, i2, i3, i4 ); - return str; - } - return ""; + return str; + } + return ""; } const char* const get_pwname( void ) @@ -132,21 +132,21 @@ const char* const get_pwname( void ) } PSID getuid() { - PSID retVal = NULL; - HANDLE hProcessToken = INVALID_HANDLE_VALUE; - PTOKEN_OWNER pTKowner = NULL; - LPVOID buffer = NULL; - DWORD dwsize = 0; - - if ( !OpenProcessToken ( GetCurrentProcess (), TOKEN_QUERY, &hProcessToken )) return 0; - if (!GetTokenInformation(hProcessToken, TokenOwner, buffer, dwsize, &dwsize)) return 0; - pTKowner = (PTOKEN_OWNER)buffer; - if ( pTKowner != NULL ) { - retVal = pTKowner->Owner; - } - if ( hProcessToken != INVALID_HANDLE_VALUE ) CloseHandle ( hProcessToken ); - - return retVal; + PSID retVal = NULL; + HANDLE hProcessToken = INVALID_HANDLE_VALUE; + PTOKEN_OWNER pTKowner = NULL; + LPVOID buffer = NULL; + DWORD dwsize = 0; + + if ( !OpenProcessToken ( GetCurrentProcess (), TOKEN_QUERY, &hProcessToken )) return 0; + if (!GetTokenInformation(hProcessToken, TokenOwner, buffer, dwsize, &dwsize)) return 0; + pTKowner = (PTOKEN_OWNER)buffer; + if ( pTKowner != NULL ) { + retVal = pTKowner->Owner; + } + if ( hProcessToken != INVALID_HANDLE_VALUE ) CloseHandle ( hProcessToken ); + + return retVal; } #define getcwd _getcwd @@ -155,36 +155,36 @@ PSID getuid() { #endif /* WIN32 */ -Identity::Identity( const char *name ): _name(duplicate(name)),\ - _hostid(get_uname()),\ - _adip(get_adip()),\ - _uid(getuid()) ,\ - _pwname(get_pwname()) ,\ - _dir(getcwd(NULL,256)),\ - _pid(getpid()) ,\ - _start(time(NULL)),\ - _cstart(ctime(&_start)) +Identity::Identity( const char *name ): _name(duplicate(name)),\ + _hostid(get_uname()),\ + _adip(get_adip()),\ + _uid(getuid()) ,\ + _pwname(get_pwname()) ,\ + _dir(getcwd(NULL,256)),\ + _pid(getpid()) ,\ + _start(time(NULL)),\ + _cstart(ctime(&_start)) //CCRT { - ASSERT(strlen(_dir)<256); + ASSERT(strlen(_dir)<256); } Identity::~Identity(void) { - delete [] (char*)_name ; - (char*&)_name = NULL ; + delete [] (char*)_name ; + (char*&)_name = NULL ; - //delete [] (char*)_dir ; - //(char*&)_dir = NULL ; - free((char*)_dir); -#ifndef WIN32 + //delete [] (char*)_dir ; + //(char*&)_dir = NULL ; + free((char*)_dir); +#ifndef WIN32 // free the memory only on Unix // becasue at Windows it is the same static variable // (function get_adip() returns the same char* as get_uname() ) - delete [] (char*)_adip ; + delete [] (char*)_adip ; #endif - (char*&)_adip = NULL ; + (char*&)_adip = NULL ; } @@ -194,15 +194,15 @@ Identity::~Identity(void) const char* const Identity::name (void) const { - return _name ; + return _name ; } #ifndef WIN32 - const pid_t& Identity::pid(void) const + const pid_t& Identity::pid(void) const #else - const DWORD& Identity::pid(void) const + const DWORD& Identity::pid(void) const #endif { - return _pid ; + return _pid ; } #ifndef WIN32 @@ -215,28 +215,28 @@ const char* const Identity::name (void) const } #ifndef WIN32 - const uid_t& Identity::uid(void) const + const uid_t& Identity::uid(void) const #else - const PSID& Identity::uid(void) const + const PSID& Identity::uid(void) const #endif { - return _uid ; + return _uid ; } const time_t &Identity::start(void) const { - return _start ; + return _start ; } const char* const Identity::rep (void) const { - return _dir ; + return _dir ; } const char* const Identity::pwname (void) const { - return _pwname ; + return _pwname ; } const char* const Identity::adip (void) const { - return _adip ; + return _adip ; } /*------------------*/ @@ -248,31 +248,31 @@ const char* Identity::host_char( void ) const #ifndef WIN32 return _hostid.nodename; #else - return _hostid; + return _hostid; #endif } const char* Identity::start_char(void) const { - return ctime(&_start) ; + return ctime(&_start) ; } std::ostream & operator<< ( std::ostream& os , const Identity& monid ) { - ASSERT(monid._name!=NULL) ; + ASSERT(monid._name!=NULL) ; os << "Identity :" << std::endl ; - os << '\t' << "Component name : " << monid._name << std::endl ; - os << '\t' << "Numero de PID : " << monid._pid << std::endl; - os << '\t' << "Uid utilisateur : " << monid._uid << std::endl; - os << '\t' << "nom utilisateur : " << monid._pwname << std::endl; + os << '\t' << "Component name : " << monid._name << std::endl ; + os << '\t' << "Numero de PID : " << monid._pid << std::endl; + os << '\t' << "Uid utilisateur : " << monid._uid << std::endl; + os << '\t' << "nom utilisateur : " << monid._pwname << std::endl; #ifndef WIN32 - os << '\t' << "Nom de machine : " << monid._hostid.nodename << std::endl; + os << '\t' << "Nom de machine : " << monid._hostid.nodename << std::endl; #else - os << '\t' << "Nom de machine : " << monid._hostid << std::endl; + os << '\t' << "Nom de machine : " << monid._hostid << std::endl; #endif - os << '\t' << "Adresse IP : " << monid._adip << std::endl; - os << '\t' << "Heure de lancement : " << monid._cstart ; //ctime(&monid._start) ; - os << '\t' << "Dans le repertoire : " << monid._dir << std::endl; + os << '\t' << "Adresse IP : " << monid._adip << std::endl; + os << '\t' << "Heure de lancement : " << monid._cstart ; //ctime(&monid._start) ; + os << '\t' << "Dans le repertoire : " << monid._dir << std::endl; - return os ; + return os ; } diff --git a/src/Utils/Utils_Identity.hxx b/src/Utils/Utils_Identity.hxx index c3385762c..77dd00731 100644 --- a/src/Utils/Utils_Identity.hxx +++ b/src/Utils/Utils_Identity.hxx @@ -46,50 +46,50 @@ class UTILS_EXPORT Identity { protected : - const char* const _name ; - const char* const _adip; // Internet address + const char* const _name ; + const char* const _adip; // Internet address #ifndef WIN32 const struct utsname _hostid; - const pid_t _pid ; - const uid_t _uid ; + const pid_t _pid ; + const uid_t _uid ; #else - const char* const _hostid; - const DWORD _pid ; - const PSID _uid ; -#endif - const char* const _pwname ; - const char* const _dir ; - const time_t _start; - const char* const _cstart ; + const char* const _hostid; + const DWORD _pid ; + const PSID _uid ; +#endif + const char* const _pwname ; + const char* const _dir ; + const time_t _start; + const char* const _cstart ; private : - Identity( void ); - Identity( const Identity &monid ); + Identity( void ); + Identity( const Identity &monid ); public : - Identity(const char *name); - ~Identity(); - friend std::ostream & operator<< ( std::ostream& os , const Identity& monid ); + Identity(const char *name); + ~Identity(); + friend std::ostream & operator<< ( std::ostream& os , const Identity& monid ); #ifndef WIN32 - const pid_t& pid(void) const; - const struct utsname& hostid(void) const; - const uid_t& uid(void) const; + const pid_t& pid(void) const; + const struct utsname& hostid(void) const; + const uid_t& uid(void) const; #else - const DWORD& pid(void) const; + const DWORD& pid(void) const; const char* const hostid(void) const; - const PSID& uid(void) const; + const PSID& uid(void) const; #endif - const char* const name( void ) const; - const char* const adip(void) const; - const char* const pwname(void) const; - const time_t& start(void) const; - const char* const rep (void) const; + const char* const name( void ) const; + const char* const adip(void) const; + const char* const pwname(void) const; + const time_t& start(void) const; + const char* const rep (void) const; - const char* host_char(void ) const; - const char* start_char(void) const; + const char* host_char(void ) const; + const char* start_char(void) const; } ; -# endif /* # if !defined( __IDENTITE_H__ ) */ +# endif /* # if !defined( __IDENTITE_H__ ) */ diff --git a/src/Utils/Utils_Mutex.cxx b/src/Utils/Utils_Mutex.cxx index 31bf4edea..75aa80611 100644 --- a/src/Utils/Utils_Mutex.cxx +++ b/src/Utils/Utils_Mutex.cxx @@ -20,8 +20,8 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // SALOME Utils : general SALOME's definitions and tools -// File: Utils_Mutex.cxx -// Author: Sergey ANIKIN +// File: Utils_Mutex.cxx +// Author: Sergey ANIKIN // Module : SALOME // $Header$ // @@ -73,7 +73,7 @@ void Utils_Mutex::unlock() #endif if ( myCount && (--myCount) < 1 ) { myCount = 0; - pthread_mutex_unlock( &myMutex ); + pthread_mutex_unlock( &myMutex ); } } diff --git a/src/Utils/Utils_Mutex.hxx b/src/Utils/Utils_Mutex.hxx index 0f19758c9..b6f00d747 100644 --- a/src/Utils/Utils_Mutex.hxx +++ b/src/Utils/Utils_Mutex.hxx @@ -20,8 +20,8 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // SALOME Utils : general SALOME's definitions and tools -// File: Utils_Mutex.hxx -// Author: Sergey ANIKIN +// File: Utils_Mutex.hxx +// Author: Sergey ANIKIN // Module : SALOME // $Header$ // diff --git a/src/Utils/Utils_ORB_INIT.cxx b/src/Utils/Utils_ORB_INIT.cxx index bbb1c7490..5c59da51b 100644 --- a/src/Utils/Utils_ORB_INIT.cxx +++ b/src/Utils/Utils_ORB_INIT.cxx @@ -59,18 +59,18 @@ CORBA::ORB_var &ORB_INIT::operator() ( int argc , char **argv ) throw( CommExcep try { if ( CORBA::is_nil( _orb ) ) { - try - { + try + { #if OMNIORB_VERSION >= 4 - _orb = CORBA::ORB_init( argc, argv, "omniORB4" ) ; + _orb = CORBA::ORB_init( argc, argv, "omniORB4" ) ; #else - _orb = CORBA::ORB_init( argc, argv, "omniORB3" ) ; + _orb = CORBA::ORB_init( argc, argv, "omniORB3" ) ; #endif - } - catch( const CORBA::Exception &ex ) - { - throw CommException( "Unable to create an ORB connexion" ) ; - } + } + catch( const CORBA::Exception &ex ) + { + throw CommException( "Unable to create an ORB connexion" ) ; + } } return _orb ; } catch ( CommException& e) {throw e;} diff --git a/src/Utils/Utils_ORB_INIT.hxx b/src/Utils/Utils_ORB_INIT.hxx index b4a867e1a..73316217a 100644 --- a/src/Utils/Utils_ORB_INIT.hxx +++ b/src/Utils/Utils_ORB_INIT.hxx @@ -45,19 +45,19 @@ class UTILS_EXPORT ORB_INIT { private : - CORBA::ORB_var _orb ; + CORBA::ORB_var _orb ; public : - ORB_INIT( void ); - virtual ~ORB_INIT(); - CORBA::ORB_var & operator() ( int argc , char **argv ) throw( CommException ) ; + ORB_INIT( void ); + virtual ~ORB_INIT(); + CORBA::ORB_var & operator() ( int argc , char **argv ) throw( CommException ) ; - inline CORBA::ORB_var &orb( void ); + inline CORBA::ORB_var &orb( void ); } ; inline CORBA::ORB_var &ORB_INIT::orb( void ) { - return _orb ; + return _orb ; } # endif diff --git a/src/Utils/Utils_SALOME_Exception.cxx b/src/Utils/Utils_SALOME_Exception.cxx index 6039476de..0e2b86e6e 100644 --- a/src/Utils/Utils_SALOME_Exception.cxx +++ b/src/Utils/Utils_SALOME_Exception.cxx @@ -45,41 +45,41 @@ const char* duplicate( const char *const str ) ; SALOME_Exception::SALOME_Exception( void ): exception() , _text(0) { - MESSAGE( "You must use the standard builder: SALOME_Exception::SALOME_Exception( const char *text )" ) ; - INTERRUPTION(1) ; + MESSAGE( "You must use the standard builder: SALOME_Exception::SALOME_Exception( const char *text )" ) ; + INTERRUPTION(1) ; } const char *makeText( const char *text, const char *fileName, const unsigned int lineNumber ) { - char *newText = 0 ; - - ASSERT(text) ; - const size_t l1 = 1+strlen(text) ; - ASSERT(l1>1) ; - - const char* prefix = "Salome Exception" ; - const size_t l0 = 2+strlen(prefix) ; - - if ( fileName ) - { - const size_t l2 = 4+strlen(fileName) ; - ASSERT(l2>4) ; - - ASSERT(lineNumber>=1) ; - const size_t l3 = 4+int(log10(float(lineNumber))) ; - - newText = new char [ 1+l0+l1+l2+l3 ] ; - sprintf( newText , "%s in %s [%u] : %s" , prefix, fileName, lineNumber, text ) ; - } - else - { - newText = new char [ 1+l0+l1 ] ; - sprintf( newText , "%s : %s" , prefix, text ) ; - } - ASSERT(newText) ; - return newText ; + char *newText = 0 ; + + ASSERT(text) ; + const size_t l1 = 1+strlen(text) ; + ASSERT(l1>1) ; + + const char* prefix = "Salome Exception" ; + const size_t l0 = 2+strlen(prefix) ; + + if ( fileName ) + { + const size_t l2 = 4+strlen(fileName) ; + ASSERT(l2>4) ; + + ASSERT(lineNumber>=1) ; + const size_t l3 = 4+int(log10(float(lineNumber))) ; + + newText = new char [ 1+l0+l1+l2+l3 ] ; + sprintf( newText , "%s in %s [%u] : %s" , prefix, fileName, lineNumber, text ) ; + } + else + { + newText = new char [ 1+l0+l1 ] ; + sprintf( newText , "%s : %s" , prefix, text ) ; + } + ASSERT(newText) ; + return newText ; } @@ -90,32 +90,32 @@ SALOME_Exception::SALOME_Exception( const char *text, const char *fileName, cons SALOME_Exception::~SALOME_Exception() throw () { - if ( _text ) - { - delete [] ((char*)_text); - char** pRef = (char**)&_text; - *pRef = 0; - } - ASSERT(_text==NULL) ; + if ( _text ) + { + delete [] ((char*)_text); + char** pRef = (char**)&_text; + *pRef = 0; + } + ASSERT(_text==NULL) ; } SALOME_Exception::SALOME_Exception( const SALOME_Exception &ex ): _text(duplicate(ex._text)) { - ; + ; } std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex ) { - os << ex._text ; - return os ; + os << ex._text ; + return os ; } const char* SALOME_Exception::what( void ) const throw () { - return _text ; + return _text ; } diff --git a/src/Utils/Utils_SALOME_Exception.hxx b/src/Utils/Utils_SALOME_Exception.hxx index 75554924b..3959e904c 100644 --- a/src/Utils/Utils_SALOME_Exception.hxx +++ b/src/Utils/Utils_SALOME_Exception.hxx @@ -66,18 +66,18 @@ class UTILS_EXPORT SALOME_Exception : public std::exception { private : - SALOME_Exception( void ); + SALOME_Exception( void ); protected : - const char* _text ; // non constant pointer but read only char variable + const char* _text ; // non constant pointer but read only char variable public : - SALOME_Exception( const char *text, const char *fileName=0, const unsigned int lineNumber=0 ); - SALOME_Exception( const SALOME_Exception &ex ); - virtual ~SALOME_Exception() throw (); - friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex ); - virtual const char *what( void ) const throw () ; + SALOME_Exception( const char *text, const char *fileName=0, const unsigned int lineNumber=0 ); + SALOME_Exception( const SALOME_Exception &ex ); + virtual ~SALOME_Exception() throw (); + friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex ); + virtual const char *what( void ) const throw () ; } ; -#endif /* #if !defined( __Utils_SALOME_Exception_hxx__ ) */ +#endif /* #if !defined( __Utils_SALOME_Exception_hxx__ ) */ diff --git a/src/Utils/Utils_SINGLETON.hxx b/src/Utils/Utils_SINGLETON.hxx index 3f9fa7f4e..26d6727d9 100644 --- a/src/Utils/Utils_SINGLETON.hxx +++ b/src/Utils/Utils_SINGLETON.hxx @@ -51,21 +51,21 @@ * To create a single instance a POINT_ object : * * # include "Utils_SINGLETON.hxx" - * ... - * ptrPoint = SINGLETON_::Instance() ; + * ... + * ptrPoint = SINGLETON_::Instance() ; * * * Design description * - * -# the user creates an object of class TYPE By using a class method : SINGLETON_::Instance() which - * returns a pointer to the single object ; - * -# this class method uses the default constructor to create an object ; - * -# at the same time, this class method reate a destructor object which is added to the generic list - * of destructors objects to be executed at the end of the application (atexit) ; - * -# at the end of the application process all the deletions are performed by the Nettoyage() C function - * which execute the destructions objects then deletes the destructions objects themselves ; - * -# the Nettoyage() C function is recorded using atexit() C function through the creation of a static - * single object ATEXIT_(). + * -# the user creates an object of class TYPE By using a class method : SINGLETON_::Instance() which + * returns a pointer to the single object ; + * -# this class method uses the default constructor to create an object ; + * -# at the same time, this class method reate a destructor object which is added to the generic list + * of destructors objects to be executed at the end of the application (atexit) ; + * -# at the end of the application process all the deletions are performed by the Nettoyage() C function + * which execute the destructions objects then deletes the destructions objects themselves ; + * -# the Nettoyage() C function is recorded using atexit() C function through the creation of a static + * single object ATEXIT_(). */ @@ -74,19 +74,19 @@ template class SINGLETON_ public : - static TYPE *Instance( void ); //!< Singleton dynamic creation using the default builder - static bool IsAlreadyExisting( void ); //!< returns True if the singleton is already existing - static int Destruction( void ); //!< destroys the Singleton before the end of the application process + static TYPE *Instance( void ); //!< Singleton dynamic creation using the default builder + static bool IsAlreadyExisting( void ); //!< returns True if the singleton is already existing + static int Destruction( void ); //!< destroys the Singleton before the end of the application process private : - TYPE _Instance ; - static SINGLETON_ *PtrSingleton ; + TYPE _Instance ; + static SINGLETON_ *PtrSingleton ; - SINGLETON_( void ); - ~SINGLETON_(); + SINGLETON_( void ); + ~SINGLETON_(); -} ; /* class SINGLETON_ */ +} ; /* class SINGLETON_ */ @@ -106,19 +106,19 @@ template SINGLETON_ *SINGLETON_::PtrSingleton=NULL ; */ template TYPE *SINGLETON_::Instance( void ) { - if ( ! PtrSingleton ) - { - //MESSAGE("SINGLETON_::Instance( void )") ; - PtrSingleton = new SINGLETON_ ; - new DESTRUCTEUR_DE_( PtrSingleton->_Instance ) ; - } - return &PtrSingleton->_Instance ; + if ( ! PtrSingleton ) + { + //MESSAGE("SINGLETON_::Instance( void )") ; + PtrSingleton = new SINGLETON_ ; + new DESTRUCTEUR_DE_( PtrSingleton->_Instance ) ; + } + return &PtrSingleton->_Instance ; } template bool SINGLETON_::IsAlreadyExisting( void ) { - return PtrSingleton ? true : false ; + return PtrSingleton ? true : false ; } @@ -126,41 +126,41 @@ template bool SINGLETON_::IsAlreadyExisting( void ) template SINGLETON_::SINGLETON_( void ) { - //MESSAGE("CREATION d'un SINGLETON_") ; + //MESSAGE("CREATION d'un SINGLETON_") ; } /*! - The method SINGLETON_::Destruction can be called by the user. If it is not - the function nettoyage() calls it atexit. + The method SINGLETON_::Destruction can be called by the user. If it is not + the function nettoyage() calls it atexit. - N.B. : the singleton objects are destroyed in the reverse order of there creation. + N.B. : the singleton objects are destroyed in the reverse order of there creation. */ template int SINGLETON_::Destruction( void ) { - int k = - 1 ; - //BEGIN_OF("SINGLETON_::Destruction( void )") ; - if ( PtrSingleton ) - { - //MESSAGE("Destruction du SINGLETON_") ; - - - std::list::iterator k ; - for( k=DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ; k!=DESTRUCTEUR_GENERIQUE_::Destructeurs->end();k++) - { - if ( *k == PtrSingleton->_Instance ) - { - DESTRUCTEUR_GENERIQUE_::Destructeurs->erase( k ) ; - break ; - } - } - delete PtrSingleton ; - PtrSingleton = NULL ; - } - //END_OF("SINGLETON_::Destruction( void )") ; - return k ; + int k = - 1 ; + //BEGIN_OF("SINGLETON_::Destruction( void )") ; + if ( PtrSingleton ) + { + //MESSAGE("Destruction du SINGLETON_") ; + + + std::list::iterator k ; + for( k=DESTRUCTEUR_GENERIQUE_::Destructeurs->begin() ; k!=DESTRUCTEUR_GENERIQUE_::Destructeurs->end();k++) + { + if ( *k == PtrSingleton->_Instance ) + { + DESTRUCTEUR_GENERIQUE_::Destructeurs->erase( k ) ; + break ; + } + } + delete PtrSingleton ; + PtrSingleton = NULL ; + } + //END_OF("SINGLETON_::Destruction( void )") ; + return k ; } @@ -169,4 +169,4 @@ template SINGLETON_::~SINGLETON_() //MESSAGE("passage dans SINGLETON_::~SINGLETON_( void )") ; } -# endif /* # if !defined( __SINGLETON__H__ ) */ +# endif /* # if !defined( __SINGLETON__H__ ) */ diff --git a/src/Utils/Utils_Timer.cxx b/src/Utils/Utils_Timer.cxx index 8c68f0600..8c1716ef0 100644 --- a/src/Utils/Utils_Timer.cxx +++ b/src/Utils/Utils_Timer.cxx @@ -76,7 +76,7 @@ void Utils_Timer::Start() { SYSTEMTIME st; GetSystemTime(&st); SystemTimeToFileTime(&st, RefToInitialTMS); - time(RefToCurrentTimeB); + time(RefToCurrentTimeB); #endif } } @@ -96,8 +96,8 @@ void Utils_Timer::Stop() { GetSystemTime(&st); SystemTimeToFileTime(&st, RefToCurrentTMS); Cumul_user += (int)(((ULARGE_INTEGER*)(RefToCurrentTMS))->QuadPart - ((ULARGE_INTEGER*)(RefToInitialTMS))->QuadPart) / 10000000; - Cumul_sys = Cumul_user; - time(RefToCurrentTimeB); + Cumul_sys = Cumul_user; + time(RefToCurrentTimeB); #endif Stopped = 1; } diff --git a/src/Utils/duplicate.cxx b/src/Utils/duplicate.cxx index 3f8aedc1a..e8f8581d5 100644 --- a/src/Utils/duplicate.cxx +++ b/src/Utils/duplicate.cxx @@ -26,9 +26,9 @@ // $Header$ // /*! - * This function can be changed by strdup() if strdup() is ANSI. - * It is strongly (and only) used in the Registry environment - * (RegistryService, RegistryConnexion, Identity, ...) + * This function can be changed by strdup() if strdup() is ANSI. + * It is strongly (and only) used in the Registry environment + * (RegistryService, RegistryConnexion, Identity, ...) */ extern "C" { @@ -42,11 +42,11 @@ using namespace std; const char* duplicate( const char *const str ) { - ASSERT(str!=NULL) ; - const size_t length = strlen( str ) ; - ASSERT(length>0) ; - char *new_str = new char[ 1+length ] ; - ASSERT(new_str) ; - strcpy( new_str , str ) ; - return new_str ; + ASSERT(str!=NULL) ; + const size_t length = strlen( str ) ; + ASSERT(length>0) ; + char *new_str = new char[ 1+length ] ; + ASSERT(new_str) ; + strcpy( new_str , str ) ; + return new_str ; }